query
stringlengths 7
5.25k
| document
stringlengths 15
1.06M
| metadata
dict | negatives
sequencelengths 3
101
| negative_scores
sequencelengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Inserts a record into the table | function insert_lost_record($dbc, $owner, $item_name, $description, $location_id, $create_date) {
$query = 'INSERT INTO stuff(owner, item_name, description, location_id, create_date, status) VALUES ("'.$owner.'" ,"'.$item_name.'", "'.$description.'", "'.$location_id.'", "'.$create_date.'", "lost")' ;
show_query($query);
$results = mysqli_query($dbc,$query) ;
check_results($results) ;
return $results ;
echo '<p> Your submission was successful!</p>' ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function insertRecord($tableName, $record);",
"public function insert(Table $table, $row);",
"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 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 insertRow($row);",
"function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}",
"public function insertRecord ($sqlString);",
"public function insert($tableName, $data);",
"public function insert($data);",
"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}",
"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 }",
"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}",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"abstract public function insert();",
"public abstract function insert();",
"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 insert()\n {\n $this->id = insert($this);\n }",
"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}",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\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 insert($connection, $table, $rows);",
"public function insert($table, array $data);",
"public function insert(stubObject $entity);",
"abstract public function insert(string $table, array $row, array $options = []);",
"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 }",
"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 insert_student($row)\n\t\t{\n\t\t\t$this->conn->insert($this->create_student($row));\n\t\t}",
"public function insert() {\n \n }",
"public static function insert()\n {\n }",
"public abstract function Insert();",
"public function insert(&$key, $record, $flags = 0) {\n return UPS_SUCCESS;\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 }",
"public function insert()\n {\n }",
"protected function saveInsert()\n {\n }",
"function dbase_add_record($dbase_identifier, $record)\n{\n}",
"public function _insert($data)\n {\n $this->insert($data);\n }",
"protected function _insert()\n\t{\n\t}",
"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 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 \n }",
"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}",
"public function insert($data)\r\n {\r\n \r\n }",
"public function insert()\n {\n # code...\n }",
"public function insert($table);",
"abstract protected function doInsert($subject, Statement $insertStatement);",
"protected abstract function insertRow($tableName, $data);",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\n }",
"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($table, array $fields);",
"public function insert(\n SugarBean $bean\n )\n {\n $sql = $this->getHelper()->insertSQL($bean);\n $this->tableName = $bean->getTableName();\n $msg = \"Error inserting into table: \".$this->tableName;\n $this->query($sql,true,$msg);\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$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 Do_insert_Example1(){\n\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\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($txn = null, &$key, $record, $flags) {\n return UPS_SUCCESS;\n }",
"public function insert(array $params);",
"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 insert($table, $data) {\n $respose = false;\n if ($this->db->insert($table, $data)) {\n $respose = true;\n }\n return $respose;\n }",
"public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\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}",
"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 {\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 insert() {\n\t\t$this->insert_user();\n\t}",
"public function insert(...$field_values);",
"public function insert(DataObject $entity){\n }",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\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($tblUpdate);",
"function insert($conn,$table,$data)\n {\n }",
"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 }",
"public function insert($medAccount);",
"public function insertRecord( $table, $record, $updateIfKeyExists=false, $updateSQL=\"\" )\n {\n \t$fields = \"\";\n\t\t$values = \"\";\n\t\t\n\t\t// populate them\n\t\tforeach ($record as $f => $v)\n\t\t{\n\t\t\t$fields .= \"`$f`,\";\n\t\t\t$values .= ( is_numeric( $v ) && ( intval( $v ) === $v ) ) ? $v.\",\" : \"'$v',\";\n\t\t}\n\t\t\n\t\t// remove our trailing ,\n \t$fields = substr( $fields, 0, -1 );\n \t// remove our trailing ,\n \t$values = substr( $values, 0, -1 );\n \t\n\t\t$insert = \"INSERT INTO $table ({$fields}) VALUES({$values})\";\n\t\tif( $updateIfKeyExists )\n\t\t{\n\t\t\t$insert .= \" ON DUPLICATE KEY UPDATE {$updateSQL} \";\n\t\t}\n\t\t$this->executeQuery( $insert );\n\t\treturn true;\n }",
"public static function Insert(){\r\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}",
"function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}",
"public function queryInsert($table, $data) : bool;",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->insert_id();\n\t}",
"protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }",
"public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}",
"public function insert(string $table, array $data): int;",
"public function insertRow($table, $data){\n\t\t$this->db->insert($table, $data);\n\t\treturn $this->db->insert_id();\n\t}",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->last_query();\n\t \t // $this->db->insert_id();\n\t}",
"public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }",
"public function insert(){\n\n }",
"public function insert(personal $personal);",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"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 $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($table, $data) {\n\t\t$fields = $values = array();\n\n\t\tforeach ($data as $key => $val) {\n\t\t\t$fields[] = $this->escape_identifiers($key);\n\t\t\t$values[] = $this->escape($val);\n\t\t}\n\n\t\treturn $this->_insert($this->protect_identifiers($table, NULL, FALSE), $fields, $values);\n\t}",
"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 }",
"function insertRow($insertObject){\n $dbh = dbConnect();\n if(!$dbh){\n return false;\n }\n $keystring = $insertObject->colString();\n $valuesString = \"\";\n for ($i=0; $i < $insertObject->getTableSize(); $i++)\n {\n $valuesString .= \"?\";\n if($i < $insertObject->getTableSize() - 1){\n $valuesString .= \",\";\n }\n }\n $sql = \"INSERT INTO \".$insertObject::TABLENAME.\"($keystring)\".\" VALUES ($valuesString)\";\n $stmt = mysqli_prepare($dbh, $sql); //creates a statement, a container we can pass back and forth from database\n //$args = array(buildtypestring($dbh, $insertObject::TABLENAME));\n $values = $insertObject->getArray();\n array_unshift($values, buildtypestring($dbh, $insertObject::TABLENAME));\n call_user_func_array(array($stmt,\"bind_param\"), $values); //call bind param on stmt with args\n $result = $stmt->execute();\n if(!$result){\n logSQLError($stmt);\n mysqli_close($dbh);\n return false;\n }\n mysqli_close($dbh);\n return true;\n }",
"public function insert($gunBbl);",
"public function insert($loyPrg);",
"public function insert() {\n\t$stmt = $this->_database->prepare('INSERT INTO planetterrains (planetid, terrainid, x, y) VALUES (?, ?, ?, ?)');\n\t$stmt->bind_param('iiii', $this->planetid, $this->terrainid, $this->x, $this->y);\n\t$stmt->execute();\n\t$this->refid = $this->_database->insert_id;\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\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 insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }"
] | [
"0.78984356",
"0.74705034",
"0.7403592",
"0.7301942",
"0.7154372",
"0.7112254",
"0.7103371",
"0.7083447",
"0.70695686",
"0.7068472",
"0.70225275",
"0.69812053",
"0.69622415",
"0.68464524",
"0.6822168",
"0.681903",
"0.6818677",
"0.6818054",
"0.67984444",
"0.67654705",
"0.67509085",
"0.6723751",
"0.67221755",
"0.6715606",
"0.670827",
"0.6705632",
"0.67018086",
"0.6690973",
"0.6656393",
"0.6649181",
"0.6648454",
"0.6644411",
"0.6629291",
"0.6613721",
"0.6613721",
"0.6607264",
"0.6597312",
"0.65924203",
"0.6591827",
"0.65817046",
"0.6579333",
"0.65666765",
"0.6566022",
"0.6565592",
"0.65592957",
"0.65569043",
"0.655244",
"0.6535864",
"0.65310234",
"0.65310234",
"0.65264213",
"0.6499704",
"0.6484348",
"0.6464014",
"0.64558256",
"0.6454262",
"0.6450748",
"0.6443702",
"0.6439753",
"0.6434855",
"0.6418468",
"0.6411592",
"0.64113504",
"0.6406955",
"0.64068764",
"0.63979954",
"0.63935673",
"0.638348",
"0.63771945",
"0.6374226",
"0.63673556",
"0.63664556",
"0.63615423",
"0.6360099",
"0.6356202",
"0.63385665",
"0.6319501",
"0.63175416",
"0.63166654",
"0.63090515",
"0.6290762",
"0.62905884",
"0.6290417",
"0.62866247",
"0.62778497",
"0.6265533",
"0.62652683",
"0.6254653",
"0.62538314",
"0.6245299",
"0.62407315",
"0.6234793",
"0.62216836",
"0.62215525",
"0.6221494",
"0.62185323",
"0.6217978",
"0.6216736",
"0.620727",
"0.62046033",
"0.62014693"
] | 0.0 | -1 |
Inserts a record into the table | function insert_found_record($dbc, $finder, $item_name, $description, $location_id, $create_date) {
$query = 'INSERT INTO stuff(finder, item_name, description, location_id, create_date, status) VALUES ("'.$finder.'" ,"'.$item_name.'", "'.$description.'", "'.$location_id.'", "'.$create_date.'", "found")' ;
show_query($query);
$results = mysqli_query($dbc,$query) ;
check_results($results) ;
return $results ;
echo '<p> Your submission was successful!</p>' ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function insertRecord($tableName, $record);",
"public function insert(Table $table, $row);",
"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 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 insertRow($row);",
"function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}",
"public function insertRecord ($sqlString);",
"public function insert($tableName, $data);",
"public function insert($data);",
"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}",
"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 }",
"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}",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"abstract public function insert();",
"public abstract function insert();",
"public function insert()\n {\n $this->id = insert($this);\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 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}",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\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 insert($connection, $table, $rows);",
"public function insert($table, array $data);",
"public function insert(stubObject $entity);",
"abstract public function insert(string $table, array $row, array $options = []);",
"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 }",
"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 insert_student($row)\n\t\t{\n\t\t\t$this->conn->insert($this->create_student($row));\n\t\t}",
"public function insert() {\n \n }",
"public static function insert()\n {\n }",
"public abstract function Insert();",
"public function insert(&$key, $record, $flags = 0) {\n return UPS_SUCCESS;\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 }",
"public function insert()\n {\n }",
"protected function saveInsert()\n {\n }",
"function dbase_add_record($dbase_identifier, $record)\n{\n}",
"public function _insert($data)\n {\n $this->insert($data);\n }",
"protected function _insert()\n\t{\n\t}",
"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 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 }",
"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}",
"public function insert($data)\r\n {\r\n \r\n }",
"public function insert()\n {\n \n }",
"public function insert()\n {\n # code...\n }",
"public function insert($table);",
"abstract protected function doInsert($subject, Statement $insertStatement);",
"protected abstract function insertRow($tableName, $data);",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\n }",
"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($table, array $fields);",
"public function insert(\n SugarBean $bean\n )\n {\n $sql = $this->getHelper()->insertSQL($bean);\n $this->tableName = $bean->getTableName();\n $msg = \"Error inserting into table: \".$this->tableName;\n $this->query($sql,true,$msg);\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$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 Do_insert_Example1(){\n\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\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($txn = null, &$key, $record, $flags) {\n return UPS_SUCCESS;\n }",
"public function insert(array $params);",
"function insert($table, $data) {\n $respose = false;\n if ($this->db->insert($table, $data)) {\n $respose = true;\n }\n return $respose;\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\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\t{\n\t\treturn $this->getModel()->insert($this);\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 {\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 insert() {\n\t\t$this->insert_user();\n\t}",
"public function insert(...$field_values);",
"public function insert(DataObject $entity){\n }",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\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($tblUpdate);",
"function insert($conn,$table,$data)\n {\n }",
"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 }",
"public function insert($medAccount);",
"public function insertRecord( $table, $record, $updateIfKeyExists=false, $updateSQL=\"\" )\n {\n \t$fields = \"\";\n\t\t$values = \"\";\n\t\t\n\t\t// populate them\n\t\tforeach ($record as $f => $v)\n\t\t{\n\t\t\t$fields .= \"`$f`,\";\n\t\t\t$values .= ( is_numeric( $v ) && ( intval( $v ) === $v ) ) ? $v.\",\" : \"'$v',\";\n\t\t}\n\t\t\n\t\t// remove our trailing ,\n \t$fields = substr( $fields, 0, -1 );\n \t// remove our trailing ,\n \t$values = substr( $values, 0, -1 );\n \t\n\t\t$insert = \"INSERT INTO $table ({$fields}) VALUES({$values})\";\n\t\tif( $updateIfKeyExists )\n\t\t{\n\t\t\t$insert .= \" ON DUPLICATE KEY UPDATE {$updateSQL} \";\n\t\t}\n\t\t$this->executeQuery( $insert );\n\t\treturn true;\n }",
"public static function Insert(){\r\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}",
"function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}",
"public function queryInsert($table, $data) : bool;",
"protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->insert_id();\n\t}",
"public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}",
"public function insert(string $table, array $data): int;",
"public function insertRow($table, $data){\n\t\t$this->db->insert($table, $data);\n\t\treturn $this->db->insert_id();\n\t}",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->last_query();\n\t \t // $this->db->insert_id();\n\t}",
"public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }",
"public function insert(){\n\n }",
"public function insert(personal $personal);",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"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 $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($table, $data) {\n\t\t$fields = $values = array();\n\n\t\tforeach ($data as $key => $val) {\n\t\t\t$fields[] = $this->escape_identifiers($key);\n\t\t\t$values[] = $this->escape($val);\n\t\t}\n\n\t\treturn $this->_insert($this->protect_identifiers($table, NULL, FALSE), $fields, $values);\n\t}",
"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($gunBbl);",
"function insertRow($insertObject){\n $dbh = dbConnect();\n if(!$dbh){\n return false;\n }\n $keystring = $insertObject->colString();\n $valuesString = \"\";\n for ($i=0; $i < $insertObject->getTableSize(); $i++)\n {\n $valuesString .= \"?\";\n if($i < $insertObject->getTableSize() - 1){\n $valuesString .= \",\";\n }\n }\n $sql = \"INSERT INTO \".$insertObject::TABLENAME.\"($keystring)\".\" VALUES ($valuesString)\";\n $stmt = mysqli_prepare($dbh, $sql); //creates a statement, a container we can pass back and forth from database\n //$args = array(buildtypestring($dbh, $insertObject::TABLENAME));\n $values = $insertObject->getArray();\n array_unshift($values, buildtypestring($dbh, $insertObject::TABLENAME));\n call_user_func_array(array($stmt,\"bind_param\"), $values); //call bind param on stmt with args\n $result = $stmt->execute();\n if(!$result){\n logSQLError($stmt);\n mysqli_close($dbh);\n return false;\n }\n mysqli_close($dbh);\n return true;\n }",
"public function insert($loyPrg);",
"public function insert() {\n\t$stmt = $this->_database->prepare('INSERT INTO planetterrains (planetid, terrainid, x, y) VALUES (?, ?, ?, ?)');\n\t$stmt->bind_param('iiii', $this->planetid, $this->terrainid, $this->x, $this->y);\n\t$stmt->execute();\n\t$this->refid = $this->_database->insert_id;\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\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 insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }"
] | [
"0.78974277",
"0.74703366",
"0.7402349",
"0.7302107",
"0.71543866",
"0.71121573",
"0.71034884",
"0.70842546",
"0.70713955",
"0.7069186",
"0.7022582",
"0.6983445",
"0.69637316",
"0.6847769",
"0.68232733",
"0.6820071",
"0.6819381",
"0.6818864",
"0.68003005",
"0.6767687",
"0.67525744",
"0.67247725",
"0.6723268",
"0.6717348",
"0.6709143",
"0.6708379",
"0.67019224",
"0.6691594",
"0.66566706",
"0.66504925",
"0.66487896",
"0.66463333",
"0.6630385",
"0.6614223",
"0.6614223",
"0.6607972",
"0.6597014",
"0.6595119",
"0.6593416",
"0.6583779",
"0.6580838",
"0.656826",
"0.65672016",
"0.6567008",
"0.65597045",
"0.65575695",
"0.65534353",
"0.65356475",
"0.6532381",
"0.6532381",
"0.6528117",
"0.6501878",
"0.6485947",
"0.6465435",
"0.64573574",
"0.6456091",
"0.6450524",
"0.64437056",
"0.64421123",
"0.64367145",
"0.6419394",
"0.6413085",
"0.64108646",
"0.6407243",
"0.6406927",
"0.6399318",
"0.6395964",
"0.6385195",
"0.63785964",
"0.6375599",
"0.63683164",
"0.6368003",
"0.63608223",
"0.6360544",
"0.63550854",
"0.6339849",
"0.63190746",
"0.6317629",
"0.63171375",
"0.63082373",
"0.6291568",
"0.6291303",
"0.6290284",
"0.62880325",
"0.62789",
"0.626535",
"0.62648207",
"0.6257257",
"0.62537426",
"0.6246433",
"0.6242211",
"0.62361693",
"0.62239957",
"0.62231946",
"0.62223446",
"0.6218876",
"0.62188274",
"0.6217709",
"0.62084365",
"0.6206631",
"0.62034446"
] | 0.0 | -1 |
Inserts a record into the table | function update_record($dbc, $id, $item_name, $description, $location_id, $owner, $finder, $status) {
$query = 'UPDATE stuff set id = '.$id.', set item_name = '.$item_name.', set description = '.$description.', set location_id = '.$location_id.', set create_date= '.$create_date.' , set owner= '.$owner.', set finder = '.$finder.', set status = '.$status.')' ;
show_query($query);
$results = mysqli_query($dbc,$query) ;
check_results($results) ;
return $results ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function insertRecord($tableName, $record);",
"public function insert(Table $table, $row);",
"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 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 insertRow($row);",
"function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}",
"public function insertRecord ($sqlString);",
"public function insert($tableName, $data);",
"public function insert($data);",
"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}",
"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 }",
"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}",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"abstract public function insert();",
"public abstract function insert();",
"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 insert()\n {\n $this->id = insert($this);\n }",
"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}",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\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 insert($connection, $table, $rows);",
"public function insert($table, array $data);",
"public function insert(stubObject $entity);",
"abstract public function insert(string $table, array $row, array $options = []);",
"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 }",
"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 insert_student($row)\n\t\t{\n\t\t\t$this->conn->insert($this->create_student($row));\n\t\t}",
"public function insert() {\n \n }",
"public static function insert()\n {\n }",
"public abstract function Insert();",
"public function insert(&$key, $record, $flags = 0) {\n return UPS_SUCCESS;\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 }",
"public function insert()\n {\n }",
"protected function saveInsert()\n {\n }",
"function dbase_add_record($dbase_identifier, $record)\n{\n}",
"protected function _insert()\n\t{\n\t}",
"public function _insert($data)\n {\n $this->insert($data);\n }",
"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 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 \n }",
"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}",
"public function insert($data)\r\n {\r\n \r\n }",
"public function insert()\n {\n # code...\n }",
"public function insert($table);",
"abstract protected function doInsert($subject, Statement $insertStatement);",
"protected abstract function insertRow($tableName, $data);",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\n }",
"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($table, array $fields);",
"public function insert(\n SugarBean $bean\n )\n {\n $sql = $this->getHelper()->insertSQL($bean);\n $this->tableName = $bean->getTableName();\n $msg = \"Error inserting into table: \".$this->tableName;\n $this->query($sql,true,$msg);\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$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 Do_insert_Example1(){\n\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\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($txn = null, &$key, $record, $flags) {\n return UPS_SUCCESS;\n }",
"public function insert(array $params);",
"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 insert($table, $data) {\n $respose = false;\n if ($this->db->insert($table, $data)) {\n $respose = true;\n }\n return $respose;\n }",
"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\t{\n\t\treturn $this->getModel()->insert($this);\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 {\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 insert() {\n\t\t$this->insert_user();\n\t}",
"public function insert(...$field_values);",
"public function insert(DataObject $entity){\n }",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\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($tblUpdate);",
"function insert($conn,$table,$data)\n {\n }",
"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 }",
"public function insert($medAccount);",
"public function insertRecord( $table, $record, $updateIfKeyExists=false, $updateSQL=\"\" )\n {\n \t$fields = \"\";\n\t\t$values = \"\";\n\t\t\n\t\t// populate them\n\t\tforeach ($record as $f => $v)\n\t\t{\n\t\t\t$fields .= \"`$f`,\";\n\t\t\t$values .= ( is_numeric( $v ) && ( intval( $v ) === $v ) ) ? $v.\",\" : \"'$v',\";\n\t\t}\n\t\t\n\t\t// remove our trailing ,\n \t$fields = substr( $fields, 0, -1 );\n \t// remove our trailing ,\n \t$values = substr( $values, 0, -1 );\n \t\n\t\t$insert = \"INSERT INTO $table ({$fields}) VALUES({$values})\";\n\t\tif( $updateIfKeyExists )\n\t\t{\n\t\t\t$insert .= \" ON DUPLICATE KEY UPDATE {$updateSQL} \";\n\t\t}\n\t\t$this->executeQuery( $insert );\n\t\treturn true;\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 static function Insert(){\r\n }",
"function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}",
"protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->insert_id();\n\t}",
"public function queryInsert($table, $data) : bool;",
"public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}",
"public function insert(string $table, array $data): int;",
"public function insertRow($table, $data){\n\t\t$this->db->insert($table, $data);\n\t\treturn $this->db->insert_id();\n\t}",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->last_query();\n\t \t // $this->db->insert_id();\n\t}",
"public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }",
"public function insert(){\n\n }",
"public function insert(personal $personal);",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"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 }",
"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() {\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($table, $data) {\n\t\t$fields = $values = array();\n\n\t\tforeach ($data as $key => $val) {\n\t\t\t$fields[] = $this->escape_identifiers($key);\n\t\t\t$values[] = $this->escape($val);\n\t\t}\n\n\t\treturn $this->_insert($this->protect_identifiers($table, NULL, FALSE), $fields, $values);\n\t}",
"function insertRow($insertObject){\n $dbh = dbConnect();\n if(!$dbh){\n return false;\n }\n $keystring = $insertObject->colString();\n $valuesString = \"\";\n for ($i=0; $i < $insertObject->getTableSize(); $i++)\n {\n $valuesString .= \"?\";\n if($i < $insertObject->getTableSize() - 1){\n $valuesString .= \",\";\n }\n }\n $sql = \"INSERT INTO \".$insertObject::TABLENAME.\"($keystring)\".\" VALUES ($valuesString)\";\n $stmt = mysqli_prepare($dbh, $sql); //creates a statement, a container we can pass back and forth from database\n //$args = array(buildtypestring($dbh, $insertObject::TABLENAME));\n $values = $insertObject->getArray();\n array_unshift($values, buildtypestring($dbh, $insertObject::TABLENAME));\n call_user_func_array(array($stmt,\"bind_param\"), $values); //call bind param on stmt with args\n $result = $stmt->execute();\n if(!$result){\n logSQLError($stmt);\n mysqli_close($dbh);\n return false;\n }\n mysqli_close($dbh);\n return true;\n }",
"public function insert($gunBbl);",
"public function insert($loyPrg);",
"public function insert() {\n\t$stmt = $this->_database->prepare('INSERT INTO planetterrains (planetid, terrainid, x, y) VALUES (?, ?, ?, ?)');\n\t$stmt->bind_param('iiii', $this->planetid, $this->terrainid, $this->x, $this->y);\n\t$stmt->execute();\n\t$this->refid = $this->_database->insert_id;\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\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 insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }"
] | [
"0.7899873",
"0.7470078",
"0.7404757",
"0.7302594",
"0.7154302",
"0.7112037",
"0.710335",
"0.7082816",
"0.7069187",
"0.706869",
"0.7021093",
"0.69806176",
"0.6961343",
"0.6846074",
"0.68228096",
"0.6819647",
"0.6817881",
"0.6817588",
"0.6798459",
"0.67644715",
"0.675085",
"0.6723895",
"0.67214745",
"0.67161196",
"0.6708182",
"0.67048454",
"0.67030746",
"0.66903996",
"0.66557634",
"0.664888",
"0.664858",
"0.6644693",
"0.6628232",
"0.66133624",
"0.66133624",
"0.6606532",
"0.65984434",
"0.65915376",
"0.6591134",
"0.6580347",
"0.65785563",
"0.65661114",
"0.6565795",
"0.6564869",
"0.6558886",
"0.65568984",
"0.6552647",
"0.6535987",
"0.653062",
"0.653062",
"0.65256935",
"0.6500158",
"0.6484064",
"0.6464149",
"0.6455015",
"0.64533603",
"0.6450373",
"0.64432645",
"0.64383996",
"0.64347094",
"0.6418169",
"0.64109325",
"0.64105415",
"0.6406353",
"0.6406133",
"0.6398093",
"0.63925344",
"0.6382591",
"0.63774306",
"0.63738203",
"0.6366313",
"0.63663",
"0.6361145",
"0.63595814",
"0.6355595",
"0.6338659",
"0.631998",
"0.63169575",
"0.63168603",
"0.631112",
"0.62898105",
"0.6289756",
"0.6289708",
"0.62854666",
"0.62771523",
"0.6264631",
"0.6264252",
"0.6254339",
"0.62533194",
"0.62453717",
"0.6240239",
"0.6234443",
"0.62209654",
"0.62209404",
"0.6220609",
"0.62179226",
"0.6217596",
"0.62164074",
"0.62066084",
"0.6205148",
"0.6201352"
] | 0.0 | -1 |
Inserts a record into the table | function insert_admin_record($dbc, $finder, $item_name, $description, $location_id, $create_date) {
$query = 'INSERT INTO stuff(finder, item_name, description, location_id, create_date, status) VALUES ("'.$finder.'" ,"'.$item_name.'", "'.$description.'", "'.$location_id.'", "'.$create_date.'", "found")' ;
show_query($query);
$results = mysqli_query($dbc,$query) ;
check_results($results) ;
return $results ;
echo '<p> Your submission was successful!</p>' ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function insertRecord($tableName, $record);",
"public function insert(Table $table, $row);",
"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 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 insertRow($row);",
"function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}",
"public function insertRecord ($sqlString);",
"public function insert($tableName, $data);",
"public function insert($data);",
"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}",
"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 }",
"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}",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"abstract public function insert();",
"public abstract function insert();",
"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 insert()\n {\n $this->id = insert($this);\n }",
"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}",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\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 insert($connection, $table, $rows);",
"public function insert($table, array $data);",
"public function insert(stubObject $entity);",
"abstract public function insert(string $table, array $row, array $options = []);",
"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 }",
"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 insert_student($row)\n\t\t{\n\t\t\t$this->conn->insert($this->create_student($row));\n\t\t}",
"public function insert() {\n \n }",
"public static function insert()\n {\n }",
"public abstract function Insert();",
"public function insert(&$key, $record, $flags = 0) {\n return UPS_SUCCESS;\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 }",
"public function insert()\n {\n }",
"protected function saveInsert()\n {\n }",
"function dbase_add_record($dbase_identifier, $record)\n{\n}",
"public function _insert($data)\n {\n $this->insert($data);\n }",
"protected function _insert()\n\t{\n\t}",
"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 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 \n }",
"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}",
"public function insert($data)\r\n {\r\n \r\n }",
"public function insert()\n {\n # code...\n }",
"public function insert($table);",
"abstract protected function doInsert($subject, Statement $insertStatement);",
"protected abstract function insertRow($tableName, $data);",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\n }",
"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($table, array $fields);",
"public function insert(\n SugarBean $bean\n )\n {\n $sql = $this->getHelper()->insertSQL($bean);\n $this->tableName = $bean->getTableName();\n $msg = \"Error inserting into table: \".$this->tableName;\n $this->query($sql,true,$msg);\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$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 Do_insert_Example1(){\n\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\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($txn = null, &$key, $record, $flags) {\n return UPS_SUCCESS;\n }",
"public function insert(array $params);",
"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 insert($table, $data) {\n $respose = false;\n if ($this->db->insert($table, $data)) {\n $respose = true;\n }\n return $respose;\n }",
"public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\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}",
"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 {\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 insert() {\n\t\t$this->insert_user();\n\t}",
"public function insert(...$field_values);",
"public function insert(DataObject $entity){\n }",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\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($tblUpdate);",
"function insert($conn,$table,$data)\n {\n }",
"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 }",
"public function insert($medAccount);",
"public function insertRecord( $table, $record, $updateIfKeyExists=false, $updateSQL=\"\" )\n {\n \t$fields = \"\";\n\t\t$values = \"\";\n\t\t\n\t\t// populate them\n\t\tforeach ($record as $f => $v)\n\t\t{\n\t\t\t$fields .= \"`$f`,\";\n\t\t\t$values .= ( is_numeric( $v ) && ( intval( $v ) === $v ) ) ? $v.\",\" : \"'$v',\";\n\t\t}\n\t\t\n\t\t// remove our trailing ,\n \t$fields = substr( $fields, 0, -1 );\n \t// remove our trailing ,\n \t$values = substr( $values, 0, -1 );\n \t\n\t\t$insert = \"INSERT INTO $table ({$fields}) VALUES({$values})\";\n\t\tif( $updateIfKeyExists )\n\t\t{\n\t\t\t$insert .= \" ON DUPLICATE KEY UPDATE {$updateSQL} \";\n\t\t}\n\t\t$this->executeQuery( $insert );\n\t\treturn true;\n }",
"public static function Insert(){\r\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}",
"function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}",
"public function queryInsert($table, $data) : bool;",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->insert_id();\n\t}",
"protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }",
"public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}",
"public function insert(string $table, array $data): int;",
"public function insertRow($table, $data){\n\t\t$this->db->insert($table, $data);\n\t\treturn $this->db->insert_id();\n\t}",
"public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->last_query();\n\t \t // $this->db->insert_id();\n\t}",
"public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }",
"public function insert(){\n\n }",
"public function insert(personal $personal);",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"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 $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($table, $data) {\n\t\t$fields = $values = array();\n\n\t\tforeach ($data as $key => $val) {\n\t\t\t$fields[] = $this->escape_identifiers($key);\n\t\t\t$values[] = $this->escape($val);\n\t\t}\n\n\t\treturn $this->_insert($this->protect_identifiers($table, NULL, FALSE), $fields, $values);\n\t}",
"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 }",
"function insertRow($insertObject){\n $dbh = dbConnect();\n if(!$dbh){\n return false;\n }\n $keystring = $insertObject->colString();\n $valuesString = \"\";\n for ($i=0; $i < $insertObject->getTableSize(); $i++)\n {\n $valuesString .= \"?\";\n if($i < $insertObject->getTableSize() - 1){\n $valuesString .= \",\";\n }\n }\n $sql = \"INSERT INTO \".$insertObject::TABLENAME.\"($keystring)\".\" VALUES ($valuesString)\";\n $stmt = mysqli_prepare($dbh, $sql); //creates a statement, a container we can pass back and forth from database\n //$args = array(buildtypestring($dbh, $insertObject::TABLENAME));\n $values = $insertObject->getArray();\n array_unshift($values, buildtypestring($dbh, $insertObject::TABLENAME));\n call_user_func_array(array($stmt,\"bind_param\"), $values); //call bind param on stmt with args\n $result = $stmt->execute();\n if(!$result){\n logSQLError($stmt);\n mysqli_close($dbh);\n return false;\n }\n mysqli_close($dbh);\n return true;\n }",
"public function insert($gunBbl);",
"public function insert($loyPrg);",
"public function insert() {\n\t$stmt = $this->_database->prepare('INSERT INTO planetterrains (planetid, terrainid, x, y) VALUES (?, ?, ?, ?)');\n\t$stmt->bind_param('iiii', $this->planetid, $this->terrainid, $this->x, $this->y);\n\t$stmt->execute();\n\t$this->refid = $this->_database->insert_id;\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\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 insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }"
] | [
"0.78984356",
"0.74705034",
"0.7403592",
"0.7301942",
"0.7154372",
"0.7112254",
"0.7103371",
"0.7083447",
"0.70695686",
"0.7068472",
"0.70225275",
"0.69812053",
"0.69622415",
"0.68464524",
"0.6822168",
"0.681903",
"0.6818677",
"0.6818054",
"0.67984444",
"0.67654705",
"0.67509085",
"0.6723751",
"0.67221755",
"0.6715606",
"0.670827",
"0.6705632",
"0.67018086",
"0.6690973",
"0.6656393",
"0.6649181",
"0.6648454",
"0.6644411",
"0.6629291",
"0.6613721",
"0.6613721",
"0.6607264",
"0.6597312",
"0.65924203",
"0.6591827",
"0.65817046",
"0.6579333",
"0.65666765",
"0.6566022",
"0.6565592",
"0.65592957",
"0.65569043",
"0.655244",
"0.6535864",
"0.65310234",
"0.65310234",
"0.65264213",
"0.6499704",
"0.6484348",
"0.6464014",
"0.64558256",
"0.6454262",
"0.6450748",
"0.6443702",
"0.6439753",
"0.6434855",
"0.6418468",
"0.6411592",
"0.64113504",
"0.6406955",
"0.64068764",
"0.63979954",
"0.63935673",
"0.638348",
"0.63771945",
"0.6374226",
"0.63673556",
"0.63664556",
"0.63615423",
"0.6360099",
"0.6356202",
"0.63385665",
"0.6319501",
"0.63175416",
"0.63166654",
"0.63090515",
"0.6290762",
"0.62905884",
"0.6290417",
"0.62866247",
"0.62778497",
"0.6265533",
"0.62652683",
"0.6254653",
"0.62538314",
"0.6245299",
"0.62407315",
"0.6234793",
"0.62216836",
"0.62215525",
"0.6221494",
"0.62185323",
"0.6217978",
"0.6216736",
"0.620727",
"0.62046033",
"0.62014693"
] | 0.0 | -1 |
Create a query to get the name and price sorted by price | function show_link_records($dbc) {
$query = 'SELECT id, item_name, create_date, status FROM stuff' ;
# Execute the query
$results = mysqli_query( $dbc , $query ) ;
check_results($results);
# Show results
if ( $results )
{
# Initializes the table before executing the query
echo '<H1 align="center"></H1>';
echo '<TABLE align="center" cellpadding=10px cellspacing=5px border = "2">';
echo '<TR>';
echo '<TH>ID</TH>' ;
echo '<TH>Item Name</TH>';
echo '<TH>Created</TH>';
echo '<TH>Updated</TH>';
echo '<TH>Status</TH>';
echo '</TR>';
# For each row result, generate a table row
while ( $row = mysqli_fetch_array( $results, MYSQLI_ASSOC ) )
{
echo '<TR>' ;
echo '<TD>' . $row['id'] . '</TD>' ;
$alink = '<A HREF=quickdetail.php?id='. $row['id'] . '>' . $row['item_name'] . '</A>' ;
echo '<TD align="right">' . $alink . '</TD>' ;
echo '<TD>' . $row['create_date'] . '</TD>' ;
echo '<TD>' . $row['status'] . '</TD>' ;
echo '</TR>' ;
}
# End the table
echo '</TABLE>';
# Free up the results in memory
mysqli_free_result( $results ) ;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_vehicles_by_price() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY price DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }",
"function getSearchProducts($bdd, $search, $order = 0){\n\t$query = 'SELECT * FROM products WHERE name LIKE :search ORDER BY price';\n\tif($order){\n\t\t$query .= ' DESC';\n\t}\n\t$reponse = $bdd->prepare($query);\n\t$reponse->bindValue(':search', '%' . $search . '%', PDO::PARAM_INT);\n\t$reponse->execute();\n\treturn $reponse->fetchAll();\n\n}",
"function orderPrice($count) {\n global $conn;\n if($count == 1) {\n $sql = \"SELECT * FROM `candy` ORDER BY `candy`.`priceId` ASC\";\n }\n else {\n $sql = \"SELECT * FROM `candy` ORDER BY `candy`.`priceId` DESC\"; \n }\n $statement = $conn->prepare($sql);\n $statement->execute();\n $candies = $statement->fetchAll(PDO::FETCH_ASSOC);\n return $candies;\n}",
"function getProducts($name, $categoryID, $salePriceMin, $salePriceMax, $basePriceMin, $basePriceMax)\n{\n global $conn;\n \n $sql = \"SELECT * FROM product WHERE 1=1 \";\n \n if (!empty($name))\n {\n $sql .= \" AND Name LIKE :productName\";\n $namedParameters[\":productName\"] = \"%\" . $name . \"%\";\n }\n \n if (!empty($categoryID))\n {\n $sql .= \" AND CategoryId = :categoryId\";\n $namedParameters[\":categoryId\"] = $categoryID;\n }\n \n if (!empty($salePriceMin) AND !empty($salePriceMax))\n {\n $sql .= \" AND SalePrice >= :salePriceMin AND SalePrice <= :salePriceMax \";\n $namedParameters[\":salePriceMin\"] = $salePriceMin;\n $namedParameters[\":salePriceMax\"] = $salePriceMax;\n }\n \n if (!empty($basePriceMin) AND !empty($basePriceMax))\n {\n $sql .= \" AND BasePrice >= :basePriceMin AND BasePrice <= :basePriceMax\";\n $namedParameters[\":basePriceMin\"] = $basePriceMin;\n $namedParameters[\":basePriceMax\"] = $basePriceMax;\n }\n \n $sql .= \" ORDER BY Name\";\n \n $stmt = $conn->prepare($sql);\n $stmt->execute($namedParameters);\n $records = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $records;\n}",
"function get_price($name)\r\n{\r\n //Read data from DB table\r\n\r\n $servername = \"localhost\";\r\n $dbname = \"webservices\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n } \r\n\t\r\n\r\n \r\n $sql = \"SELECT price, make, model, year FROM vehicles_pinefalls where make ='$name' order by price asc limit 1\";\r\n $result = $conn->query($sql);\r\n\r\n $info=mysqli_fetch_array($result,MYSQLI_ASSOC);\r\n\r\n return $info;\r\n}",
"public function testSortByPrice()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setPrice(1.1);\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setPrice(2.2);\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setPrice(0.1);\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_PRICE);\n\n $this->assertEquals($item3, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item2, $sorted[2]);\n }",
"public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }",
"public static function getAllorderByName(){\n \t$data = DB::table('fxes')->orderBy('name')->get();\n \treturn $data;\n }",
"function allProducts($sort, $order) {\r\n global $conn;\r\n $select = \"SELECT productid, name, category, quantityavailable, quantitysold FROM product ORDER BY \" . $sort . \" \" . $order . \";\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}",
"function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }",
"function searchPrice($price){\n\t\t//Connect to database. Include db_password.php with your MySQL or MariaDB credentials\n\t\n\t\ttry{\n\t\t\tif(!isset($pdo)){\n\t\t\t\t$pdo = new PDO('mysql:host=127.0.0.1;dbname=auction_site_db', $GLOBALS[\"user\"], $GLOBALS[\"pass\"]);\t//'root', 'pizza64');\n\t\t\t}\n\t\t\t$queryString = 'SELECT * FROM AuctionItems WHERE listPrice <= :listPrice'; //= :itemName'; \n\t\t\t//$queryString = \"SELECT * FROM AuctionItems\"; //for debugging\n\t\t\t\n\t\t\t$query = $pdo->prepare($queryString);\n\t\t\t\n\t\t\t//take name variable, add SQL wildcards to find more results\n\t\t\t//$wildcard = \"%\";\n\t\t\t//$iName = {$wildcard}{$GLOBALS[\"name\"]}{$wildcard};\n\t\t\t//print_r($iName);\n\t\t\t//$name = \"fdfd\";\n\t\t\t\n\t\t\t$query->execute(array(':listPrice' => $price));//$GLOBALS[\"name\"]));\t//$name));\n\t\t\t$query_result = $query->fetchAll(PDO::FETCH_BOTH);\n\t\t\t\n\t\t\tif($query_result){\n\t\t\t\t//echo json_encode(array_values($query_result));\n\t\t\t\treturn json_encode(array_values($query_result));\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//echo \"No match was found\";\n\t\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\t}\n\t\t\t\n\t\t\t//make everything null so it closes the db connection\n\t\t\t$query = null; \n\t\t\t$pdo = null;\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\tdie();\n\t\t}\n\t\n\t}",
"function sortByPrice($a, $b) { \n return $a['menor_valor'] - $b['menor_valor'];\n}",
"function getItemsByPrice($dbh, $min, $max)\r\n{\r\n $stmt = $dbh->prepare ( \"SELECT * FROM items WHERE items.price >= ? and items.price <= ?\"); \r\n\r\n $stmt->bindParam(1,$min);\r\n $stmt->bindParam(2,$max);\r\n\r\n if ($stmt->execute()) \r\n {\r\n showItemsTable($stmt);\r\n }\r\n}",
"public function getProductNameAndPriceInPartnerOrdersByProductId() {\n\n $query = $this->db->prepare(\"SELECT o.order_id, p.product_name, p.product_price FROM orders o JOIN products p ON o.order_product_id = p.ext_product_id AND o.order_partner_id = p.vendor_id ORDER BY o.order_id\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }",
"function getItemsBasedOnName($search) {\n $query = \"SELECT \n item.id AS item_id,\n item.name AS item_name,\n item.fee AS item_fee,\n item.description AS item_description,\n item.pickup_lat AS item_pickup_lat,\n item.pickup_long AS item_pickup_long,\n item.return_lat AS item_return_lat,\n item.return_long AS item_return_long,\n item.date_available AS item_date_available,\n item.borrowed AS item_borrowed,\n item.promoted AS item_promoted,\n item.created AS item_created,\n item.last_updated AS item_last_updated,\n c.name AS categories_name,\n c.image_url AS categories_image_url,\n u.username AS user_username,\n u.profile_image_url AS user_profile_image_url,\n image.image_link,\n image.cover AS cover_image\n FROM items item, item_images image, categories c, users u\n WHERE item.id = image.item_id \n AND item.category_id = c.id\n AND item.user_id = u.id\n AND LOWER(item.name) LIKE LOWER(\"\n .string('%'.$search .'%')\n .\") ORDER BY item.last_updated DESC\";\n\n $go_q = pg_query($query);\n $items = array();\n\n while ($fe_q = pg_fetch_assoc($go_q)) {\n $items[$fe_q['item_id']]['id'] = $fe_q['item_id'];\n $items[$fe_q['item_id']]['name'] = $fe_q['item_name'];\n $items[$fe_q['item_id']]['fee'] = $fe_q['item_fee'];\n $items[$fe_q['item_id']]['description'] = $fe_q['item_description'];\n $items[$fe_q['item_id']]['pickup_lat'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['pickup_long'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['return_lat'] = $fe_q['item_return_lat'];\n $items[$fe_q['item_id']]['return_long'] = $fe_q['item_return_long'];\n $items[$fe_q['item_id']]['date_available'] = $fe_q['item_date_available'];\n $items[$fe_q['item_id']]['borrowed'] = $fe_q['item_borrowed'];\n $items[$fe_q['item_id']]['promoted'] = $fe_q['item_promoted'];\n $items[$fe_q['item_id']]['created'] = $fe_q['item_created'];\n $items[$fe_q['item_id']]['last_updated'] = $fe_q['item_last_updated'];\n $items[$fe_q['item_id']]['categories_name'] = $fe_q['categories_name'];\n $items[$fe_q['item_id']]['categories_image_url'] = $fe_q['categories_image_url'];\n $items[$fe_q['item_id']]['username'] = $fe_q['user_username'];\n $items[$fe_q['item_id']]['profile_image_url'] = $fe_q['user_profile_image_url'];\n if ($fe_q['cover_image'] == t) {\n $items[$fe_q['item_id']]['cover_image'] = $fe_q['image_link'];\n } else {\n $items[$fe_q['item_id']]['images'][] = array('image_link' => $fe_q['image_link']);\n }\n }\n\n return $items;\n\n}",
"function getInventoryOrderedLow(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT idItem, `name`, amount, unitPrice, salesPrice, parAmount, (amount / parAmount) AS orderAmount FROM inventory ORDER BY orderAmount ASC;\");\n \n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }",
"function es_add_catalog_order_by_member_prices($catalog_orderby_options) {\n\tunset($catalog_orderby_options[\"rating\"]);\n\n\t$catalog_orderby_options['member_price'] = __( 'Sort by member price', 'woocommerce' );\n\t\n\treturn $catalog_orderby_options;\n}",
"function high_price(){\n\n\tglobal $con;\t\n\t$get_hprice = \"SELECT * FROM items ORDER BY item_pice DESC\";\n\t$run_hprice = mysql_query($get_hprice);\t\n\tshow_item($run_hprice);\n\n}",
"function sortWithMoneyAndAlph($a, $b)\n{\n $aPrice = $a[\"price\"];\n $bPrice = $b[\"price\"];\n if (is_numeric($aPrice) and is_numeric($bPrice)) {\n $diff = $aPrice- $bPrice;\n } elseif (is_numeric($aPrice)) {\n $diff= 1; //only a is a nmber\n } else {\n $diff = -1; //only b is a number\n }\n\n\n $moneyRank = priceSort($a, $b);\n if ($diff == 0) {\n return critterNameSort($a, $b);\n }\n return $moneyRank;\n}",
"public function orderby(){\n\n $rows = $this\n ->db\n ->order_by(\"title\", \"asc\")\n ->order_by(\"id\", \"random\")\n ->get(\"personel\")\n ->result();\n\n print_r($rows);\n\n }",
"function low_price(){\n\tglobal $con;\t\n\t$get_lprice = \"SELECT * FROM items ORDER BY item_pice ASC\";\n\t$run_lprice = mysql_query($get_lprice);\t\n\tshow_item($run_lprice);\n\n}",
"public function priceList(Request $request){\n /*==Sorting filter on price ghazanfar on 27-1-2020==*/\n\n // $objProduct=Product::select('products.id','products.name','products.image_url','products.msrp','products.price','products.brand_id','products.category_id','product_rugs.collection','product_rugs.size','product_rugs.color','product_decors.collection','product_decors.size','product_decors.color')->Join('product_rugs','product_rugs.product_id','=','products.id')->Join('product_decors','product_decors.product_id','=','products.id')->where($request->filter)->orderBy('price',$request->order)->paginate(12);\n\n \n $objProduct=Product::has('productRug')->select('products.id','products.name','products.image_url','products.msrp','products.price','products.brand_id','products.category_id','product_rugs.collection','product_rugs.size','product_rugs.color')->Join('product_rugs','product_rugs.product_id','=','products.id')->where($request->filter)->orderBy('price',$request->order)->where('active',1)->paginate(12);\n \n if(count($objProduct)==0){\n\n $objProduct=Product::has('productDecor')->select('products.id','products.name','products.image_url','products.msrp','products.price','products.brand_id','products.category_id','product_decors.collection','product_decors.size','product_decors.color')->Join('product_decors','product_decors.product_id','=','products.id')->orderBy('price',$request->order)->where($request->filter)->where('active',1)->paginate(12);\n \n }\n \n return view('layouts.product_listing',compact('objProduct'));\n }",
"public function getSortedItemsByPrice($order = 'asc')\n\t{\n $sorted = array();\n foreach ( $this->items as $item ) {\n $sorted[($item->getPrice() * 100)] = $item;\n }\n ksort($sorted, SORT_NUMERIC);\n\t\treturn ($order == 'asc') ? $sorted : array_reverse($sorted);\n }",
"public function testSortByPrice()\n {\n $result=$this->sort->sortByPrice();\n $result = $this->hotelMapperService->serialize($result);\n $this->assertInternalType('array',$result);\n foreach ($result as $i => $hotel) {\n var_dump($hotel['price']);die;\n $this->assertGreaterThan($result[$i+1]['price'],$hotel['price']);\n $this->assertArrayHasKey('name', $hotel);\n $this->assertArrayHasKey('price', $hotel);\n $this->assertArrayHasKey('city', $hotel);\n $this->assertArrayHasKey('availability', $hotel);\n } \n }",
"public function orderBy($sql);",
"public function getProductNameInOrdersByProductId() {\n\n $query = $this->db->prepare(\"SELECT o.order_id, p.product_name FROM orders o JOIN products p ON o.order_product_id = p.product_id\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }",
"public static function listAll(){//le todos os dados da tabela\n\n\t\t$sql = new Sql();\n\n\t\treturn $sql->select(\n\t\t\t\"SELECT * FROM tb_products ORDER BY desproduct\" \n\t\t\t);\n\t}",
"public function getAllOrderedByName()\n {\n return $this->model->orderBy('name', 'asc')->get();\n }",
"public function &getOrderBy();",
"Function SalesPriceUsedInOrder($int_record_id) {\r\n return GetField(\"SELECT orders.OrderID\r\n\t\t\t\t\t FROM order_details\r\n\t\t\t\t\t INNER JOIN orders ON orders.OrderID = order_details.OrderID\r\n\t\t\t\t\t INNER JOIN pricing ON pricing.ProductID = order_details.ProductID\r\n\t\t\t\t\t\t\t\t\t AND (order_details.Quantity >= pricing.start_number OR pricing.start_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (pricing.ContactID = orders.ContactID OR pricing.ContactID = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate >= pricing.start_date OR pricing.start_date = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate <= pricing.end_date OR pricing.end_date = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t WHERE recordID = $int_record_id\");\r\n}",
"function fetch_prices()\n {\n $data = $this->db->query('SELECT * FROM `users_prices` WHERE users_price_order != 999 ORDER BY users_price_order ASC');\n if (!isset($data[0])) {\n return false;\n }\n return $data;\n }",
"public function modelReadSearchProductPrice($fromPrice,$toPrice,$recordPerPage){\n\t\t\t//lay bien p truyen tu url\n\t\t\t$p = isset($_GET[\"p\"]) && is_numeric($_GET[\"p\"]) && $_GET[\"p\"] > 0 ? ($_GET[\"p\"]-1) : 0;\t\t\t\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $p * $recordPerPage;\n\t\t\t//---\n\t\t\t//lay bien ket noi csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->query(\"select * from products where price >= $fromPrice and price <= $toPrice order by id desc limit $from,$recordPerPage\");\n\t\t\t//lay toan bo ket qua tra ve\n\t\t\t$result = $query->fetchAll();\t\t\t\n\t\t\t//---\n\t\t\treturn $result;\n\t\t}",
"public function getProductsWithName($name){\r\n\t\t$newQuery = \"SELECT * from products \".\r\n\t\t\t\t\" WHERE name LIKE '%\".$name.\"%'\";\r\n\t\t\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($newQuery);\r\n\t}",
"protected function priceSearch($price,$query)\n {\n\n if ($price != null )\n $query->whereBetween('price',[$price-200000,$price]);\n\n }",
"public static function getItem($name = '') {\n\n // Recommended: Secure Way to Write SQL in Yii \n $sql = 'SELECT id ,concat_ws(\" : \",name,unit_price) AS text \n FROM item \n WHERE (name LIKE :name or item_number=:item_number)';\n $name = '%' . $name . '%';\n $item_number = $name;\n return Yii::app()->db->createCommand($sql)->queryAll(true, array(':name' => $name, ':item_number'=>$item_number));\n \n }",
"function sortLowToHigh($a, $b)\n{\n return $a->price < $b->price ? -1 : 1; //Compare the prices, evalutes to true\n // return $a->price > $b->price ? 1 : -1; // Gives the same result\n}",
"public function getPrices()\n {\n }",
"function getProductBasics() {\n $db = acmeConnect();\n $sql = 'SELECT invName, invId FROM inventory ORDER BY invName ASC';\n $stmt = $db->prepare($sql);\n $stmt->execute();\n $products = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $products;\n }",
"public function modelSearchPrice($recordPerPage){\n\t\t\t$fromPrice = isset($_GET[\"fromPrice\"])?$_GET[\"fromPrice\"]:0;\n \t\t$toPrice = isset($_GET[\"toPrice\"])?$_GET[\"toPrice\"]:0;\n\t\t\t//tong so ban ghi\n\t\t\t$totalRecord = $this->modelTotalRecordSearchPrice();\n\t\t\t//tinh so trang\n\t\t\t//ham ceil la ham lay tran cua gia tri. VD: ceil(2.1) = 3\n\t\t\t//ham floor la ham lay san cua gia tri. VD: floor(2.6) = 2\n\t\t\t$numPage = ceil($recordPerPage/$totalRecord);\n\t\t\t//lay bien p truyen tu url\n\t\t\t$p = isset($_GET[\"p\"])&&is_numeric($_GET[\"p\"])&&$_GET[\"p\"]>0 ? ($_GET[\"p\"]-1):0;\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $p * $recordPerPage;\n\t\t\t//thuc hien truy van\n\t\t\t$conn = Connection::getInstance();\n\t\t\t$query = $conn->query(\"select * from products where price >= $fromPrice and price <= $toPrice order by id desc limit $from,$recordPerPage\");\n\t\t\t//lay tat ca ban ghi tra ve\n\t\t\t$result = $query->fetchAll();\n\t\t\treturn $result;\n\t\t}",
"function getToppingsSalesFromDB()\n{\n\t$con = mysql_connect(\"localhost\", \"DBandGUI\", \"narwhal\");\n\n\tif(!$con) { die('Could not connect: ' . mysql_error()); }\n\n\tmysql_select_db(\"CustomCupcakes\", $con) or die('Could not select db: ' . mysql_error());\n\n\t$query = \"SELECT topping_Name,purchase_Amount FROM CupcakeTopping;\";\n\n\t$result = mysql_query($query);\n\n\t$finalArr = array();\n\n\twhile($row = mysql_fetch_array($result))\n\t{\n\t\t$finalArr[$row['topping_Name']] = $row['purchase_Amount'];\n\t}\n\n\tmysql_close($con);\n\n\treturn $finalArr;\n}",
"public function getPriceLists(): ActiveQuery\n {\n return $this->hasMany(PriceList::className(), ['adv_prod_type_id' => 'id']);\n }",
"public function __construct($name, $price) {\n $this->name = $name;\n $this->price = $price;\n }",
"public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}",
"function getTodosProdutos($order='titulo ASC', $startwith=null, $simple=true)\n{\n global $conn;\n\n $order = !empty($order) ? $order : 'titulo ASC';\n $whr = null;\n $sql = \"SELECT\n pro_id,\n pro_titulo,\n pro_tipo,\n pro_valor\n FROM \".TP.\"_produto\n WHERE pro_status=1\n ORDER BY pro_{$order};\";\n $lst = array();\n if(!$qry = $conn->prepare($sql))\n echo divAlert($conn->error, 'error');\n\n else {\n\n $qry->execute();\n $qry->bind_result($id, $titulo, $tipo, $valor);\n\n if (!empty($startwith))\n $lst[0] = array('id'=>0, 'titulo'=>$startwith);\n\n $i=1;\n while ($qry->fetch()) {\n if (!$simple)\n $i = linkfySmart($titulo);\n\n $lst[$i]['id'] = $id;\n $lst[$i]['titulo'] = mb_strtoupper($titulo, 'utf8');\n $lst[$i]['tipo'] = $tipo;\n $lst[$i]['valor'] = 'R$ '.Moeda($valor);\n $lst[$i]['valor_decimal'] = $valor;\n\n if ($simple)\n $i++;\n }\n\n $qry->close();\n\n return $lst;\n }\n\n}",
"public static function loadProductsTopSale()\n {\n $ret = array();\n $sql = \"select p.ProID,p.ProName,p.Price, SUM(od.quantity) from products p,orderdetails od \n\t\t\t\twhere p.ProID = od.ProId\n\t\t\t\tGROUP BY p.ProID\n\t\t\t\tORDER BY od.quantity DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n //$tinyDes = $row[\"TinyDes\"];\n //$fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n //$quantity = $row[\"Quantity\"];\n //$catId = $row[\"CatID\"];\n //$view = $row[\"NView\"];\n //$dayAdd = $row[\"DayAdd\"];\n //$classify =$row[\"Classify\"];\n\n $p = new Products($proId, $proName, '', '', $price, '', '', '', '', '');\n array_push($ret, $p);\n }\n\n return $ret;\n }",
"public static function sortByName(){\n \n $db = Db::getConnection();\n \n $result = $db->query('SELECT * FROM task ORDER BY user_name ASC');\n\n return $result->fetchAll();\n }",
"function getOrderings() ;",
"public function modelTotalRecordSearchPrice(){\n\t\t\t$fromPrice = isset($_GET[\"fromPrice\"])?$_GET[\"fromPrice\"]:0;\n \t\t$toPrice = isset($_GET[\"toPrice\"])?$_GET[\"toPrice\"]:0;\n\t\t\t//lay bien ket noi\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->prepare(\"select id from products where price >= $fromPrice and price <= $toPrice\");\n\t\t\t//thuc thi truy van. Neu khong co tham so o cau truy van thi ghi array rong\n\t\t\t$query->execute(array());\n\t\t\t//tra ve so luong ban ghi\n\t\t\treturn $query->rowCount() > 0 ? $query->rowCount() : 1;\n\t\t}",
"function get_vehicles_by_year() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY year DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }",
"function getAllOrders()\n {\n $database = new Database();\n\n $conn = $database->getConnection();\n\n $stmt = $conn->prepare(\"SELECT * FROM mfqgkhncw3r34ada.orders INNER JOIN mfqgkhncw3r34ada.order_details ON mfqgkhncw3r34ada.orders.ID=mfqgkhncw3r34ada.order_details.orders_ID ORDER BY mfqgkhncw3r34ada.orders.TOTAL_PRICE DESC\");\n\n $stmt->execute();\n\n $result = $stmt->get_result();\n\n if (!$result) {\n echo \"assume there is an error in SQL statement\";\n exit;\n }\n\n if ($result->num_rows == 0) {\n return null;\n } else {\n\n $order_array = array();\n\n while ($user = $result->fetch_assoc()) {\n array_push($order_array, $user);\n }\n return $order_array;\n }\n }",
"public function search($params)\n {\n $query = Deal::find()->alias('d1')\n ->select([\n '*',\n 'TRUNCATE(price*(1.01),2) as \"1%_price\"',\n 'TRUNCATE(price*(1.02),2) as \"2%_price\"',\n 'TRUNCATE(price*(1.03),2) as \"3%_price\"',\n 'TRUNCATE(price*(1.04),2) as \"4%_price\"',\n 'TRUNCATE(price*(1.05),2) as \"5%_price\"',\n 'if(is_sell=1,TRUNCATE((sell_price-price)*num,2),0) win_money'\n ])\n ;\n\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $query;\n }\n\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'd1.id' => $this->id,\n 'd1.price' => $this->price,\n 'd1.num' => $this->num,\n 'd1.date' => $this->date,\n ]);\n $query->orderBy(['is_sell'=>SORT_ASC,'d1.stock_id'=>SORT_DESC,'d1.price'=>SORT_ASC]);\n\n return $query;\n }",
"function find_all_product_info_by_title($title){\n global $db;\n $sql = \"SELECT * FROM products \";\n $sql .= \" WHERE name ='{$title}'\";\n $sql .=\" LIMIT 1\";\n return find_by_sql($sql);\n }",
"public function prices()\n {\n return $this->hasMany(Price::class);\n }",
"function getHotelsByNameOrderBy( $ime_grada, $kriterij )\n\t{\n\t\t//slucaj kad korisnik zeli sortirati po atributima iz tablice projekt_hoteli\n\t\t\tif($kriterij === 'udaljenost_od_centra' || $kriterij === 'ocjena' || $kriterij === 'broj_zvjezdica')\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$db = DB::getConnection();\n\t\t\t\t\tif($kriterij === 'udaljenost_od_centra')\n\t\t\t\t\t\t$st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE ime_grada=:ime_grada ORDER BY udaljenost_od_centra' );\n\t\t\t\t\tif($kriterij === 'ocjena')\n\t\t\t\t\t\t$st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE ime_grada=:ime_grada ORDER BY ocjena' );\n\t\t\t\t\tif($kriterij === 'broj_zvjezdica')\n\t\t\t\t\t\t$st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE ime_grada=:ime_grada ORDER BY broj_zvjezdica' );\n\t\t\t\t\t$st->execute(array('ime_grada' => $ime_grada));\n\t\t\t}\n\t\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t\t//popuni polje soba koje je dodatna varijbla u klasi hotel.class osim atributa iz\n\t\t\t//tablice projekt_hoteli\n\t\t\t$arr = array();\n\t\t\twhile( $row = $st->fetch() )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$db = DB::getConnection();\n\t\t\t\t\t$st2 = $db->prepare( 'SELECT * FROM projekt_sobe WHERE id_hotela=:id_hotela' );\n\t\t\t\t\t$st2->execute(array('id_hotela' => $row['id']));\n\t\t\t\t}\n\t\t\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t\t\t$arr2 = array();\n\t\t\t\twhile ($row2 = $st2->fetch())\n\t\t\t\t\t$arr2[] = new Soba($row['ime_hotela'], $row2['id'], $row2['id_hotela'], $row2['broj_osoba'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row2['tip_kreveta'], $row2['vlastita_kupaonica'], $row2['cijena_po_osobi']);\n\t\t\t\t$arr[] = new Hotel( $row['id'], $row['ime_grada'], $row['ime_hotela'], $row['adresa_hotela'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['udaljenost_od_centra'], $row['ocjena'], $row['broj_zvjezdica'], $arr2 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$arr = array();\n\t\t\t//prvo dohvati sobe soritrane po kriteriju\n\t\t\t$sobe = $this->getRoomsByNameOrderBy($ime_grada, $kriterij);\n\t\t\tforeach($sobe as $var)\n\t\t\t{\n\t\t\t\t//za svaku sobu nadji hotel kojem pripada\n\t\t\t\t$db = DB::getConnection();\n\t\t\t $st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE id=:id_hotela' );\n\t\t\t\t$st->execute(array('id_hotela' => $var->id_hotela));\n\t\t\t\twhile( $row = $st->fetch() )\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$db = DB::getConnection();\n\t\t\t\t\t\t//mozda nepotreban dio, bitno je samo dohvatit sobe hotela kao i u gornjem\n\t\t\t\t\t\t//prvom slucaju da bi se to polje moglo spremit u klasu hotel.class\n\t\t\t\t\t\tif($kriterij === 'broj_osoba')\n\t\t\t\t\t\t\t$st2 = $db->prepare( 'SELECT * FROM projekt_sobe WHERE id_hotela=:id_hotela ORDER BY broj_osoba' );\n\t\t\t\t\t if($kriterij === 'cijena_po_osobi')\n\t\t\t\t\t\t\t$st2 = $db->prepare( 'SELECT * FROM projekt_sobe WHERE id_hotela=:id_hotela ORDER BY cijena_po_osobi' );\n\t\t\t\t\t\t$st2->execute(array('id_hotela' => $row['id']));\n\t\t\t\t\t}\n\t\t\t\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t\t\t\t$arr2 = array();\n\t\t\t\t\twhile ($row2 = $st2->fetch())\n\t\t\t\t\t\t$arr2[] = new Soba($row['ime_hotela'], $row2['id'], $row2['id_hotela'], $row2['broj_osoba'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row2['tip_kreveta'], $row2['vlastita_kupaonica'], $row2['cijena_po_osobi']);\n\t\t\t\t\t$arr[] = new Hotel( $row['id'], $row['ime_grada'], $row['ime_hotela'], $row['adresa_hotela'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['udaljenost_od_centra'], $row['ocjena'], $row['broj_zvjezdica'], $arr2 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\n\t}",
"function getOrderingAndPlaygroundQuery()\n\t{\n\t\treturn 'SELECT ordering AS value,name AS text FROM #__joomleague_playground ORDER BY ordering';\n\t}",
"public function index(Request $request, $page = 1) {\n\n $orderByOptions = [\n 'price' => ['field'=>'price', 'order' => 'asc'],\n '!price' => ['field' => 'price', 'order' => 'desc'],\n 'title' => ['field'=>'name', 'order'=>'asc'],\n '!title' => ['field'=>'name', 'order'=>'desc']\n ];\n\n $orderByKey = $request->get('order');\n\n if ( !$orderByKey || !array_key_exists($orderByKey, $orderByOptions) ) {\n $orderByKey = 'price';\n }\n\n $orderBy = $orderByOptions[$orderByKey];\n// $paginator = $productRepository->findAllPaginated($page, $orderBy['field'], $orderBy['order']);\n $paginator = [];\n return view('main.index', ['paginator'=>$paginator]);\n }",
"public function fetchCoffeeShops(){\n // $endPrice = $this->_request['endPrice'] != \"undefined\" ? intval ($this->_request['endPrice']) : -1;\n \n\n $sql = \"select distinct * from coffee_shops cf join city c on cf.CityId = c.CityID \";\n // if($startPrice!=\"undefined\")\n // {\n // $sql.=\" where cf.start_price>=$startPrice \";\n // if($endPrice != -1 )\n // $sql.=\" and cf.end_price<=$endPrice\";\n // }\n $rows = $this->executeGenericDQLQuery($sql);\n $coffeeShops = array();\n for($i=0;$i<sizeof($rows);$i++)\n {\n\n\n $coffeeShops[$i]['Name'] =($rows[$i]['Name'] == null || $rows[$i]['Name'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Name'] ;\n $coffeeShops[$i]['Address'] =($rows[$i]['Address'] == null || $rows[$i]['Address'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Address'] ;\n $coffeeShops[$i]['content'] =($rows[$i]['content'] == null || $rows[$i]['content'] ==\"null\") ? \"No Data Available\" : $rows[$i]['content'] ;\n $coffeeShops[$i]['Phone1'] =($rows[$i]['Phone1'] == null || $rows[$i]['Phone1'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone1'] ;\n $coffeeShops[$i]['Phone2'] =($rows[$i]['Phone2'] == null || $rows[$i]['Phone2'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone2'] ;\n $coffeeShops[$i]['Phone3'] =($rows[$i]['Phone3'] == null || $rows[$i]['Phone3'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Phone3'] ;\n $coffeeShops[$i]['Mobile'] =($rows[$i]['Mobile'] == null || $rows[$i]['Mobile'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Mobile'] ;\n $coffeeShops[$i]['Website'] =($rows[$i]['Website'] == null || $rows[$i]['Website'] ==\"null\") ? \"No Data Available\" : $rows[$i]['Website'] ;\n $coffeeShops[$i]['Category'] =($rows[$i]['Category'] == null) ? 0 : $rows[$i]['Category'] ;\n $coffeeShops[$i]['Facilities'] =$this->getFacilitiesByIds($rows[$i]['Facilities']);\n $coffeeShops[$i]['CityId'] =$rows[$i]['CityId'] ;\n $coffeeShops[$i]['icon_image'] =($rows[$i]['icon_image'] == null || $rows[$i]['icon_image'] ==\"null\") ? \"img/not_found.jpg\" : $rows[$i]['icon_image'] ;\n $coffeeShops[$i]['home_image'] =($rows[$i]['home_image'] == null || $rows[$i]['home_image'] ==\"null\") ? \"img/not_found.jpg\" : $rows[$i]['home_image'] ;\n \n \n \n \n }\n $this->response($this->json($coffeeShops), 200);\n\n }",
"public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }",
"public function getEggWidgetProducts(array $params)\n {\n $sql = 'SELECT *';\n if ($params['sortby'] == 'discount')\n $sql .= ', old_price-price as discount';\n\n $sql .= ' from ' . $this->tableName();\n\n //where\n $ids = array();\n $where = array();\n if ($params['affegg_ids'])\n {\n $ids = explode(',', $params['affegg_ids']);\n if ($ids)\n {\n $inQuery = implode(',', array_fill(0, count($ids), '%d'));\n $where[] = 'egg_id IN(' . $inQuery . ')';\n }\n }\n if ($params['in_stock'])\n $where[] = 'in_stock = 1';\n if ($params['sortby'] == 'discount')\n $where[] = 'old_price != 0';\n if ($where)\n $sql .= \" WHERE \" . implode(\" AND \", $where);\n\n //order\n if ($params['sortby'] == 'last')\n $params['sortby'] = \"egg_id\";\n $sql .= ' ORDER BY ';\n if ($params['sortby'] == 'random')\n $sql .= 'RAND()';\n elseif ($params['sortby'] == 'create_date')\n $sql .= 'create_date DESC';\n elseif ($params['sortby'] == 'last_update')\n $sql .= 'last_update DESC';\n elseif ($params['sortby'] == 'egg_id')\n $sql .= 'egg_id DESC';\n elseif ($params['sortby'] == 'discount')\n $sql .= 'discount DESC';\n\n //limit\n if ($params['limit'])\n $sql .= ' LIMIT ' . (int) $params['limit'];\n if ($ids)\n $sql = $this->getDb()->prepare($sql, $ids);\n $rows = $this->getDb()->get_results($sql, \\ARRAY_A);\n if (!$rows)\n return array();\n foreach ($rows as $i => $r)\n {\n $rows[$i]['extra'] = unserialize($r['extra']);\n }\n return $rows;\n }",
"function getProductsbySearch($Search){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `name` LIKE ? OR \n\t\t\t\t\t\t\t\t\t`description` LIKE ? OR\n\t\t\t\t\t\t\t\t\t`large_description` LIKE ? AND `stock`>0\");\n\t\t$Search = '%'.$Search.'%';\n\t\t$Search = str_replace(\" \", \"%\", $Search);\n\t\t$sth \t-> execute(array($Search, $Search, $Search));\n\n\t\treturn \t$sth;\n\t}",
"public function testOrder()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->order('price'));\n\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [['price' => ['order' => 'desc']]];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['created' => 'asc']);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['price' => ['order' => 'desc']],\n ['created' => ['order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['modified' => 'desc', 'score' => 'asc']);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['price' => ['order' => 'desc']],\n ['created' => ['order' => 'asc']],\n ['modified' => ['order' => 'desc']],\n ['score' => ['order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['clicks' => ['mode' => 'avg', 'order' => 'asc']]);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['price' => ['order' => 'desc']],\n ['created' => ['order' => 'asc']],\n ['modified' => ['order' => 'desc']],\n ['score' => ['order' => 'asc']],\n ['clicks' => ['mode' => 'avg', 'order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n\n $query->order(['created' => 'asc'], true);\n $elasticQuery = $query->compileQuery()->toArray();\n $expected = [\n ['created' => ['order' => 'asc']],\n ];\n $this->assertEquals($expected, $elasticQuery['sort']);\n }",
"public function sortProductByCreatedAt()\n {\n $query=new \\yii\\db\\Query();\n return $sort=$query->from('product')->where(['status' => self::ACTIVE_STATUS])->orderBy('created_at DESC')->all();\n }",
"public function getSortBy();",
"function getAll($tName, $order){\r\n\tglobal $con;\r\n\t$getAll = $con->prepare(\"SELECT * FROM $tName ORDER BY $order DESC\");\r\n\t$getAll->execute();\t\r\n\t$all = $getAll->fetchAll();\r\n\treturn $all;\r\n}",
"function getAllProducts(){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT id, name, description, price, stock, img_src \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock`>0\");\n\t\t$sth \t->execute();\n\t\t\n\t\treturn \t$sth;\n\t}",
"function shipPriceList($argWhere = '', $argLimit = '') {\n global $objGeneral;\n $this->orderOptions = 'pkpriceid DESC';\n\n $varQuery = \"SELECT pkpriceid,zonetitleid,shippingmethod,maxlength,maxwidth,maxheight,minkg,maxkg,costperkg,\"\n . \" handlingcost,fragilecost,deliveryday,cubicweight,title,MethodName,created,modified,pricestatus,logisticTitle \"\n . \" FROM \" . TABLE_ZONEPRICE . \" \"\n . \" LEFT JOIN \" . TABLE_ZONE . \" ON zoneid = zonetitleid \"\n . \" LEFT JOIN \" . TABLE_LOGISTICPORTAL . \" ON fklogisticidvalue = logisticportalid \"\n . \" LEFT JOIN \" . TABLE_SHIPPING_METHOD . \" ON pkShippingMethod = shippingmethod \"\n . \" WHERE \" . $argWhere . \" ORDER BY pkpriceid DESC LIMIT \" . $argLimit . \"\";\n //pre($varQuery);\n $arrRes = $this->getArrayResult($varQuery);\n //$varTable = TABLE_ZONEPRICE;\n //$arrRes = $this->select($varTable, $arrClms, $argWhere, $this->orderOptions, $argLimit);\n return $arrRes;\n }",
"function orderBy($param, $array){\n $x=0;\n if ($param === \"1\"){\n foreach ( $array as $price ){\n $arrayPrice[$x] = $price[3].$price[0];\n $x++;\n }\n $x=0;\n sort($arrayPrice,SORT_NUMERIC);\n foreach ( $array as $hotel ){\n foreach ( $array as $hotel ) {\n if (is_string($arrayPrice[$x])){\n if (str_contains($arrayPrice[$x], $hotel[0])) {\n $arrayPrice[$x] = $hotel;\n }\n }\n }\n $x++;\n }\n return $arrayPrice;\n }\n else{\n foreach ( $array as $km ){\n $arrayKm[$x] = $km['KM'];\n $x++;\n }\n $x=0;\n sort($arrayKm);\n foreach ( $array as $km ){\n foreach ( $array as $hotel ){\n if($arrayKm[$x] == $hotel['KM'] ) {\n $arrayKm[$x] = $hotel;\n }\n }\n $x++;\n }\n return $arrayKm;\n }\n }",
"public function getPriceCodeAndName()\n {\n return DB::table($this->table_wrist)\n ->select(DB::raw('wristband_style.code AS `style_code`, wristband_style.name AS `style_name`, wristband_size.code AS `size_code`, wristband_size.name AS `size_name`, price.qty, price.price'))\n ->join('wristband_style', 'price.style_id', '=', 'wristband_style.id')\n ->join('wristband_size', 'price.size_id', '=', 'wristband_size.id')\n ->get();\n }",
"public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }",
"public function get_price() {\n $query = $this->db->query(\"SELECT * FROM price \");\n\n if ($query) {\n return $query->result_array();\n }\n }",
"public function order();",
"public function getProducts()\n {\n $products = [\n [\"name\" => \"Sledgehammer\", \"price\" => 125.75],\n [\"name\" => \"Axe\", \"price\" => 190.50],\n [\"name\" => \"Bandsaw\", \"price\" => 562.131],\n [\"name\" => \"Chisel\", \"price\" => 12.9],\n [\"name\" => \"Hacksaw\", \"price\" => 18.45],\n ];\n return $products;\n }",
"public function getPriceFromDatabase()\n {\n }",
"public function getShopperList($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n \n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n if($query['sort'] == 'highest')\n $ratingOrder = 'rating desc, orders desc';\n else if ($query['sort'] == 'lowest')\n $ratingOrder = 'rating asc';\n // $ratingOrder .= ', name asc';\n\n DB::enableQueryLog();\n // execute\n $currentTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->whereNotNull('orders.rating')\n ->count();\n\n $prevTransactionCount = DB::connection('virtual_market')\n ->table('orders')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->whereNotNull('orders.rating')\n ->count();\n\n $currentAvgRating = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw('round(avg(orders.rating), 2) as rating'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->whereNotNull('orders.rating')\n ->get();\n\n $prevAvgRating = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw('round(avg(orders.rating), 2) as rating'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->whereNotNull('orders.rating')\n ->get();\n\n $ratingTrend = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw('round(avg(orders.rating), 2) as rating,'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->whereNotNull('orders.rating')\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $currentShopperData = DB::connection('virtual_market')\n ->table('orders')\n ->join('garendongs', 'garendongs.id', '=', 'orders.garendong_id')\n ->leftJoin('user_feedbacks', 'orders.id', '=', 'user_feedbacks.order_id')\n ->select(DB::raw('garendongs.id, garendongs.user_id, count(orders.rating) as orders, round(avg(orders.rating), 2) as rating, count(user_feedbacks) as feedbacks'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->whereNotNull('orders.rating')\n ->groupBy('garendongs.id')\n ->orderByRaw($ratingOrder);\n $currentShopperCount = $currentShopperData->get()->count();\n $shoppers = $currentShopperData->get();\n \n $shopperName = DB::connection('user')\n ->table('users')\n ->join('roles', 'users.role_id', '=', 'roles.id')\n ->select(DB::raw('users.id, users.name'))\n ->where('roles.name', '=', 'garendong')\n ->orderByRaw('users.id asc')\n ->get();\n // convert shopperName to associative array\n $names = array();\n for($i=0; $i<count($shopperName); $i++){\n $names[$shopperName[$i]->id] = $shopperName[$i];\n }\n $shopperChanges = array();\n foreach ($shoppers as $shopper) {\n $result = DB::connection('virtual_market')\n ->table('orders')\n ->join('garendongs', 'garendongs.id', '=', 'orders.garendong_id')\n ->select(DB::raw('count(orders.rating) as orders, round(avg(orders.rating), 2) as rating'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('garendongs.id', '=', $shopper->id)\n ->whereNotNull('orders.rating')\n ->groupBy('garendongs.id')\n ->get();\n array_push($shopperChanges, $result);\n }\n for($i=0; $i<count($shoppers); $i++){\n $prevOrder = count($shopperChanges[$i]) > 0 ? $shopperChanges[$i][0]->orders : $shoppers[$i]->orders;\n $prevRating = count($shopperChanges[$i]) > 0 ? $shopperChanges[$i][0]->rating : $shoppers[$i]->rating;\n $shoppers[$i]->orders_change = $shoppers[$i]->orders - $prevOrder;\n $shoppers[$i]->rating_change = round((float)($shoppers[$i]->rating - $prevRating), 2);\n $shoppers[$i]->name = $names[$shoppers[$i]->user_id]->name;\n }\n\n $prevShopperData = DB::connection('virtual_market')\n ->table('orders')\n ->join('garendongs', 'garendongs.id', '=', 'orders.garendong_id')\n ->select(DB::raw('garendongs.id, garendongs.user_id as name, count(orders.rating) as orders, round(avg(orders.rating), 2) as rating'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->whereNotNull('orders.rating')\n ->groupBy('garendongs.id');\n $prevShopperCount = $prevShopperData->get()->count();\n \n\n\n $data = array();\n $data['transaction_count'] = array();\n $data['transaction_count']['current'] = $currentTransactionCount;\n $data['transaction_count']['prev'] = $prevTransactionCount;\n $data['shopper_count'] = array();\n $data['shopper_count']['current'] = $currentShopperCount;\n $data['shopper_count']['prev'] = $prevShopperCount;\n $data['avg_rating'] = array();\n $data['avg_rating']['current'] = $currentAvgRating[0]->rating;\n $data['avg_rating']['prev'] = $prevAvgRating[0]->rating;\n $data['avg_rating']['trend'] = array();\n $data['avg_rating']['trend']['granularity'] = $granularity;\n $data['avg_rating']['trend']['trend'] = $ratingTrend;\n $data['shopper'] = $shoppers;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]); \n }",
"public function providerSortBy() {\n return array(\n array('name','ASC','item-01'),\n array('name','DESC','item-39'),\n array('color,name','ASC','item-03'),\n );\n }",
"public function getIngredientListWithUnitAndPrice($company_id) {\n $result = $this->db->query(\"SELECT tbl_ingredients.id, tbl_ingredients.name, tbl_ingredients.code, tbl_ingredients.purchase_price, tbl_units.unit_name\n FROM tbl_ingredients \n JOIN tbl_units ON tbl_ingredients.unit_id = tbl_units.id\n WHERE tbl_ingredients.company_id=$company_id AND tbl_ingredients.del_status = 'Live' \n ORDER BY tbl_ingredients.name ASC\")->result();\n return $result;\n }",
"function getProducts()\n {\n $this->db->select('id, name');\n $this->db->from('tbl_products');\n\t\t$this->db->order_by(\"name asc\");\n $query = $this->db->get(); \n return $query->result();\n }",
"public function getProductList($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $dbQuery = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('products', 'order_lines.product_id', '=', 'products.id')\n ->join('categories', 'products.category_id', '=', 'categories.id')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->join('units', 'products.default_unit_id', 'units.id')\n ->select(DB::raw('products.id, products.name, categories.name as category, count(*), sum(quantity) as sums, units.unit, round(avg(order_lines.price/order_lines.quantity), 0) as avg_price, round((cast(count(case when order_lines.is_available then 1 end) as float)/count(*) *100)::numeric, 2) as availability'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('products.id')\n ->groupBy('categories.name')\n ->groupBy('units.unit')\n ->orderByRaw('count desc, products.name asc');\n\n $totalRows = $dbQuery->get()->count();\n\n $product = $dbQuery\n ->get();\n\n for($i=0; $i<count($product); $i++) {\n $countData = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('products', 'order_lines.product_id', '=', 'products.id')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->join('units', 'products.default_unit_id', 'units.id')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('products.id', '=', $product[$i]->id)\n ->count();\n if($countData) {\n $prevData = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('products', 'order_lines.product_id', '=', 'products.id')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->join('units', 'products.default_unit_id', 'units.id')\n ->select(DB::raw('count(*), sum(quantity) as sums, round(avg(order_lines.price/order_lines.quantity), 0) as avg_price, round((cast(count(case when order_lines.is_available then 1 end) as float)/count(*) *100)::numeric, 2) as availability'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('products.id', '=', $product[$i]->id)\n ->get();\n } else {\n $prevData = array();\n }\n if(count($prevData) != 0) {\n $product[$i]->sum_change = (string) ($product[$i]->sums - $prevData[0]->sums);\n $product[$i]->price_change = (string) ($product[$i]->avg_price - $prevData[0]->avg_price);\n $product[$i]->availability_change = (string) ($product[$i]->availability - $prevData[0]->availability);\n } else {\n $product[$i]->sum_change = (string) 0;\n $product[$i]->price_change = (string) 0;\n $product[$i]->availability_change = (string) 0;\n }\n }\n\n\n $currentAvailability = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->select('*')\n ->select(DB::raw('count(case when order_lines.is_available then 1 end) as available, count(order_lines.is_available) as total'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->get();\n if($currentAvailability[0]->total > 0)\n $currentAvailability = round(((float)$currentAvailability[0]->available / $currentAvailability[0]->total)*100, 2);\n else \n $currentAvailability = null;\n\n $prevAvailability = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->select(DB::raw('count(case when order_lines.is_available then 1 end) as available, count(order_lines.is_available) as total'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->get();\n if($prevAvailability[0]->total > 0)\n $prevAvailability = round(((float)$prevAvailability[0]->available / $prevAvailability[0]->total)*100, 2);\n else \n $prevAvailability = null;\n\n $availabilityTrend = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->select(DB::raw('round((cast(count(case when order_lines.is_available then 1 end) as float)/count(*) *100)::numeric, 2) as availability,'.$dateQuery))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['total_rows'] = $totalRows;\n $data['product'] = $product;\n $data['availability'] = array();\n $data['availability']['current'] = $currentAvailability;\n $data['availability']['prev'] = $prevAvailability;\n $data['availability']['trend'] = array();\n $data['availability']['trend']['granularity'] = $granularity;\n $data['availability']['trend']['trend'] = $availabilityTrend;\n\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }",
"public function getSortedByCity()\n {\n return $this->createQueryBuilder('d')\n ->orderBy('d.name', 'ASC')\n ->getQuery()\n ->getResult();\n }",
"public function mainform_get_quotes()\n\t{\n\t\t$quotes = $this->get_quotes();\n\t// process the quotes\n\t\tforeach($quotes as $key => &$value)\n\t\t{\n\t\t $tmp = (array) $value;\n\t\t $quotes[$key] = $tmp['price'];\n\t\t} \n\t\tksort($quotes);\n\t\t$data['quotes'] = $quotes;\n\t\treturn $quotes;\n\t}",
"public function resolvePrice();",
"public function get_list()\n\t{\n\n\t\t$sel=$this->db->prepare(\"SELECT * from shop ORDER BY distance ASC\");\n\n $sel->execute();\n\n return ($sel->fetchAll(PDO::FETCH_ASSOC));\n\t\t\n\n\n\n }",
"function sortOrderProducts(order_products $orderProducts);",
"function nameSearch($conn, $search_term)\n {\n $query = \"SELECT DISTINCT whwp_Advert.advert_id FROM whwp_Advert \"\n . \"WHERE advert_bookname = :search_term \"\n . \"ORDER BY whwp_Advert.advert_price DESC\";\n $conn->prepQuery($query);\n $conn->bind('search_term', $search_term);\n $advert = $conn->resultset();\n return $advert;\n }",
"function get_products(){\r\n global $db;\r\n $query = 'SELECT * FROM products ORDER BY productID';\r\n $statement = $db->prepare($query);\r\n $statement->execute();\r\n $products = $statement->fetchAll();\r\n $statement->closeCursor();\r\n return $products;\r\n}",
"public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }",
"public function refinedGetJobs(){\r\n\t\t//extract info from the form\r\n\t\textract($_POST);\r\n\t\tif($sortBy == 'highestPrice'){\r\n\t\t\t$orderBy = 'price';\r\n\t\t\t$ascOrDesc = 'DESC';\r\n\t\t} elseif($sortBy == 'lowestPrice') {\r\n\t\t\t$orderBy = 'price';\r\n\t\t\t$ascOrDesc = 'ASC';\r\n\t\t} elseif($sortBy == 'newestJobs') {\r\n\t\t\t$orderBy = 'timeStamp';\r\n\t\t\t$ascOrDesc = 'ASC';\r\n\t\t} elseif($sortBy == 'oldestJobs') {\r\n\t\t\t$orderBy = 'timeStamp';\r\n\t\t\t$ascOrDesc = 'DESC';\r\n\t\t}\r\n\r\n\t\t$query = \"SELECT jobID, userID, category, title, price, description, timeStamp FROM jobs WHERE category='$category' ORDER BY $orderBy $ascOrDesc\";\r\n\t\t$data = $this -> multiSelectQuery($query);\r\n\t\treturn $data;\r\n\t}",
"function findsPrPosPriceList($pricelist)\n{\n\t$data['from'] = 'prpos';\n\t$data['select'] = 'ID, ARTNR, LST_NR, POS_0_WERT';\n\t$addWhere = \"\n\t\tLST_NR = '\" . $pricelist . \"'\";\n\treturn SQLSelect($data['from'], $data['select'], $addWhere, 0, 0, 0, 'shop', __FILE__, __LINE__);\n}",
"function sortWithAll($a, $b)\n{\n\n $priorityRank = expSort($a, $b);\n\n if ($priorityRank == 0) {\n $aPrice = $a[\"price\"];\n $bPrice = $b[\"price\"];\n if (is_numeric($aPrice) and is_numeric($bPrice)) {\n $diff = $bPrice - $aPrice;\n } elseif (is_numeric($aPrice)) {\n $diff= -1; //only a is a nmber\n } else {\n $diff = 1; //only b is a number\n }\n if ($diff == 0){\n return critterNameSort($a, $b);\n }\n return $diff;\n }\n return $priorityRank;\n}",
"public function searchRepeatedProduct($name) {\n $stmt = $this->db->prepare(\"select * from product where title = :title;\");\n $stmt->bindValue(\"title\", $name, PDO::PARAM_STR);\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function listOrder($arr_params){\n //lay bien ket noi csdl\n $limit = $arr_params['limit'];\n $page = $arr_params['page'];\n $start = ($page - 1) * $limit;\n $start = ($page - 1) * $limit;\n $obj_select=$this->connection->prepare\n (\"select * from orders where TRUE $this->str_search \n order by orders.created_at desc LIMIT $start, $limit\");\n //lay tat ca ket qua tra ve\n $arr_select = [];\n $obj_select->execute($arr_select);\n $orders = $obj_select->fetchAll(PDO::FETCH_ASSOC);\n return $orders;\n }",
"public function getSorting();",
"function GetPrice($symbol)\n{\n\t//google finance can only handle up to 100 quotes at a time so split up query then merge results\n\tif(count($symbol) > 100)\n\t{\n\t\t$retArr = array();\n\t\tfor($j=0; $j< count($symbol); $j +=100)\n\t\t{\n\t\t\t$arr = LookUpWithFormattedString(FormatString(array_slice($symbol, $j, 100)));\n\t\t\t$retArr = array_merge($retArr, $arr);\n\t\t}\n\t\treturn $retArr;\n\t}\n\telse\n\t\treturn LookUpWithFormattedString(FormatString($symbol));\n}",
"public function get_top_seller($num=5){\n $data =$this\n ->join('product_description','product.id','=','product_description.product_id')\n ->select(\"product.id\",'product.price','product.image','product_description.name')\n ->where('stock_status_id','5')\n ->where('status','1')\n ->where('product_description.language_id','1')\n ->orderBy('id', 'ASC')\n ->take($num)\n ->get();\n return $data;\n }",
"function getAllKontakt($id) {\n $rechte=berechtigung(\"cp_\");\n $sql=\"select * from contacts where cp_cv_id=$id and $rechte order by cp_name,cp_givenname\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n return $rs;\n}",
"public function prices() {\n return $this->hasMany('Auction_price'); // this matches the Eloquent model\n }",
"public function getTopProduct($params) {\n\t\t$query = OrderItem::find();\n\t\t$this->load($params);\n\t\t$query->select('product.name,SUM(order_item.quantity) as total');\n\t\t$query->innerJoin('product', 'order_item.product_id=product.id');\n\t\t$query->innerJoin('order', 'order_item.order_id=order.id');\n\t\t$query->andFilterWhere(['order.parent_id' => $this->username == null ? $this->user->id : $this->username]);\n\t\tif($this->start_date != null) {\n\t\t\tif($this->end_date == null) {\n\t\t\t\t$this->end_date = date('Y-m-d');\n\t\t\t}\n\t\t\t$query->andFilterWhere([\n\t\t\t\t'>=',\n\t\t\t\t'order.created_date',\n\t\t\t\t$this->start_date,\n\t\t\t]);\n\t\t\t$query->andFilterWhere([\n\t\t\t\t'<=',\n\t\t\t\t'order.created_date',\n\t\t\t\t$this->end_date,\n\t\t\t]);\n\t\t\t//\t\t\t$query->andFilterWhere([\n\t\t\t//\t\t\t\t'between',\n\t\t\t//\t\t\t\t'order.created_date',\n\t\t\t//\t\t\t\t$this->start_date,\n\t\t\t//\t\t\t\t$this->end_date,\n\t\t\t//\t\t\t]);\n\t\t\t//\t\t\t$query->andFilterWhere([\n\t\t\t//\t\t\t\t'between',\n\t\t\t//\t\t\t\t'order_item.created_date',\n\t\t\t//\t\t\t\t$this->start_date,\n\t\t\t//\t\t\t\t$this->end_date,\n\t\t\t//\t\t\t]);\n\t\t}\n\t\t$query->asArray()->groupBy('product.name');\n\t\t$query->orderBy('total DESC');\n\t\t$top_products = $query->limit(10)->all();\n\t\t$top = [];\n\t\tif($top_products != null) {\n\t\t\tforeach($top_products as $top_product) {\n\t\t\t\t$top[] = [\n\t\t\t\t\t$top_product['name'],\n\t\t\t\t\t(int) $top_product['total'],\n\t\t\t\t];\n\t\t\t}\n\t\t} else {\n\t\t\t$top[] = [\n\t\t\t\t'Không có',\n\t\t\t\t0,\n\t\t\t];\n\t\t}\n\t\t$top = ArrayHelper::merge([\n\t\t\t[\n\t\t\t\t'Top sản phẩm bán chạy',\n\t\t\t\t'Số lượng',\n\t\t\t],\n\t\t], $top);\n\t\treturn $top;\n\t}",
"public function getPrice();",
"public function getPrice();",
"public function getPrice();",
"public function getPrice();"
] | [
"0.721035",
"0.6168503",
"0.60461926",
"0.6002468",
"0.597751",
"0.5963464",
"0.58996195",
"0.5794403",
"0.5789841",
"0.5742664",
"0.57313246",
"0.5725735",
"0.5678571",
"0.5619953",
"0.5503527",
"0.5499075",
"0.54782397",
"0.5464432",
"0.5419354",
"0.5419088",
"0.54100794",
"0.5376154",
"0.53701866",
"0.53540117",
"0.53430116",
"0.53078276",
"0.530614",
"0.5304194",
"0.52685183",
"0.52550656",
"0.5251354",
"0.5241848",
"0.5221472",
"0.5217261",
"0.52107835",
"0.51918566",
"0.5190651",
"0.5180319",
"0.51719266",
"0.5165263",
"0.5164669",
"0.5144343",
"0.51412565",
"0.51330936",
"0.51289517",
"0.51228905",
"0.5115339",
"0.5113535",
"0.51078653",
"0.51016086",
"0.5100175",
"0.5094776",
"0.5092719",
"0.5086575",
"0.5068725",
"0.5068695",
"0.50623524",
"0.5060936",
"0.5059784",
"0.505644",
"0.50532216",
"0.5048592",
"0.5047587",
"0.50385463",
"0.5038184",
"0.5038149",
"0.50143576",
"0.5010968",
"0.5006466",
"0.5005068",
"0.50019115",
"0.4996895",
"0.49911684",
"0.49897453",
"0.49852547",
"0.4973929",
"0.49667785",
"0.495917",
"0.49572948",
"0.49518096",
"0.49474218",
"0.49467948",
"0.49438664",
"0.49430412",
"0.49405602",
"0.49398965",
"0.493086",
"0.49264285",
"0.4924866",
"0.49247912",
"0.49222338",
"0.49160567",
"0.49152294",
"0.49120098",
"0.49114054",
"0.49097255",
"0.48975536",
"0.48961848",
"0.48961848",
"0.48961848",
"0.48961848"
] | 0.0 | -1 |
Create query to get all details on an item | function show_record($dbc, $id){
$query = 'SELECT * FROM stuff WHERE id = ' . $id . '';
# Execute the query
$results = mysqli_query( $dbc, $query ) ;
check_results($results) ;
$row = mysqli_fetch_array( $results, MYSQLI_ASSOC) ;
# Show results
if ( $results ) {
# Initilizes the table before executing query.
echo '<DIV>' ;
echo '<TABLE border = "1" align= "center" cellpadding="5px" cellspacing=5px border = "1" >';
echo '<TR class="id">';
echo '<TD>ID:</TD>';
echo '<TD>'.$row['id'].'</TD>';
echo '<TR></TR>';
echo '<TR>';
echo '<TD>Item Name:</TD>';
echo '<TD>'.$row['item_name'].'</TD>';
echo '</TR>';
echo '<TR>';
echo '<TD>Location:</TD>' ;
echo '<TD>'.$row['location_id'].'</TD>';
echo '</TR>';
echo '<TR>';
echo '<TD>Description</TD>';
echo '<TD>'.$row['description'].'</TD>';
echo '</TR>';
echo '<TR>';
echo '<TD>Created</TD>';
echo '<TD>'.$row['create_date'].'</TD>';
echo '</TR>' ;
echo '<TR>' ;
echo '<TD>Owner</TD>';
echo '<TD>'.$row['owner'].'</TD>';
echo '</TR>' ;
echo '<TR>' ;
echo '<TD>Finder</TD>';
echo '<TD>'.$row['finder'].'</TD>';
echo '</TR>' ;
echo '<TR>' ;
echo '<TD>Status</TD>';
echo '<TD>'.$row['status'].'</TD>';
echo '</TR>' ;
echo '</TABLE>';
echo '</DIV>';
# For each row result, generate a table row
while ( $row = mysqli_fetch_array( $results , MYSQLI_ASSOC ) ) {
echo '<TR class="id">' ;
echo '<TD>' . $row['id'] . '</TD>' ;
echo '<TD>' . $row['item_name'] . '</TD>' ;
echo '</TR>' ;
}
# End the table
echo '</TABLE>';
# Free up the results in memory
mysqli_free_result( $results ) ;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function ItemInfoQuery() {\n\treturn $this->GetConnection()->MakeTableWrapper('vcqtItemsInfo');\n }",
"public function itemQuery()\n {\n return $this->item($this->getInput('id'));\n }",
"protected function ItemInfoQuery() {\n\treturn $this->Engine()->Make('vcqtImagesInfo');\n }",
"public function getAll(){\n\t\t\t//return $this->db->get('item'); \n\t\t}",
"public function itemsQuery()\n {\n return $this->items(null);\n }",
"public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM item_vendor_x';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"function item_details($iid, $oid)\n\t{\n\t\t$q = $this->db\n\t\t\t->select('co.store_id as stid, co.drug_id as iid, co.supplier_id as suid, co.manufacturer_id as mid, co.unit_cost price, co.unit_savings, co.quantity as qtyPrev, co.date_time, lc.item_type')\n\t\t\t->from('ci_completedorders as co')\n\t\t\t->join('ci_listings_compiled as lc', 'co.drug_id = lc.drug_id')\n\t\t\t->where('co.drug_id', $iid)\n\t\t\t->where('co.order_id', $oid)\n\t\t\t->limit(1)\n\t\t\t->get();\n\t\t\t\n\t\t$r = $q->row();\n\t\t\t\n\t\tif ( $q->num_rows() === 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$r->rx = ( $r->item_type == 1 ) ? false : true;\n\t\t\tunset($r->item_type);\n\t\t\t$r->date = strtotime($r->date_time);\n\t\t\tunset($r->date_time);\n\t\t\t\n\t\t\t$this->result_to_table('Queried item details: ', array($r));\n\t\t\t\n\t\t\treturn $r;\n\t\t}\n\t}",
"public static function getAllItems(){\n\t\t$sql = \"\n\t\tSELECT *\n\t\tFROM item\n\t\t\";\n\n\t\t// Make a PDO statement\n\t\t$statement = DB::prepare($sql);\n\n\t\t// Execute\n\t\tDB::execute($statement);\n\n\t\t// Get all the results of the statement into an array\n\t\t$results = $statement->fetchAll();\n\n\t\t// Loop array to get each row\n\t\t$template = '';\n\t\tforeach ($results as $heading => $row) {\n\t\t\t$template .=\n\t\t\t\t\t'<tr>\n\t\t\t\t\t\t<td>' . $row['name'] . '</td>\n\t\t\t\t\t\t<td>' . $row['price'] . '</td>\n\t\t\t\t\t\t<td>' . '<a href=\"edit_item.php?id=' . $row['id'] . '\">Edit</a></td>\n\t\t\t\t\t\t<td>' . '<a href=\"delete_item.php?id=' . $row['id'] . '\">Remove</a></td>\n\t\t\t\t\t</tr>';\n\t\t}\n\treturn $template;\n}",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM shoppingcart_courseregcodeitemannotation';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public function all_items($id) {\n $items = new stdClass();\n\n $items->bulk = DB::select('select I.name, B.quantity \n from (transaction_bulk as B \n join items as I on B.item_id = I.id)\n where B.transaction_id = ?',\n [ $id ]);\n\n $itm_info = DB::select('select I.item_id, C.name, I.item_code, I.serial_no \n from (transaction_inventory as T \n join inventory_items as I on T.inventory_item_id = I.id\n join items as C on I.item_id = C.id)\n where T.transaction_id = ? order by item_id',\n [ $id ]);\n\n //$items->inv = $itm_info;\n\n $items->inv = $this->process_inv_info($itm_info);\n\n return response()->json($items);\n }",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM patient_info';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public function getItems()\n {\n return $this->hasMany(Item::className(), ['item_id' => 'item_id'])->viaTable('exam_item', ['exam_id' => 'exam_id']);\n }",
"public function item_details($item_id)\n {\n $url = preg_replace('/set/i', 'item:' . $item_id, $this->public_url);\n return $this->curl($url)->item;\n }",
"public function index()\n {\n $items = Item::with([\n 'gender:id,name',\n 'type:id,name',\n 'supplier:id,name',\n 'image',\n ])->get()->toArray();\n return $items;\n }",
"public function getItems()\n {\n \n\n $items = DB::table('articulos')\n ->join('medidas', 'articulos.idMedida', '=', 'medidas.idMedida') \n ->where('articulos.estado', '=', true)\n ->select('articulos.idArticulo', \n 'articulos.nombre', \n 'articulos.descripcion', \n 'articulos.imagen', \n 'articulos.codigo', \n 'articulos.stockMinimo', \n 'articulos.precioCompraDefecto', \n 'articulos.precioVentaDefecto',\n 'medidas.nombre as nombreMedida',\n 'articulos.idCategoria',\n 'articulos.idLugarServir',\n 'articulos.idMedida')\n ->orderBy('articulos.created_at', 'desc')\n ->get();\n\n\n //$items = articulo::select('idArticulo', 'nombre', 'descripcion', 'imagen', 'codigo', 'stockMinimo', 'precioCompraDefecto', 'precioVentaDefecto', 'idCategoria', 'idLugarServir', 'idMedida')->where('estado', true)->orderBy('created_at', 'desc')->get();\n return response()->json($items);\n }",
"public function show(Item $item)\n {\n $item = Item::with([\n 'gender:id,name',\n 'type:id,name',\n 'supplier:id,name',\n 'image',\n ])->where('id',$item->id)->get()->toArray();\n return $item;\n }",
"public function index()\n {\n return DB::table('Item')->get();\n }",
"public function index()\n {\n return Item::join('categories', 'categories.id', '=', 'items.category_id')\n ->select('categories.name AS category_name', 'items.name', 'items.serial', 'items.description', 'items.max_quantity', 'items.created_at', 'items.category_id AS category', 'items.id', 'items.availability')\n ->latest()\n ->paginate(5);\n }",
"public static function getItem($name = '') {\n\n // Recommended: Secure Way to Write SQL in Yii \n $sql = 'SELECT id ,concat_ws(\" : \",name,unit_price) AS text \n FROM item \n WHERE (name LIKE :name or item_number=:item_number)';\n $name = '%' . $name . '%';\n $item_number = $name;\n return Yii::app()->db->createCommand($sql)->queryAll(true, array(':name' => $name, ':item_number'=>$item_number));\n \n }",
"public function f_get_items()\n {\n\n $sql = $this->db->query(\"SELECT * FROM md_dm_item \");\n return $sql->result();\n\n }",
"public function index()\n {\n return $this->itemRepo->findAll();\n }",
"public function query()\n {\n /**\n * Create your query\n */\n $query = newsItem::select(\n 'news_items.news_item_id as id' ,\n 'news_items.sequence as sequence' ,\n 'news_items.title as title' ,\n 'news_items.content as content' ,\n 'news_items.visible_from_date as visible_from_date' ,\n 'news_items.visible_until_date as visible_until_date'\n //'users_create.name as created_by',\n //'news_items.id as created_by_id',\n //'users_update.name as updated_by',\n //'news_items.id as updated_by_id'\n );\n //->orderBy('news_items.sequence')\n //->leftJoin('users as users_create', 'users_create.id', '=', 'news_items.created_by')\n //->leftJoin('users as users_update', 'users_update.id', '=', 'news_items.updated_by');\n return $this->applyScopes($query);\n }",
"public function get_all_items()\r\n\t{\r\n\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM tbl_item i\r\n\t\t\t\tORDER by i.item_id DESC\r\n\t\t\";\r\n\t\t$result = $this->getRows($sql);\r\n\t\treturn $result;\r\n\t}",
"public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM material';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"function getItemInfo($id, $obDB)\n{\n $obDB->doQuery(\"select * from auctionitems where itemID=\".$id.\" LIMIT 1\");\n $aResult = $obDB->fetchAssocResult()[0];\n return $aResult;\n \n}",
"public function f_get_item()\n {\n\n $sql = $this->db->query(\"SELECT * FROM md_dm_item \");\n return $sql->result();\n\n }",
"function getItems($db, $resource_pk) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $sql = <<< EOD\r\nSELECT i.item_pk, i.item_title, i.item_text, i.item_url, i.max_rating mr, i.step st, i.visible vis, i.sequence seq,\r\n i.created cr, i.updated upd, COUNT(r.user_pk) num, SUM(r.rating) total\r\nFROM {$prefix}item i LEFT OUTER JOIN {$prefix}rating r ON i.item_pk = r.item_pk\r\nWHERE (i.resource_link_pk = :resource_pk)\r\nGROUP BY i.item_pk, i.item_title, i.item_text, i.item_url, i.max_rating, i.step, i.visible, i.sequence, i.created, i.updated\r\nORDER BY i.sequence\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_INT);\r\n $query->execute();\r\n\r\n $rows = $query->fetchAll(PDO::FETCH_CLASS, 'Item');\r\n if ($rows === FALSE) {\r\n $rows = array();\r\n }\r\n\r\n return $rows;\r\n\r\n }",
"protected function getAllDetails()\n\t{\n\t\t $qbLogin = $this->getDefaultEntityManager()->createQueryBuilder();\n\t\t $qbLogin->select('m')\n ->from('MailingList\\Entity\\PhoenixMailingList', 'm')\n\t\t\t ->where('m.status=:st')\n\t\t\t ->andwhere('m.subscribe=:s')\n\t\t\t ->setParameter('s',1)\n\t\t\t ->setParameter('st',1);\n\t\t $result = $qbLogin->getQuery()->getResult();\t\n\t\treturn $result;\n\t}",
"function getItems();",
"function getItems();",
"public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }",
"public function show(Item $item)\n {\n //\n // $result = DB::table('items')->where('id', $item->id)->get();\n $result = Item::Where('id', $item->id)->first();\n return $result;\n }",
"function getiteminfo($sessionID, $itemID, $debug) {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT * FROM pricing WHERE sessionid = :sessionID AND itemid = :itemid LIMIT 1\");\n\t\t$switching = array(':sessionID' => $sessionID, ':itemid' => $itemID); $withquotes = array(true, true);\n\t\tif ($debug) {\n\t\t\treturn returnsqlquery($sql->queryString, $switching, $withquotes);\n\t\t} else {\n\t\t\t$sql->execute($switching);\n\t\t\treturn $sql->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t}",
"public function getItemsCriteria() {}",
"public function getItemsCriteria() {}",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function query()\n {\n $param = $this->list_type;\n $account = Account::paramBasedList($param);\n $account->select([\n 'accounts.id',\n 'accounts.transaction_date',\n 'accounts.transaction_type',\n 'accounts.ref_id',\n 'accounts.amount',\n 'income.purpose as income_purpose',\n 'expense.purpose as expense_purpose'\n ]);\n return $this->applyScopes($account);\n }",
"public function f_get_itemList()\n {\n\n $sql = $this->db->query(\" SELECT * FROM md_dm_item \");\n return $sql->result();\n\n }",
"public function getAll()\n\t{\n\t\t$stmt = self::$_connection->prepare(\"SELECT * FROM purchase_details\");\n\t\t$stmt->execute();\n\t\t$stmt->setFetchMode(PDO::FETCH_CLASS, 'PurchaseDetails');\n\t\treturn $stmt->fetchAll();\n\t}",
"protected function _buildItemsQuery() {\n\n $query=\"SELECT b.id, b.title, b.alias, b.state, b.create_date, b.public_date, u.name AS author_name, c.title AS category_title, c.alias AS category_alias\n FROM `#__blog` AS b\n LEFT JOIN `#__categories` AS c\n ON b.category_id = c.id \n LEFT JOIN `#__users` AS u\n ON b.author_id = u.id\";\n\n return $query;\n\n }",
"public function index()\r\n {\r\n $filters = request([\"sort_by\", \"description\", \"num_items\"]);\r\n $items = InventoryItem::filter($filters)\r\n ->with(\"user\")\r\n ->with(\"transactionSummary\")\r\n ->get();\r\n\r\n return array(\"items\" => $items);\r\n }",
"function getItemsBasedOnName($search) {\n $query = \"SELECT \n item.id AS item_id,\n item.name AS item_name,\n item.fee AS item_fee,\n item.description AS item_description,\n item.pickup_lat AS item_pickup_lat,\n item.pickup_long AS item_pickup_long,\n item.return_lat AS item_return_lat,\n item.return_long AS item_return_long,\n item.date_available AS item_date_available,\n item.borrowed AS item_borrowed,\n item.promoted AS item_promoted,\n item.created AS item_created,\n item.last_updated AS item_last_updated,\n c.name AS categories_name,\n c.image_url AS categories_image_url,\n u.username AS user_username,\n u.profile_image_url AS user_profile_image_url,\n image.image_link,\n image.cover AS cover_image\n FROM items item, item_images image, categories c, users u\n WHERE item.id = image.item_id \n AND item.category_id = c.id\n AND item.user_id = u.id\n AND LOWER(item.name) LIKE LOWER(\"\n .string('%'.$search .'%')\n .\") ORDER BY item.last_updated DESC\";\n\n $go_q = pg_query($query);\n $items = array();\n\n while ($fe_q = pg_fetch_assoc($go_q)) {\n $items[$fe_q['item_id']]['id'] = $fe_q['item_id'];\n $items[$fe_q['item_id']]['name'] = $fe_q['item_name'];\n $items[$fe_q['item_id']]['fee'] = $fe_q['item_fee'];\n $items[$fe_q['item_id']]['description'] = $fe_q['item_description'];\n $items[$fe_q['item_id']]['pickup_lat'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['pickup_long'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['return_lat'] = $fe_q['item_return_lat'];\n $items[$fe_q['item_id']]['return_long'] = $fe_q['item_return_long'];\n $items[$fe_q['item_id']]['date_available'] = $fe_q['item_date_available'];\n $items[$fe_q['item_id']]['borrowed'] = $fe_q['item_borrowed'];\n $items[$fe_q['item_id']]['promoted'] = $fe_q['item_promoted'];\n $items[$fe_q['item_id']]['created'] = $fe_q['item_created'];\n $items[$fe_q['item_id']]['last_updated'] = $fe_q['item_last_updated'];\n $items[$fe_q['item_id']]['categories_name'] = $fe_q['categories_name'];\n $items[$fe_q['item_id']]['categories_image_url'] = $fe_q['categories_image_url'];\n $items[$fe_q['item_id']]['username'] = $fe_q['user_username'];\n $items[$fe_q['item_id']]['profile_image_url'] = $fe_q['user_profile_image_url'];\n if ($fe_q['cover_image'] == t) {\n $items[$fe_q['item_id']]['cover_image'] = $fe_q['image_link'];\n } else {\n $items[$fe_q['item_id']]['images'][] = array('image_link' => $fe_q['image_link']);\n }\n }\n\n return $items;\n\n}",
"public function index()\n {\n return Item::orderBy('id', 'DESC')->get();\n }",
"function items( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the list of items or not? If $zcarriage='NO' exclude the zcarriage from the return result\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND ci.sku<>'zcarriage'\" : '';\n\n\t\t$qry = \"SELECT ci.*, product, product_image, model_type FROM cart ct INNER JOIN cart_items ci ON ct.id=ci.cart_id LEFT OUTER JOIN catalog c ON c.sku=ci.sku WHERE ct.id='\".$cart_id.\"' AND user='\".$user_no.\"' \".$zcarriage.\" AND ci.qty>0 GROUP BY ci.sku\";\n\t\treturn $this->db->query( $qry )->result_array();\n\t}",
"public function index()\n {\n\n if(isset($_GET['q'])){\n $q=$_GET['q'];\n $items=DB::table('items')\n ->where('active' , 0)\n ->where(function($query) use($q){\n $query->where('items.itemDescription' ,'LIKE' ,'%'.$q.'%')\n ->orwhere('code' ,'=' , $q) \n ->orwhere('materialType1' ,'LIKE' , '%'.$q.'%')\n ->orwhere('materialType2' ,'LIKE' , '%'.$q.'%');\n \n })\n ->paginate(7);\n\n }else{\n $items=DB::table('items')->where('active' , 0)->orderBy('created_at' , 'DESC')->paginate(7);\n } \n // $items=array();\n return view ('backend.items.itemList')->withitems($items);\n }",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM consultation_vp';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public function getItems()\n {\n $pageSize = $this->request->query('pageSize') ?? 30;\n $page = $this->request->query('page') ?? 1;\n $sortBy = $this->request->query('sort') ?? 'title_asc';\n $search = $this->request->has('search') ? $this->request->query('search') : null;\n $allowedFields = ['title', 'author', 'isbn'];\n $allowedOrder = ['asc', 'desc'];\n $sort = ControllerHelpers::deserializeSort($sortBy, $allowedFields, $allowedOrder);\n if (!$sort) {\n return response()->json([\n 'success' => false,\n 'message' => 'Please enter a valid sort params'\n ], 400);\n }\n\n $items = new ItemService();\n try {\n $result = $items->getItems($page, $pageSize, $search, $sort);\n if ($result) {\n return response()->json([\n 'success' => true,\n 'items' => $result\n ], 200);\n }\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'your request could not be completed'\n ], 400);\n }\n\n }",
"public function queryItem(Model $item, $extraCondition = array())\n {\n $condition = $item->queryGetCondition($extraCondition, Model::READ);\n return $this->query($condition, 'query');\n\n }",
"function json_SuppItemByItemId($itemId) {\n\t\t$query = \"SELECT fabID, Supp_ArtNo, SupplierID, Comp, Density, YarnCount, \n WidthPrint, CuttablePrint, Weight_gm2, Weight_gyd, Finishing, Supp_FinishingNum\n\t\t\t\tFROM fabricvw\n\t\t\t\tWHERE Supp_ArtNo LIKE '%\".$itemId.\"%' \";\n\t\t\n\t\tmysql_connect(DB_SERVER, DB_USER, DB_PASSWORD);\n\t\tmysql_select_db(DB_NAME);\n \t\n\t\t if($result = mysql_query($query)){\t\t\n\t\t\t$rows = Array(); // returned object\n\t\t\t$rows['identifier'] = \"fabID\";\n\t\t\t\n \t\t\twhile($r=mysql_fetch_assoc($result)) {\n \t\t\t $rows['items'][] = $r;\n \t\t\t}\n\n\t\t\treturn json_encode($rows);\n } else {\n die(mysql_error());\n }\n\t}",
"public function query()\n {\n $query = Unit::select(['id','code','name']);\n\n return $this->applyScopes($query);\n }",
"public abstract function get_query();",
"public function getItemByMultiple($item_data)\n\t{\n\t\t$where = array();\n\t\tif(isset($item_data['it_id'])){\n\t\t\t$where['it_id'] = $item_data['it_id'];\n\t\t}\n\t\tif(isset($item_data['owner_id'])){\n\t\t\t$where['owner_id'] = $item_data['owner_id'];\n\t\t}\n\t\treturn \\ORM::for_table($this->table)->where($where)->find_one();\n\t}",
"public function findAll() {\n $queryString = 'SELECT * FROM ElectronicSpecification';\n $eSDataList = $this->conn->directQuery($queryString);\n //dd($eSDataList);\n foreach ($eSDataList as &$eSData) {\n //dd($eSData);\n $queryString = 'SELECT * FROM ElectronicItem WHERE ';\n $parameters = array('ElectronicSpecification_id' => $eSData->id);\n //For each key, (ex: id, email, etc.), we build the query\n foreach ($parameters as $key => $value) {\n $queryString .= $key . ' = :' . $key;\n $queryString .= ' AND ';\n }\n //We delete the last useless ' AND '\n $queryString = substr($queryString, 0, -5);\n //We send to MySQLConnection the associative array, to bind values to keys\n //Please mind that stdClass and associative arrays are not the same data structure, althought being both based on the big family of hashtables\n $eIDataList = $this->conn->query($queryString, $parameters);\n //dd($eIDataList);\n $eSData->electronicItems = $eIDataList;\n }\n return $eSDataList;\n //dd($eSDataList);\n }",
"function getItemInfo($itemId)\n {\n $this->db->select('*');\n $this->db->from('tbl_product_items');\n $this->db->where('id', $itemId);\n $query = $this->db->get();\n \n return $query->result();\n }",
"function read_all_items() {\n $db = GetGlobal('db');\n\t $lan = GetReq('lan')>=0?GetReq('lan'):getlocal();\t//in case of post sitemap set lan param uri \n\t $itmname = $lan?'itmname':'itmfname';\n\t $itmdescr = $lan?'itmdescr':'itmfdescr';\t \n\t $start = GetReq('start');\n\t //$headcat = GetReq('headcat')?GetReq('headcat'):\"\";\t \n\t //$meter = $start?$start-1:0; \t \n\t \n\t \t\n $sSQL = \"select id,itmname,itmfname,cat0,cat1,cat2,cat3,cat4,itmdescr,itmfdescr,itmremark,\".$this->getmapf('code').\" from products \";\n\t $sSQL .= \" WHERE \";\n\t $sSQL .= \"itmactive>0 and active>0 \";\t\n\t //$sSQL .= \" GROUP BY cat0,$itmname\";\n\t $sSQL .= \" ORDER BY cat0,cat1,cat2,cat3,cat4,$itmname asc \";\n\t $sSQL .= $start ? \" LIMIT $start,10000\" : \" LIMIT 10000\";\t\t\t\n\t //echo $sSQL;\n\t\t\n\t $resultset = $db->Execute($sSQL,2);\t\n\t // $result = $resultset;\n\t $this->result = $resultset; \n \t $this->max_items = $db->Affected_Rows();//count($this->result);\t \n return (null);//$this->max_items);\t\t \n\t}",
"function get_info($item_kit_id) {\n $this->db->from('paket_sofa_items');\n $this->db->where('paket_id', $item_kit_id);\n \n //return an array of item kit items for an item\n return $this->db->get()->result_array();\n}",
"public function getSocialConnectItemsList()\n {\n //collection\n\n //SELECT * FROM MYTABLE\n $collection = $this->_ItemFactory->getCollection();\n $collection->addFieldToFilter(\"status\", 1);\n $collection->setOrder(\"Sort_Order\", 'DESC');\n //$collection->getSelect() use print query\n return ($collection->count()) ? $collection : null;\n }",
"public function getListQuery();",
"public function query()\n {\n $query = xpsArt::join('sys_lock_status', 'xps_art.sys_lock_status_id', '=', 'sys_lock_status.sys_lock_status_id')\n\t\t->select([\n\t\t\t'art_id',\n\t\t\t'art_id as id',\n\t\t\t'prod_sg_id',\n\t\t\t'xps_art.descr',\n\t\t\t'mis_art',\n\t\t\t'env_id',\n\t\t\t'xps_art.sys_lock_status_id',\n\t\t\t'sys_lock_status.descr as lock_descr',\n\t\t\t'digital',\n\t\t\t'price_only'\n ]);\n\n return $this->applyScopes($query);\n }",
"public function GetNewItemsDataNoti()\n {\n $this->db->select('items.item_id,items.item_name,items.description,items.verified,items.block,vendor.name,vendor.shop_name,vendor.address,vendor.mobile_no,sub_category.sub_cat_name,category.category_name,filters.filt_name');\n $this->db->from('items');\n $this->db->join('vendor','vendor.vid = items.vid','left');\n $this->db->join('filters','filters.filt_id = items.f_id','left');\n $this->db->join('sub_category','sub_category.sub_cat_id = filters.sub_cat_id','left');\n $this->db->join('category','category.cat_id = sub_category.cat_id','left');\n $this->db->where('items.verified',0);\n // $this->db->where($condition);\n $query = $this->db->get();\n return $query->result();\n }",
"private function fetchIt($item) {\n $book_id = $item->book_id;\n $book_title = $item->book_title;\n $book_author = $item->book_author === null ? \"\" : $item->book_author;\n $book_editor = $item->book_editor === null ? \"\" : $item->book_editor;\n $book_image = $item->book_image === null ? \"\" : $item->book_image;\n $book_state = $item->book_state;\n $cycle = $item->cycle;\n $classe = $item->classe;\n $book_unit_prise = $item->book_unit_prise;\n $book_stock_quantity = $item->book_stock_quantity;\n $b = new Book();\n return $b->setData($book_id, $book_title, $book_author, $book_editor, $book_image,\n $book_state, $cycle, $classe, $book_unit_prise, $book_stock_quantity);\n }",
"function GetDetailPPHItemById($id){\n\n $data = $this->db\n ->select('form_bd_item_pph.id_form_bd_item_pph as id_item_pph,form_bd_item_pph.id_form_bd_item as id_item,form_bd_item_pph.*,form_bd_item.real_amount,form_bd_item.name as item_name')\n ->where('form_bd_item_pph.id_form_bd_item_pph',$id)\n ->join('form_bd_item','form_bd_item.id_form_bd_item=form_bd_item_pph.id_form_bd_item')\n ->get('form_bd_item_pph')\n ->row_array();\n return $data;\n }",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM cbt_nomor_peserta';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public function listItems($param = null){\n $query = $this->orderBy('id', 'ASC')->paginate(5);\n return $query;\n }"
] | [
"0.7338643",
"0.69641715",
"0.6879929",
"0.66940415",
"0.64425546",
"0.636812",
"0.63556993",
"0.62433225",
"0.62293965",
"0.61693454",
"0.6168883",
"0.61534375",
"0.61428285",
"0.61306006",
"0.6113986",
"0.6101691",
"0.60924286",
"0.60905284",
"0.6058249",
"0.6055408",
"0.60476804",
"0.6031667",
"0.60203725",
"0.600909",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.59809643",
"0.597157",
"0.5971309",
"0.59533113",
"0.5945706",
"0.59405756",
"0.59405756",
"0.5934127",
"0.5916574",
"0.59149426",
"0.5913715",
"0.5911357",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58879465",
"0.58795244",
"0.58774316",
"0.58665186",
"0.58493996",
"0.58459073",
"0.5813466",
"0.5810142",
"0.5795966",
"0.5795763",
"0.57926965",
"0.5780451",
"0.57743967",
"0.5771884",
"0.57660943",
"0.57614326",
"0.5759824",
"0.5754523",
"0.57485384",
"0.57443494",
"0.5735682",
"0.572953",
"0.5723757",
"0.572074",
"0.5717671",
"0.57158387",
"0.57088476",
"0.56988996",
"0.5681685"
] | 0.0 | -1 |
Shows the query as a debugging aid | function show_query($query) {
global $debug;
if($debug)
echo "<p>Query = $query</p>" ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function printquery(){\n\t\techo $this->query.\";\";\n\t}",
"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 debug($row = null)\n\t{\n\t\tif($row) {\n\t\t\t// Dump debugging info for current row\n\t\t}\n\t\t\n\t\techo \"<p>Executed \" . $this->getQueryCount() . \" queries:</p>\";\n\t\techo \"<pre>\\n\";\n\t\tprint_r(self::$queryLog);\n\t\techo \"</pre>\\n\";\n\t}",
"public function showQuery() {\n return $this->_sql;\n }",
"public function showQuery() {\n return $this->_sql;\n }",
"function show_query($query) {\r\n global $debug;\r\n\r\n if($debug)\r\n echo \"<p>Query = $query</p>\" ;\r\n}",
"function print_query($db) {\n\t\techo \"<pre>\";print_r($db->get_compiled_select());echo \"</pre>\";\n\t}",
"function show_query($query) {\n global $debug;\n\n if(false && $debug)\n echo \"<p>Query = $query</p>\" ;\n}",
"public function actionDatabaseQueries() {\n echo \"Database Debug Log:\";\n $this->showLog('dbDebug.log');\n }",
"public function debug(){\r\n $this->db->debugMode(function($args){\r\n echo ($args[\"query\"]);\r\n });\r\n return $this;\r\n }",
"protected function debug($sql){\n\t\tif($this->debug){\n\t\t\tFlash::notice($sql);\n\t\t}\t\n\t}",
"function show_query($query) {\n global $debug;\n if($debug)\n echo \"<p>Records have been changed.</p>\" ;\n}",
"function display_sql(){\n #\n # Formating for sqlplus\n #\n u::p('set linesize 200');\n u::p('set pagesize 999');\n u::p('set feedback off');\n u::p('col s_time format a8');\n u::p('col active_sessions format a20');\n u::p('col on_cpu format 900');\n u::p('col user_io format 900');\n u::p('col system_io format 900');\n u::p('col other format 900');\n u::p('col sessions_in_lock format a15');\n u::p('col sql_id format a15');\n u::p('col sql_ids format a60');\n u::p('col sql_text format a90');\n u::p('col sid format 9999');\n u::p('col to_kill format a25');\n u::p('col username format a10');\n u::p('col program format a40');\n u::p('col sids_on_cpu format a40');\n u::p('col sids_user_io format a15');\n u::p('col sids_system_io format a15');\n u::p('col sids_blocked format a16');\n u::p('col others format a15'); \n u::p('----------------------');\n #\n # Dump out the sql we have run\n #\n foreach( $this->sql_details as $sql_detail ) u::p($sql_detail);\n }",
"public static function enableQueryLog()\n {\n }",
"public function get_query_log()\n {\n }",
"function debug($print_to_screen=true)\n\t\t{\n\n\t\t\t// Start outup buffering\n\t\t\tob_start();\n\n\t\t\techo \"<blockquote>\";\n\n\t\t\t// Only show ezSQL credits once..\n\t\t\tif ( ! $this->debug_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080 face=arial size=2><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Debug..</b></font><p>\\n\";\n\t\t\t}\n\n\t\t\tif ( $this->last_error )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b>$this->last_error</b></font>]<p>\";\n\t\t\t}\n\n\t\t\tif ( $this->from_disk_cache )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Results retrieved from disk cache</b></font><p>\";\n\t\t\t}\n\n\t\t\techo \"<font face=arial size=2 color=000099><b>Query</b> [$this->num_queries] <b>--</b> \";\n\t\t\techo \"[<font color=000000><b>$this->last_query</b></font>]</font><p>\";\n\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Query Result..</b></font>\";\n\t\t\t\techo \"<blockquote>\";\n\n\t\t\tif ( $this->col_info )\n\t\t\t{\n\n\t\t\t\t// =====================================================\n\t\t\t\t// Results top rows\n\n\t\t\t\techo \"<table cellpadding=5 cellspacing=1 bgcolor=555555>\";\n\t\t\t\techo \"<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td>\";\n\n\n\t\t\t\tfor ( $i=0; $i < count($this->col_info); $i++ )\n\t\t\t\t{\n\t\t\t\t\techo \"<td nowrap align=left valign=top><font size=1 color=555599 face=arial>{$this->col_info[$i]->type} {$this->col_info[$i]->max_length}</font><br><span style='font-family: arial; font-size: 10pt; font-weight: bold;'>{$this->col_info[$i]->name}</span></td>\";\n\t\t\t\t}\n\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\t// ======================================================\n\t\t\t\t// print main results\n\n\t\t\tif ( $this->last_result )\n\t\t\t{\n\n\t\t\t\t$i=0;\n\t\t\t\tforeach ( $this->get_results(null,ARRAY_N) as $one_row )\n\t\t\t\t{\n\t\t\t\t\t$i++;\n\t\t\t\t\techo \"<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial>$i</font></td>\";\n\n\t\t\t\t\tforeach ( $one_row as $item )\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<td nowrap><font face=arial size=2>$item</font></td>\";\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\n\t\t\t} // if last result\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<tr bgcolor=ffffff><td colspan=\".(count($this->col_info)+1).\"><font face=arial size=2>No Results</font></td></tr>\";\n\t\t\t}\n\n\t\t\techo \"</table>\";\n\n\t\t\t} // if col_info\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2>No Results</font>\";\n\t\t\t}\n\n\t\t\techo \"</blockquote></blockquote>\".$this->donation().\"<hr noshade color=dddddd size=1>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on && $print_to_screen)\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->debug_called = true;\n\n\t\t\treturn $html;\n\n\t\t}",
"protected function printSqlCheck() {}",
"function debug($print_to_screen=true)\n\t\t{\n\t\t\t// Start outup buffering\n\t\t\tob_start();\n\n\t\t\techo \"<blockquote>\";\n\n\t\t\t// Only show ezSQL credits once..\n\t\t\tif ( ! $this->debug_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080 face=arial size=2><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Debug..</b></font><p>\\n\";\n\t\t\t}\n\n\t\t\tif ( $this->last_error )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b>$this->last_error</b></font>]<p>\";\n\t\t\t}\n\n\t\t\tif ( $this->from_disk_cache )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Results retrieved from disk cache</b></font><p>\";\n\t\t\t}\n\n\t\t\techo \"<font face=arial size=2 color=000099><b>Query</b> [$this->num_queries] <b>--</b> \";\n\t\t\techo \"[<font color=000000><b>$this->last_query</b></font>]</font><p>\";\n\t\t\techo \"<font face=arial size=2 color=000099><b>Query Result..</b></font>\";\n\t\t\techo \"<blockquote>\";\n\n\t\t\tif ( $this->col_info )\n\t\t\t{\n\t\t\t\t// =====================================================\n\t\t\t\t// Results top rows\n\t\t\t\techo \"<table cellpadding=5 cellspacing=1 bgcolor=555555>\";\n\t\t\t\techo \"<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td>\";\n\n\t\t\t\tfor ( $i=0, $j=count($this->col_info); $i < $j; $i++ )\n\t\t\t\t{\n\t\t\t\t\t/* when selecting count(*) the maxlengh is not set, size is set instead. */\n\t\t\t\t\techo \"<td nowrap align=left valign=top><font size=1 color=555599 face=arial>{$this->col_info[$i]->type}\";\n\t\t\t\t\tif (!isset($this->col_info[$i]->max_length))\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"{$this->col_info[$i]->size}\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"{$this->col_info[$i]->max_length}\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"</font><br><span style='font-family: arial; font-size: 10pt; font-weight: bold;'>{$this->col_info[$i]->name}</span></td>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\t// ======================================================\n\t\t\t\t// print main results\n\t\t\t\tif ( $this->last_result )\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach ( $this->get_results(null,ARRAY_N) as $one_row )\n\t\t\t\t\t{\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\techo \"<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial>$i</font></td>\";\n\n\t\t\t\t\t\tforeach ( $one_row as $item )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"<td nowrap><font face=arial size=2>$item</font></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t}\n\t\t\t\t// if last result\n\t\t\t\t} else {\n\t\t\t\t\techo \"<tr bgcolor=ffffff><td colspan=\".(count($this->col_info)+1).\"><font face=arial size=2>No Results</font></td></tr>\";\n\t\t\t\t}\n\t\t\t\techo \"</table>\";\n\t\t\t// if col_info\n\t\t\t} else {\n\t\t\t\techo \"<font face=arial size=2>No Results</font>\";\n\t\t\t}\n\n\t\t\techo \"</blockquote></blockquote>\".$this->donation().\"<hr noshade color=dddddd size=1>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on && $print_to_screen)\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->debug_called = true;\n\t\t\treturn $html;\n\t\t}",
"private function query_debugger($Query) {\n\t\t// Debug queries\n\t\tif($this->debug) {\n\t\t\tstatic $query_cnt = 0;\n\t\t\tstatic $query_dup = 0;\n\t\t\tglobal $queries_debug, $queries_debug_arr;\n\t\t\t\n\t\t\t$queryTime = \"<span class='badge pull-right'>\".$this->Connection->queryTime.\" sec</span>\";\n\t\t\t\t\t\t\n\t\t\t$q = $Query;\n\t\t\t$paterns = '/(SELECT|FROM|ORDER BY|ASC|ASC\\,|DESC|WHERE|AND|\\sOR|JOIN|LEFT JOIN|IN| ON|GROUP BY|GROUP_CONCAT\\(|CONCAT\\(|CONVERT\\(|COUNT\\(|AS|LIMIT|OFFSET)\\s/i';\n\t\t\t$q = preg_replace($paterns, '<span>'.\"$1 \".'</span>', $q);\n\t\t\t$q = str_replace(\"\\r\", \"\", str_replace(\"\\n\", \"<br/>\", $q));\n\t\t\t$q = str_replace(\"<span>\", \"<span style='color:#990099; font-weight:bold;'>\", $q);\n\t\t\t\n\t\t\t$duplicate = '';\n\t\t\tif(in_array($Query, $queries_debug_arr)) {\n\t\t\t\t$query_dup++;\n\t\t\t\t$dup_key = array_search($Query, $queries_debug_arr)+1;\n\t\t\t\t//$q = \"Duplicate ($dup_key) : $q\";\n\t\t\t\t$duplicate = \" <code title='Duplicate'><i class='fa fa-copy'></i> \".$dup_key.\"</code>\";\n\t\t\t} else {\n\t\t\t\t$queries_debug_arr[] = $Query;\n\t\t\t}\n\t\t\t\n\t\t\t$q = \"<div class='trace' style='cursor:pointer;'><b>\".++$query_cnt . $duplicate . \"</b>. \". $q . $queryTime . \"</div>\";\n\t\t\t$q .= \"<div style='display:none;margin:15px 15px 0 15px;border-left: 2px solid #000000;'>\";\n\t\t\t$trace = debug_backtrace(false);\n\t\t\tfor($i=count($trace)-1;$i>=0;$i--) {\n\t\t\t\t$q .= str_repeat(\" \",(count($trace)-$i)*3);\n\t\t\t\t$q .= \"↳\";\n\t\t\t\t$q .= preg_replace(\"/^\\S+public_html\\//\",\"\",$trace[$i]['file']);\n\t\t\t\t$q .= \" : \".$trace[$i]['line'].\" -> \";\n\t\t\t\t$q .= isset($trace[$i]['class'])?$trace[$i]['class'].\"::\":\"\";\n\t\t\t\t$q .= $trace[$i]['function'];\n\t\t\t\tif($trace[$i]['function']=='render' && $trace[$i]['class']=='Twig_Environment') {\n\t\t\t\t\tif($trace[$i]['args']['0']=='mainpage.tpl' && !isset($queries_debug['-1'])) $queries_debug['-1'] = '*******************************Render TPL Start*********************************<br/>';\n\t\t\t\t\t$q .= ' (<b>'.$trace[$i]['args']['0'].'</b>)';\n\t\t\t\t}\n\t\t\t\t$q .= \"<br/>\";\n\t\t\t}\n\t\t\t$q .= \"</div>\";\n\t\t\t$GLOBALS['query_cnt'] = $query_cnt;\n\t\t\t$GLOBALS['query_dup'] = $query_dup;\n\t\t\t$queries_debug[] = $q;\n\t\t}\n\t}",
"function debug($message, $query = \"\") {\n global $logger;\n\t $logger->debug(\"$message \" . \"[ $query ]\" . \"\\n\");\n }",
"public static function getQueryLog()\n {\n }",
"public function enableQueryLog()\n {\n $this->loggingQueries = true;\n }",
"public function toString()\n {\n return \"is equivalent to the SQL query \". \\PHPUnit_Util_Type::toString($this->sql);\n }",
"function queryDebug($resultVar){\n\tif (!$resultVar) {\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message .= 'Whole query: ' . $query;\n\t\tdie($message);\n\t}\n}",
"public function debugQuery(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult $queryResult) {\n\t\t$GLOBALS['TYPO3_DB']->debugOuput = 2;\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;\n\t\t$queryResult->toArray();\n\t\t\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);\n\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = false;\n\t\t$GLOBALS['TYPO3_DB']->explainOutput = false;\n\t\t$GLOBALS['TYPO3_DB']->debugOuput = false;\n\t}",
"function dump_query($tablename, $filter=\"\") {\r\n //$this->query(sprintf(\"select * from %s\", $tablename));\r\n while ($this->next_record()) {\r\n\t $this->dump_record($tablename, $filter);\r\n\t};\r\n }",
"public function echoQuery($showAll = true)\r\n\t\t{\r\n\t\t\tif($showAll){\r\n\t\t\t\techo \"select property: \" . $this->_select . \"<br>\\n\";\r\n\t\t\t\techo \"where property: \" . $this->_where . \"<br>\\n\";\r\n\t\t\t\techo \"limit property: \" . $this->_limit . \"<br>\\n\";\r\n\t\t\t\techo \"order property: \" . $this->_orderBy . \"<br>\\n\";\r\n\t\t\t}\r\n\t\t\techo \"complete SQL:<br>\\n\" . $this->_sql . \"<br>\\n\";\r\n\t\t\tif($this->_errorCode != \"\" and $this->_errorCode != \"00000\"){\r\n\t\t\t\techo \"Errors:<br>\\n\";\r\n\t\t\t\tforeach($this->_errorInfo as $error){\r\n\t\t\t\t\techo \"::\" . $error . \"<br>\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"function Show()\n\t{\n\t\tif(!$this->Ready())\n\t\t\treturn $this->Error('query.exec', __FUNCTION__);\n\t\t\n\t\treturn $this->query;\n\t}",
"public static function showsql(){\n echo self::table()->last_sql;\n die;\n }",
"public function getSqlLog(){\n\n $queryLog = DB::getQueryLog();\n\n var_dump($queryLog);\n }",
"public function debug();",
"public function debug();",
"public function __toString() {\n return $this->query;\n }",
"public function inspect()\n {\n $query = array();\n if($this->_query) {\n $query[] = JSON::str($this->_query);\n } else {\n $query[] = '{}';\n }\n if($this->_fields) $query[] = JSON::str($this->_fields);\n $query = \"db.$this->name.find(\".implode(',',$query).\")\";\n foreach($this->_options as $key => $value)\n {\n $query .= \".$key(\".JSON::str($value).\")\";\n }\n return $query;\n }",
"function trace_sql()\n {\n if (!defined('OCTOBER_NO_EVENT_LOGGING')) {\n define('OCTOBER_NO_EVENT_LOGGING', 1);\n }\n\n if (!defined('OCTOBER_TRACING_SQL')) {\n define('OCTOBER_TRACING_SQL', 1);\n }\n else {\n return;\n }\n\n Event::listen('illuminate.query', function ($query, $bindings, $time, $name) {\n $data = compact('bindings', 'time', 'name');\n\n foreach ($bindings as $i => $binding) {\n if ($binding instanceof \\DateTime) {\n $bindings[$i] = $binding->format('\\'Y-m-d H:i:s\\'');\n } elseif (is_string($binding)) {\n $bindings[$i] = \"'$binding'\";\n }\n }\n\n $query = str_replace(['%', '?'], ['%%', '%s'], $query);\n $query = vsprintf($query, $bindings);\n\n traceLog($query);\n });\n }",
"public static function debugPrintStartQueryCode()\n {\n $ret = '';\n if (Channels::$channelsMode === 'debug'\n && self::$_currentSystem !== 'Report'\n ) {\n $ret .= \"if (Channels::\\$installing === FALSE) {\\n\";\n $ret .= \"Channels::includeSystem('Report');\\n\";\n $ret .= \"Report::debugStartQuery();\\n\";\n $ret .= \"}\\n\";\n }\n\n return $ret;\n\n }",
"function ddSql(Builder $query):string\n{\n dd($query->toSql(), $query->getBindings());\n}",
"function debugging() {\n\t\t$result = $this->connection->prepare(\"SELECT * FROM admins\");\n\t\t$result->execute();\n\t\treturn $result->fetchAll();\n\t}",
"function show_debug_params(PDOStatement $stmt)\n{\n echo '<div class=\"info\">';\n echo $stmt->debugDumpParams();\n echo '</div>';\n}",
"public function query() {\n // Leave empty to avoid a query on this field.\n }",
"public function enableQueryLog()\n\t{\n\t\t$this->neoeloquent->enableQueryLog();\n\t}",
"public function __toString() {\n\t\treturn $this->query;\n\t}",
"public function debugAction() : string\n {\n // Deal with the action and return a response.\n //return __METHOD__ . \", \\$db is {$this->db}\";\n return \"Debug my database!!\";\n }",
"public function dump()\n {\n $this->composeQuery();\n $result = $this->connection->client()->search($this->queryBody);\n\n dd($result);\n }",
"function query() {\n }",
"public function __toString() {\n\t\treturn $this->getQuery();\n\t}",
"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}",
"function get_debug_info($query)\n\t{\n\t\t$data = array();\n\t\tif (substr(trim(strtoupper($query)), 0, 6) == 'SELECT') {\n\t\t\tif (!pg_send_query($this->connection, \"EXPLAIN $query\"))\n\t\t\t{\n\t\t\t\t$err = pg_get_result($this->connection);\n\t\t\t\terror(PDNSADMIN_QUERY_ERROR, pg_result_error($err), $query, 0);\n\t\t\t} else {\n\t\t\t\t$result = pg_get_result($this->connection);\n\t\n\t\t\t\tif (false === $this->last)\n\t\t\t\t{\n\t\t\t\t\terror(PDNSADMIN_QUERY_ERROR, pg_result_error($err), $query, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = pg_fetch_array($result);\n\t\t}\n\t\treturn $data;\n\t}",
"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 function ViewResults() {\n echo \"<pre>\" . print_r($this->rs, TRUE) . \"</pre>\";\n }",
"public function __toString()\n {\n return $this->getQuery();\n }",
"public function showQueries()\n {\n return $this->queries;\n }",
"function __toString() {\n\t\treturn $this->query;\n\t}",
"protected function generateQueryReport()\n {\n $queryDetails = $this->getQueryDetails();\n if (count($queryDetails) === 0) {\n return '';\n }\n $queryInfo = '';\n foreach ($queryDetails as $query) {\n $sql = preg_replace('/[^%]%[^%]/', '%%', $query[ DFullProfiler::QUERY_SQL ]);\n $queryInfo .= sprintf(\"<tr><td>{$sql}</td><td class=\\\"good\\\">{$query[DFullProfiler::QUERY_COUNT]}</td><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">%0.4f sec</td><td class=\\\"good\\\">{$query[DFullProfiler::QUERY_AFFECTED_ROWS]}</td></tr>\",\n $query[ DFullProfiler::QUERY_EXECUTION_TIME ],\n $query[ DFullProfiler::QUERY_RETRIEVAL_TIME ],\n $query[ DFullProfiler::QUERY_PROCESSING_TIME ]);\n }\n\n return '<h2>Database Query Information</h2>'\n . '<table id=\"queries\">'\n . '<thead><tr><th style=\"width: 60%;\">SQL / Stored Procedure</th><th>Iterations</th><th>Execution Time</th><th>Result Retrieval Time</th><th>Processing Time</th><th>Affected Rows</th></tr></thead><tbody>'\n . $queryInfo\n . '</tbody></table>';\n }",
"public static function query()\n {\n }",
"public function queryFormat(): string\n {\n return 'Pretty';\n }",
"public function __toString(): string\n {\n $this->buildQuery();\n return $this->query;\n }",
"private function logDQL($msg)\n {\n $this->logger->info($msg . ' query: ' . $this->qb->getQuery()->getDQL());\n\n $params = $this->qb->getQuery()->getParameters();\n\n foreach ($params as $param) {\n $this->logger->info($msg . ' param name: ' . $param->getName() . ' param value: ' . $param->getValue());\n }\n }",
"public static function disableQueryLog()\n {\n }",
"public function debug(bool $oneLine = false): string\n {\n $query = $this->getSQL();\n\n foreach ($this->getBindings()->getBindings() as $parameter => $bind) {\n if ($parameter[0] == ':') {\n $parameter = substr($parameter, 1);\n }\n\n $value = $bind->getValue();\n\n $type = gettype($value);\n switch ($type) {\n case 'string':\n $query = str_replace(\":{$parameter}\", (\"'\" . addslashes((string) $value) . \"'\"), $query);\n break;\n\n case 'integer':\n case 'float':\n case 'double':\n $query = str_replace(\":{$parameter}\", (string)$value, $query);\n break;\n\n case 'NULL':\n $query = str_replace(\":{$parameter}\", 'NULL', $query);\n break;\n\n case 'boolean':\n $true = (bool)$value;\n $query = str_replace(\":{$parameter}\", $true ? 'true' : 'false', $query);\n break;\n\n case 'object':\n case 'array':\n case 'resource':\n case 'resource (closed)':\n case 'unknown type':\n\t throw new QueryException(\"Unsupported type ({$type}) was passed as parameter ({$parameter}) to SQL statement\");\n\n default:\n\t throw new \\Koldy\\Exception('Unknown data type (' . $type . ') was passed to SQL statement');\n }\n }\n\n if ($oneLine) {\n $query = str_replace(\"\\t\", '', $query);\n $query = str_replace(\"\\n\", ' ', $query);\n $query = str_replace(' ', ' ', $query);\n }\n\n return $query;\n }",
"public function dprint()\n\t{\n\t\tprint_r( $this->debug );\n\t}",
"public function __debugInfo()\n {\n return [\n '(help)' => 'This is a Query object, to get the results execute or iterate it.',\n 'action' => $this->clause('action'),\n 'formatters' => $this->_formatters,\n 'offset' => $this->clause('offset'),\n 'page' => $this->clause('page'),\n 'limit' => $this->clause('limit'),\n 'set' => $this->set(),\n 'sort' => $this->clause('order'),\n 'extraOptions' => $this->getOptions(),\n 'conditions' => $this->where(),\n 'repository' => $this->getEndpoint(),\n 'webservice' => $this->getWebservice(),\n ];\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function _query()\n {\n }",
"function query_info()\r\n\t\t{\r\n\t\t\techo \"<u>Your Previous Query Consisted of:</u><br>\";\r\n\t\t\techo \"SQL = '\".$this->last_query[\"sql\"].\"'<br>\";\r\n\t\t\t$temp = ($this->last_query[\"end_time\"] - $this->last_query[\"start_time\"]);\r\n\t\t\t$temp *= 1000;\r\n\t\t\t$temp = number_format($temp, 3);\r\n\t\t\techo \"Time Elapsed: \".$temp.\"(ms)<br>\";\r\n\t\t\techo \"Number of Records: \".$this->numrows.\"<br>\";\r\n\t\t\techo \"Number of Rows Affected: \".$this->affected_rows;\r\n\t\t}",
"public function debug(){\n $debug = [\n 'ID' => $this->ID,\n 'slug' => $this->slug,\n 'options' => $this->options,\n 'items' => $this->items,\n ];\n \"<pre>\".var_dump($debug).\"</pre>\";\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 enquery_view()\n {\n $ob = new model();\n $show_enquery=$ob->enquery_view_sql();\n return $show_enquery;\n }",
"public function display()\n\t{\n\t $sql = \"SELECT * FROM address WHERE name = ?\";\n\t \n\t}",
"public function log_query()\n\t{\n\t\t$query = $this->get_query();\n\n\t\tif ( ! $query ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_array( $query ) && ! is_object( $query ) ) {\n\t\t\t$query = [ $query ];\n\t\t}\n\n\t\t$log = new Charcoal_Log;\n\t\t$log->event_type = $this->event_type;\n\t\t$log->data = $query;\n\t\t$log->save();\n\t}",
"public static function debug()\r\n {\r\n if (func_num_args() === 0)\r\n return;\r\n\r\n // Get all passed variables\r\n $variables = func_get_args();\r\n\r\n $output = array();\r\n foreach ($variables as $var)\r\n {\r\n $output[] = Core::_dump($var, 1024);\r\n }\r\n\r\n echo '<pre class=\"debug\">'.implode(\"\\n\", $output).'</pre>';\r\n }",
"public static function show_in_graphql()\n {\n }",
"public function debug(){\n echo\"<pre><code>\";\n var_dump($this);\n echo \"</code></pre>\";\n }",
"function db_log_query($description, $sql, $params, $result = null) {\n\tif (! option('debug')) {\n\t\treturn;\n\t}\n\tif (! isset($GLOBALS['SQL_QUERIES'])) {\n\t\t$GLOBALS['SQL_QUERIES'] = array ();\n\t}\n\t$GLOBALS['SQL_QUERIES'][] = array (\n\t\t\"description\" => $description,\n\t\t\"query\" => $sql,\n\t\t// Ineffective and ugly way for a deep copy\n\t\t\"result\" => unserialize(serialize($result)),\n\t\t\"params\" => $params \n\t);\n}",
"function dq_dump_queries() {\n\tglobal $wpdb;\n\t$hide = true;\n\n\tif ($hide) echo \"<!--\\n\";\n\t\tif ( SAVEQUERIES === true ) {\n\t\techo \"<p>\\n\";\n\t\techo \"<strong>Total Number of Queries:</strong> {$wpdb->num_queries}<br/>\\n\";\n\t\techo \"<strong>Number of seconds:</strong> \"; timer_stop(1); echo \"<br/>\\n\\n\";\n\t\techo \"<strong>Memory Usage:</strong> \" . memory_get_usage() . \"<br/>\\n\\n\";\n\t\techo \"</p>\";\n\n\t\tforeach ($wpdb->queries as $query) {\n\t\t\techo \"<p>\\n\";\n\t\t\techo \"<strong>Query:</strong> {$query[0]}<br/>\\n\";\n\t\t\techo \"<strong>Time:</strong> {$query[1]}<br />\\n\";\n\t\t\tif ( isset($query[2]) )\n\t\t\t\techo \"<strong>Caller:</strong> {$query[2]}\\n\";\n\t\t\techo \"</p>\\n\";\n\t\t}\n\t} else {\n\t\techo \"<p>Add the following to wp-config.php to enable query dumps.</p>\\n\";\n\t\techo \"<p><code>define('SAVEQUERIES', true);</code></p>\\n\";\t\n\t}\n\n\tglobal $wp_object_cache;\n\tif ( isset($wp_object_cache) )\n\t\t$wp_object_cache->stats();\n\n\tif ($hide) echo \"\\n-->\\n\";\n}",
"public function getQueryLog()\n\t{\n\t\treturn $this->neoeloquent->getQueryLog();\n\t}",
"function graphql_debug($message, $config = [])\n {\n }",
"function query() {}",
"public function debugDumpParams()\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$parameters = array();\r\n\t\t\t\r\n\t\t\tif(count($this->parametersBound) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($this->parametersBound as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!isset($this->parameters[$key]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$parameters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"key\" => is_string($key) == true ? \"Name: [\".strlen($key).\"] \".$key : \"Position #\".$key,\r\n\t\t\t\t\t\t\t\"paramno\" => is_string($key) == true ? -1 : $key,\r\n\t\t\t\t\t\t\t\"name\" => is_string($key) == true ? \"[\".strlen($key).\"] \\\"\".$key.\"\\\"\" : \"[0] \\\"\\\"\",\r\n\t\t\t\t\t\t\t\"is_param\" => 1,\r\n\t\t\t\t\t\t\t\"param_type\" => $param['data_type']\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(count($this->parameters) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($this->parameters as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!isset($this->parametersBound[$key]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$parameters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"key\" => is_string($key) == true ? \"Name: [\".strlen($key).\"] \".$key : \"Position #\".$key.\":\",\r\n\t\t\t\t\t\t\t\"paramno\" => is_string($key) == true ? -1 : $key,\r\n\t\t\t\t\t\t\t\"name\" => is_string($key) == true ? \"[\".strlen($key).\"] \\\"\".$key.\"\\\"\" : \"[0] \\\"\\\"\",\r\n\t\t\t\t\t\t\t\"is_param\" => 1,\r\n\t\t\t\t\t\t\t\"param_type\" => $param['data_type']\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprintf(\"SQL: [%d] %s\".PHP_EOL.\"Params: %d\".PHP_EOL.PHP_EOL, strlen($this->queryString), $this->queryString, count($parameters));\r\n\t\t\t\r\n\t\t\tif(count($parameters) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($parameters as $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"Key: %s\".PHP_EOL, $param['key']);\r\n\t\t\t\t\tprintf(\"paramno=%d\".PHP_EOL, $param['paramno']);\r\n\t\t\t\t\tprintf(\"name=%s\".PHP_EOL, $param['name']);\r\n\t\t\t\t\tprintf(\"is_param=%d\".PHP_EOL, $param['is_param']);\r\n\t\t\t\t\tprintf(\"param_type=%d\".PHP_EOL, $param['param_type']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"function\n\tShow ()\n\t{\n\t\t$this->sourceStrings();\n\t\t\n\t\tif ($this->Title == '')\n\t\t{\n\t\t\t$this->Title = $this->_STRINGS['DEFAULT_QUERY_TITLE'];\n\t\t}\n\n\t\tif (count($this->Additional) > 0)\n\t\t\t$this->Fields = array_merge($this->Fields, $this->Additional);\n\t\t\n\t\t$this->display();\n\t}",
"public function debug() {\n $args = func_get_args();\n $debug = [];\n \n if ( in_array(self::DEBUG_LAST, $args) ) {\n $debug = end($this->_log_queries);\n }else if (in_array(self::DEBUG_ACTIVE, $args) ) {\n $debug = $this->_active_query;\n } else {\n $debug = $this->_log_queries;\n }\n \n if ( in_array(self::DEBUG_QUERIES, $args) ) {\n $new_debug = [];\n foreach ($debug as $db) {\n $new_debug[] = $db->debug();\n }\n \n $debug = $new_debug;\n }\n \n return $debug;\n }",
"function devlyQueries() {\n\t\n\techo 'ran ' . get_num_queries() . ' queries in ' . timer_stop(1) . ' seconds';\n\t\n}",
"private function logQuery(string $query): void\n {\n $query = trim($query);\n\n if (strpos($query, \"\\n\")!==false)\n {\n // Query is a multi line query.\n $this->io->logVeryVerbose('Executing query:');\n $this->io->logVeryVerbose('<sql>%s</sql>', $query);\n }\n else\n {\n // Query is a single line query.\n $this->io->logVeryVerbose('Executing query: <sql>%s</sql>', $query);\n }\n }",
"public function get_sql()\n {\n }",
"function get_trace(){\n\t\tglobal $database_queries,$database_query_count,$is_connected_to_db,$global_link;\n\t\treturn(\"<div style='width:100%'></div>\".$this->get_shadow(\"<h1>Mysql Trace information</h1>Note: this information s for debug purposes only, and will not be shown in the final product.<br/>Query Count:\".\n\t\t\t'db used:'.$this->dbdatabase.'<br/>Connected to Database:'.(int)$is_connected_to_db.'<br/>Link:'.$global_link.'<br/> Query Count: '.\n\t\t\t$database_query_count.'<br/>'.$database_queries,$this->default_style,'center','80%'));\n\t}",
"public function __toString(){\r\n\t\treturn $this->queryString();\r\n\t}",
"public function gatherSQLQueryData()\n {\n $queryTotals = array();\n\n $queryTotals['count'] = 0;\n $queryTotals['time'] = 0;\n\n $queries = array();\n\n if(isset($this->connection)) {\n $queryLog = $this->connection->getQueryLog();\n\n $queryTotals['count'] += count($queryLog);\n\n foreach($queryLog as $query) {\n if(isset($query['bindings']) && ! empty($query['bindings'])) {\n $query['sql'] = PdoDebugger::show($query['query'], $query['bindings']);\n } else {\n $query['sql'] = $query['query'];\n }\n\n $query = $this->attemptToExplainQuery($query);\n\n $queryTotals['time'] += $query['time'];\n\n $query['time'] = $this->getReadableTime($query['time']);\n\n //\n $queries[] = $query;\n }\n }\n\n $queryTotals['time'] = $this->getReadableTime($queryTotals['time']);\n\n $this->output['queries'] = $queries;\n $this->output['queryTotals'] = $queryTotals;\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}",
"public function query($query = \"NONEE\"){\n\t\t\n\t\tif($update = $query === \"NONEE\")\n\t\t\t$query = $this->query; \t\t\t\t\t\n\t\t\n\t\t$this->query_total++;\n\t\t\n\t\t$query_check = trim($query);\n\t\t\n\t\tif($this->debug){\n\t\t\techo \"<br/><strong style=\\\"color:#E4C100\\\"><DEBUG></strong><br/>\";\n\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#D3C26E;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : \"\";\n\t\t\techo \"<span style=\\\"color:#E4C100\\\">\".$query.\"</span><br/><strong style=\\\"color:#E4C100\\\"></DEBUG></strong><br/>\";\n\t\t}\n\t\t\n\t\t$resultset = $this->showErrors ? mysqli_query($this->connection,$query) : @mysqli_query($this->connection,$query);\n\t\t\n\t\t$proceed_log = $this->log && ( \n\t\t(stripos($query_check,\"INSERT\") === 0 && $this->log_options{0} === '1')\n\t\t||\n\t\t(stripos($query_check,\"DELETE\") === 0 && $this->log_options{1} === '1')\n\t\t||\n\t\t(stripos($query_check,\"UPDATE\") === 0 && $this->log_options{2} === '1')\n\t\t||\n\t\t(stripos($query_check,\"SELECT\") === 0 && $this->log_options{3} === '1'));\n\t\t\n\t\tif(stripos($query_check,\"INSERT\") === 0 || stripos($query_check,\"DELETE\") === 0 || stripos($query_check,\"UPDATE\") === 0)\n\t\t\tif(!$resultset)\n\t\t\t\t$this->transaction = false;\n\t\t\n\t\tif($proceed_log){\n\t\t\t$log_fields = \"query,date,user\";\n\t\t\t$log_values=\"'\".$this->secure($query).\"',NOW(),\".$this->log_user;\n\t\t}\n\t\t\n\t\tif(!$resultset){\n\t\t\tif($this->showErrors){ \n\t\t\t\techo \"<br/><strong style=\\\"color:red\\\"><QERROR></strong><br/>\";\n\t\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#E88888;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : $this->comment.\"nada\";\n\t\t\t\techo \"<span style=\\\"color:red\\\">\".mysqli_error($this->connection).\" at \".$query_check.\"</span><br/><strong style=\\\"color:red\\\"></QERROR></strong><br/>\";\n\t\t\t}\n\t\t\tif($proceed_log){\n\t\t\t\t$log_fields .= \",error\";\n\t\t\t\t$log_values .= \",'\".mysqli_error($this->connection).\"'\";\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($proceed_log){\t\t\t\n\t\t\t@mysqli_query($this->connection,\"INSERT INTO \".$this->log_table.\"($log_fields) VALUES($log_values)\");\n\t\t}\n\t\t\n\t\tif(!$resultset && $this->closeOnError) \n\t\t\texit;\n\t\t\n\t\tif($update)\n\t\t\t$this->resultset = $resultset;\n\t\t\n\t\treturn $resultset; \n\t}",
"public function Query() {\n \n }",
"public static function query();",
"public function query()\n {\n }"
] | [
"0.7704094",
"0.74717724",
"0.73182344",
"0.72348976",
"0.72348976",
"0.7183185",
"0.71733016",
"0.71637195",
"0.7068388",
"0.69680417",
"0.68164",
"0.6735474",
"0.67048234",
"0.6661419",
"0.66545194",
"0.66503924",
"0.6643856",
"0.66430044",
"0.66264325",
"0.66179943",
"0.6587809",
"0.65824205",
"0.65209275",
"0.64951086",
"0.64864445",
"0.64717823",
"0.64630014",
"0.644931",
"0.64205873",
"0.6385848",
"0.63841224",
"0.63841224",
"0.63833416",
"0.6370822",
"0.6358499",
"0.63472646",
"0.6331851",
"0.63263196",
"0.6321173",
"0.6270972",
"0.62029034",
"0.6188583",
"0.6170452",
"0.6156838",
"0.6152581",
"0.6139784",
"0.61268324",
"0.6123729",
"0.6115361",
"0.6098724",
"0.609673",
"0.60847825",
"0.6051692",
"0.6044272",
"0.6017035",
"0.6013517",
"0.60108364",
"0.6004735",
"0.59929836",
"0.59870297",
"0.5986981",
"0.5980652",
"0.5974109",
"0.5974109",
"0.5974109",
"0.5974109",
"0.5974109",
"0.5974109",
"0.5974109",
"0.5974109",
"0.5974109",
"0.5970277",
"0.59484875",
"0.5919186",
"0.5908196",
"0.58785564",
"0.5864096",
"0.5861396",
"0.58601993",
"0.58494765",
"0.58487695",
"0.5844856",
"0.58422786",
"0.5828646",
"0.5828078",
"0.5821724",
"0.58156985",
"0.5806851",
"0.5805938",
"0.58039975",
"0.5800659",
"0.5800516",
"0.5790127",
"0.57878053",
"0.5786894",
"0.5781797",
"0.57777524",
"0.57768476",
"0.5775123",
"0.57625765"
] | 0.71795 | 6 |
Checks the inputed number for validity. | function valid_item_name ($item_name) {
if ( empty($item_name) )
return false;
else
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function input_number_is_valid( $number ) {\n\t\treturn ( is_numeric( $number ) && $number > 0 );\n\t}",
"public function isValid($number);",
"public function validate(string $number): bool;",
"abstract public function validateNumber(): bool;",
"public static function validInput($number)\r\n {\r\n return is_string($number) || is_int($number);\r\n }",
"public static function validate_number($number){\r\n if(!preg_match('/^[0-9]*$/', $number)) return FALSE;\r\n return TRUE;\r\n }",
"function validate_Integer($number)\n {\n // condition for validating user input using preg_match conditions.\n if (preg_match('/[1-9]{1}/', $number) && $number > 0) {\n return true;\n }\n }",
"function valid_number($num) {\r\nif(empty($num) || !is_numeric($num))\r\n return false ; \r\nelse {\r\n $num = intval($num) ; \r\n\tif($num <= 0) \r\n\t\treturn false ;\r\n }\r\n return true ; \r\n}",
"function validarnumero($numero){ \nif($numero=='0'){\n\t\n}else{\n\tif(is_numeric($numero)) {\n //si es un numero no dice nada\n } else {\n return TRUE;\n }\n}\n \n}",
"public function check()\n {\n return ctype_digit($this->value);\n }",
"function checkNum($number) {\n if($number>50) {\n throw new Exception(\" Tavë Kosi has been known for 90 years in Albanian cuisine.\");\n }\n return true;\n}",
"public function validate()\n {\n // get the value; remove spaces, dashes, and dots\n $value = str_replace([' ', '-', '.'], '', (string) $this->getValue());\n\n // is it composed only of digits?\n if (! ctype_digit($value)) {\n return false;\n }\n\n // luhn mod-10 algorithm: https://gist.github.com/1287893\n $sumTable = [\n [0,1,2,3,4,5,6,7,8,9],\n [0,2,4,6,8,1,3,5,7,9],\n ];\n\n $sum = 0;\n $flip = 0;\n\n for ($i = strlen($value) - 1; $i >= 0; $i--) {\n $sum += $sumTable[$flip++ & 0x1][$value[$i]];\n }\n return $sum % 10 === 0;\n }",
"private function _valid($numValue){\n\t\tif(!is_int($numValue)){\n\t\t\t//throws error\n\t\t\techo \"not an int\";\n\t\t\treturn 0;\n\t\t}\n\n\t\tif($numValue < 1 || $numValue > 100){\n\t\t\t//throws error\n\t\t\techo \"not in range\";\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}",
"private function validate()\n {\n if (! is_numeric($this->number)) {\n throw new \\InvalidArgumentException(\"Invalid numeric value provided ($this->number).\");\n }\n }",
"public function testValidateNumber(): void\n {\n $this->assertTrue($this->validate(1));\n }",
"protected function validateNumber($value) {\n if (preg_match(\"/^\\-?[0-9\\ ]+[\\.|\\,]?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid number\"));\n return false;\n }",
"private function checkValueNumber($number)\n {\n if ($number < 0) {\n throw new InvalidArgumentException(\"should be not negative number\");\n }\n\n if (!is_numeric($number)) {\n throw new InvalidArgumentException(\"should be a number\");\n }\n }",
"function validateAmount($amount)\n{ \n return is_numeric($amount) && $amount > 0;\n}",
"protected function validateNumber($value){\n\t\treturn is_numeric($value);\n\t}",
"public function validate($value)\n {\n $value = preg_replace('/[^\\d]/', '', (string) $value);\n if (strlen($value) != 11 ) {\n return false;\n }\n $acumulado = 0;\n $digits = str_split($value);\n\n // obtain digit\n $digit = array_pop($digits);\n\n for ($i=0; $i < count($digits); $i++ ) {\n $acumulado += $digits[9-$i] * (2 + ($i % 6 ));\n }\n $verif = 11 - ( $acumulado % 11 );\n $verif = $verif == 11? 0 : $verif;\n\n return $digit == $verif;\n }",
"public static function validId($input)\n\t{\n\t\treturn (isset($input) && is_numeric($input) && $input > 0);\n\t}",
"function isValidNumber($variable){\n\t\tif(preg_replace(\"/^(\\+|\\-)?[0-9]+$/\", '', $variable) !== '')\n\t\t\treturn false;\n\t\treturn true;\n\t}",
"protected function validateDigit($input)\n {\n $validator = new Digits();\n if (!$validator->isValid($input)) {\n throw new ValidatorException(\"Validation failed: {$input} is not a digit in function \" .\n debug_backtrace()[1]['function'] . \".\");\n }\n return true;\n }",
"public static function check(string $number = NULL)\n {\n $table = \n [\n\t\t\t[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n\t\t\t[0, 2, 4, 6, 8, 1, 3, 5, 7, 9]\n\t\t];\n\n\t\t$total = 0; $transform = 0;\n\n\t\tfor( $i = strlen($number ?? '') - 1; $i >= 0; $i-- )\n\t\t{\n\t\t\t$total += $table[$transform++ & 0x1][$number[$i]];\n\t\t}\n\n\t\treturn $total % 10 === 0;\n }",
"public static function checkIsNumber($input) {\r\n\r\n\t\tif (is_numeric($input) == true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}",
"private function hasNumber(): bool\n {\n if (1 == preg_match('/\\d/', $this->password)) {\n return true;\n }\n array_push($this->errorMessages, \"Number missing.\");\n return false;\n }",
"function isValid($value = null)\n {\n if(is_numeric($value)){\n return true;\n }\n\n $this->errorFound();\n\n return false;\n }",
"private function verifyByLuhnAlgorithm($number){ }",
"public function validate(): bool\n {\n return is_int($this->value);\n }",
"public function isValidCheckDigit() {\n\t\t$checkDigit = self::calculateCheckDigit($this->number);\n\t\t// Validate\n\t\treturn $checkDigit === $this->checkDigit;\n\t}",
"protected function validateDigits($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}",
"public function isValid($value)\r\n {\r\n $response = parent::isValid($value);\r\n if (!$response)\r\n {\r\n $this->_messages =\r\n array(self::INVALID => \"El valor debe ser un número entero\");\r\n }\r\n return $response;\r\n }",
"function check($a, $b) {\n if (is_numeric($a) && is_numeric($b)) {\n return true;\n } else {\n return \"please enter numbers only.\";\n }\n}",
"public function validate($field, $value) {\n if (! empty($value) && ($value != '')) {\n if ((! is_numeric($value)) || (is_numeric($value) && (floatval($value) != intval($value)))) {\n throw new \\fwk\\exceptions\\InvalidInput(sprintf(_('%s should be a valid int'), $field));\n }\n }\n return true;\n }",
"public function testValidateStringNumber(): void\n {\n $this->assertFalse($this->validate('1'));\n }",
"function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}",
"public function validate($value)\n {\n return is_numeric($value);\n }",
"private function validateNumber($number, $length = false) {\n\n $number = filter_var($number, FILTER_SANITIZE_NUMBER_INT);\n\n if ($length && strlen($number) > $length)\n $this->errors[] = 'Number is too large for field: \"' . $number . '\"';\n\n if (!ctype_digit($number))\n $this->errors[] = 'The number ' . $number . ' should contain only digits';\n\n return $number;\n }",
"private static function validate_number(&$phone)\n\t{\n\t\tif (substr($phone, 0, 1) == '+') {\n\t\t\t$phone = substr($phone, 1);\n\t\t}\n\n\n\t\tif (is_numeric($phone)) {\n\n\t\t\t// test if there's a 1 prepended.\n\t\t\tif (strlen($phone) === 11 && $phone[0] == 1) {\n\t\t\t\t//pop 1 off. \n\t\t\t\t$phone = substr($phone, 1);\n\t\t\t\treturn true;\n\n\t\t\t} elseif (strlen($phone) === 10) {\n\t\t\t\t// it's a 10 digit number... I guess that works.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// is invalid if no return by here. \n\t\treturn false;\n\t}",
"public function isValid($value)\n\t{\t\t\n \t$value = str_replace(',', '.', $value);\n \t\n\t if(is_numeric($value) && !empty($value)) {\n return true;\n\t }\n\t\t\n\t echo \"value numerique\" . $value;exit;\n\t \n\t $this->_error( self::INVALID_SYNTAX );\n\t\treturn false;\n\t}",
"function number_check($var) {\n\tif ( is_numeric($var) )\n\t\treturn $var;\n\treturn null;\n}",
"function validateNumber ( $validatedValue, $stringName ) {\n\tif ( !is_numeric ( $validatedValue ) ) {\n\t\techo \"<script>alert('$stringName should be a number!!!!')</script>\";\n\t\texit ();\n\t} else if ( $validatedValue < 0 ) {\n\t\techo \"<script>alert('$stringName should be greater or equal 0!!!!')</script>\";\n\t\texit ();\n\t}\n}",
"public function valid_cc_number($number)\n\t{\n\t\t// is the number in the correct format?\n\t\t$valid_format = FALSE;\n\t\tif(ereg(\"^5[1-5][0-9]{14}$\", $number)) // mastercard\n\t\t{\n\t\t\t$valid_format = TRUE;\n\t\t}\n\t\telseif(ereg(\"^4[0-9]{12}([0-9]{3})?$\", $number)) // visa\n\t\t{\n\t\t\t$valid_format = TRUE;\n\t\t}\n\t\t// will add others as needed\n\t\n\t\t// is the number valid?\n\t\t$card_number = strrev($number);\n\t\t$num_sum = 0;\n\t\t\n\t\tfor($i=0; $i < strlen($card_number); $i++)\n\t\t{\n\t\t\t$current_num = substr($card_number, $i, 1);\n\t\t\t\n\t\t\t// double every second digit\n\t\t\tif($i%2 == 1)\n\t\t\t{\n\t\t\t\t$current_num *= 2;\n\t\t\t}\n\t\t\t\n\t\t\t// add digits of 2-digit numbers together\n\t\t\tif($current_num > 9)\n\t\t\t{\n\t\t\t\t$first_num = $current_num % 10;\n\t\t\t\t$second_num = ($current_num - $first_num) / 10;\n\t\t\t\t$current_num = $first_num + $second_num;\n\t\t\t}\n\t\t\t\n\t\t\t$num_sum += $current_num;\n\t\t}\n\t\t\n\t\t// if the total has no remainder it's OK\n\t\t$pass_check = ($num_sum % 10 == 0);\n\t\t\n\t\tif($valid_format && $pass_check)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function is_number($num){\t\t\n\t\tif(!empty($num)){\n\t\t\tif(!ctype_digit($num)){\n\t\t\t\treturn true;\n\t\t\t}\n \t}\n }",
"protected function _isValidNotation($number) {\n $invalidNotations = array(\"00310\", \"0310\", \"310\", \"31\");\n foreach($invalidNotations as $invalid) {\n if( strpos( substr( $number, 0, 6 ), $invalid ) !== false ) {\n $valid = substr($invalid, 0, -1);\n if (substr($valid, 0, 2) == '31') { \n $valid = \"00\" . $valid;\n }\n if (substr($valid, 0, 2) == '03') { \n $valid = \"0\" . $valid;\n }\n if ($valid == '3'){ \n $valid = \"0\" . $valid . \"1\";\n }\n $number = str_replace($invalid, $valid, $number);\n }\n }\n return $number;\n }",
"protected function validateInt($value) {\n if (preg_match(\"/^\\-?[0-9]+$/\", $value))\n return true;\n $this->setError(t(\"Invalid integer\"));\n return false;\n }",
"function checkInteger($var) {\r\n\r\n\tif(preg_match('!^\\d+$!', $var)) { return true; } else { return false; }\r\n\r\n}",
"private function luhn_check($number) {\r\n\r\n\t\t// Set the string length and parity\r\n\t\t$number_length=strlen($number);\r\n\t\t$parity=$number_length % 2;\r\n\r\n\t\t// Loop through each digit and do the maths\r\n\t\t$total=0;\r\n\t\tfor ($i=0; $i<$number_length; $i++) {\r\n\t\t\t$digit=$number[$i];\r\n\t\t\t// Multiply alternate digits by two\r\n\t\t\tif ($i % 2 == $parity) {\r\n\t\t\t\t$digit*=2;\r\n\t\t\t\t// If the sum is two digits, add them together (in effect)\r\n\t\t\t\tif ($digit > 9) {\r\n\t\t\t\t\t$digit-=9;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Total up the digits\r\n\t\t\t$total+=$digit;\r\n\t\t}\r\n\r\n\t\t// If the total mod 10 equals 0, the number is valid\r\n\t\treturn ($total % 10 == 0) ? TRUE : FALSE;\r\n\r\n\t}",
"function validate(int $number):string{\n\treturn \"You dont have any error\";\n}",
"function fn_validate_cc_number($number, $show_error = false)\n{\n if (empty($number)) {\n return false;\n }\n\n $number = str_replace(array('-',' '), '', $number);\n\n if (preg_match('/^([?0-9]{13,19}|[?*\\d]+)$/', $number)) {\n return true;\n } elseif ($show_error) {\n fn_set_notification('E', __('error'), __('text_not_valid_cc_number', array(\n '[cc_number]' => $number\n )));\n }\n\n return false;\n}",
"private function integrityCheck(int $number) : bool \n {\n if($this->resultPossibilities[$number] == false) {\n return false;\n } else {\n return true;\n }\n }",
"public function checkNumber($value, $lifetime=5400)\n\t\t{\n\t\t\t$time = intval(time()/10);\n\t\t\tfor($i = 0; $i < $lifetime; $i++)\n\t\t\t\tif($value == $this->calculate($this->getNumericSalt()+$time-$i, $this->min, $this->max))\n\t\t\t\t\treturn true; // this is a legal value\n\n\t\t\treturn false; // no legal values found the last 90 minutes\n\t\t}",
"static function checkInteger($param) {\n \n if(isset($param) && is_numeric($param)) { \n return true;\n } else {\n return false;\n }\n }",
"protected function isValidValue($value): bool\n\t{\n\t\treturn is_numeric($value) === true;\n\t}",
"function validate_is_number($field_input, array &$field): bool\n{\n if (!is_numeric($field_input)) {\n $field['error'] = 'Type in integer';\n return false;\n }\n return true;\n}",
"function validateNumberOrRange($number, $min_value, $max_value)\n {\n $result=false;\n\n if (filter_var($number, FILTER_VALIDATE_INT)===0 || !filter_var($number, FILTER_VALIDATE_INT)===false) //number provided\n {\n if ($number>=$min_value && $number<=$max_value)\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n\n if (stristr($number, \"-\")) //range provided\n {\n $numbers_array=explode(\"-\", $number);\n if (filter_var($numbers_array[0], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[0], FILTER_VALIDATE_INT)===false && filter_var($numbers_array[1], FILTER_VALIDATE_INT)===0 || !filter_var($numbers_array[1], FILTER_VALIDATE_INT)===false)\n {\n if ($numbers_array[0]>=$min_value && $numbers_array[1]<=$max_value && $numbers_array[0]<=$numbers_array[1])\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n }\n\n return $result;\n }",
"function buzzer_sms_number_validate($element, &$form_state, $form) {\n if ($number = twilio_validate_number($element['#value'], TRUE)) {\n $form_state['values']['buzzer_sms_number'] = $number;\n }\n else {\n form_error($element, t('You must enter a valid 10 digit phone number'));\n }\n}",
"static function isANumber($value) {\n // check whether the integer value has the same length like the entered string\n return is_numeric($value) && strlen(intval($value)) == strlen($value);\n }",
"public static function isValid($number)\n {\n return self::checksum($number) === 0;\n }",
"function checksum_validate($number)\n{\n $original = substr($number, 0, strlen($number) - 1);\n return checksum_generate($original) === $number;\n}",
"function isnumincorrect($str = null){\n if ($str) {\n if (strlen($str)==13) \n if (($str[0]==\"+\") && ($str[1]==6) && ($str[2]==3) && ($str[3]==9)){\n echo \"is valid<br>\";\n return false;\n }else{\n echo \"input is Incorrect Number or Incorrect Format<br>\";\n return true;\n }else{\n echo \"input is Incorrect format<br>\";\n return true;\n }\n }\n}",
"private function checkAuth($number)\n {\n $number = substr($number, 0, 1) === '0' ? substr($number, 1) : $number;\n $status = IncomingNumber::query()->where('number', 'like', \"%\" . $number . \"%\")->where('allowed', true)->first();\n return ($status !== null);\n }",
"public function isValid() {\n\t\t$checksum = self::calculateChecksum($this->number . $this->checkDigit, $this->nDigits + 1);\n\t\t// If the checksum is divisible by 10 it is valid\n\t\treturn ($checksum % 10) === 0;\n\t}",
"function is_number($number=\"\")\n {\n \tif ($number == \"\") return -1;\n \t\n \tif ( preg_match( \"/^([0-9]+)$/\", $number ) )\n \t{\n \t\treturn $number;\n \t}\n \telse\n \t{\n \t\treturn \"\";\n \t}\n }",
"public function isValid($value): bool\n {\n return is_null($value) || (is_int($value) && $value > 9);\n }",
"public function isValid($number)\n {\n return (boolean) preg_match('/^\\-?\\d+(\\.\\d+)?$/', $number);\n }",
"protected function validateUint($value) {\n if (preg_match(\"/^[0-9]+$/\", $value))\n return true;\n $this->setError(t(\"Invalid positive integer\"));\n return false;\n }",
"public static function validatePhoneNumber($input)\r\n\t{\r\n\t\treturn preg_match('/\\d{3}-\\d{3}-\\d{4}/', $input) && (strlen($input) == 12);\r\n\t}",
"public function validate( $value )\n\t{\n\t\treturn (int)$value === $value;\n\t}",
"public static function valid_positive_integer($value){\n\t\treturn preg_match('@^[0-9]+$@',$value) === 1;\n\t}",
"function is_valid_bank_card_number($number)\n{\n if (is_null($number) || strlen($number) < 16 || strlen($number) > 19)\n {\n return false;\n }\n $pattern = \"/^\\d{16,19}$/\";\n return (preg_match($pattern, $number) == 1);\n}",
"function validateIdNumber($idNumber, $name)\n\t\t{\n\t\t\t// include the Id Number Validator Class and validate the id number\n\t\t\tinclude(\"class_libraries/IdNumberValidator.php\");\n\t\t\t$idValidator = new IdNumberValidator();\n\t\t\t\n\t\t\t// validate the id number\n\t\t\t$result = $idValidator -> validateIdNumber($idNumber, $name);\n\t\t\t\n\t\t\t// check the result\n\t\t\tif($result == false)\n\t\t\t{\n\t\t\t\t// get the error and return it\n\t\t\t\treturn $idValidator -> getErrors();\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}",
"protected function validateInteger($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_INT) !== false;\n\t}",
"function has_number($value , $options = []){\r\n if(!is_numeric($value)){\r\n return false;\r\n }\r\n if(isset($options['max']) && ($value > (int) $options['max'])){\r\n return false;\r\n }\r\n if(isset($options['min'])&& ($value < (int) $options['min'])){\r\n return false;\r\n }\r\n return true;\r\n}",
"function validAge($age) {\r\n return is_numeric($age) && $age >= 18 && $age <= 118;\r\n}",
"function validInt($value)\n {\n return filter_var($value, FILTER_VALIDATE_INT);\n }",
"private function CheckNumber($n){\n\t\tif($n<=0){\n\t\t\treturn false;\n\t\t}else if($n==1 || $n==2){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t$checkFlag = true;\n\t\t\tfor($i=2;$i<=sqrt($n);$i++){\n\t\t\t\tif($n%$i==0){\n\t\t\t\t\t$checkFlag =false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $checkFlag;\n\t\t}\n\n\t}",
"public function isValid($value)\n {\n if (!is_numeric($value)) {\n $this->addError(\n $this->translateErrorMessage(\n 'validator.numberrange.notvalid',\n 'extbase'\n ),\n 1221563685\n );\n return;\n }\n\n $minimum = $this->options['minimum'];\n $maximum = $this->options['maximum'];\n\n if ($minimum > $maximum) {\n $x = $minimum;\n $minimum = $maximum;\n $maximum = $x;\n }\n if ($value < $minimum || $value > $maximum) {\n $this->addError($this->translateErrorMessage(\n 'validator.numberrange.range',\n 'extbase',\n [\n $minimum,\n $maximum\n ]\n ), 1221561046, [$minimum, $maximum]);\n }\n }",
"function has_number($value, $options=[])\n{\n if (!is_numeric($value)) {\n return false;\n }\n if (isset($options['max']) && ($value > (int)$options['max'])) {\n return false;\n }\n if (isset($options['min']) && ($value < (int)$options['min'])) {\n return false;\n }\n return true;\n}",
"public function validate_numeric($param) {\n return is_numeric($param);\n }",
"function validQty($qty)\n{\n return !empty($qty)\n && ctype_digit($qty)\n && $qty >= 1;\n}",
"public function validIntegers() {}",
"function testInN($num,$n)\n\t{\n\t\tif(!is_numeric($num)) return false;\n\t\tif(!is_numeric($n)) return false;\n\t\tif($num<0) return false;\n\t\tif($n<0) return false;\n\t\t\n\t\tif($num<=$n) return true;\n\t\treturn false;\n\t}",
"protected static function validate_numeric( $value ){\n\t\t//instead of validating here, we should probably be doing something else entirely.\n\t\tif ( is_numeric( $value ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function letter_num_validation($input){\n\t\tif(!preg_match('/^[a-zA-Z0-9]*$/',$input)){ \n\t\t\treturn true;\n \t}\n }",
"public function validate()\n\t{\n\t\tif(strlen($this->value) <= $this->argument)\n\t\t\treturn true;\n\n\t\t$this->addError('Please enter no more than ' . $this->argument . ' characters.');\n\t\treturn false;\n\t}",
"public function isValidId($id) {\n\t\treturn (is_numeric($id) && $id > 0) ? true : false;\n\t}",
"public static function validateInteger(TextBase $control)\r\n\t{\r\n\t\tforeach ($control->getValue() as $tag) {\r\n\t\t\tif (!Strings::match($tag, '/^-?[0-9]+$/')) {\r\n\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn TRUE;\r\n\t}",
"public function validateContactNumber()\n {\n if(! ctype_digit($this->Landline))\n $this->addError('Landline', 'Invalid landline.');\n }",
"private function isValid(): bool\n {\n $this->generateChecksum();\n return (($this->luhnValue % $this->base == 0) && ($this->luhnValue != 0));\n }",
"public function testNumber()\r\n {\r\n\r\n $testData = array(\r\n 'number' => '',\r\n 'number2' => '1337',\r\n 'number3' => 0x539,\r\n 'number4' => 02471,\r\n 'number5' => 0b10100111001,\r\n 'number6' => 1337e0,\r\n 'number7' => \"not numeric\",\r\n 'number8' => array(),\r\n 'number9' => 9.1\r\n );\r\n\r\n $validator = new Validator($testData);\r\n $validator->addRule('number', 'number', ['number']);\r\n $validator->addRule('number2', 'number2', ['required', 'number']);\r\n $validator->addRule('number3', 'number3', ['required', 'number']);\r\n $validator->addRule('number4', 'number4', ['required', 'number']);\r\n $validator->addRule('number5', 'number5', ['required', 'number']);\r\n $validator->addRule('number6', 'number6', ['required', 'number']);\r\n $validator->addRule('number7', 'number7', ['required', 'number']);\r\n $validator->addRule('number8', 'number8', ['required', 'number']);\r\n $validator->addRule('number9', 'number9', ['required', 'number']);\r\n\r\n $this->assertFalse($validator->validate());\r\n $this->assertFalse($validator->isValid());\r\n\r\n\r\n /** The field is not required, so it can be empty and contains no valid number */\r\n $this->assertFalse($validator->hasErrors('number'), $validator->getFieldError('number'));\r\n $this->assertFalse($validator->hasErrors('number2'), $validator->getFieldError('number2'));\r\n $this->assertFalse($validator->hasErrors('number3'), $validator->getFieldError('number3'));\r\n $this->assertFalse($validator->hasErrors('number4'), $validator->getFieldError('number4'));\r\n $this->assertFalse($validator->hasErrors('number5'), $validator->getFieldError('number5'));\r\n $this->assertFalse($validator->hasErrors('number6'), $validator->getFieldError('number6'));\r\n $this->assertTrue($validator->hasErrors('number7'), $validator->getFieldError('number7'));\r\n $this->assertTrue($validator->hasErrors('number8'), $validator->getFieldError('number8'));\r\n $this->assertFalse($validator->hasErrors('number9'), $validator->getFieldError('number9'));\r\n }",
"function checkIfInt($checkMe){\n\tif(is_Int((int)$checkMe) == true){\n\t\treturn true;\n\t\t// an acceptable respne\n\t}else{\n\t\treturn false;\n\t}\n\t\n}",
"function strNumValid($val = '',$type = 's', $min_len = 0) {\r\n if(!empty($val)) {\r\n\t\tif(strlen($val)>=$min_len) {\r\n\t\t\tif($type == 'n' && ctype_digit($val)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if($type == 's' && is_string($val) && !ctype_digit($val)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse return false;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}",
"function validateIdNumber($idNumber, $name)\n {\n //include the id number validator class to validate the id number and the name of the student if it matches\n include(\"../includes/class_libraries/IdNumberValidator.php\");\n $idNumberValidator = new IdNumberValidator();\n \n // validate the id number\n $result = $idNumberValidator -> validateIdNumber($idNumber, $name);\n \n // check the result if there is an error committed\n if($result == false)\n {\n // get the error and and return the error\n return $idNumberValidator -> getErrors();\n }\n \n return;\n }",
"function checkPhoneNumberValidity($phoneNum='')\n\t{\n\t\tglobal $db737;\n\t\tif(!$phoneNum)\n\t\t\treturn;\n\t\t$phoneNumber =phoneNumberCheck($phoneNum);\n\t\tif($phoneNumber){\n\t\t\t$sql =\"select PHONE_NUM from newjs.PHONE_JUNK WHERE PHONE_NUM IN('$phoneNumber','0$phoneNumber')\";\n\t\t $res = mysql_query($sql,$db737) or die(\"$sql\".mysql_error($db737));\n\t\t if($row = mysql_fetch_array($res))\n\t\t\t\t$phoneJunk =true;\n\t\t}\n\t\tif($phoneNumber && !$phoneJunk)\n\t\t\treturn $phoneNumber;\n\t\treturn;\t\n\t}",
"private function validateId()\n {\n return is_numeric($this->id) && (int)$this->id >= 1;\n }",
"function validate($phoneNumber)\n {\n // Let's fix issue of V2: we remove spaces for validation.\n $phoneNumber = str_replace(' ', '', $phoneNumber);\n\n return strlen($phoneNumber) == 10 && is_numeric($phoneNumber);\n }",
"function validateTelNum($num)\r\n {\r\n preg_match_all($this->re, $num, $matches, PREG_SET_ORDER, 0);\r\n if (empty($matches)) {\r\n $this->invalid_number[] = $num;\r\n return \"invalid number\";\r\n } else {\r\n return $num;\r\n }\r\n }",
"function testForInt($data)\r\n\t{\r\n\t\tif (!filter_var($data, FILTER_VALIDATE_INT) === false)\r\n\t\t{\r\n\t\t\treturn intval($data);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo(\"Integer is not valid<br>\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function isPosNum($number){\n if(((int)$number) >= 0){\n return true;\n }\n else{\n echo \"invalid number of pages (or words)\";\n return false;\n }\n }",
"public function ifNum($num);"
] | [
"0.81321514",
"0.80611885",
"0.7835089",
"0.78211963",
"0.7366171",
"0.72805893",
"0.7280396",
"0.72462964",
"0.7138083",
"0.7064233",
"0.7052229",
"0.7015122",
"0.69587135",
"0.69329333",
"0.69118494",
"0.6874888",
"0.68413836",
"0.6803531",
"0.67983115",
"0.6707958",
"0.6661936",
"0.6611964",
"0.6609333",
"0.6605238",
"0.6577756",
"0.65483975",
"0.6542786",
"0.6537006",
"0.65068465",
"0.6492579",
"0.64829314",
"0.6465975",
"0.6450187",
"0.6433249",
"0.64302295",
"0.64301544",
"0.6427615",
"0.6360431",
"0.6355618",
"0.6354298",
"0.6353611",
"0.6341713",
"0.6337272",
"0.631311",
"0.63050693",
"0.6300152",
"0.62900853",
"0.627601",
"0.6263953",
"0.6255817",
"0.62457466",
"0.6244403",
"0.624209",
"0.61855125",
"0.6179968",
"0.6177935",
"0.61697453",
"0.6153579",
"0.6135689",
"0.612921",
"0.612557",
"0.61122555",
"0.6106823",
"0.6106642",
"0.60921025",
"0.6089977",
"0.60891527",
"0.60879844",
"0.6071893",
"0.6063833",
"0.60626435",
"0.6037017",
"0.60195047",
"0.60162723",
"0.6010189",
"0.60083145",
"0.6006383",
"0.600501",
"0.600061",
"0.5997637",
"0.59857374",
"0.5985139",
"0.5983325",
"0.598033",
"0.5975417",
"0.59708107",
"0.5941528",
"0.59318846",
"0.59306186",
"0.5915464",
"0.5892528",
"0.5888591",
"0.58809805",
"0.58777744",
"0.5863746",
"0.58546203",
"0.58543897",
"0.5853253",
"0.5849284",
"0.58405423",
"0.5839843"
] | 0.0 | -1 |
Checks the query results as a debugging aid | function check_results($results) {
global $dbc;
if($results != true)
echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function printSqlCheck() {}",
"function debugging() {\n\t\t$result = $this->connection->prepare(\"SELECT * FROM admins\");\n\t\t$result->execute();\n\t\treturn $result->fetchAll();\n\t}",
"function queryDebug($resultVar){\n\tif (!$resultVar) {\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message .= 'Whole query: ' . $query;\n\t\tdie($message);\n\t}\n}",
"public function checkResult() {\n\t\treturn ($this->_query_result !== false);\n\t}",
"public function query_fetchlist()\n {\n if (($this->mode > 0) and is_array($this->sql_query_list)) {\n $this->sql_query_list = $this->sort_array_by_col($this->sql_query_list);\n foreach ($this->sql_query_list as $debug_query) {\n $sql_query_debug .= debug::row_double(sprintf(\"<b>%8.4f ms</b>\", $debug_query[0]), $debug_query[1]);\n if (!($debug_query[2]==\"\")) {\n $sql_query_debug .= debug::row_double(\"\", \"<span style=\\\"color:red\\\"><b>Error : \".$debug_query[2].\"</b></span>\");\n }\n }\n return $sql_query_debug;\n }\n }",
"public function report()\n {\n \\Log::debug('Query failure');\n }",
"public function check_queries() {\r\n\t\tQueryManager::check_queries();\r\n\t}",
"public function debugQuery(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QueryResult $queryResult) {\n\t\t$GLOBALS['TYPO3_DB']->debugOuput = 2;\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;\n\t\t$queryResult->toArray();\n\t\t\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);\n\n\t\t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = false;\n\t\t$GLOBALS['TYPO3_DB']->explainOutput = false;\n\t\t$GLOBALS['TYPO3_DB']->debugOuput = false;\n\t}",
"function print_results() {\n global $dbh;\n print \"results:\\n\";\n $res = $dbh->query(\"SELECT * FROM phptest WHERE a = 72 ORDER BY b\");\n $i = 0;\n while ($row = $res->fetchRow(DB_FETCHMODE_ORDERED)) {\n print '|' . implode(\" - \", $row) . \"|\\n\";\n $i++;\n }\n if (!$i) {\n print \"The records were not found. Did they get inserted?\\n\";\n }\n}",
"public function ViewResults() {\n echo \"<pre>\" . print_r($this->rs, TRUE) . \"</pre>\";\n }",
"protected function showResult()\n {\n//\n// unset($this->result['missing_advertiser']);\n\n var_dump($this->result);\n }",
"function check_results($results) {\n global $dbc;\n if($results != true)\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ; \n}",
"function check_results($results) {\r\n global $dbc;\r\n\r\n if($results != true)\r\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ; \r\n}",
"public function hasResults();",
"function show_query($query) {\n global $debug;\n if($debug)\n echo \"<p>Records have been changed.</p>\" ;\n}",
"function query_error_check($passed_result, $passed_query, $note=\"\") {\n\tif (!$passed_result) {\n\t\thtml_header('HI Asset DB - Error','');\n\t\tinclude(\"top_menu.php\");\n\t\techo \"<h2>Problem with query - \" . $note . \"</h2>\\n\";\n\t\techo \"<pre>\" . $query . \"\\n\";\n\t\techo pg_last_error();\n\t\techo \"</pre></body></html>\\n\";\n\t\texit();\n\t}\n\treturn;\n}",
"function summary() {\n $affected_rows = 0;\n foreach ($this->results as $result) $affected_rows += @$result['result']['xaffectedrows'];\n // Creates a result set according xModel::query result\n $results = array(\n 'xsuccess' => empty($this->exceptions),\n 'xaffectedrows' => $affected_rows,\n 'xresults' => $this->results\n );\n return $results;\n }",
"function check_results($results) {\n global $dbc;\n\n if($results != true)\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ;\n\n\n}",
"function good_query_list($sql, $debug=0)\n{\n $result = good_query($sql, $debug);\n\t\n if($lst = mysql_fetch_row($result))\n {\n\tmysql_free_result($result);\n\treturn $lst;\n }\n mysql_free_result($result);\n return false;\n}",
"function has_results() {\n\t\treturn ($this->QueryID && $this->record_count() !== 0);\n\t}",
"public function debug($row = null)\n\t{\n\t\tif($row) {\n\t\t\t// Dump debugging info for current row\n\t\t}\n\t\t\n\t\techo \"<p>Executed \" . $this->getQueryCount() . \" queries:</p>\";\n\t\techo \"<pre>\\n\";\n\t\tprint_r(self::$queryLog);\n\t\techo \"</pre>\\n\";\n\t}",
"public function hadSuccess(){\n\n\t\t\treturn $this->failedQuery;\n\t\t}",
"public function debug_check_recordset($res)\n {\n if ($res !== false && $res !== null) {\n return true;\n }\n $trace = debug_backtrace(0);\n array_shift($trace);\n $msg = 'Invalid database result detected: function TYPO3\\\\CMS\\\\Typo3DbLegacy\\\\Database\\\\DatabaseConnection->' . $trace[0]['function'] . ' called from file ' . substr($trace[0]['file'], (strlen(Environment::getPublicPath() . '/') + 2)) . ' in line ' . $trace[0]['line'] . '.';\n self::getLogger()->log(LogLevel::ERROR, $msg . ' Use a devLog extension to get more details.', [\n 'extension' => 'core'\n ]);\n\n return false;\n }",
"public function checkQuery( $oQuery ){\n if( !$oQuery ){\n if( defined( 'DEVELOPER_MODE' ) ){\n exit( '<pre>'.var_dump( $this->errorInfo( ) ).'</pre>' );\n }\n else{\n header( 'Location: '.$_SERVER['PHP_SELF'].'?error='.md5( $_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR'] ) );\n exit;\n }\n } \n }",
"public function errorDump()\n {\n /* No errors? */\n if (empty($this->_ERRORS) && empty($this->_query->_ERRORS)) {\n echo 'No errors occurred during script execution';\n\n return true;\n }\n\n /* Errors during this part of script */\n if (!empty($this->_ERRORS)) {\n foreach ($this->_ERRORS as $key => $value) {\n echo 'ERROR #[' . $key . '] ' . $value;\n }\n }\n\n /* Errors during query execution portion */\n elseif (!empty($this->_query->_ERRORS)) {\n foreach ($this->_query->_ERRORS as $key => $value) {\n echo 'ERROR #[' . $key . '] ' . $value;\n }\n }\n\n return true;\n }",
"protected function checkResultSet() {\n\t\tif (is_null($this->indexMax)) {\n\t\t\tthrow new Exception('Query does not produce a result set - can not perform operation');\n\t\t}\n\t}",
"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 get_query_log()\n {\n }",
"public function logResults() {\n\t\tforeach ( $this->records as $outcome) {\n\t\t\t$this->log($outcome);\n\t\t}\n\t}",
"public function testIfQueryWorks()\n {\n $this->database->query(\"SELECT * FROM users\");\n\n $data = $this->database->resultSet();\n\n $this->assertIsArray($data);\n }",
"public function hasResults() {\n\t\treturn $this->count() >= 1;\n\t}",
"function validate ($results) {\n\t\tglobal $mysqli;\n\t\tif (!$results) {\n\t\t\techo \"MySQL Query Error: \" . $mysqli->error;\n\t\t\t$mysqli->close();\n\t\t\texit();\n\t\t}\n\t}",
"public function query()\n\t{\n\t\treturn false;\n\t}",
"public function test_queries()\n\t{\n\t\t$this->setup_options_obj($input);\n\t\t$rpt = new Reports_Model($this->options);\n\t\t$rpt->set_option('start_time', 0);\n\t\t$rpt->set_option('end_time', time());\n\t\t$result = $rpt->test_summary_queries();\n\t\techo \"<pre>\\n\";\n\t\t$cnt = count($result);\n\t\techo $cnt . \" total different queries\\n\";\n\t\t$total_rows = 0.0;\n\t\tforeach ($result as $query => $ary) {\n\t\t\techo $query . \"\\n\";\n\t\t\tprint_r($ary);\n\t\t\t$total_rows += $ary['rows'];\n\t\t}\n\t\t$avg_rows = $total_rows / $cnt;\n\t\techo \"Average row-count: $avg_rows\\n\";\n\t\techo \"</pre>\\n\";\n\t\tdie;\n\t}",
"public function dump()\n {\n $this->composeQuery();\n $result = $this->connection->client()->search($this->queryBody);\n\n dd($result);\n }",
"function check_results($result) {\n\tif((!$result) || (mysql_num_rows($result) < '1')) {\n\t\t$num_results = '0';\n\t} else $num_results = mysql_num_rows($result);\n\treturn array($result,$num_results);\n}",
"public function actionDatabaseQueries() {\n echo \"Database Debug Log:\";\n $this->showLog('dbDebug.log');\n }",
"public function found_rows() {\n\t\t$this->FoundRows();\n\t}",
"private function sanity_check() {\n\t\tglobal $wpdb;\n\t\t$results_table = array();\n\t\t$columns_to_check = array(\n\t\t\t\t$wpdb->prefix.'commentmeta' => array(\n\t\t\t\t\t'comment_id' => '\\'0\\'',\n\t\t\t\t\t'meta_key' => 'NULL'\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'comments' => array(\n\t\t\t\t\t'comment_post_ID' => '\\'0\\'',\n\t\t\t\t\t'comment_author_email' => '\\'\\'',\n\t\t\t\t\t'comment_author_url' => '\\'\\'',\n\t\t\t\t\t'comment_author_IP' => '\\'\\'',\n\t\t\t\t\t'comment_date_gmt' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'comment_date' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'comment_karma' => '\\'0\\'',\n\t\t\t\t\t'comment_approved' => '\\'1\\'',\n\t\t\t\t\t'comment_agent' => '\\'\\'',\n\t\t\t\t\t'comment_type' => '\\'\\'',\n\t\t\t\t\t'comment_parent' => '\\'0\\'',\n\t\t\t\t\t'user_id' => '\\'0\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'links' => array(\n\t\t\t\t\t'link_url' => '\\'\\'',\n\t\t\t\t\t'link_name' => '\\'\\'',\n\t\t\t\t\t'link_image' => '\\'\\'',\n\t\t\t\t\t'link_target' => '\\'\\'',\n\t\t\t\t\t'link_description' => '\\'\\'',\n\t\t\t\t\t'link_visible' => '\\'Y\\'',\n\t\t\t\t\t'link_owner' => '\\'1\\'',\n\t\t\t\t\t'link_rating' => '\\'0\\'',\n\t\t\t\t\t'link_updated' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'link_rel' => '\\'\\'',\n\t\t\t\t\t'link_rss' => '\\'\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'options' => array(\n\t\t\t\t\t'option_name' => '\\'\\'',\n\t\t\t\t\t'autoload' => '\\'yes\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'postmeta' => array(\n\t\t\t\t\t'post_id' => '\\'0\\'',\n\t\t\t\t\t'meta_key' => 'NULL'\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'posts' => array(\n\t\t\t\t\t'post_author' => '\\'0\\'',\n\t\t\t\t\t'post_date_gmt' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'post_date' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'post_status' => '\\'publish\\'',\n\t\t\t\t\t'comment_status' => '\\'open\\'',\n\t\t\t\t\t'ping_status' => '\\'open\\'',\n\t\t\t\t\t'post_password' => '\\'\\'',\n\t\t\t\t\t'post_name' => '\\'\\'',\n\t\t\t\t\t'post_modified_gmt' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'post_modified' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'post_parent' => '\\'0\\'',\n\t\t\t\t\t'guid' => '\\'\\'',\n\t\t\t\t\t'menu_order' => '\\'0\\'',\n\t\t\t\t\t'post_type' => '\\'post\\'',\n\t\t\t\t\t'post_mime_type' => '\\'\\'',\n\t\t\t\t\t'comment_count' => '\\'0\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'term_relationships' => array(\n\t\t\t\t\t'term_order' => '0'\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'term_taxonomy' => array(\n\t\t\t\t\t'taxonomy' => '\\'\\'',\n\t\t\t\t\t'parent' => '0',\n\t\t\t\t\t'count' => '0'\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'terms' => array(\n\t\t\t\t\t'name' => '\\'\\'',\n\t\t\t\t\t'slug' => '\\'\\'',\n\t\t\t\t\t'term_group' => '0'\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'users' => array(\n\t\t\t\t\t'user_login' => '\\'\\'',\n\t\t\t\t\t'user_pass' => '\\'\\'',\n\t\t\t\t\t'user_nicename' => '\\'\\'',\n\t\t\t\t\t'user_email' => '\\'\\'',\n\t\t\t\t\t'user_url' => '\\'\\'',\n\t\t\t\t\t'user_registered' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'user_activation_key' => '\\'\\'',\n\t\t\t\t\t'user_status' => '\\'0\\'',\n\t\t\t\t\t'display_name' => '\\'\\'',\n\t\t\t\t\t// for network install\n\t\t\t\t\t'spam' => '\\'0\\'',\n\t\t\t\t\t'deleted' => '\\'0\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'usermeta' => array(\n\t\t\t\t\t'user_id' => '\\'0\\'',\n\t\t\t\t\t'meta_key' => 'NULL',\n\t\t\t\t),\n\t\t\t\t// for network install\n\t\t\t\t$wpdb->prefix.'blog_versions' => array(\n\t\t\t\t\t'blog_id' => '\\'0\\'',\n\t\t\t\t\t'db_version' => '\\'\\'',\n\t\t\t\t\t'last_updated' => '\\'0000-00-00 00:00:00\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'blogs' => array(\n\t\t\t\t\t'site_id' => '\\'0\\'',\n\t\t\t\t\t'domain' => '\\'\\'',\n\t\t\t\t\t'path' => '\\'\\'',\n\t\t\t\t\t'registered' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'last_updated' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'public' => '\\'1\\'',\n\t\t\t\t\t'mature' => '\\'0\\'',\n\t\t\t\t\t'spam' => '\\'0\\'',\n\t\t\t\t\t'deleted' => '\\'0\\'',\n\t\t\t\t\t'lang_id' => '\\'0\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'registration_log' => array(\n\t\t\t\t\t'email' => '\\'\\'',\n\t\t\t\t\t'IP' => '\\'\\'',\n\t\t\t\t\t'blog_id' => '\\'0\\'',\n\t\t\t\t\t'date_registered' => '\\'0000-00-00 00:00:00\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'signups' => array(\n\t\t\t\t\t'domain' => '\\'\\'',\n\t\t\t\t\t'path' => '\\'\\'',\n\t\t\t\t\t'user_login' => '\\'\\'',\n\t\t\t\t\t'user_email' => '\\'\\'',\n\t\t\t\t\t'registered' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'activated' => '\\'0000-00-00 00:00:00\\'',\n\t\t\t\t\t'active' => '\\'0\\'',\n\t\t\t\t\t'activation_key' => '\\'\\'',\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'site' => array(\n\t\t\t\t\t'domain' => '\\'\\'',\n\t\t\t\t\t'path' => '\\'\\''\n\t\t\t\t),\n\t\t\t\t$wpdb->prefix.'sitemeta' => array(\n\t\t\t\t\t'site_id' => '\\'0\\'',\n\t\t\t\t\t'meta_key' => 'NULL',\n\t\t\t\t)\n\t\t);\n\t\t$tables = $wpdb->tables('all');\n\t\tforeach ($tables as $table) {\n\t\t\t$col_infos = $wpdb->get_results(\"SHOW COLUMNS FROM $table\");\n\t\t\tforeach ($col_infos as $col) {\n\t\t\t\tif (array_key_exists($col->Field, $columns_to_check[$table]) && $col->Default != $columns_to_check[$table][$col->Field]) {\n\t\t\t\t\t$results_table[$table] = 'damaged';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (empty($results_table)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn $results_table;\n\t\t}\n\t}",
"public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }",
"public function isHasResults();",
"protected function all() {\n if (!$this->query_failed) {\n return $this->results;\n }\n\n return false;\n }",
"function get_debug_info($query)\n\t{\n\t\t$data = array();\n\t\tif (substr(trim(strtoupper($query)), 0, 6) == 'SELECT') {\n\t\t\tif (!pg_send_query($this->connection, \"EXPLAIN $query\"))\n\t\t\t{\n\t\t\t\t$err = pg_get_result($this->connection);\n\t\t\t\terror(PDNSADMIN_QUERY_ERROR, pg_result_error($err), $query, 0);\n\t\t\t} else {\n\t\t\t\t$result = pg_get_result($this->connection);\n\t\n\t\t\t\tif (false === $this->last)\n\t\t\t\t{\n\t\t\t\t\terror(PDNSADMIN_QUERY_ERROR, pg_result_error($err), $query, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = pg_fetch_array($result);\n\t\t}\n\t\treturn $data;\n\t}",
"public function displayQuery($result)\n\t{\n\n\t\tif(!$result){\n\n\t\t\t$output = 'Database Is Faild :'.mysqli_error($this->connection).'<br>';\n\t\t\t$output .= 'Last Query Is : '.$this->lastQuery;\n\t\t\tdie($output);\n\t\t}else{\n\n\t\t\t$this->affectedRows = mysqli_affected_rows($this->connection);\n\t\t}\n\t}",
"private function confirmQuery($result){\n if (!$result) {\n die(\"Database query failed!\");\n }\n }",
"public function valid()\n\t{\n\t\treturn $this->query->valid();\n\t}",
"protected function reportRows()\n {\n // foreach table\n foreach ($this->rowsLoadedForTable as $tableName => $rows) {\n $msg = \"Rows loaded for table '\".$tableName.\"': \".$rows;\n $this->log($msg);\n }\n\n return true;\n }",
"private function check($results)\r\n\t\t{\r\n\t\t\tif ( count($results) > 0 ) {\r\n\t\t\t\tforeach ( $results as $result ) {\r\n\t\t\t\t\tself::setError($result);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"function confirm_query($result_set) {\r\n\t\tif(!$result_set) {\r\n\t\t\tdie(\"Database query failed.\");\r\n\t\t}\r\n\t}",
"public function query( $query )\n {\n $this->free( );\n $this->db_query_result = @ mysql_query( $query );\n $this->fields_of_current_query = array();\n if ( $this->db_query_result )\n {\n $l_fnum = @mysql_num_fields($this->db_query_result);\n if($l_fnum > 0)\n {\n for($i = 0; $i < $l_fnum; $i++)\n $this->fields_of_current_query[] = mysql_field_name($this->db_query_result,$i);\n //var_dump($this->fields_of_current_query);\n }\n return true;\n }\n\n return false;\n }",
"public function debugWarnings()\n\t{\n\t\t$stmt = $this->_query('SHOW WARNINGS', true);\n\n\t\t$warnings = array();\n\t\twhile ($warning = $stmt->fetch_assoc())\n\t\t{\n\t\t\t$warnings[] = $warning;\n\t\t}\n\n\t\tforeach ($warnings as $warning)\n\t\t{\n\t\t\tatkwarning(\"MYSQL warning '{$warning['Level']}' (Code: {$warning['Code']}): {$warning['Message']}\");\n\t\t}\n\t}",
"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 static function getQueryLog()\n {\n }",
"protected function debug($sql){\n\t\tif($this->debug){\n\t\t\tFlash::notice($sql);\n\t\t}\t\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 }",
"private function query_debugger($Query) {\n\t\t// Debug queries\n\t\tif($this->debug) {\n\t\t\tstatic $query_cnt = 0;\n\t\t\tstatic $query_dup = 0;\n\t\t\tglobal $queries_debug, $queries_debug_arr;\n\t\t\t\n\t\t\t$queryTime = \"<span class='badge pull-right'>\".$this->Connection->queryTime.\" sec</span>\";\n\t\t\t\t\t\t\n\t\t\t$q = $Query;\n\t\t\t$paterns = '/(SELECT|FROM|ORDER BY|ASC|ASC\\,|DESC|WHERE|AND|\\sOR|JOIN|LEFT JOIN|IN| ON|GROUP BY|GROUP_CONCAT\\(|CONCAT\\(|CONVERT\\(|COUNT\\(|AS|LIMIT|OFFSET)\\s/i';\n\t\t\t$q = preg_replace($paterns, '<span>'.\"$1 \".'</span>', $q);\n\t\t\t$q = str_replace(\"\\r\", \"\", str_replace(\"\\n\", \"<br/>\", $q));\n\t\t\t$q = str_replace(\"<span>\", \"<span style='color:#990099; font-weight:bold;'>\", $q);\n\t\t\t\n\t\t\t$duplicate = '';\n\t\t\tif(in_array($Query, $queries_debug_arr)) {\n\t\t\t\t$query_dup++;\n\t\t\t\t$dup_key = array_search($Query, $queries_debug_arr)+1;\n\t\t\t\t//$q = \"Duplicate ($dup_key) : $q\";\n\t\t\t\t$duplicate = \" <code title='Duplicate'><i class='fa fa-copy'></i> \".$dup_key.\"</code>\";\n\t\t\t} else {\n\t\t\t\t$queries_debug_arr[] = $Query;\n\t\t\t}\n\t\t\t\n\t\t\t$q = \"<div class='trace' style='cursor:pointer;'><b>\".++$query_cnt . $duplicate . \"</b>. \". $q . $queryTime . \"</div>\";\n\t\t\t$q .= \"<div style='display:none;margin:15px 15px 0 15px;border-left: 2px solid #000000;'>\";\n\t\t\t$trace = debug_backtrace(false);\n\t\t\tfor($i=count($trace)-1;$i>=0;$i--) {\n\t\t\t\t$q .= str_repeat(\" \",(count($trace)-$i)*3);\n\t\t\t\t$q .= \"↳\";\n\t\t\t\t$q .= preg_replace(\"/^\\S+public_html\\//\",\"\",$trace[$i]['file']);\n\t\t\t\t$q .= \" : \".$trace[$i]['line'].\" -> \";\n\t\t\t\t$q .= isset($trace[$i]['class'])?$trace[$i]['class'].\"::\":\"\";\n\t\t\t\t$q .= $trace[$i]['function'];\n\t\t\t\tif($trace[$i]['function']=='render' && $trace[$i]['class']=='Twig_Environment') {\n\t\t\t\t\tif($trace[$i]['args']['0']=='mainpage.tpl' && !isset($queries_debug['-1'])) $queries_debug['-1'] = '*******************************Render TPL Start*********************************<br/>';\n\t\t\t\t\t$q .= ' (<b>'.$trace[$i]['args']['0'].'</b>)';\n\t\t\t\t}\n\t\t\t\t$q .= \"<br/>\";\n\t\t\t}\n\t\t\t$q .= \"</div>\";\n\t\t\t$GLOBALS['query_cnt'] = $query_cnt;\n\t\t\t$GLOBALS['query_dup'] = $query_dup;\n\t\t\t$queries_debug[] = $q;\n\t\t}\n\t}",
"public function testQuery(){\n\t\t// $department_lists = \\DB::connection('mysql2')->select(\\DB::raw($department_table_50_select_query));\n\n\t\t$login_db_select_query = \"SELECT *\n\t\t\t\t\t\t\t\t\t\tFROM hr_tool_db.employee_table hr\n\t\t\t\t\t\t\t\t\t\t\tWHERE NOT EXISTS (SELECT lg.email\n \t\t\t\t\t\t\t\t\t\t\t\t\tFROM login_plugin_db.login_table lg\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE lg.email = hr.email)\";\n\n\n\t\t$login_db_lists = \\DB::select(\\DB::raw($login_db_select_query));\n\n\n\t\tforeach ($login_db_lists as $login_db_list) {\n\t\t\tprint_r($login_db_list);\n\t\t\techo \"<p>\";\n\t\t}\n\n\t\t\n\n\t\t//print_r($department_lists);\n\t\treturn \"test success\";\n\t}",
"private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }",
"function testarQuery($res){\n\t\tif (!$res) {\n echo \"</br><strong>Erro na consulta MySQL: </strong></br>\" . mysql_error().\"</br>\";\n }\n\t}",
"function show_query($query) {\n global $debug;\n\n if(false && $debug)\n echo \"<p>Query = $query</p>\" ;\n}",
"function print_query($db) {\n\t\techo \"<pre>\";print_r($db->get_compiled_select());echo \"</pre>\";\n\t}",
"function testFindBooksResults() {\n\n /* test title */\n echo '<h2 style=\"color: black;\">testFindBookResults...</h2>';\n\n /* can't page layout because of the indeterminate nature of\n * results (i.e. we can't guarantee there's a book in the \n * production database, and the page layout depends on whether\n * or not there's a result)*/\n\n /* a fix for this could be to possibly display the\n * container (div or whatever) for results, then just\n * not populate it with anything if no results */\n\n $this->assertTrue(1);\n\n }",
"public function test_executeQuery()\n\t{\n\t}",
"function good_query_value($sql, $debug=0)\n{\n $lst = good_query_list($sql, $debug);\n return is_array($lst)?$lst[0]:false;\n}",
"private function getQueryInfo()\n {\n // Get the Info string\n $infoString = mysql_info($this->mysql);\n \n // Clear collection\n $this->info = array();\n \n // Parse\n $matches = array();\n preg_match_all('/([\\w]+[\\s]?[\\w]+): ([0-9]+)[\\s]?/', $infoString, $matches, PREG_SET_ORDER);\n \n // Load into the info property\n foreach($matches as $match)\n {\n $keyName = strtolower(str_replace(' ', '_', $match[1]));\n $this->info[$keyName] = $match[2];\n }\n \n return true;\n }",
"public function sql_affected_rows() {}",
"public function sql_affected_rows() {}",
"function debug($print_to_screen=true)\n\t\t{\n\n\t\t\t// Start outup buffering\n\t\t\tob_start();\n\n\t\t\techo \"<blockquote>\";\n\n\t\t\t// Only show ezSQL credits once..\n\t\t\tif ( ! $this->debug_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080 face=arial size=2><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Debug..</b></font><p>\\n\";\n\t\t\t}\n\n\t\t\tif ( $this->last_error )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b>$this->last_error</b></font>]<p>\";\n\t\t\t}\n\n\t\t\tif ( $this->from_disk_cache )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Results retrieved from disk cache</b></font><p>\";\n\t\t\t}\n\n\t\t\techo \"<font face=arial size=2 color=000099><b>Query</b> [$this->num_queries] <b>--</b> \";\n\t\t\techo \"[<font color=000000><b>$this->last_query</b></font>]</font><p>\";\n\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Query Result..</b></font>\";\n\t\t\t\techo \"<blockquote>\";\n\n\t\t\tif ( $this->col_info )\n\t\t\t{\n\n\t\t\t\t// =====================================================\n\t\t\t\t// Results top rows\n\n\t\t\t\techo \"<table cellpadding=5 cellspacing=1 bgcolor=555555>\";\n\t\t\t\techo \"<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td>\";\n\n\n\t\t\t\tfor ( $i=0; $i < count($this->col_info); $i++ )\n\t\t\t\t{\n\t\t\t\t\techo \"<td nowrap align=left valign=top><font size=1 color=555599 face=arial>{$this->col_info[$i]->type} {$this->col_info[$i]->max_length}</font><br><span style='font-family: arial; font-size: 10pt; font-weight: bold;'>{$this->col_info[$i]->name}</span></td>\";\n\t\t\t\t}\n\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\t// ======================================================\n\t\t\t\t// print main results\n\n\t\t\tif ( $this->last_result )\n\t\t\t{\n\n\t\t\t\t$i=0;\n\t\t\t\tforeach ( $this->get_results(null,ARRAY_N) as $one_row )\n\t\t\t\t{\n\t\t\t\t\t$i++;\n\t\t\t\t\techo \"<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial>$i</font></td>\";\n\n\t\t\t\t\tforeach ( $one_row as $item )\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<td nowrap><font face=arial size=2>$item</font></td>\";\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\n\t\t\t} // if last result\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<tr bgcolor=ffffff><td colspan=\".(count($this->col_info)+1).\"><font face=arial size=2>No Results</font></td></tr>\";\n\t\t\t}\n\n\t\t\techo \"</table>\";\n\n\t\t\t} // if col_info\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2>No Results</font>\";\n\t\t\t}\n\n\t\t\techo \"</blockquote></blockquote>\".$this->donation().\"<hr noshade color=dddddd size=1>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on && $print_to_screen)\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->debug_called = true;\n\n\t\t\treturn $html;\n\n\t\t}",
"public function valid()\n\t{\n\t\treturn $this->databaseResult->valid();\n\t}",
"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 }",
"function anva_debug_queries() {\n\tif ( true == WP_DEBUG && current_user_can( 'administrator' ) ) :\n\t?>\n\t\t<div class=\"alert alert-warning text-center\">Page generated in <?php timer_stop(1); ?> seconds with <?php echo get_num_queries(); ?> database queries.</div>\n\t<?php\n\tendif;\n}",
"function bwc_exec_query_show($querystr1, $idarray, $show_errors = null){\r\n\tglobal $wpdb;\r\n\twp_reset_query();\r\n\t$return = $wpdb->get_results($wpdb->prepare($querystr1, $idarray));\r\n\tif($show_errors){\r\n\t\t$wpdb->show_errors();\r\n\t\t$wpdb->print_error();\t\r\n\t}\r\n\treturn $return;\r\n}",
"protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}",
"function debug($print_to_screen=true)\n\t\t{\n\t\t\t// Start outup buffering\n\t\t\tob_start();\n\n\t\t\techo \"<blockquote>\";\n\n\t\t\t// Only show ezSQL credits once..\n\t\t\tif ( ! $this->debug_called )\n\t\t\t{\n\t\t\t\techo \"<font color=800080 face=arial size=2><b>ezSQL</b> (v\".EZSQL_VERSION.\") <b>Debug..</b></font><p>\\n\";\n\t\t\t}\n\n\t\t\tif ( $this->last_error )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b>$this->last_error</b></font>]<p>\";\n\t\t\t}\n\n\t\t\tif ( $this->from_disk_cache )\n\t\t\t{\n\t\t\t\techo \"<font face=arial size=2 color=000099><b>Results retrieved from disk cache</b></font><p>\";\n\t\t\t}\n\n\t\t\techo \"<font face=arial size=2 color=000099><b>Query</b> [$this->num_queries] <b>--</b> \";\n\t\t\techo \"[<font color=000000><b>$this->last_query</b></font>]</font><p>\";\n\t\t\techo \"<font face=arial size=2 color=000099><b>Query Result..</b></font>\";\n\t\t\techo \"<blockquote>\";\n\n\t\t\tif ( $this->col_info )\n\t\t\t{\n\t\t\t\t// =====================================================\n\t\t\t\t// Results top rows\n\t\t\t\techo \"<table cellpadding=5 cellspacing=1 bgcolor=555555>\";\n\t\t\t\techo \"<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td>\";\n\n\t\t\t\tfor ( $i=0, $j=count($this->col_info); $i < $j; $i++ )\n\t\t\t\t{\n\t\t\t\t\t/* when selecting count(*) the maxlengh is not set, size is set instead. */\n\t\t\t\t\techo \"<td nowrap align=left valign=top><font size=1 color=555599 face=arial>{$this->col_info[$i]->type}\";\n\t\t\t\t\tif (!isset($this->col_info[$i]->max_length))\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"{$this->col_info[$i]->size}\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"{$this->col_info[$i]->max_length}\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"</font><br><span style='font-family: arial; font-size: 10pt; font-weight: bold;'>{$this->col_info[$i]->name}</span></td>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\t// ======================================================\n\t\t\t\t// print main results\n\t\t\t\tif ( $this->last_result )\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach ( $this->get_results(null,ARRAY_N) as $one_row )\n\t\t\t\t\t{\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\techo \"<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial>$i</font></td>\";\n\n\t\t\t\t\t\tforeach ( $one_row as $item )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"<td nowrap><font face=arial size=2>$item</font></td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t}\n\t\t\t\t// if last result\n\t\t\t\t} else {\n\t\t\t\t\techo \"<tr bgcolor=ffffff><td colspan=\".(count($this->col_info)+1).\"><font face=arial size=2>No Results</font></td></tr>\";\n\t\t\t\t}\n\t\t\t\techo \"</table>\";\n\t\t\t// if col_info\n\t\t\t} else {\n\t\t\t\techo \"<font face=arial size=2>No Results</font>\";\n\t\t\t}\n\n\t\t\techo \"</blockquote></blockquote>\".$this->donation().\"<hr noshade color=dddddd size=1>\";\n\n\t\t\t// Stop output buffering and capture debug HTML\n\t\t\t$html = ob_get_contents();\n\t\t\tob_end_clean();\n\n\t\t\t// Only echo output if it is turned on\n\t\t\tif ( $this->debug_echo_is_on && $print_to_screen)\n\t\t\t{\n\t\t\t\techo $html;\n\t\t\t}\n\n\t\t\t$this->debug_called = true;\n\t\t\treturn $html;\n\t\t}",
"public function printquery(){\n\t\techo $this->query.\";\";\n\t}",
"function show_query($query) {\r\n global $debug;\r\n\r\n if($debug)\r\n echo \"<p>Query = $query</p>\" ;\r\n}",
"function query_info()\r\n\t\t{\r\n\t\t\techo \"<u>Your Previous Query Consisted of:</u><br>\";\r\n\t\t\techo \"SQL = '\".$this->last_query[\"sql\"].\"'<br>\";\r\n\t\t\t$temp = ($this->last_query[\"end_time\"] - $this->last_query[\"start_time\"]);\r\n\t\t\t$temp *= 1000;\r\n\t\t\t$temp = number_format($temp, 3);\r\n\t\t\techo \"Time Elapsed: \".$temp.\"(ms)<br>\";\r\n\t\t\techo \"Number of Records: \".$this->numrows.\"<br>\";\r\n\t\t\techo \"Number of Rows Affected: \".$this->affected_rows;\r\n\t\t}",
"function dprv_db_ok()\r\n\t{\r\n\t\t$log = new DPLog();\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->last_error = \"\";\r\n\t\t$sql=\"SELECT last_fingerprint FROM \" . get_option('dprv_prefix') . \"dprv_posts WHERE id = 0 LIMIT 1\";\r\n\t\t$result = $wpdb->get_var($sql);\r\n\t\t$dprv_sql_error = mysql_error();\r\n\t\t$dprv_db_error = $wpdb->last_error;\r\n\t\tif (trim($dprv_db_error) != \"\")\r\n\t\t{\r\n\t\t\t$dprv_this_event = $dprv_db_error . \" while testing for last_fingerprint\";\r\n\t\t\tdprv_record_event($dprv_this_event);\r\n\t\t\tif (strpos(strtolower($dprv_db_error), \"unknown column\") !== false)\r\n\t\t\t{\r\n\t\t\t\treturn -1;\t\t// last fingerprint column does not exist\r\n\t\t\t}\r\n\t\t\treturn 0;\t\t\t// some other error\r\n\t\t}\r\n\t\treturn 1;\t\t\t\t// OK\r\n\t}",
"function confirm_query($result_set) {\n\tif (!$result_set) {\n\t\tdie(\"Database query failed.\");\n\t}\n}",
"function confirm_query($result_set) {\n\tif (!$result_set) {\n\t\tdie(\"Database query failed.\");\n\t}\n}",
"public function _query()\n {\n }",
"private static function fetchLogResult(&$result) {\n\t\twhile ($myrow = self::$db->fetchArray($result)) {\n\t\t\tself::addLog($myrow['Table'].' - '.$myrow['Op'].' - '.$myrow['Msg_type'].' - '.$myrow['Msg_text']);\n\t\t}\n\t}",
"function db_log_query($description, $sql, $params, $result = null) {\n\tif (! option('debug')) {\n\t\treturn;\n\t}\n\tif (! isset($GLOBALS['SQL_QUERIES'])) {\n\t\t$GLOBALS['SQL_QUERIES'] = array ();\n\t}\n\t$GLOBALS['SQL_QUERIES'][] = array (\n\t\t\"description\" => $description,\n\t\t\"query\" => $sql,\n\t\t// Ineffective and ugly way for a deep copy\n\t\t\"result\" => unserialize(serialize($result)),\n\t\t\"params\" => $params \n\t);\n}",
"function confirm_query($result_set) {\n if (!$result_set) {\n die(\"Database query failed: \" . sqlite_error());\n }\n }",
"function printResult($result) {\n\techo \"result from SQL:\";\n echo \"<table>\";\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \" \") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n}",
"public function gatherSQLQueryData()\n {\n $queryTotals = array();\n\n $queryTotals['count'] = 0;\n $queryTotals['time'] = 0;\n\n $queries = array();\n\n if(isset($this->connection)) {\n $queryLog = $this->connection->getQueryLog();\n\n $queryTotals['count'] += count($queryLog);\n\n foreach($queryLog as $query) {\n if(isset($query['bindings']) && ! empty($query['bindings'])) {\n $query['sql'] = PdoDebugger::show($query['query'], $query['bindings']);\n } else {\n $query['sql'] = $query['query'];\n }\n\n $query = $this->attemptToExplainQuery($query);\n\n $queryTotals['time'] += $query['time'];\n\n $query['time'] = $this->getReadableTime($query['time']);\n\n //\n $queries[] = $query;\n }\n }\n\n $queryTotals['time'] = $this->getReadableTime($queryTotals['time']);\n\n $this->output['queries'] = $queries;\n $this->output['queryTotals'] = $queryTotals;\n }",
"function set_debug_item($stmt, $result) { }",
"function print_results() {\r\n if ($list = $this->print_list()) {\r\n echo '<p>' . $this->print_count() . '</p>';\r\n echo $list;\r\n echo '<p class=\"more\">' . $this->print_more() . '</p>';\r\n }\r\n else {\r\n echo $this->zero_results;\r\n }\r\n }",
"public function query($query = \"NONEE\"){\n\t\t\n\t\tif($update = $query === \"NONEE\")\n\t\t\t$query = $this->query; \t\t\t\t\t\n\t\t\n\t\t$this->query_total++;\n\t\t\n\t\t$query_check = trim($query);\n\t\t\n\t\tif($this->debug){\n\t\t\techo \"<br/><strong style=\\\"color:#E4C100\\\"><DEBUG></strong><br/>\";\n\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#D3C26E;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : \"\";\n\t\t\techo \"<span style=\\\"color:#E4C100\\\">\".$query.\"</span><br/><strong style=\\\"color:#E4C100\\\"></DEBUG></strong><br/>\";\n\t\t}\n\t\t\n\t\t$resultset = $this->showErrors ? mysqli_query($this->connection,$query) : @mysqli_query($this->connection,$query);\n\t\t\n\t\t$proceed_log = $this->log && ( \n\t\t(stripos($query_check,\"INSERT\") === 0 && $this->log_options{0} === '1')\n\t\t||\n\t\t(stripos($query_check,\"DELETE\") === 0 && $this->log_options{1} === '1')\n\t\t||\n\t\t(stripos($query_check,\"UPDATE\") === 0 && $this->log_options{2} === '1')\n\t\t||\n\t\t(stripos($query_check,\"SELECT\") === 0 && $this->log_options{3} === '1'));\n\t\t\n\t\tif(stripos($query_check,\"INSERT\") === 0 || stripos($query_check,\"DELETE\") === 0 || stripos($query_check,\"UPDATE\") === 0)\n\t\t\tif(!$resultset)\n\t\t\t\t$this->transaction = false;\n\t\t\n\t\tif($proceed_log){\n\t\t\t$log_fields = \"query,date,user\";\n\t\t\t$log_values=\"'\".$this->secure($query).\"',NOW(),\".$this->log_user;\n\t\t}\n\t\t\n\t\tif(!$resultset){\n\t\t\tif($this->showErrors){ \n\t\t\t\techo \"<br/><strong style=\\\"color:red\\\"><QERROR></strong><br/>\";\n\t\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#E88888;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : $this->comment.\"nada\";\n\t\t\t\techo \"<span style=\\\"color:red\\\">\".mysqli_error($this->connection).\" at \".$query_check.\"</span><br/><strong style=\\\"color:red\\\"></QERROR></strong><br/>\";\n\t\t\t}\n\t\t\tif($proceed_log){\n\t\t\t\t$log_fields .= \",error\";\n\t\t\t\t$log_values .= \",'\".mysqli_error($this->connection).\"'\";\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($proceed_log){\t\t\t\n\t\t\t@mysqli_query($this->connection,\"INSERT INTO \".$this->log_table.\"($log_fields) VALUES($log_values)\");\n\t\t}\n\t\t\n\t\tif(!$resultset && $this->closeOnError) \n\t\t\texit;\n\t\t\n\t\tif($update)\n\t\t\t$this->resultset = $resultset;\n\t\t\n\t\treturn $resultset; \n\t}",
"function show_query($query) {\n global $debug;\n\n if($debug)\n echo \"<p>Query = $query</p>\" ;\n}",
"public function diagnostics()\n {\n $diagnostics = array();\n $utilityObj = new Utility;\n $domains = array('', 'Action', 'Credential', 'Group', 'User', 'Tag', 'Webhook');\n $queue = $this->getBatchRequest();\n foreach($domains as $domain)\n $this->db->batch($queue)->domain_metadata(\"{$this->domainPhoto}{$domain}\");\n $responses = $this->db->batch($queue)->send();\n if($responses->areOK())\n {\n $diagnostics[] = $utilityObj->diagnosticLine(true, 'All SimpleDb domains are accessible.');\n }\n else\n {\n foreach($responses as $key => $res)\n {\n if((int)$res->status !== 200)\n $diagnostics[] = $utilityObj->diagnosticLine(false, sprintf('The SimpleDb domains \"%s\" is NOT accessible.', $domains[$key]));\n }\n }\n return $diagnostics;\n }",
"public function testResultGetStatement()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(\"SELECT * FROM test WHERE status='ACTIVE'\", $result->getStatement());\n }",
"public function _processResults(){\n $data = array();\n foreach($this->_resultset as $doc){\n\t$fields = array();\n\tforeach($doc as $key => $value){\n $fields[$key] = $value;\n }\n \t$data[] = $fields;\n }\n $processor = new Pas_Solr_SensitiveFields();\n $clean = $processor->cleanData($data, $this->_getRole(), $this->_core);\n return $clean;\n }",
"function confirm_result_set($result_set){\n if (!$result_set) {\n exit(\"Database query failed.\");\n }\n}",
"public static function enableQueryLog()\n {\n }",
"function good_query_assoc($sql, $debug=0)\n{\n $result = good_query($sql, $debug);\n\t\n if($lst = mysql_fetch_assoc($result))\n {\n\tmysql_free_result($result);\n\treturn $lst;\n }\n mysql_free_result($result);\n return false;\n}",
"public function __debugInfo()\n {\n return $this->all();\n }",
"private function searchCorrectedQuery(\\stdClass $result) {\n if (property_exists($result, \"spelling\")) {\n if ($this->searchQueryInGoogle($result->spelling->correctedQuery)) {\n $this->view->data->info_message = \"On your request nothing has been found. Showing results on <strong>\". $result->spelling->correctedQuery .\"</strong>.\";\n return true;\n }\n }\n return false;\n }",
"public function hasResult(){\n return $this->_has(2);\n }"
] | [
"0.6636826",
"0.64521456",
"0.6436782",
"0.62944865",
"0.6272143",
"0.62406516",
"0.6168132",
"0.6140891",
"0.6134641",
"0.6033268",
"0.60119975",
"0.60107106",
"0.5960356",
"0.5945545",
"0.589718",
"0.58958215",
"0.58827114",
"0.5872968",
"0.58247524",
"0.5796907",
"0.5795551",
"0.57839006",
"0.57745355",
"0.57595277",
"0.5752368",
"0.5744477",
"0.57433826",
"0.57096106",
"0.570955",
"0.570882",
"0.57072955",
"0.5699271",
"0.5683851",
"0.56563956",
"0.5648797",
"0.56379163",
"0.5636922",
"0.5628166",
"0.5611743",
"0.56048125",
"0.56006676",
"0.55970347",
"0.5592947",
"0.55830365",
"0.5550385",
"0.5527343",
"0.5508311",
"0.5498654",
"0.5489271",
"0.548242",
"0.54795235",
"0.54757273",
"0.5474279",
"0.5468026",
"0.54575527",
"0.545518",
"0.5452345",
"0.5449895",
"0.54468286",
"0.5441203",
"0.543811",
"0.54302835",
"0.54230416",
"0.5416694",
"0.5414376",
"0.5404903",
"0.5404903",
"0.54044735",
"0.5399398",
"0.5396158",
"0.53947663",
"0.5392157",
"0.5391235",
"0.5382804",
"0.5379941",
"0.53770256",
"0.5375879",
"0.5374012",
"0.53699493",
"0.53699493",
"0.5368825",
"0.5362528",
"0.5347321",
"0.53429574",
"0.53404075",
"0.53394884",
"0.53257775",
"0.532117",
"0.5313582",
"0.52950823",
"0.5291779",
"0.52905965",
"0.5276281",
"0.52748233",
"0.5262532",
"0.52615565",
"0.52546966",
"0.5250881",
"0.5240833"
] | 0.59669286 | 13 |
Count elements of an object | public function count()
{
return ++$this->id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function countObjects();",
"public function count() {\r\n return count($this->objects);\r\n }",
"public function count(): int {\n return count($this->toArray());\n }",
"public function count()\n {\n // NOTE: Cannot use \\COUNT_RECURSIVE because that counts the arrays\n // as well as their contents. We want a count only of Properties.\n $count = 0;\n foreach ($this->data as $key=>$values)\n {\n if (is_array($this->data[$key]))\n $count += count($values);\n else\n $count += 1;\n }\n return $count;\n }",
"public function count()\n {\n return count($this->valueOf());\n }",
"public function count() {\n\t\treturn count($this->_dataobjects);\n\t}",
"public function count(): int\n {\n return count( $this->toArray() );\n }",
"public function countObjects($subtype = \"\");",
"function actual_count($data)\n{\n //do not ask me why, but count() doesn't work on $result->turns\n $i = 0;\n foreach ($data as $stuff) {\n $i++;\n }\n\n return $i;\n}",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"public function count(): int\n {\n // TODO: Implement count() method.\n return count($this->toArray());\n }",
"public function count() {\r\n if (is_null($this->objectcount)) {\r\n $this->fetchData();\r\n }\r\n return $this->objectcount;\r\n }",
"function count() {\n return count($this->data);\n }",
"public function getCountList(){\n\t\t$select = $this->getListSelect();\n\t\t$stmt = $select->query();\n\t\t$objects = array();\n\t\treturn count($stmt->fetchAll());\n\t}",
"public function countItems();",
"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 abstract function count();",
"public abstract function count();",
"function count() {\n\t\treturn count($this->data);\n\t}",
"function tidy_access_count(tidy $object) {}",
"public function count()\n\t{\n\t\treturn count($this->getListByKey());\n\t}",
"#[\\ReturnTypeWillChange]\n public function count() {\n return count($this->all());\n }",
"public function count() {\n\t\treturn count($this->getData());\n\t}",
"public function count() {\r\n return count($this->data);\r\n }",
"public function count() {\n\t\treturn count($this->data);\n\t}",
"function get_object_count()\r\n {\r\n return $this->get_browser()->count_profile_publications($this->get_condition());\r\n }",
"public function countKeys();",
"public function count()\r\n {\r\n return count($this->data);\r\n }",
"public function _count();",
"public static function count();",
"public function get_object_count($label) {\n if (!$this->section_exists('Objects')) {\n return 0;\n }\n\n return count($this->get_object_content($label));\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count()\n {\n return count($this->data);\n }",
"public function count() {\n\t\treturn count($this->_data);\n\t}",
"public function count() {\n return count($this->_data);\n }",
"public function count() {\n\t\treturn count($this->array);\n\t}",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"function number_of_elements() {\n return count($this->page_object);\n }",
"public function count()\n {\n $this->setIteratorFilter(self::FLIST_NOCONTAINER | self::FLIST_UNSUB);\n return count(iterator_to_array($this));\n }",
"public function count()\n {\n return count($this->elements);\n }",
"public function count()\n {\n return count($this->elements);\n }",
"public function count()\n {\n return count($this->_elements);\n }",
"public function count()\n {\n return count( $this->data );\n }",
"public function count ( )\n {\n if(!isset($this->data))\n {\n return 0;\n }\n if(is_array($this->data))\n {\n return count($this->data);\n }\n return 1;\n }",
"public function count() {\n return count($this->cast);\n }",
"public function count()\n\t{\n\t\treturn $this->getParentObject()->count();\n\t}",
"function getCount ($data){\nreturn count($data);\n \n}",
"#[\\ReturnTypeWillChange]\n public function count()\n {\n return count($this->_data);\n }",
"public function count()\n {\n return count($this->_data);\n }",
"public function count(): int\n {\n if (is_array($this->data)) {\n return count($this->data);\n }\n if ($this->data instanceof Countable) {\n return $this->data->count();\n }\n $this->dataToArray();\n\n return count($this->data);\n }",
"public function count() {\n\t\treturn count($this->values);\n\t}",
"public function count ( )\n {\n return count($this->_values);\n }",
"public function getRepeatedObjFieldCount()\n {\n return $this->count(self::REPEATED_OBJ_FIELD);\n }",
"public function count()\n {\n $children = @unserialize($this->attributes['__members']);\n if (!is_array($children)) {\n return 0;\n } else {\n return count($children);\n }\n }",
"public function count(): int\n {\n $arr = $this->all();\n $this->items = (fn(): Generator => yield from $arr)();\n\n return count($arr);\n }",
"public function count() {\n return count($this->list);\n }",
"public function count()\n {\n return $this->getValue()->count();\n }",
"function _size($list): int\n{\n return !\\is_countable($list) ?\n (\n \\is_object($list) ?\n _fold(\n function (int $size) {\n $size += 1;\n\n return $size;\n },\n $list,\n 0\n ) :\n 0\n ) :\n \\count($list);\n}",
"public function count() : int {\n return count($this->elements);\n }",
"public function count(): int\n {\n return \\count($this->elements);\n }",
"public function count()\r\n {\r\n return count($this->_values);\r\n }",
"public function getAttributeCount();",
"public function count()\r\n {\r\n return count($this->attributes);\r\n }",
"function statistics_extended_objects_count($object_subtypes,$container_guid=null,$owner_guid=null,$object_type='object'){\r\n\tif(!is_array($object_types)){\r\n\t\t$object_types = array($object_subtypes);\r\n\t}\r\n\t$resp = array();\r\n\tforeach($object_subtypes as $object_subtype){\r\n\t\t$resp[$object_subtype] = statistics_extended_object_count($object_subtype,$owner_guid,$container_guid,$object_type);\r\n\t}\r\n\treturn $resp;\r\n}",
"function getNumberOfMembers(){\n\t\t$number = 0;\n\t\tforeach ($this->members as $obj){\n\t\t\t$number++;\n\t\t}\n\t\treturn $number;\n\t}",
"public static function count($obj) {\n\t\treturn DB::table(Version::getVersionsTable())->where('object_id', '=', $obj->attributes['id'])->where('object_table', '=', strtolower(get_class($obj)))->count();\n\t}",
"public function count()\n {\n return count($this->countable);\n }",
"public function count()\n {\n return count($this->getIteratorArray());\n }",
"public function count()\n\t{\n\t\treturn count($this->values);\n\t}",
"public function size() {\n return n(count($this->value()));\n }"
] | [
"0.7844575",
"0.7308457",
"0.7274846",
"0.72054976",
"0.71488273",
"0.70194924",
"0.6937613",
"0.6936243",
"0.6926989",
"0.6924251",
"0.6924251",
"0.6924251",
"0.6924251",
"0.69202334",
"0.6894718",
"0.68790454",
"0.68629766",
"0.683714",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6827706",
"0.6799263",
"0.6799263",
"0.67932993",
"0.6769706",
"0.6747677",
"0.67228913",
"0.6711254",
"0.66810447",
"0.6676362",
"0.6672654",
"0.6667606",
"0.66669375",
"0.666277",
"0.6660378",
"0.6656005",
"0.66239357",
"0.66239357",
"0.66239357",
"0.66239357",
"0.66239357",
"0.6623021",
"0.661919",
"0.6613401",
"0.6612495",
"0.6612495",
"0.6612495",
"0.6612495",
"0.6612495",
"0.66062987",
"0.66046554",
"0.6604163",
"0.6604163",
"0.6601926",
"0.658598",
"0.65840054",
"0.6583241",
"0.6571299",
"0.65671563",
"0.6564019",
"0.65515906",
"0.6541165",
"0.6533809",
"0.6525028",
"0.65218604",
"0.6515519",
"0.65104264",
"0.6504654",
"0.6502039",
"0.65001833",
"0.6497417",
"0.64960283",
"0.64947027",
"0.6493797",
"0.6492948",
"0.6484524",
"0.64808154",
"0.64787734",
"0.647786",
"0.6476029",
"0.647518",
"0.64708257"
] | 0.0 | -1 |
Get time diff in humanreadable format. | public static function timeDiff($periodStartDate, $periodEndDate)
{
/**
* @var \DateTime $fromDate
* @var \DateTime $toDate
*/
// @codeCoverageIgnoreStart
$dateRange = new DateRange($periodStartDate, $periodEndDate);
$fromDate = $dateRange->getRangeBegin();
$toDate = $dateRange->getRangeEnd();
// @codeCoverageIgnoreEnd
$diff = $fromDate->diff($toDate);
// @codeCoverageIgnoreStart
if ($diff === false) {
throw new \RuntimeException('Unexpected runtime error.');
}
// @codeCoverageIgnoreEnd
if ($diff->invert === 1) {
throw new \InvalidArgumentException(
'$periodStartDate argument can not be greater than $periodEndDate argument.'
);
}
$translations = static::loadTranslations(__FUNCTION__);
if ($diff->y >= 1) {
$text = UString::plural($diff->y, $translations['year'], true);
} elseif ($diff->m >= 1) {
$text = UString::plural($diff->m, $translations['month'], true);
} elseif ($diff->d >= 7) {
$text = UString::plural(ceil($diff->d / 7), $translations['week'], true);
} elseif ($diff->d >= 1) {
$text = UString::plural($diff->d, $translations['day'], true);
} elseif ($diff->h >= 1) {
$text = UString::plural($diff->h, $translations['hour'], true);
} elseif ($diff->i >= 1) {
$text = UString::plural($diff->i, $translations['minute'], true);
} elseif ($diff->s >= 1) {
$text = UString::plural($diff->s, $translations['second'], true);
} else {
$text = UString::plural(0, $translations['second'], true);
}
return trim($text) . ' ' . $translations['ago'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatDiffTime($t) {\n\n\t\t/*\n\t\tif ($t) {\n\t\t\t$t = $t/10; // convert from 10ths of seconds into seconds\n\t\t\tif ($t > 3600) \t\t\n\t\t\t\treturn sprintf(\"+%d:%02d:%02d\", $t/3600, ($t/60)%60, $t%60);\n\t\t\telse\n\t\t\t\treturn sprintf(\"+%d:%02d\", ($t/60)%60, $t%60);\n\t\t}\n\t\t*/\n\n\t\t// This code does mmm:ss for everyone\n\t\tif ($t) {\n\t\t\t$t = $t/10; // convert from 10ths of seconds into seconds\n\t\t\treturn sprintf(\"+%d:%02d\", ($t/60), $t%60);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function format(): string\n {\n foreach ($this->times as $unit => $value) {\n if ($this->time >= $value) {\n $time = floor($this->time / $value * 100) / 100;\n return \"{$time} {$unit}\";\n }\n }\n\n return round($this->time * 1000) . \" ms\";\n }",
"public function get_duration() {\n\t\t$a = explode (' ',microtime()); \n \t$this->stop_time = (double) $a[0] + $a[1];\n \t$this->duration = number_format(($this->stop_time - $this->start_time),2);\n\n\t\treturn sprintf('<h2>%s</h2><div class=\"summarize-posts-errors\">%s</div>'\n\t\t\t, __('Execution Time', CCTM_TXTDOMAIN)\n\t\t\t, sprintf(__('%s seconds', CCTM_TXTDOMAIN), $this->duration));\n\t}",
"public static function formatMicrotimeDiff($timediff)\n {\n $ms = (int)($timediff * 1000);\n if ($ms>=3600000) {\n return (((int)($ms / 3600000 * 100.0)) / 100.0).'h';\n } elseif ($ms>=60000) {\n return (((int)($ms / 60000 * 100.0)) / 100.0).'m';\n } elseif ($ms>=1000) {\n return (((int)($ms / 1000 * 100.0)) / 100.0).'s';\n } else {\n return $ms.'ms';\n }\n }",
"function humanTiming($time) {\n\tif(time() - $time >= 345600) {\n return date(\"m/d/Y g:i A\", $time);\n }\n $time = time() - $time;\n if (strval($time) < 1) {\n $time = 1;\n }\n $tokens = array(86400 => 'day', 3600 => 'hour', 60 => 'minute', 1 => 'second');\n foreach ($tokens as $unit => $text){\n if($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':''). ' ago';\n }\n}",
"function time_elapsed_string($ptime)\n{\n if (empty($ptime)) {\n return \"No Time\";\n }\n $etime = time() - $ptime;\n\n if ($etime < 1) {\n return '0 seconds';\n }\n\n $a = array(365 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'min',\n 1 => 'sec'\n );\n $a_plural = array('year' => 'years',\n 'month' => 'months',\n 'day' => 'days',\n 'hour' => 'hours',\n 'min' => 'min',\n 'sec' => 'secs'\n );\n\n foreach ($a as $secs => $str) {\n $d = $etime / $secs;\n if ($d >= 1) {\n $r = round($d);\n return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . '';\n }\n }\n}",
"public function getTimeElapsed(): string\n {\n $now = new DateTime('now');\n $ago = new DateTime($this->datetime);\n $diff = $ago->diff($now);\n if (!empty($diff->y)) {\n $age = $diff->y . 'year';\n $age = $age . ($diff->y > 1 ? 's' : '');\n } elseif ($diff->m > 0) {\n $age = $diff->m . 'month';\n $age = $age . ($diff->m > 1 ? 's' : '');\n } elseif ($diff->d > 0) {\n $age = $diff->d . 'day';\n $age = $age . ($diff->d > 1 ? 's' : '');\n } elseif ($diff->h > 0) {\n $age = $diff->h . 'hour';\n $age = $age . ($diff->h > 1 ? 's' : '');\n } elseif ($diff->i > 0) {\n $age = $diff->i . 'minute';\n $age = $age . ($diff->i > 1 ? 's' : '');\n } else {\n $age = $diff->s . 'second';\n $age = $age . ($diff->s > 1 ? 's' : '');\n }\n $ageWithPostfix = $age . ' ago';\n return $ageWithPostfix;\n }",
"function humanTiming ($time)\n {\n\n $time = time() - $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'tahun',\n 2592000 => 'bulan',\n 604800 => 'minggu',\n 86400 => 'hari',\n 3600 => 'jam',\n 60 => 'menit',\n 1 => 'detik'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n\n }",
"public function getTimeDisplay()\n {\n return $this->timeDisplay;\n }",
"public function gettimeModifiedAttribute()\n {\n return Carbon::parse($this->time)->translatedFormat('g:i A');\n }",
"public function get_duration()\n {\n $previous_point_obj = Game_Point::where(\n 'created_at',\n '<',\n $this->created_at\n )\n ->orderBy('created_at', 'desc')\n ->first();\n\n $current_point = $this->created_at;\n\n if (!empty($previous_point_obj)) {\n $previous_point = $previous_point_obj->created_at;\n } else {\n $previous_point = $this->game()->created_at;\n }\n\n $duration_obj = $current_point->diff($previous_point);\n\n $duration = '';\n\n $duration .= (int) $duration_obj->h > 0 ? $duration_obj->h . 'h' : '';\n $duration .= (int) $duration_obj->m > 0 ? $duration_obj->m . 'm' : '';\n $duration .= !empty($duration) && !empty($duration_obj->s) ? ':' : '';\n $duration .= (int) $duration_obj->s > 0 ? $duration_obj->s . 's' : '';\n\n return $duration;\n }",
"function humanTiming ($time){\n $time = (time()- 2*60*60)- $time; // to get the time since that moment\n $time = ($time<1)? 1 : $time;\n $tokens = array (\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n }\n }",
"public function getTimeDiff()\n {\n $start = ServiceUtil::getManager()->getArgument('debug.toolbar.panel.rendertime.start');\n $end = microtime(true);\n\n $diff = $end - $start;\n return $diff;\n }",
"function printtimediff($start, $end = null) {\n\n\tif( ! $end )\t$end = time();\n\t$ret = '';\n\t$diff = $end - $start;\n\n\t$h = floor($diff/3600);\n\t$diff %= 3600;\n\tif($h > 0) {\n\t\t$ret .= $h.' h ';\n\t}\n\n\t$m = floor($diff/60);\n\t$diff %= 60;\n\tif ( $m > 0 ) {\n\t\t$ret .= $m.' m ';\n\t}\n\n\treturn $ret . $diff .' s';\n}",
"public function time(): string\n {\n return $this->time;\n }",
"public function humanize()\n {\n $now = IntlCalendar::fromDateTime(self::now($this->timezone));\n $time = $this->getCalendar()->getTime();\n\n $years = $now->fieldDifference($time, IntlCalendar::FIELD_YEAR);\n $months = $now->fieldDifference($time, IntlCalendar::FIELD_MONTH);\n $days = $now->fieldDifference($time, IntlCalendar::FIELD_DAY_OF_YEAR);\n $hours = $now->fieldDifference($time, IntlCalendar::FIELD_HOUR_OF_DAY);\n $minutes = $now->fieldDifference($time, IntlCalendar::FIELD_MINUTE);\n\n $phrase = null;\n\n if ($years !== 0) {\n $phrase = lang('Time.years', [abs($years)]);\n $before = $years < 0;\n } elseif ($months !== 0) {\n $phrase = lang('Time.months', [abs($months)]);\n $before = $months < 0;\n } elseif ($days !== 0 && (abs($days) >= 7)) {\n $weeks = ceil($days / 7);\n $phrase = lang('Time.weeks', [abs($weeks)]);\n $before = $days < 0;\n } elseif ($days !== 0) {\n $before = $days < 0;\n\n // Yesterday/Tomorrow special cases\n if (abs($days) === 1) {\n return $before ? lang('Time.yesterday') : lang('Time.tomorrow');\n }\n\n $phrase = lang('Time.days', [abs($days)]);\n } elseif ($hours !== 0) {\n $phrase = lang('Time.hours', [abs($hours)]);\n $before = $hours < 0;\n } elseif ($minutes !== 0) {\n $phrase = lang('Time.minutes', [abs($minutes)]);\n $before = $minutes < 0;\n } else {\n return lang('Time.now');\n }\n\n return $before ? lang('Time.ago', [$phrase]) : lang('Time.inFuture', [$phrase]);\n }",
"function timedifference($timedifference=0)\n{\n\tif ($timedifference < 60) {\n\t\t$timechange = number_format($timedifference, 0) . ' second';\n\t\tif ($timedifference > 1) {\n\t\t\t$timechange .= 's';\n\t\t}\n\t}\n\n\tif ($timedifference >= 60 && $timedifference < 3600) {\n\t\t$num_mins = floor($timedifference / 60);\n\t\t$timechange = number_format($num_mins, 0) . ' minute';\n\t\tif ($num_mins > 1) {\n\t\t\t$timechange .= 's';\n\t\t}\n\t}\n\n\tif ($timedifference >= 3600) {\n\t\t$hours = floor($timedifference/3600);\n\t\t$mins = floor($timedifference % 3600) / 60;\n\n\t\t$timechange = number_format($hours, 0) . ' hour';\n\t\tif ($hours > 1) {\n\t\t\t$timechange .= 's';\n\t\t}\n\n\t\t$timechange .= ' and ' . number_format($mins, 0) . ' minute';\n\t\tif ($mins > 1) {\n\t\t\t$timechange .= 's';\n\t\t}\n\t}\n\treturn $timechange;\n}",
"public function getTime() : string\r\n {\r\n return $this->format('H:i:s');\r\n }",
"function humanTiming ($time)\n{\n $time = time() - $time;\n\n // time unit constants\n $timeUnits = array (\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n\n // iterate over time contants to build a human \n //$humanTiming;\n foreach ($timeUnits as $unit => $text)\n {\n if ($time < $unit)\n continue;\n $numberOfUnits = floor($time / $unit);\nif(!isset($humanTiming)){\n // human readable token for current time unit\n $humanTiming = $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');\n}\n // compute remaining time for next loop iteration\n $time -= $unit*$numberOfUnits;\n }\n return $humanTiming;\n}",
"function time_elapsed_string($datetime) {\n\n $etime = time() - $datetime->getTimestamp();\n\n if ($etime < 1) {\n return '0 seconds';\n }\n\n $a = array( 12 * 30 * 24 * 60 * 60 => 'année',\n 30 * 24 * 60 * 60 => 'mois',\n 24 * 60 * 60 => 'jour',\n 60 * 60 => 'heure',\n 60 => 'minute',\n 1 => 'seconde'\n );\n\n foreach ($a as $secs => $str) {\n $d = $etime / $secs;\n if ($d >= 1) {\n $r = round($d);\n $s = $r . ' ' . $str;\n if($str != 'mois')\n return $s . ($r > 1 ? 's' : '');\n else\n return $s;\n }\n }\n }",
"public function formatTime()\n { \n return sprintf('%02d:%02d:%02d', ($this->totaltime / 3600), \n ($this->totaltime / 60 % 60), $this->totaltime % 60); \n }",
"public function getTripTimeAttribute()\n { \n $begin_time = new DateTime($this->attributes['begin_trip']);\n $end_time = new DateTime($this->attributes['end_trip']);\n $timeDiff = date_diff($begin_time,$end_time);\n return $timeDiff->format('%H').':'.$timeDiff->format('%I').':'.$timeDiff->format('%S');\n \n }",
"public function displayTime()\n {\n return $this->displayTime;\n }",
"public function toStringShort() {\n return gmdate(\"Y-m-d h:i:s\", $this->sec); }",
"public function getInterval()\n {\n $time_diff = date_diff($this->created_at, new \\DateTime());\n\n $format = \"Aujourd'hui\";\n if ($time_diff->d == 1) {\n $format = \"Hier\";\n }\n if ($time_diff->d > 1) {\n $format = \"Il y a %d jours\";\n }\n if ($time_diff->m > 0) {\n $format = \"Il y a %m mois\";\n }\n if ($time_diff->y > 0) {\n $format = \"Il y a %m ans\";\n }\n return $time_diff->format($format);\n }",
"static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }",
"public function getUpdatedForHumans() : string{\n return $this->updated_at->diffForHumans(now());\n }",
"function __toString()\n\t{\n\t\treturn self::dtToHumanReadableString( $this->elapsedMilliseconds() );\n\t}",
"public function duration()\n {\n if ($this->minDuration == 0 && $this->maxDuration == 0) return '1+ days';\n if ($this->minDuration == 1 && $this->maxDuration == 30) return '1+ days';\n if ($this->minDuration == 1 && $this->maxDuration == 1) return '1 day';\n if ($this->minDuration == $this->maxDuration) return $this->maxDuration.' days';\n if ($this->maxDuration == 30) return $this->minDuration.' days and more';\n\n return $this->minDuration.' - '.$this->maxDuration.' days';\n\n }",
"public function getDifferenceAsString(\\DateTime $time1, \\DateTime $time2)\n {\n if ($time1 == $time2) {\n return '0';\n }\n $interval = $time1->diff($time2);\n $years = $interval->format('%y');\n $months = $interval->format('%m');\n $days = $interval->format('%d');\n $hours = $interval->format('%h');\n $minutes = $interval->format('%i');\n $seconds = $interval->format('%s');\n\n $differenceString = (($years) ? $years . 'Y ' : '')\n . (($months) ? $months. 'M ' : '')\n . (($days) ? $days. 'd ' : '')\n . (($hours) ? $hours. 'h ' : '')\n . (($minutes) ? $minutes . 'm ' : '')\n . (($seconds) ? $seconds . 's' : '');\n\n return trim($differenceString);\n }",
"public function time() {\n return $this->info['total_time'];\n }",
"public function getDurationLabel()\n {\n return $this->format_duration($this->getWorkingDuration());\n }",
"function time_elapsed_string($datetime) {\n\t\t\t $now = new DateTime;\n\t\t\t $ago = new DateTime($datetime);\n\t\t\t $diff = $now->diff($ago);\n\n\t\t\t $diff->w = floor($diff->d / 7);\n\t\t\t $diff->d -= $diff->w * 7;\n\n\t\t\t $string = array(\n\t\t\t 'y' => 'year',\n\t\t\t 'm' => 'month',\n\t\t\t 'w' => 'week',\n\t\t\t 'd' => 'day',\n\t\t\t 'h' => 'hour',\n\t\t\t 'i' => 'minute',\n\t\t\t 's' => 'second',\n\t\t\t );\n\t\t\t foreach ($string as $k => &$v) {\n\t\t\t if ($diff->$k) {\n\t\t\t $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');\n\t\t\t } else {\n\t\t\t unset($string[$k]);\n\t\t\t }\n\t\t\t }\n\n\t\t\t if ($string = array_slice($string, 1));\n\t\t\t return $string ? implode(', ', $string) . ', ago' : 'just now';\n\t\t}",
"public function getElapsedTime();",
"function humanizeDateDiff(Date $datetime, Date $origin = null) : string\n {\n if (!isset($origin)) {\n $origin = new Date();\n }\n $interval = $datetime->diff($origin);\n\n $d = $interval->d;\n $h = $interval->h;\n $m = $interval->i;\n $s = $interval->s;\n\n if ($d > 0) {\n $unit = 'day';\n $count = $d;\n } elseif ($h > 0) {\n $unit = 'hour';\n $count = $h;\n } elseif ($m > 0) {\n $unit = 'minute';\n $count = $m;\n } else {\n $unit = 'second';\n $count = $s;\n }\n\n $key = \"common/time.$unit\";\n\n return Lang::choice($key, $count);\n }",
"public function getTimeFormatter();",
"public function execTimeStr()\n {\n $execTime = $this->execTime();\n\n if ($execTime >= 1) {\n return round($execTime, 1).'s';\n } else {\n return round($execTime * 1000, 2).'ms';\n }\n }",
"function iu_time_elapsed_string($datetime, $full = false) {\n\t$now = new DateTime;\n\t$ago = new DateTime($datetime);\n\t$diff = $now->diff($ago);\n\t//print_r($diff);\n\t// $diff->w = floor($diff->d / 7);\n\t// $diff->d -= $diff->w * 7;\n\n\t$string = array(\n\t'y' => 'year',\n\t'm' => 'month',\n\t//'w' => 'week',\n\t'd' => 'day',\n\t'h' => 'hour',\n\t'i' => 'minute',\n\t's' => 'second',\n\t);\n\tforeach ($string as $k => &$v) {\n\t\tif ($diff->$k) {\n\t\t\t$v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');\n\t\t} else {\n\t\t\tunset($string[$k]);\n\t\t}\n\t}\n\n\tif (!$full) $string = array_slice($string, 0, 1);\n\treturn $string ? implode(', ', $string) . ' ago' : 'just now';\n}",
"public function toTimeString()\n {\n return $this->format('H:i:s');\n }",
"public static function getLogTime()\n\t{\n\t\t$mt = explode(' ', microtime());\n\t\treturn '[' . date('Y.m.d H:i:s', $mt[1]) . '.' . sprintf('%06d', $mt[0] * 1000000) . ' ' . date('O') . ']';\n\t}",
"public function timestamp()\n {\n list($uSecond, $second) = explode(' ', microtime());\n return (string) ($second + ($uSecond * 1000000));\n }",
"public function getWorktimeDifference() {\n // Get work time in millis\n $workedTime = new DateTime($this->getWorkedTime());\n $workedTime = $workedTime->getTimestamp();\n\n // Get exp work time in millis\n $exp = new DateTime($this->getExp());\n $exp = $exp->getTimestamp();\n\n // substract actual worked time from extected tme\n // $diff are seconds\n $diff = -($exp - $workedTime);\n\n // check if the difference is negative\n if ($diff < 0) {\n // if so, set the flag to \"-\"\n $flag = \"-\";\n }\n $diff = abs($diff);\n\n // work out hours and minutes\n $minutes = ($diff / (60)) % 60;\n $hours = ($diff / (60 * 60)) % 24;\n\n // prepare values for return\n $hours = $hours <= 9 \n ? $hours < 0 \n ? str_split($hours)[0] . \"0\" . str_split($hours)[1] \n : \"0$hours\" \n : $hours;\n\n $minutes = $minutes <= 9 \n ? \"0$minutes\" \n : $minutes;\n\n // return the hours (with sign), minutes an total seconds\n // hours / minutes for rendering in views\n // total seconds (with sign) for further calculation\n return [\n $hours,\n $minutes,\n $diff,\n \"print\" => \"$flag$hours:$minutes\",\n \"flag\" => $flag\n ];\n }",
"public function getEmptyDiffMessage()\n {\n return $this->translator->trans('diff.empty', array(), 'time');\n }",
"static public function get_time() {\n // By Zach Buller ([email protected])\n $time1 = \\microtime();\n \\settype($time1, 'string'); //convert to string to keep trailing zeroes\n $time2 = explode(\" \", $time1);\n $sub_secs = \\preg_replace('/0./', '', $time2[0], 1);\n $time3 = ($time2[1].$sub_secs)/100;\n return $time3;\n }",
"public function getTimeLabelAttribute()\n {\n $start = Carbon::createFromFormat('Y-m-d H:i:s', $this->start)->format('Y-m-d H:i');\n $end = Carbon::createFromFormat('Y-m-d H:i:s', $this->end)->format('H:i');\n\n return $start . '〜' . $end;\n }",
"public static function timeToHumanReadable($time = 0)\r\n {\r\n if (!is_numeric($time)) {\r\n $time = izDateTime::timeStringToStamp($time);\r\n }\r\n\r\n if ($time == 0) {\r\n return 'no time at all';\r\n } else {\r\n if ($time < 0) {\r\n $neg = 1;\r\n $time = 0 - $time;\r\n } else {\r\n $neg = 0;\r\n }\r\n \r\n $days = $time / 86400;\r\n $days = floor($days);\r\n $hrs = ($time / 3600) % 24;\r\n $mins = ($time / 60) % 60;\r\n $secs = $time % 60;\r\n \r\n $timestring = '';\r\n if ($neg) {\r\n $timestring .= 'negative ';\r\n }\r\n if ($days) {\r\n $timestring .= \"$days day\" . ($days == 1 ? '' : 's');\r\n if ($hrs || $mins || $secs) {\r\n $timestring .= ', ';\r\n }\r\n }\r\n if ($hrs) {\r\n $timestring .= \"$hrs hour\" . ($hrs == 1 ? '' : 's');\r\n if ($mins && $secs) {\r\n $timestring .= ', ';\r\n }\r\n if (($mins && !$secs) || (!$mins && $secs)) {\r\n $timestring .= ' and ';\r\n }\r\n }\r\n if ($mins) {\r\n $timestring .= \"$mins min\" . ($mins == 1 ? '' : 's');\r\n if ($mins && $secs) {\r\n $timestring .= ', ';\r\n }\r\n if ($secs) {\r\n $timestring .= ' and ';\r\n }\r\n }\r\n if ($secs) {\r\n $timestring .= \"$secs sec\" . ($secs == 1 ? '' : 's');\r\n }\r\n return $timestring;\r\n }\r\n }",
"public function toTimeString()\n {\n return $this->toLocalizedString('HH:mm:ss');\n }",
"public function cChrono(){\n\t\treturn round(getMicrotime()-PLX_MICROTIME,3).'s';\n\t}",
"function human_time_diff($from, $to = 0)\n {\n }",
"public function LastChange()\n {\n $today = new DateTime(); // This object represents current date/time\n $today->setTime(0, 0, 0); // reset time part, to prevent partial comparison\n\n $dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $this->Changed);\n if (!($dateTime instanceof DateTime)) {\n return '---';\n }\n\n $todayTime = $dateTime;\n $todayTime->setTime(0, 0, 0); // reset time part, to prevent partial comparison\n\n $diff = $today->diff($todayTime);\n $diffDays = (integer)$diff->format('%R%a'); // Extract days count in interval\n\n switch ($diffDays) {\n case 0:\n return 'Heute ' . date('H:i', strtotime($this->Changed));\n break;\n case -1:\n return 'Gestern ' . date('H:i', strtotime($this->Changed));\n break;\n default:\n return date('j. M H:i', strtotime($this->Changed));\n }\n }",
"function getTime(){\n\t\t$mtime = microtime();//print(\"\\n time : \" . $mtime);\n\t\t$mtime = explode(' ', $mtime);\n\t\t$mtime = $mtime[1] + $mtime[0];\n\t\treturn $mtime;\n\t}",
"public static function timeunit(/* Long */ $time) {\n if ($time == null)\n return '';\n $sec = (int) $time % 60;\n $min = (int) ($time / 60) % 60;\n $hours = (int) ($time / 3600);\n return \"$hours:\" . sprintf('%02d', $min) . ':' . sprintf('%02d', $sec);\n }",
"public function getTitle()\n {\n return round($this->getTimeDiff()*1000, 3).' ms';\n }",
"static function dtToHumanReadableString($dt)\n\t{\n\t\t$res = \"\";\n\t\t\n\t\tif( $dt == 0 )\n\t\t\treturn \"0.000 s\";\n\t\t\n\t\tif( $dt < 0 ){\n\t\t\t$res .= \"-\";\n\t\t\t$dt = -$dt;\n\t\t}\n\t\t\n\t\tif( $dt >= self::day ){\n\t\t\t$day_no = (int) ($dt / self::day);\n\t\t\t$res .= \" $day_no days\";\n\t\t\t$dt -= $day_no * self::day;\n\t\t}\n\t\t\n\t\tif( $dt >= self::hour ){\n\t\t\t$hour_no = (int) ($dt / self::hour);\n\t\t\t$res .= \" $hour_no h\";\n\t\t\t$dt -= $hour_no * self::hour;\n\t\t}\n\t\t\n\t\tif( $dt >= self::min ){\n\t\t\t$min_no = (int) ($dt / self::min);\n\t\t\t$res .= \" $min_no min\";\n\t\t\t$dt -= $min_no * self::min;\n\t\t}\n\t\t\n\t\tif( $dt >= self::sec ){\n\t\t\t$sec_no = (int) ($dt / self::sec);\n\t\t\t$ms_no = $dt - $sec_no * self::sec;\n\t\t\tif( $ms_no == 0 )\n\t\t\t\t$res .= \" $sec_no s\";\n\t\t\telse {\n\t\t\t\t$res .= \" $sec_no.\" . sprintf(\"%03d\", $ms_no) . \" s\";\n\t\t\t}\n\t\t} else if( $dt > 0 ){\n\t\t\t$res .= \" $dt ms\";\n\t\t}\n\t\t\n\t\tif( strlen($res) > 0 && $res[0] === ' ' )\n\t\t\t$res = substr($res, 1);\n\t\t\n\t\treturn $res;\n\t}",
"function time_diff($start) {\n return formatDateTimeDiff($start);\n}",
"public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }",
"private function getTime() {\n // Get the current microtime string as `microseconds seconds`\n $time_arr = microtime();\n // Add the two numbers together\n $time = array_sum(explode(' ', $time_arr));\n // Multiply by 1000 and return a 13 digit timestamp\n $microtime = $time * 1000;\n return substr($microtime, 0, 13); \n }",
"public function getDiff()\n {\n if (!$this->checkDiff()) {\n return '';\n }\n\n $original = $this->reconstructFromTokens($this->tokensOriginal);\n $mutated = $this->reconstructFromTokens($this->tokensMutated);\n\n return $this->getDiffProvider()->difference($original, $mutated);\n }",
"public function getTotalTimeLabelAttribute()\n {\n return Str::plural('hour', $this->total_time);\n }",
"function get_date_diff_str($diff, $diff_type='hrs', $return_form='short')\n{\n\t$diff_str = \"\";\n\tif($diff_type == 'hrs')\n\t{\n\t\t$difference_months = $diff/(24*30);\n\t\t$months = floor($diff/(24*30));\n\t\t$days = floor(($difference_months - $months)*30);\n\t\t$hours = floor(((($difference_months - $months)*30) - $days)*24);\n\t\t\n\t\t$end = \"\";\n\t\tif($months > 0)\n\t\t{\n\t\t\t#Just show greater than if you need the short form\n\t\t\t$diff_str .= ($return_form == 'short')? \">\": \"\";\n\t\t\t\n\t\t\t$end = ($months == 1)? \"\": \"s\";\n\t\t\t$diff_str .= $months.\"month\".$end.\" \";\n\t\t}\n\t\tif($days > 0 && (($return_form == 'short' && empty($months)) || $return_form != 'short'))\n\t\t{\n\t\t\t$end = ($days == 1)? \"\": \"s\";\n\t\t\t$diff_str .= $days.\"day\".$end.\" \";\n\t\t}\n\t\tif($hours > 0 && (($return_form == 'short' && empty($months)) || $return_form != 'short'))\n\t\t{\n\t\t\t$end = ($hours == 1)? \"\": \"s\";\n\t\t\t$diff_str .= $hours.\"hr\".$end.\" \";\n\t\t}\n\t}\n\t\n\treturn $diff_str;\n}",
"public function time() {\n return date('j F Y, H:i', $this->time_changed); // 12 October 2010, 09:14\n // return date('j F Y, h:ia', $this->time_changed); // 12 October 2010, 09:14am\n }",
"public function time() {\n return $this->returnCommand(['TIME'], null, null, ResponseParser::PARSE_TIME);\n }",
"public function getCreatedTimeAgo() {\n $timeStamp = $this->getCreatedTime('U');\n $elapsed = time() - $timeStamp;\n \n if ($elapsed < 1)\n return 'just now';\n\n $lengths = array( 12 * 30 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'minute',\n 1 => 'second');\n\n foreach ($lengths as $secs => $str)\n {\n $d = $elapsed / $secs;\n if ($d >= 1)\n {\n $r = round($d);\n return $r . ' ' . $str . ($r > 1 ? 's' : '') . ' ago';\n }\n }\n }",
"private function _time_elapsed_string($ptime) \n\t{\n\t\t$year \t\t= lang('period_year');\n\t\t$month \t\t= lang('period_month');\n\t\t$day \t\t= lang('period_day');\n\t\t$hour \t\t= lang('period_hour');\n\t\t$min \t\t= lang('period_min');\n\t\t$sec \t\t= lang('period_sec');\n\t\t$postfix \t= lang('period_postfix');\n\t\t$ago \t\t= lang('period_ago');\n\n\t\t$etime = $ptime;\n\n\t\tif ($etime < 1) return lang('period_now');\n\n\n\t\t$a = array( 12 * 30 * 24 * 60 * 60 \t=> $year,\n\t\t\t\t\t 30 * 24 * 60 * 60 => $month,\n\t\t\t\t\t 24 * 60 * 60 => $day,\n\t\t\t\t\t 60 * 60 => $hour,\n\t\t\t\t\t 60 => $min,\n\t\t\t\t\t 1 => $sec );\n\n\t\t foreach ($a as $secs => $str)\n\t\t {\n\t\t\t $d = $etime / $secs;\n\n\t\t\t if ($d >= 1)\n\t\t\t {\n\t\t\t\tif($secs == 60)\n\t\t\t\t{\n\t\t\t\t\t$str = $min;\n\t\t\t\t}\n\n\t\t\t\t$r = round($d);\n\t\t\t\treturn $r . ' ' . $str . ($r > 1 ? $postfix : ' ') . ' ' . $ago;\n\t\t\t}\n\t\t }\n\t}",
"function getHtmlTime(){\r\n\treturn('Página generada en <b>'.(time() - $_SERVER['REQUEST_TIME']) .'</b> segundos');\r\n}",
"public function diff()\n {\n return trim(implode(\"\\n\", $this->git('diff')));\n }",
"public function getCurrentTimeDifference($time_record, $unit = 'm');",
"public function getCurrentTimeDifference($time_record, $unit = 'm');",
"function getTimeDuration();",
"public function duration()\n\t{\n\t\t$dif = $this->runEnd->difference( $this->runStart );\n\n\t\t$minutes = (int) $dif->getMinutes( true );\n\t\t$seconds = $dif->getSeconds( true );\n\n\t\t// Since $seconds includes the minutes, calc the extra\n\t\t$seconds = $seconds - ( $minutes * 60 );\n\n\t\treturn str_pad( (string) $minutes, 2, '0', STR_PAD_LEFT ) . ':' . str_pad( (string) $seconds, 2, '0', STR_PAD_LEFT );\n\t}",
"public static function show($time)\n{\n\t$t=new Time($time);return$t->humanFriendly();\n}",
"function formattime_ago($time) {\n\t$period = $GLOBALS['i18']['time_period'];\n\t$periods = $GLOBALS['i18']['time_periods'];\n\t$lengths = array(\"60\",\"60\",\"24\",\"7\",\"4.35\",\"12\",\"10\");\n\n\t$now = time();\n\t$difference = $now - $time;\n\t$tense = $GLOBALS['i18']['ago'];\n\n\tfor($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {\n\t\t$difference /= $lengths[$j];\n\t}\n\t$difference = round($difference);\n\t\n\tif($difference > 1)\n\t\t$period_lbl = $periods[$j];\n\telse\n\t\t$period_lbl = $period[$j];\n\t\t\n\treturn str_replace('%', $difference.\" \".$period_lbl, $tense);\n}",
"public function formatShort()\n {\n switch (true) {\n case $this->seconds < self::TO_MINUTE:\n return sprintf('%d s', $this->seconds);\n case $this->seconds < self::TO_HOUR:\n return sprintf('%d min', $this->toMinutes());\n case $this->seconds < self::TO_DAY:\n return sprintf('%d h', $this->toHours());\n default:\n return sprintf('%d d', $this->toDays());\n }\n }",
"function time_calc($up_time)\n {\n // time is of the form YYYY-MM-DD HH:MM:SS.MILISEC\n $x = explode(' ', $up_time);\n $y = explode('-', $x[0]);\n $z = explode(':', $x[1]);\n\n // condition for year\n if(((int)date('Y') - (int)$y[0]) > 0)\n {\n $temp = ((int)date('Y') - (int)$y[0]);\n $temp = $temp.\" years ago\";\n return($temp);\n }\n else if(((int)date('m') - (int)$y[1]) > 0)\n {\n $temp = ((int)date('m') - (int)$y[1]);\n $temp = $temp.\" months ago\";\n return($temp);\n }\n else if(((int)date('d') - (int)$y[2]) > 0)\n {\n $temp = ((int)date('d') - (int)$y[2]);\n $temp = $temp.\" days ago\";\n return($temp);\n }\n else if(((int)date('H') - (int)$z[0]) > 0)\n {\n $temp = ((int)date('H') - (int)$z[0]);\n $temp = $temp.\" hrs ago\";\n return($temp);\n }\n else if(((int)date('i') - (int)$z[1]) > 0)\n {\n $temp = ((int)date('i') - (int)$z[1]);\n $temp = $temp.\" mins ago\";\n return($temp);\n }\n }",
"public static function renderTime($time)\n {\n return floor($time / 60) . \" min \" . $time % 60 . \" secondes\";\n }",
"public function getTimeCodeString(): string\n {\n return $this->start.' --> '.$this->stop;\n }",
"public function formatAsString()\n {\n return $this->formatTimeAsString(\n $this->value,\n $this->nanoSeconds\n );\n }",
"public function timeFormat();",
"function cal_times($times){\n\t\t$diffTime = time()-strtotime($times);\n\t\t//echo $diffTime; exit();\n\t\tif($diffTime>31104000){\n\n\t\t\t$time = ceil($diffTime/31104000);\n\n\t\t\treturn $time.' year ago';\n\n\t\t}elseif($diffTime>2492000){\n\n\t\t\t$time = ceil($diffTime/2492000);\n\n\t\t\treturn $time.' months ago';\n\n\t\t}elseif($diffTime>86400){\n\n\t\t\t$time = ceil($diffTime/86400);\n\n\t\t\treturn $time.' days ago';\n\n\t\t}elseif($diffTime>3600){\n\n\t\t\t$time = ceil($diffTime/3600);\n\n\t\t\treturn $time.' hours ago';\n\n\t\t}elseif($diffTime>60){\n\n\t\t\t$time = ceil($diffTime/60);\n\n\t\t\treturn $time.' minutes ago';\n\n\t\t}else{\n\n\t\t\treturn $diffTime.' second ago';\n\n\t\t}\n\n\t}",
"function ago($time) {\n $timediff=time()-$time;\n $days=intval($timediff/86400);\n $remain=$timediff%86400;\n $hours=intval($remain/3600);\n $remain=$remain%3600;\n $mins=intval($remain/60);\n $secs=$remain%60;\n\n if ($secs>=0) $timestring = $secs.\"s\";//\"0m\".\n if ($mins>0) $timestring = $mins.\"m\";//.$secs.\"s\";\n if ($hours>0) $timestring = $hours.\"h\";//.$mins.\"m\";\n if ($days>0) $timestring = $days.\"d\";//.$hours.\"h\";\n\n return $timestring;\n}",
"protected function getTimeDifference()\n {\n // Create temp file\n $localPath = tempnam(sys_get_temp_dir(), 'test');\n\n // Count time difference\n $diff = $this->writeTempFile($localPath);\n\n // Remove local temp file\n unlink($localPath);\n\n return $diff;\n }",
"public function getTiempoTranscurrido()\r\n {\r\n $fecha1 = new DateTime($this->fechaDeInicio);\r\n $fecha2 = new DateTime(date(\"Y-m-d H:i:s\")); //fecha de cierre\r\n $intervalo = $fecha1->diff($fecha2); // differencia\r\n return $intervalo->format(\"%s\");\r\n }",
"public function getMessageWithComparisonDiff()\n {\n $previous = $this;\n\n while($previous = $previous->getPrevious()) {\n if ($previous instanceof \\SebastianBergmann\\Comparator\\ComparisonFailure) {\n return trim($this->getMessage() . \"\\n\" . $previous->getDiff());\n }\n }\n\n return $this->getMessage();\n }",
"public function getTime() {\n return $this->time;\n }",
"public function getCreatedForHumans() : string{\n return $this->created_at->diffForHumans(now());\n }",
"public function getTime()\n {\n return $this->data['fields']['time'];\n }",
"public function getTime()\n {\n return $this->get(self::TIME);\n }",
"public function getTime()\n {\n $time = 0;\n foreach ($this->data['views'] as $view) {\n $time += (float) $view['time'];\n }\n\n return $time;\n }",
"protected function time()\n {\n $time = microtime();\n $time = explode(' ', $time);\n $time = $time[1] + $time[0];\n return $time;\n }",
"public function getTime()\n {\n return $this->values[\"time\"];\n }",
"private function formatTime(int $timerRef = null): string\n {\n $timeTaken = $this->getDuration($timerRef);\n return !is_null($timeTaken) ? \" ($timeTaken)\" : '';\n }",
"protected function getTotalTime()\n {\n return (string) round(array_sum(array_column($this->pdo->getLog(), 'time')), 4);\n }",
"private static function prettyFormat($difference, $unit)\n {\n $helper = Mage::helper('yanws');\n // $prepend is added to the start of the string if the supplied\n // difference is greater than 0, and $append if less than\n $prepend = ($difference < 0) ? $helper->__('In ') : '';\n $append = ($difference > 0) ? $helper->__(' ago') : '';\n $difference = floor(abs($difference));\n // If difference is plural, add an 's' to $unit\n if ($difference > 1) {\n $unit = $unit . 's';\n }\n $unit = $helper->__($unit);\n return sprintf('%s%d %s%s', $prepend, $difference, $unit, $append);\n }",
"public function diffTime($interval_in_seconds) {\n $d1 = new DateTime();\n $d2 = new DateTime();\n $d2->add(new DateInterval('PT'.($interval_in_seconds).'S'));\n $difftime = \"\";\n foreach ($d2->diff($d1) as $t => $v) {\n if ($v>0) {\n $difftime = $v.\" \".$this->container->translations['diff_time_'.$t.($v==1?'1':'')];\n break;\n }\n }\n return $difftime ? $difftime : $this->container->translations['diff_time_now'];\n }",
"public function getTiming()\n {\n return $this->timing;\n }",
"static function time_elapsed_string($datetime, $full = false) {\n\t\t $now = new DateTime;\n\t\t $ago = new DateTime($datetime);\n\t\t $diff = $now->diff($ago);\n\n\t\t $diff->w = floor($diff->d / 7);\n\t\t $diff->d -= $diff->w * 7;\n\n\t\t $string = array(\n\t\t 'y' => 'year',\n\t\t 'm' => 'month',\n\t\t 'w' => 'week',\n\t\t 'd' => 'day',\n\t\t 'h' => 'hour',\n\t\t 'i' => 'minute',\n\t\t 's' => 'second',\n\t\t );\n\t\t foreach ($string as $k => &$v) {\n\t\t if ($diff->$k) {\n\t\t $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');\n\t\t } else {\n\t\t unset($string[$k]);\n\t\t }\n\t\t }\n\n\t\t if (!$full) $string = array_slice($string, 0, 1);\n\t\t return $string ? implode(', ', $string) . ' ago' : 'just now';\n\t\t}",
"public function createdHuman(): ?string\n {\n $created = $this->created();\n if ($created === null) {\n return null;\n }\n\n $seconds = time() - $this->created();\n $hours = (int)floor($seconds / 3600);\n $minutes = (int)round(($seconds / 60) % 60);\n\n if ($seconds < 60) {\n return $seconds . (($seconds === 1)? ' second' : ' seconds');\n }\n\n $string = '';\n if ($seconds >= 3600) {\n $string .= $hours . (($hours === 1)? ' hour and ' : ' hours and ');\n }\n\n return $string . $minutes . (($minutes === 1)? ' minute' : ' minutes');\n }",
"function get_time_description($seconds)\r\n{\r\n $weeks = (int) ($seconds / 604800);\r\n $weeks_p = $weeks > 1 ? 'weeks' : 'week';\r\n $days=(int)($seconds/86400);\r\n $days_p = $days > 1 ? 'days' : 'day';\r\n $hours = (int)(($seconds-($days*86400))/3600);\r\n $mins = (int)(($seconds-$days*86400-$hours*3600)/60);\r\n $secs = (int)($seconds - ($days*86400)-($hours*3600)-($mins*60));\r\n\r\n //build a string\r\n $ret = \"$secs sec\";\r\n if ($mins > 0 && $sec >= 0)\r\n $ret = \"$mins min $ret\";\r\n if ($hours > 0 && $min >= 0 && sec >=0)\r\n $ret = \"$hours hours $ret\";\r\n if ($days > 0 && $hours >= 0 && $min >= 0 && sec >= 0)\r\n $ret = \"$days $days_p $ret\";\r\n\r\n return $ret;\r\n}",
"static function timeElapsed($timestamp)\n {\n $d1 = new DateTime($timestamp);\n $d2 = new DateTime();\n $interval = $d1->diff($d2);\n $totalDiff = abs(time() - strtotime($timestamp)); // diff in seconds\n if ($totalDiff < 60) return \"seconds ago\";\n if ($totalDiff >= 60 && $totalDiff < 3600) return $interval->i . \" minutes ago\";\n if ($totalDiff >= 3600 && $totalDiff < 86400) return $interval->h . \" hours ago\";\n if ($totalDiff >= 86400) return $interval->d . \" days ago\";\n }",
"public function getTime()\n {\n return $this->time;\n }",
"public function getTime()\n {\n return $this->time;\n }"
] | [
"0.67907834",
"0.6756366",
"0.65380967",
"0.65217346",
"0.6517339",
"0.64892644",
"0.647118",
"0.6467001",
"0.64599043",
"0.64472467",
"0.64437413",
"0.6417667",
"0.64136606",
"0.63823646",
"0.6346818",
"0.63065225",
"0.62692624",
"0.6263801",
"0.6223458",
"0.6186265",
"0.6175898",
"0.6168922",
"0.6123829",
"0.6108341",
"0.61035514",
"0.6080648",
"0.6074916",
"0.6050505",
"0.60331744",
"0.6008852",
"0.5983253",
"0.59757614",
"0.5972805",
"0.5965663",
"0.59587",
"0.59550226",
"0.590949",
"0.5896186",
"0.5895656",
"0.589041",
"0.5889987",
"0.5889095",
"0.5883248",
"0.5877487",
"0.5846437",
"0.58453906",
"0.5839718",
"0.58383775",
"0.58354276",
"0.5829368",
"0.5828117",
"0.58262116",
"0.58215994",
"0.5812051",
"0.5791921",
"0.57762694",
"0.5771717",
"0.5756611",
"0.5745972",
"0.57400167",
"0.5738833",
"0.5737452",
"0.57350415",
"0.5734907",
"0.5734178",
"0.5727022",
"0.571694",
"0.571694",
"0.57166225",
"0.57053214",
"0.5682658",
"0.5661228",
"0.56472063",
"0.5637309",
"0.5636471",
"0.56260663",
"0.56229615",
"0.5620342",
"0.5607933",
"0.56006926",
"0.5597375",
"0.5595238",
"0.559083",
"0.55900156",
"0.55878145",
"0.55869114",
"0.55863225",
"0.5580072",
"0.5572575",
"0.557242",
"0.5571354",
"0.5571178",
"0.5570738",
"0.55693763",
"0.55630517",
"0.5553597",
"0.5548439",
"0.55414605",
"0.5541239",
"0.55407834",
"0.55407834"
] | 0.0 | -1 |
Return seconds difference between two dates. | public static function secondsDiff($periodStartDate, $periodEndDate)
{
/**
* @var \DateTime $fromDate
* @var \DateTime $toDate
*/
// @codeCoverageIgnoreStart
$dateRange = new DateRange($periodStartDate, $periodEndDate);
$fromDate = $dateRange->getRangeBegin();
$toDate = $dateRange->getRangeEnd();
// @codeCoverageIgnoreEnd
$diff = $fromDate->diff($toDate);
// @codeCoverageIgnoreStart
if ($diff === false) {
throw new \RuntimeException('Unexpected runtime error.');
}
// @codeCoverageIgnoreEnd
if ($diff->y > 0 || $diff->m > 0) {
throw new \OutOfRangeException('Date diff may not exceed one month.');
}
$seconds = 0;
if ($diff->d >= 1) {
$seconds += $diff->d * 24 * 60 * 60;
}
if ($diff->h >= 1) {
$seconds += $diff->h * 60 * 60;
}
if ($diff->i >= 1) {
$seconds += $diff->i * 60;
}
if ($diff->s >= 1) {
$seconds += $diff->s;
}
return $diff->invert === 0 ? $seconds : -$seconds;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function diffInSeconds ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\treturn $diff;\n\t}",
"public static function diff(Date $a, Date $b) {\n return new TimeSpan($a->getTime() - $b->getTime());\n }",
"function dateDiff($date1, $date2){\n\t $date1_ts = strtotime($date1);\n\t $date2_ts = strtotime($date2);\n\t $diff = $date2_ts - $date1_ts;\n\t return round($diff / 86400);\n}",
"function dateDiff($date1, $date2) \n {\n $diff = strtotime($date2) - strtotime($date1); \n // 1 day = 24 hours \n // 24 * 60 * 60 = 86400 seconds \n return ($diff/ 86400); \n }",
"public static function dateDiff($date1, $date2) {\n\t\t// $datetime2 = new DateTime ( $date2 );\n\t\t// $interval = $datetime1->diff ( $datetime2 );\n\t\t// return $interval->format ( '%a' );\n\t\t$unixOriginalDate = strtotime ( $date1 );\n\t\t$unixNowDate = strtotime ( $date2 );\n\t\t$difference = $unixNowDate - $unixOriginalDate;\n\t\t$days = ( int ) ($difference / 86400);\n\t\t$hours = ( int ) ($difference / 3600);\n\t\t$minutes = ( int ) ($difference / 60);\n\t\t$seconds = $difference;\n\t\treturn $days;\n\t}",
"public function getdifftime($date1,$date2)\n {\n\n\n\n \n\n// Declare and define two dates \n$diff = abs($date1->getTimestamp()-$date2->getTimestamp());\n\n \n \n// To get the year divide the resultant date into \n// total seconds in a year (365*60*60*24) \n$years = floor($diff / (365*60*60*24)); \n \n \n// To get the month, subtract it with years and \n// divide the resultant date into \n// total seconds in a month (30*60*60*24) \n$months = floor(($diff - $years * 365*60*60*24) \n / (30*60*60*24)); \n \n \n// To get the day, subtract it with years and \n// months and divide the resultant date into \n// total seconds in a days (60*60*24) \n$days = floor(($diff - $years * 365*60*60*24 - \n $months*30*60*60*24)/ (60*60*24)); \n \n \n// To get the hour, subtract it with years, \n// months & seconds and divide the resultant \n// date into total seconds in a hours (60*60) \n$hours = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24) \n / (60*60)); \n \n \n// To get the minutes, subtract it with years, \n// months, seconds and hours and divide the \n// resultant date into total seconds i.e. 60 \n$minutes = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60)/ 60); \n \n \n// To get the minutes, subtract it with years, \n// months, seconds, hours and minutes \n$seconds = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60 - $minutes*60)); \n \nreturn $hours;\n }",
"static function getDateDifference($date1, $date2) {\n $date1 = strtotime($date1);\n $date2 = strtotime($date2);\n $datediff = $date1 - $date2;\n return floor($datediff / (60 * 60 * 24));\n }",
"function dateDiff($start, $end) {\n\t\n $start_ts = strtotime($start);\n $end_ts = strtotime($end);\n $diff = $end_ts - $start_ts;\n return round($diff / 86400);\n}",
"function diffInDays ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\t$dayInSecs = 60 * 60 * 24;\n\t\treturn ($diff/$dayInSecs);\n\t}",
"function dateDiff ($d1, $d2) {\n return round(abs(strtotime($d1) - strtotime($d2))/86400);\n\n}",
"function diffDate($date1 ,$date2){\n\t$diff = abs(strtotime($date2) - strtotime($date1));\n\t$years = floor($diff / (365*60*60*24));\n\t$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));\n\t$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));\n\t$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60));\n\t$minuts = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60);\n\t$seconds = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minuts*60));\n\t$result [0]= $years;\n\t$result [1]= $months;\n\t$result [2]= $days;\n\t$result [3]= $hours;\n\t$result [4]= $minuts;\n\t$result [5]= $seconds;\n\treturn $result;\n}",
"function dateDiff($dt1, $dt2, $split) \r\n{\r\n\t$date1 = (strtotime($dt1) != -1) ? strtotime($dt1) : $dt1;\r\n\t$date2 = (strtotime($dt2) != -1) ? strtotime($dt2) : $dt2;\r\n\t$dtDiff = $date1 - $date2;\r\n\t$totalDays = intval($dtDiff/(24*60*60));\r\n\t\r\n\t$totalSecs = $dtDiff-($totalDays*24*60*60); // this doesnt look at days!?! .. so check $dif['d'] == 0 to see if its the same day.\r\n\t$dif['totalSecs'] = $totalSecs; // not including any days in the total seconds. you would think 1 day difference with identical minutes/seconds should equal == 86,400 seconds, but actually this var will say zero.\r\n\t$dif['h'] = $h = intval($totalSecs/(60*60));\r\n\t$dif['m'] = $m = intval(($totalSecs-($h*60*60))/60);\r\n\t$dif['s'] = $totalSecs-($h*60*60)-($m*60);\r\n\t\r\n\t// use this if you want the TOTAL seconds between two dates. above, the $dif['totalSecs'] could be the same if you compare \r\n\t// two different days...\r\n\t$dif['totalSecs_including_days'] = $totalSecs + ($totalDays*24*60*60); // 86400seconds in one full day..ie 24 hours. ie 1440 mins.\r\n\t\r\n // set up array as necessary\r\n \tswitch($split) \r\n\t{\r\n\t\tcase 'yw': # split years-weeks-days\r\n\t\t\t$dif['y'] = $y = intval($totalDays/365);\r\n\t\t\t$dif['w'] = $w = intval(($totalDays-($y*365))/7);\r\n\t\t\t$dif['d'] = $totalDays-($y*365)-($w*7);\r\n\t\t\tbreak;\r\n\t\tcase 'y': # split years-days\r\n\t\t\t$dif['y'] = $y = intval($totalDays/365);\r\n\t\t\t$dif['d'] = $totalDays-($y*365);\r\n\t\t\tbreak;\r\n\t\tcase 'w': # split weeks-days\r\n\t\t\t$dif['w'] = $w = intval($totalDays/7);\r\n\t\t\t$dif['d'] = $totalDays-($w*7);\r\n\t\t\tbreak;\r\n\t\tcase 'd': # don't split -- total days\r\n\t\t\t$dif['d'] = $totalDays;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tdie(\"Error in dateDiff(). Unrecognized \\$split parameter. Valid values are 'yw', 'y', 'w', 'd'. Default is 'yw'.\");\r\n }\r\n return $dif;\r\n}",
"function dateDiff($t1, $t2) {\r\n\t\t$t1 = strtotime($t1);\r\n\t\t$t2 = strtotime($t1);\r\n\t\t$delta_T = ($t2 - $t1);\r\n\t\t$day = round(($delta_T % 604800) / 86400); \r\n\t\t$hours = round((($delta_T % 604800) % 86400) / 3600); \r\n\t\t$minutes = round(((($delta_T % 604800) % 86400) % 3600) / 60); \r\n\t\t$sec = round((((($delta_T % 604800) % 86400) % 3600) % 60));\r\n\r\n\t\treturn \"$day days $hours hours $minutes minutes $sec secs\";\t \r\n }",
"public function getTotalDifferenceInDays();",
"protected function toSeconds(DateInterval $diff)\n {\n if ($diff->m > 0 || $diff->y > 0) {\n throw new Exception('I don\\'t handle reminders larger than a month.');\n }\n $seconds = $diff->d * 86400\n + $diff->h * 3600\n + $diff->i * 60\n + $diff->s;\n return $seconds;\n }",
"function dateDiffInDays($date1, $date2) \n\t{\n\t\t$diff = strtotime($date2) - strtotime($date1); \n\t\t \n\t\t// 1 day = 24 hours \n\t\t// 24 * 60 * 60 = 86400 seconds \n\t\treturn abs(round($diff / 86400)); \n\t}",
"public static function daysPassed($date1, $date2)\r\n\t{\r\n\t\t$timestamp1 = strtotime($date1);\r\n\t\t$timestamp2 = strtotime($date2);\r\n\t\t$datediff = $timestamp1 - $timestamp2;\r\n\t\treturn floor($datediff/(60*60*24));\r\n }",
"public function getNumberOfDaysBetweenTwoDates() {\n\t return str_replace(\"-\",\"\", $this->calculateNumberOfDays());\n\t}",
"public function duration()\n {\n $start_date = (int) $this->start_date;\n $end_date = (int) $this->end_date;\n\n $duration = ($end_date - $start_date) / 1000;\n\n return $duration;\n }",
"function diff_two_dates2($startdate,$enddate){\n $date1 = strtotime($startdate); \n $date2 = strtotime($enddate); \n \n // Formulate the Difference between two dates \n $diff = abs($date2 - $date1); \n \n \n // To get the year divide the resultant date into \n // total seconds in a year (365*60*60*24) \n $years = floor($diff / (365*60*60*24)); \n \n \n // To get the month, subtract it with years and \n // divide the resultant date into \n // total seconds in a month (30*60*60*24) \n $months = floor(($diff - $years * 365*60*60*24) \n / (30*60*60*24)); \n \n \n // To get the day, subtract it with years and \n // months and divide the resultant date into \n // total seconds in a days (60*60*24) \n $days = floor(($diff - $years * 365*60*60*24 - \n $months*30*60*60*24)/ (60*60*24)); \n \n \n // To get the hour, subtract it with years, \n // months & seconds and divide the resultant \n // date into total seconds in a hours (60*60) \n $hours = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24) \n / (60*60)); \n \n \n // To get the minutes, subtract it with years, \n // months, seconds and hours and divide the \n // resultant date into total seconds i.e. 60 \n $minutes = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60)/ 60); \n \n \n // To get the minutes, subtract it with years, \n // months, seconds, hours and minutes \n $seconds = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60 - $minutes*60)); \n \n // Print the result \n return array(\n 'seconds'=>$seconds,\n 'minutes'=>$minutes,\n 'hours'=>$hours,\n 'days'=>$days,\n 'months'=>$months,\n 'years'=>$years\n );\n}",
"public function getSpentSeconds()\n {\n $diff = $this->dateStarted->diff(new \\DateTime('now', new \\DateTimeZone('UTC')));\n $seconds = ($diff->y * TimeSpent::YEAR)\n + ($diff->m * TimeSpent::MONTH)\n + ($diff->d * TimeSpent::DAY)\n + ($diff->h * TimeSpent::HOUR)\n + ($diff->i * TimeSpent::MINUTE)\n + $diff->s;\n\n return $seconds;\n }",
"function date_diff2($date1, $date2) {\n\tif(empty($date2)) return array(\"d\"=>1); // considering only [d] so if date 2 is empty then return 1\n\n $s = strtotime($date2)-strtotime($date1);\n $d = intval($s/86400); \n $s -= $d*86400;\n $h = intval($s/3600);\n $s -= $h*3600;\n $m = intval($s/60); \n $s -= $m*60;\n return array(\"d\"=>$d,\"h\"=>$h,\"m\"=>$m,\"s\"=>$s);\n}",
"function DayDiff($StartDate, $StopDate)\n{\n // to the approriate days using 86400 seconds for a day\n //\n return (date('U', strtotime($StopDate)) - date('U', strtotime($StartDate))) / 86400; //seconds a day\n}",
"public static function getDurationInSeconds($dateTime1, $dateTime2) {\n\t\t$ri = 0;\n\t\t$dateTime1Seconds = qdat::getAbsoluteSeconds($dateTime1);\n\t\t$dateTime2Seconds = qdat::getAbsoluteSeconds($dateTime2);\n\t\t$ri = $dateTime1Seconds - $dateTime2Seconds;\n\t\t$ri = abs($ri);\n\t\treturn $ri;\n\t}",
"function date_diff_between_ts($time1, $time2, $what='d') {\n\t$result = 0;\n\n\tif($time2 > $time1) {\n\t\t$nseconds = $time2 - $time1;\n\t} else {\n\t\t$nseconds = $time1 - $time2;\n\t}\n\n\tif($what == 'd') {\t\t// Days\n\t\t$result = (float)($nseconds / 86400);\n\t} elseif($what == 'w') {\t// Weeks\n\t\t$result = (float)($nseconds / 604800);\n\t} elseif($what == 'm') {\t// Months\n\t\tif($time1 > $time2) {\n\t\t\t$temp = $time1;\n\t\t\t$time1 = $time2;\n\t\t\t$time2 = $temp;\n\t\t}\n\n\t\t$day1 = uwa_date('j', $time1);\n\t\t$mon1 = uwa_date('n', $time1);\n\t\t$year1 = uwa_date('Y', $time1);\n\t\t$day2 = uwa_date('j', $time2);\n\t\t$mon2 = uwa_date('n', $time2);\n\t\t$year2 = uwa_date('Y', $time2);\n\n\t\tif($day1 > $day2) {\n\t\t\t$result = (($year2 - $year1) * 12) + ($mon2 - $mon1 - 1);\n\t\t} else {\n\t\t\t$result = (($year2 - $year1) * 12) + ($mon2 - $mon1);\n\t\t}\n\t} elseif($what == 'y') {\t// Years\n\t\t$weeks = (float)($nseconds / 604800);\n\t\t$result = $weeks / 52;\n\t} elseif($what == 'h') {\t// Hours\n\t\t$result = (float)($nseconds / 3600);\n\t} elseif($what == 'i') {\t// Minutes\n\t\t$result = (int)($nseconds / 60);\n\t}\n\n\treturn $result;\n}",
"function mdiff($date1, $date2){\r\n $diff = abs(strtotime($date1->format('d-m-Y H:i:s.u'))-strtotime($date2->format('d-m-Y H:i:s.u')));\r\n\r\n //Creates variables for the microseconds of date1 and date2\r\n $micro1 = $date1->format(\"u\");\r\n $micro2 = $date2->format(\"u\");\r\n\r\n //Difference between these micro seconds:\r\n $diffmicro = $micro1 - $micro2;\r\n\r\n list($sec,$micro) = explode('.',((($diff) * 1000000) + $diffmicro )/1000000);\r\n\r\n //Creates the variable that will hold the seconds (?):\r\n $difference = $sec . \".\" . str_pad($micro,6,'0');\r\n\r\n return $difference;\r\n }",
"function date_diff($d1, $d2){\n\t$d1 = (is_string($d1) ? strtotime($d1) : $d1);\n\t$d2 = (is_string($d2) ? strtotime($d2) : $d2);\n\n\t$diff_secs = abs($d1 - $d2);\n\t$base_year = min(date(\"Y\", $d1), date(\"Y\", $d2));\n\n\t$diff = mktime(0, 0, $diff_secs, 1, 1, $base_year);\n\t$diffArray = array(\n\t\t\"years\" => date(\"Y\", $diff) - $base_year,\n\t\t\"months_total\" => (date(\"Y\", $diff) - $base_year) * 12 + date(\"n\", $diff) - 1,\n\t\t\"months\" => date(\"n\", $diff) - 1,\n\t\t\"days_total\" => floor($diff_secs / (3600 * 24)),\n\t\t\"days\" => date(\"j\", $diff) - 1,\n\t\t\"hours_total\" => floor($diff_secs / 3600),\n\t\t\"hours\" => date(\"G\", $diff),\n\t\t\"minutes_total\" => floor($diff_secs / 60),\n\t\t\"minutes\" => (int) date(\"i\", $diff),\n\t\t\"seconds_total\" => $diff_secs,\n\t\t\"seconds\" => (int) date(\"s\", $diff)\n\t);\n\tif($diffArray['days'] > 0){\n\t\tif($diffArray['days'] == 1){\n\t\t\t$days = '1 day';\n\t\t}else{\n\t\t\t$days = $diffArray['days'] . ' days';\n\t\t}\n\t\treturn $days . ' and ' . $diffArray['hours'] . ' hours ago';\n\t}else if($diffArray['hours'] > 0){\n\t\tif($diffArray['hours'] == 1){\n\t\t\t$hours = '1 hour';\n\t\t}else{\n\t\t\t$hours = $diffArray['hours'] . ' hours';\n\t\t}\n\t\treturn $hours . ' and ' . $diffArray['minutes'] . ' minutes ago';\n\t}else if($diffArray['minutes'] > 0){\n\t\tif($diffArray['minutes'] == 1){\n\t\t\t$minutes = '1 minute';\n\t\t}else{\n\t\t\t$minutes = $diffArray['minutes'] . ' minutes';\n\t\t}\n\t\treturn $minutes . ' and ' . $diffArray['seconds'] . ' seconds ago';\n\t}else{\n\t\treturn 'Less than a minute ago';\n\t}\n}",
"public function getDifferenceInDays();",
"public function getTotalSeconds()\n\t{\n\t\treturn ($this->s)\n\t\t+ ($this->i * 60)\n\t\t+ ($this->h * 60 * 60)\n\t\t+ ($this->d * 60 * 60 * 24)\n\t\t+ ($this->m * 60 * 60 * 24 * 30) \t// Month - usually days count 30\n\t\t+ ($this->y * 60 * 60 * 24 * 365);\t// Year - usually days count 365\n\t}",
"function elapsedSeconds() {\n if (null === $this->startMicrotime) {\n throw new InvalidArgumentException(\"Start time was not marked\");\n }\n if (null === $this->endMicrotime) {\n // Not stopped so return time from start to now\n return microtime(true) - $this->startMicrotime;\n }\n // Stopped so show total elapsed time between start and stop\n return $this->endMicrotime - $this->startMicrotime;\n }",
"public static function difference($time1, $time2) {\n\t\treturn self::toUnix($time1) - self::toUnix($time2);\n\t}",
"function dateDiffDay ($d1, $d2) {\n// Return the number of days between the two dates:\n\n return round(abs(strtotime($d1)-strtotime($d2))/(DAY_VAL));\n\n}",
"function GetDiffDays($dt1, $dt2){\n \n list($dia1, $mes1, $anio1) = explode( '/', $dt1); \n list($dia2, $mes2, $anio2) = explode( '/', $dt2);\n \n //calculo timestam de las dos fechas \n $timestamp1 = mktime(0,0,0,$mes1,$dia1,$anio1); \n $timestamp2 = mktime(4,12,0,$mes2,$dia2,$anio2); \n\n //resto a una fecha la otra \n $segundos_diferencia = $timestamp1 - $timestamp2; \n //echo $segundos_diferencia; \n\n //convierto segundos en días \n $dias_diferencia = $segundos_diferencia / (60 * 60 * 24); \n\n //obtengo el valor absoulto de los días (quito el posible signo negativo) \n $dias_diferencia = abs($dias_diferencia); \n\n //quito los decimales a los días de diferencia \n $dias_diferencia = floor($dias_diferencia); \n\n return $dias_diferencia; \n}",
"public static function getDaysBetweenTwoDates($date1, $date2) {\n\t\t$date1Seconds =qdat::getAbsoluteSeconds($date1);\n\t\t$date2Seconds =qdat::getAbsoluteSeconds($date2);\n\t\t$totalSeconds = $date2Seconds - $date1Seconds;\n\t\t$daysDecimal = qdat::convertSecondsToDays($totalSeconds);\n\t\t$daysRounded = intval($daysDecimal);\n\t\treturn $daysRounded;\n\t}",
"function getdays($date1,$date2)\r\n {\r\n return round((strtotime($date2)-strtotime($date1))/(24*60*60),0);\r\n }",
"function dateDiffInDays($date11, $date22) \n {\n $diff = strtotime($date22) - strtotime($date11); \n \n // 1 day = 24 hours \n // 24 * 60 * 60 = 86400 seconds \n return abs(round($diff / 86400)); \n }",
"function dateDiffInDays($date11, $date22) \n {\n $diff = strtotime($date22) - strtotime($date11); \n \n // 1 day = 24 hours \n // 24 * 60 * 60 = 86400 seconds \n return abs(round($diff / 86400)); \n }",
"function date_diff($d1, $d2){\r\n\t//check higher timestamp and switch if neccessary\t\r\n\t$d1 = date_parse($d1);\r\n\t$d2 = date_parse($d2);\r\n\tif ($d1 < $d2){\r\n\t\t$temp = $d2;\r\n\t\t$d2 = $d1;\r\n\t\t$d1 = $temp;\r\n\t}\r\n\telse {\r\n\t\t$temp = $d1; //temp can be used for day count if required\r\n\t}\r\n\t//seconds\r\n\tif ($d1['second'] >= $d2['second']){\r\n\t\t$diff['second'] = $d1['second'] - $d2['second'];\r\n\t}\r\n\telse {\r\n\t\t$d1['minute']--;\r\n\t\t$diff['second'] = 60-$d2['second']+$d1['second'];\r\n\t}\r\n\t//minutes\r\n\tif ($d1['minute'] >= $d2['minute']){\r\n\t\t$diff['minute'] = $d1['minute'] - $d2['minute'];\r\n\t}\r\n\telse {\r\n\t\t$d1['hour']--;\r\n\t\t$diff['minute'] = 60-$d2['minute']+$d1['minute'];\r\n\t}\r\n\t//hours\r\n\tif ($d1['hour'] >= $d2['hour']){\r\n\t\t$diff['hour'] = $d1['hour'] - $d2['hour'];\r\n\t}\r\n\telse {\r\n\t\t$d1['day']--;\r\n\t\t$diff['hour'] = 24-$d2['hour']+$d1['hour'];\r\n\t}\r\n\t//days\r\n\tif ($d1['day'] >= $d2['day']){\r\n\t\t$diff['day'] = $d1['day'] - $d2['day'];\r\n\t}\r\n\telse {\r\n\t\t$d1['month']--;\r\n\t\t$diff['day'] = date(\"t\",$temp)-$d2['day']+$d1['day'];\r\n\t}\r\n\t//months\r\n\tif ($d1['month'] >= $d2['month']){\r\n\t\t$diff['month'] = $d1['month'] - $d2['month'];\r\n\t}\r\n\telse {\r\n\t\t$d1['year']--;\r\n\t\t$diff['month'] = 12-$d2['month']+$d1['month'];\r\n\t}\r\n\t//years\r\n\t$diff['year'] = $d1['year'] - $d2['year'];\r\n\t//return $diff; \r\n\t//return strtotime($diff);\r\n\t\r\n\treturn mktime($diff['hour'],$diff['minute'],$diff['second'],$diff['month'], $diff['day'], $diff['year']) - 943920000;\r\n\t\r\n\t\r\n}",
"function dateDiff($date1, $date2){\r\n $diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative\r\n $retour = array();\r\n \r\n $tmp = $diff;\r\n $retour['second'] = $tmp % 60;\r\n \r\n $tmp = floor( ($tmp - $retour['second']) /60 );\r\n $retour['minute'] = $tmp % 60;\r\n \r\n $tmp = floor( ($tmp - $retour['minute'])/60 );\r\n $retour['hour'] = $tmp % 24;\r\n \r\n $tmp = floor( ($tmp - $retour['hour']) /24 );\r\n $retour['day'] = $tmp;\r\n \r\n return $retour;\r\n }",
"function DiffBetweenDates($fechaI, $fechaF) {\r\n if ($fechaF == \"NOW\")\r\n $fechaF = date(USERDATE_READ);\r\n if ($fechaI == \"NOW\")\r\n $fechaI = date(USERDATE_READ);\r\n $seg_dif = strtotime(STRdate_format($fechaF, USERDATE_READ, \"Y-m-d H:i\")) - strtotime(STRdate_format($fechaI, USERDATE_READ, \"Y-m-d H:i\"));\r\n return round($seg_dif / 60, 0, PHP_ROUND_HALF_DOWN);\r\n}",
"private function calculateDifference()\n {\n $this->stampDifference = abs(strtotime($this->firstDate) - strtotime($this->secondDate));\n\n //all of the calculations get whole interval represented in a given scale\n $this->yearDifference = floor($this->stampDifference / (365 * 60 * 60 * 24));\n $this->monthDifference = floor($this->stampDifference / (30.41 * 60 * 60 * 24));\n $this->weekDifference = floor($this->stampDifference / (7 * 60 * 60 * 24));\n $this->dayDifference = floor($this->stampDifference / (60 * 60 * 24));\n $this->hourDifference = floor($this->stampDifference / (60 * 60));\n $this->minuteDifference = floor($this->stampDifference / (60));\n\n //Slightly Different Solution: All of the calculations altogether represent same interval\n //$this->yearDifference = floor($this->stampDifference / (365*60*60*24));\n //$this->monthDifference = floor(($this->stampDifference - $this->yearDifference * 365*60*60*24) / (30*60*60*24));\n //$this->dayDifference = floor(($this->stampDifference - $this->yearDifference * 365*60*60*24 - $this->monthDifference*30*60*60*24)/ (60*60*24));\n }",
"public function getSeconds() {\n $seconds = 0;\n foreach ($this->steps ?? [] as $step):\n $parser = explode(':', $step->getDuration());\n $seconds += (($parser[0] ?? 0) * 60 * 60) + (($parser[1] ?? 0) * 60) + $parser[2] ?? 0;\n endforeach;\n $this->seconds = $seconds;\n return $this->seconds;\n }",
"public function time_delta($in, $out)\n\t\t{\n\t\t\t$in = new DateTime($in);\n\t\t\t$out = new DateTime($out);\n\n\t\t\tif($in > $out) return -1;\n\n\t\t\t$delta = $in->diff($out);\n\n\t\t\t$seconds = $delta->days * 86400;\n\t\t\t$seconds += $delta->h * 3600;\n\t\t\t$seconds += $delta->i * 60;\n\t\t\t$seconds += $delta->s;\n\n\t\t\treturn $seconds;\n\t\t}",
"static public function dateDiff(Date $startDate, Date $endDate)\r\n\t{\r\n\t\t// Make a unix timestamp from start date\r\n\t\t$start = gmmktime(0, 0, 0, $startDate->_month, $startDate->_day, $startDate->_year);\r\n\t\t\r\n\t\t// Make a unix timestamp form the end date\r\n\t\t$end = gmmktime(0, 0, 0, $endDate->_month, $endDate->_day, $endDate->_year);\r\n\t\t\r\n\t\t// Perform the calculation and return result\r\n\t\treturn ($end - $start) / (60 * 60 * 24);\r\n\t}",
"public function seconds(): int {\n\t\treturn $this->duration;\n\t}",
"function count_days( $a, $b )\n {\n // First we need to break these dates into their constituent parts:\n $gd_a = getdate( $a );\n $gd_b = getdate( $b );\n\n // Now recreate these timestamps, based upon noon on each day\n // The specific time doesn't matter but it must be the same each day\n $a_new = mktime( 12, 0, 0, $gd_a['mon'], $gd_a['mday'], $gd_a['year'] );\n $b_new = mktime( 12, 0, 0, $gd_b['mon'], $gd_b['mday'], $gd_b['year'] );\n\n // Subtract these two numbers and divide by the number of seconds in a\n // day. Round the result since crossing over a daylight savings time\n // barrier will cause this time to be off by an hour or two.\n return round( abs( $a_new - $b_new ) / 86400 );\n }",
"function dateDiff($date1, $date2)\r\n{\r\n\t$diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative\r\n\t$retour = array();\r\n \r\n\t$tmp = $diff;\r\n\t$retour['second'] = $tmp % 60;\r\n \r\n\t$tmp = floor( ($tmp - $retour['second']) /60 );\r\n\t$retour['minute'] = $tmp % 60;\r\n \r\n\t$tmp = floor( ($tmp - $retour['minute'])/60 );\r\n\t$retour['hour'] = $tmp % 24;\r\n \r\n\t$tmp = floor( ($tmp - $retour['hour']) /24 );\r\n\t$retour['day'] = $tmp;\r\n \r\n\treturn $retour;\r\n}",
"function getElapsedSeconds() {\n\t\treturn $this->time;\n\t}",
"function difference($val1) {\n $date1 = strtotime($val1);\n $date2 = date('Y-m-d H:i:s');\n $diff = abs(strtotime($date2) - $date1);\n $years = floor($diff / (365 * 60 * 60 * 24));\n $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));\n $days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));\n $hours = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24) / (60 * 60));\n $minuts = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60) / 60);\n $seconds = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60 - $minuts * 60));\n $nowtime = strtotime(date(\"H:i:s\"));\n $endTime = strtotime(\"23:59:59\");\n if ($seconds >= 0 && $seconds <= 60 && $minuts == 0 && $hours == 0 && $days == 0 && $months == 0 && $years == 0) {\n $time = $seconds . \" Seconds\";\n //$minuts = $endTime - $nowtime;\n //$minuts = date(\"H:i:s\",$minuts);\n } elseif ($minuts == 0) {\n $minuts = $endTime - $nowtime;\n $minuts = date(\"H:i:s\", $minuts);\n }\n if ($days != '1') {\n $hours11 = $endTime - $nowtime;\n $hours11 = date(\"H\", $hours11);\n if ($hours11 > 0) {\n $hours11 = $hours11 . ' Hour';\n }\n $day = 'Days ' . $hours11;\n } else {\n $hours11 = $endTime - $nowtime;\n\n $hours11 = date(\"H\", $hours11);\n if ($hours11 > 0) {\n $hours11 = $hours11 . ' Hour';\n }\n\n $day = 'Day ' . $hours11;\n }\n if ($months != '' && $days != '') {\n $time = $months . \" Month & \" . $days . \" \" . $day;\n } elseif ($months != '') {\n $time = $months . \" Month\";\n } elseif ($days != '') {\n $time = $days . \" \" . $day;\n } elseif ($hours != '') {\n $time = $hours . \" Hour\";\n } elseif ($hours != '') {\n $time = $minuts . \" Minutes\";\n } else {\n $time = $seconds . \" Seconds\";\n }//echo $time;\t\n return $time;\n}",
"public function calculeDureVie($date1,$date2){\n //$datenow=strtotime(date(\"Y-m-d\"));\n // $date=selectDateStartCampagne();\n\n $diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative\n $retour = array();\n\n $tmp = $diff;\n $retour['second'] = $tmp % 60;\n\n $tmp = floor( ($tmp - $retour['second']) /60 );\n $retour['minute'] = $tmp % 60;\n\n $tmp = floor( ($tmp - $retour['minute'])/60 );\n $retour['hour'] = $tmp % 24;\n\n $tmp = floor( ($tmp - $retour['hour']) /24 );\n $retour['day'] = $tmp;\n\n return $retour['day'] ;\n }",
"public function diff_date($from, $to){ \n\t\t$sql = \"SELECT DATEDIFF('$to','$from') AS date_diff\";\n\t\t$result = $this->query($sql);\t\t\n\t\treturn $result[0][0]['date_diff'];\n\t}",
"public function getSeconds(): int\n {\n return $this->seconds;\n }",
"function datediff($interval,$date1,$date2){\n\n switch($interval){\n case 'Y': // Year\n case 'y':\n return ceil(($date2-$date1)/31536000); break;\n case 'm': // Month \n case 'n':\n return ceil(($date2-$date1)/2592000); break;\n case 'd': // Day \n case 'j':\n return ceil(($date2-$date1)/86400); break;\n case 'H': // Hour \n case 'h':\n case 'g':\n case 'G':\n return ceil(($date2-$date1)/3600); break;\n case 'i': // Minute \n return ceil(($date2-$date1)/60); break;\n case 's': // Second\n return $date2-$date1; break;\n }\n}",
"public function calculate_duration() {\n $date_helper = YITH_WCBK_Date_Helper();\n $duration = $date_helper->get_time_diff( $this->from, $this->to, $this->duration_unit );\n if ( $this->is_all_day() )\n $duration += 1;\n\n return $duration;\n }",
"public function secondsRemaining(): int\n {\n return $this->getTimeRemaining() / 1000;\n }",
"function timeDiff($firstTime, $lastTime) {\n $firstTime = strtotime($firstTime);\n $lastTime = strtotime($lastTime);\n $timeDiff = ($lastTime - $firstTime) / 86400;\n return $timeDiff;\n}",
"function getAsSeconds()\n {\n return $this->seconds;\n }",
"public function diffAbsoluteSecond($date)\n {\n return $date->getTimestamp() - $this->date->getTimestamp();\n }",
"public static function getDateDiffCount($date1, $date2) {\n $date1 = new DateTime($date1);\n $date2 = new DateTime($date2);\n $interval = $date1->diff($date2);\n if($interval->days == 0) {\n $diff = 1;\n } else {\n $diff = $interval->days;\n }\n return $diff;\n }",
"function diffInHours ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\t$hoursInSecs = 60 * 60;\n\t\treturn ($diff / $hoursInSecs);\n\t}",
"function erp_date_duration( $start_date, $end_date ) {\n $diff = abs( strtotime( $start_date ) - strtotime( $end_date ) );\n $hours_diff = ceil( $diff / ( 60 * 60 ) );\n\n return ceil( $hours_diff / 24 );\n}",
"function time_diff($start) {\n return formatDateTimeDiff($start);\n}",
"function dateDiffYears($time1, $time2){\n \n $yrs = 0;\n $time1 = date_create($time1);\n $time2 = date_create($time2);\n $diffArray = date_diff($time1, $time2); \n $yrs = $diffArray->format('%R%y'); \n return $yrs * 1;\n}",
"public function getDifferenceDays()\n {\n if ($this->event->start_at->diff($this->event->end_at)->days > 1) {\n return $this->start_date . ' - ' . $this->end_date;\n }\n\n return $this->start_date;\n }",
"function timeDiff($firstTime,$lastTime)\n{\n$firstTime=strtotime($firstTime);\n$lastTime=strtotime($lastTime);\n$timeDiff = ($lastTime-$firstTime)/86400;\nreturn $timeDiff;\n}",
"function dateDifference($date_1 , $date_2 , $differenceFormat = '%a' )\n{\n $datetime1 = date_create($date_1);\n $datetime2 = date_create($date_2);\n \n $interval = date_diff($datetime1, $datetime2);\n \n return ($interval->format($differenceFormat));\n \n}",
"function difference_time($begin, $end) {\n $data_frek['frek'] = round(abs(strtotime($end)-strtotime($begin))/86400);\n return $data_frek;\n // end function dateDiff\n}",
"function dateDiff($date1,$date2,$format='D'){\n $diff = abs($date2 - $date1);\n $year=$months=$days=$hours=$minutes=$seconds=0;\n $print=\"\";\n\n switch($format){\n case 'Y':\n $years = floor($diff / (365*60*60*24));\n $print.= $years.\" years \";\n case 'M':\n $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));\n $print.= $months.\" months \";\n case 'D':\n $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));\n $print.= $days.\" days \";\n case 'H':\n $hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24) / (60*60));\n $print.= $hours.\" hours \";\n case 'i':\n $minutes = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60);\n $print.= $minutes.\" minutes \";\n case 's':\n $seconds = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minutes*60));\n $print.= $seconds.\" seconds \";\n }\n return $print;\n}",
"protected function getTimeDifference()\n {\n // Create temp file\n $localPath = tempnam(sys_get_temp_dir(), 'test');\n\n // Count time difference\n $diff = $this->writeTempFile($localPath);\n\n // Remove local temp file\n unlink($localPath);\n\n return $diff;\n }",
"function get_time_difference( $time1, $time2 ) {\n\t$time1 = (int)$time1;\n\t$time2 = (int)$time2;\n\t$result = array(\n\t\t'days' => 0,\n\t\t'hours' => 0,\n\t\t'minutes' => 0,\n\t\t'seconds' => 0\n\t);\n\tif( $time1 == 0 || $time2 == 0) return $result;\n\t\n\tif($time2 > $time1) {\n\t\t$start = date(\"H:i\",$time1);\n\t\t$end = date(\"H:i\",$time2);\n\t} else {\n\t\t$start = date(\"H:i\",$time2);\n\t\t$end = date(\"H:i\",$time1);\t\n\t}\t\n\t\n\t$uts['start'] = $time2;\n\t$uts['end'] = $time1;\n\tif( $uts['start']!==-1 && $uts['end']!==-1 ) {\n\t\tif( $uts['end'] >= $uts['start'] ) {\n\t\t\n\t\t\t$diff = $uts['end'] - $uts['start'];\n\t\t\tif( $days=intval((floor($diff/86400))) ) $diff = $diff % 86400;\n\t\t\tif( $hours=intval((floor($diff/3600))) ) $diff = $diff % 3600;\n\t\t\tif( $minutes=intval((floor($diff/60))) ) $diff = $diff % 60;\n\t\t\t$diff = intval( $diff ); \n\t\t\tif($days > 0) $hours += $days*24;\n\t\t\treturn( array('days'=>str_pad($days,2,0, STR_PAD_LEFT), 'hours'=>str_pad($hours,2,0, STR_PAD_LEFT), 'minutes'=>str_pad($minutes,2,0, STR_PAD_LEFT), 'seconds'=>str_pad($diff,2,0, STR_PAD_LEFT)) );\n\t\t}\t\n\t}\t\n\treturn $result;\n}",
"public function get_seconds_left() {\r\n\t\tif ( $this->is_endless() ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$time_left = $this->get_end_time() - current_time( 'timestamp' );\r\n\t\treturn $time_left < 0 ? 0 : $time_left;\t\r\n\t}",
"public function getDateDifference()\n {\n switch ($this->scale) {\n case \"year\":\n return $this->yearDifference;\n case \"mon\":\n return $this->monthDifference;\n case \"week\":\n return $this->weekDifference;\n case \"day\":\n return $this->dayDifference;\n case \"hour\":\n return $this->hourDifference;\n case \"min\":\n return $this->minuteDifference;\n case \"sec\":\n return $this->stampDifference;\n }\n }",
"function elapsed_time($start_time, $finish_time){\n\treturn sc_strtotime($finish_time) - sc_strtotime($start_time);\n}",
"function date_difference($date1, $date2, $return_format)\r\n{\r\n switch ($return_format) {\r\n case 'd':\r\n return (int)$date1->diff($date2)->format('%r%a');\r\n break;\r\n case 'h':\r\n return (int)$date1->diff($date2)->format('%r%h');\r\n break;\r\n case 'm':\r\n return (int)$date1->diff($date2)->format('%r%m');\r\n break;\r\n case 'i':\r\n return (int)$date1->diff($date2)->format('%r%i');\r\n break;\r\n\r\n default:\r\n return (int)($date1->getTimestamp() - $date1->getOffset()) - ($date2->getTimestamp() - $date2->getOffset());\r\n break;\r\n }\r\n}",
"function DateDifference($interval, $date1, $date2)\n {\n $difference = $date2 - $date1;\n switch ($interval) {\n case \"w\":\n $returnvalue = $difference / 604800;\n break;\n case \"d\":\n $returnvalue = $difference / 86400;\n break;\n case \"h\":\n $returnvalue = $difference / 3600;\n break;\n case \"m\":\n $returnvalue = $difference / 60;\n break;\n case \"s\":\n $returnvalue = $difference;\n break;\n }\n return $returnvalue;\n }",
"public function getDurationSeconds()\n {\n return ($this->batch->getDuration($this->name, 'start') / 1000);\n }",
"protected function dateIntervalSeconds($dateInterval){\n $hourSeconds = $dateInterval->h * 60 * 60;\n $minuteSeconds = $dateInterval->i * 60;\n\n return $dateInterval->s + $minuteSeconds + $hourSeconds; \n }",
"public function getTempsRestant()\n {\n $today = new DateTime(date(\"d-m-Y\"));\n $fin = new DateTime($this->dateFinPrevue);\n $interval = $today->diff($fin);\n\n return $interval;\n }",
"function get_time_difference($start, $end) {\r\n\t\r\n $uts['start'] = strtotime($start);\r\n $uts['end'] = strtotime($end);\r\n if ($uts['start']!=false && $uts['end']!=false) {\r\n if ($uts['end'] >= $uts['start']) {\r\n $diff = $uts['end'] - $uts['start'];\r\n\t\t\t$days = intval((floor($diff/60/60/24)));\r\n\t\t\t$hours = intval((floor($diff/60/60)));\r\n\t\t\t$minutes = intval((floor($diff/60)));\r\n $seconds = intval($diff); \r\n return(array('days'=>$days, 'hours'=>$hours, 'minutes'=>$minutes, 'seconds'=>$seconds));\r\n } else {\r\n return(false);\r\n }\r\n } else {\r\n return(false);\r\n }\r\n return(false);\r\n}",
"function getNumberOfDays($date1, $date2)\n\t{\n\t\t$datetime1 = new DateTime($date1);\n\t\t$datetime2 = new DateTime($date2);\n\t\t$interval = $datetime1->diff($datetime2);\n\t\treturn $interval->format('%a');\n\t}",
"public function getDelayInSeconds()\n {\n $now = Carbon::now();\n $delayed = $now->copy()->modify($this->getDelayInterval());\n return $delayed->diffInSeconds(`$now`);\n }",
"function totalSecond($hh1, $mm1, $ss1 = '0', $hh2, $mm2, $ss3 = '0')\n {\n $seconds = mktime($hh1, $mm1, $ss1) - mktime($hh2, $mm2, $ss3);\n return $seconds;\n }",
"public static function calculateRemainTime($start,$end)\n {\n $date1 = strtotime($start); \n $date2 = strtotime($end); \n \n // Formulate the Difference between two dates \n $diff = abs($date2 - $date1); \n \n \n // To get the year divide the resultant date into \n // total seconds in a year (365*60*60*24) \n $years = floor($diff / (365*60*60*24)); \n \n \n // To get the month, subtract it with years and \n // divide the resultant date into \n // total seconds in a month (30*60*60*24) \n $months = floor(($diff - $years * 365*60*60*24) \n / (30*60*60*24)); \n \n \n // To get the day, subtract it with years and \n // months and divide the resultant date into \n // total seconds in a days (60*60*24) \n $days = floor(($diff - $years * 365*60*60*24 - \n $months*30*60*60*24)/ (60*60*24)); \n \n \n // To get the hour, subtract it with years, \n // months & seconds and divide the resultant \n // date into total seconds in a hours (60*60) \n $hours = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24) \n / (60*60)); \n \n \n // To get the minutes, subtract it with years, \n // months, seconds and hours and divide the \n // resultant date into total seconds i.e. 60 \n $minutes = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60)/ 60); \n \n \n // To get the minutes, subtract it with years, \n // months, seconds, hours and minutes \n $seconds = floor(($diff - $years * 365*60*60*24 \n - $months*30*60*60*24 - $days*60*60*24 \n - $hours*60*60 - $minutes*60)); \n \n // Print the result\n return [\n 0=>$days,\n 1=>$hours,\n 2=>$minutes,\n 3=>$seconds\n ];\n }",
"public static function calculateDayDiff($date1, $date2=\"Now\") {\n if (!($date1 instanceof DateTime)) {\n $date1 = new DateTime($date1);\n }\n if (!($date2 instanceof DateTime)) {\n $date2 = new DateTime($date2);\n }\n // Set the period as \"1 day\" for the interval\n if ($date1 == $date2) {\n return 0;\n }\n $diff = $date1->diff($date2);\n $days_late = intval($diff->format('%r%a'));\n if ($date1 < $date2) {\n if ($diff->h > 0 || $diff->i > 0 || $diff->s > 0) {\n $days_late += 1;\n }\n }\n\n return $days_late;\n }",
"public function simple_diff( $a, $b ) {\n\t\t\treturn intval( $a ) - intval( $b );\n\t\t}",
"protected static function TimeDifference()\n\t{\n\t\t$ts=0;\n\t\t$ts -= date ( \"Z\" ) * 1;\n\t\t$daylight = date ( \"I\" );\n\t\t$daylight *= 1;\n\t\t$daylight *= 3600;\n\t\t$ts += $daylight; //12600 seconds 3:30+ GMT Tehran\n\t\t$ts += self::$GMTdelta;\n\t\treturn $ts;\n\t\t\n\t}",
"function getduration_cmn($EndTime, $StartTime) {\n $diff = strtotime($EndTime) - strtotime($StartTime);\n return $diff;\n}",
"function simpleDiff($start, $end = 'NOW') { \n $start_time = strtotime($start);\n $stop_time = strtotime($end);\n\n $diff_time = $start_time - $stop_time;\n\n if (abs($diff_time) < 3600) {\n return ceil($diff_time / 60) . 'm';\n }\n\n return ceil($diff_time / 3600) . 'h';\n }",
"public function date_compare($a, $b) {\n\t\t$t1 = strtotime ( $a ['date'] );\n\t\t$t2 = strtotime ( $b ['date'] );\n\t\treturn $t1 - $t2;\n\t}",
"function days_since_start()\n{\n\t$date_diff = time() - strtotime(START_DATE);\n\t$time_span = floor($date_diff/(60*60*24));\n\treturn $time_span;\n}",
"function diff($from,$to,$howlong,$howlongtype)\n{\n$duration_in_days = \"\";\n if($howlongtype=='Weeks')\n {\n $duration_in_days = $howlong * 7;\n }\n else if($howlongtype=='Months')\n {\n $duration_in_days = $howlong * 30;\n }\n else if($howlongtype=='Days')\n {\n $duration_in_days = $howlong;\n }\n\n$diff = abs(strtotime($to) - strtotime($from));/*Plan Synced Date - Current Date*/\n$diff = floor($diff/(60*60*24));\n$diff_in_days = max(0,floor($duration_in_days-$diff));\n\nreturn $diff_in_days;\n}",
"function DayDifferences($y_from, $m_from, $d_from, $y_to, $m_to, $d_to){\n $from = new DateTime($y_from.'-'.$m_from.'-'.$d_from);\n $to = new DateTime($y_to.'-'.$m_to.'-'.$d_to);\n return ($to->getTimeStamp() - $from->getTimeStamp())/3600/24;\n }",
"function age($date){\n\t$previousDate = strtotime($date);\n\t$currentDate = time(); // for the second date we are going to use the current Unix system time\n\t$nrSeconds = $currentDate - $previousDate; // subtract the previousDate from the currentDate to see how many seconds have passed between these two dates\n\t$nrSeconds = abs($nrSeconds); // in some cases, because of a user input error, the second date which should be smaller then the current one\n\tswitch ($nrSeconds) {\n\t\tcase ($nrSeconds < 60):\n\t\t\t$return = \"$nrSeconds second\";\n\t\t\tif ($nrSeconds != 1) $return.=\"s\";\n\t\t\treturn $return;\n\t\t\tbreak;\n\t\tcase ($nrSeconds < 3600):\n\t\t\t$nrMinutesPassed = floor($nrSeconds / 60);\n\t\t\t$return = \"$nrMinutesPassed minute\";\n\t\t\tif ($nrMinutesPassed != 1) $return.=\"s\";\n\t\t\treturn $return;\n\t\tcase ($nrSeconds < 86400):\n\t\t\t$nrHoursPassed = floor($nrSeconds / 3600);\n\t\t\t$return = \"$nrHoursPassed hour\";\n\t\t\tif ($nrHoursPassed != 1) $return.=\"s\";\n\t\t\treturn $return;\n\t\t\tbreak;\n\t\tcase ($nrSeconds < 604800):\n\t\t\t$nrDaysPassed = floor($nrSeconds / 86400); // see explanations below to see what this does\n\t\t\t$return = \"$nrDaysPassed day\";\n\t\t\tif ($nrDaysPassed != 1) $return.=\"s\";\n\t\t\treturn $return;\n\t\t\tbreak;\n\t\tcase ($nrSeconds < 2620800):\n\t\t\t$nrWeeksPassed = floor($nrSeconds / 604800); // same as above\n\t\t\t$return = \"$nrWeeksPassed week\";\n\t\t\tif ($nrWeeksPassed != 1) $return.=\"s\";\n\t\t\treturn $return;\n\t\t\tbreak;\n\t\tcase ($nrSeconds < 31536000):\n\t\t\t$nrMonthsPassed = floor($nrSeconds / 2620800);\n\t\t\t$return = \"$nrMonthsPassed month\";\n\t\t\tif ($nrMonthsPassed != 1) $return.=\"s\";\n\t\t\treturn $return;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$nrYearsPassed = floor($nrSeconds / 31536000); // same as above\n\t\t\t$return = \"$nrYearsPassed year\";\n\t\t\tif ($nrYearsPassed != 1) $return.=\"s\";\n\t\t\treturn $return;\n\t\t\tbreak;\n\t}\n}",
"function diffInMinutes ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\t$minuteInSecs = 60;\n\t\treturn ($diff / $minuteInSecs);\n\t}",
"public function getTimeDiff()\n {\n $start = ServiceUtil::getManager()->getArgument('debug.toolbar.panel.rendertime.start');\n $end = microtime(true);\n\n $diff = $end - $start;\n return $diff;\n }",
"function secondsElapsed()\r\n {\r\n return $this->SecondsElapsed;\r\n }",
"public function dateDiff($date_start, $date_end){\r\n if((!empty($date_start))&&(!empty($date_end))){\r\n $date_diff_sec = strtotime($date_end) - strtotime($date_start);\r\n $date_sec = 60*60*24;\r\n $num_date = floor($date_diff_sec/$date_sec);\r\n $hour_sec = $date_diff_sec%$date_sec;\r\n $num_hour = floor($hour_sec/3600);\r\n $min_sec = $hour_sec%3600;\r\n $num_min = floor($min_sec/60);\r\n $sec \t = $min_sec%60;\r\n\r\n $return_array = array(\r\n 'num_date' \t=>str_pad($num_date, 2, \"0\", STR_PAD_LEFT),\r\n 'num_hour'\t=>str_pad($num_hour, 2, \"0\", STR_PAD_LEFT),\r\n 'num_min'\t=>str_pad($num_min, 2, \"0\", STR_PAD_LEFT),\r\n 'num_sec'\t=>str_pad($sec, 2, \"0\", STR_PAD_LEFT)\r\n );\r\n return $return_array;\r\n }\r\n else{\r\n $message = \"Date start or Date empty .Please check your parameter.\";\r\n return $message;\r\n }\r\n }",
"public function subSeconds($n)\n {\n return new Date($this->timestamp - $n, $this->timezone);\n }",
"function timeDiff($firstTime,$lastTime)\n {\n $firstTime=strtotime($firstTime);\n $lastTime=strtotime($lastTime);\n\n// perform subtraction to get the difference (in seconds) between times\n $timeDiff=$lastTime-$firstTime;\n\n return ($timeDiff);\n }",
"public function date_compare($a, $b)\n\t{\n\t\t$t1 = strtotime($a);\n\t\t$t2 = strtotime($b);\n\t\treturn $t1 - $t2;\n\t}"
] | [
"0.7046257",
"0.6965999",
"0.679718",
"0.6781185",
"0.6700592",
"0.663406",
"0.66150284",
"0.649206",
"0.6422793",
"0.6418234",
"0.64164495",
"0.6407968",
"0.63969415",
"0.6373387",
"0.633611",
"0.63041705",
"0.6250982",
"0.620842",
"0.6173213",
"0.6166254",
"0.6165687",
"0.61452365",
"0.61402446",
"0.61313725",
"0.61274177",
"0.6070231",
"0.6044743",
"0.6042601",
"0.60401386",
"0.59793764",
"0.59739",
"0.5951491",
"0.5940743",
"0.5929109",
"0.5927617",
"0.582787",
"0.582787",
"0.58267367",
"0.5823304",
"0.57895017",
"0.57739204",
"0.57731724",
"0.5755369",
"0.57418764",
"0.57400537",
"0.5709533",
"0.57030314",
"0.5692259",
"0.5688867",
"0.5683881",
"0.5675871",
"0.5672996",
"0.56632036",
"0.5654777",
"0.56475794",
"0.5617385",
"0.55969375",
"0.558628",
"0.5572373",
"0.555594",
"0.55471486",
"0.5543478",
"0.5517239",
"0.55017304",
"0.5486671",
"0.5484081",
"0.5479331",
"0.5474263",
"0.5472842",
"0.5469552",
"0.5462385",
"0.54535156",
"0.5451702",
"0.5444976",
"0.5444968",
"0.54414535",
"0.5430825",
"0.54275477",
"0.5416482",
"0.5413566",
"0.54077286",
"0.54074776",
"0.54006255",
"0.53889006",
"0.5383664",
"0.5377851",
"0.5367195",
"0.53589594",
"0.53514284",
"0.5345899",
"0.5338215",
"0.5326734",
"0.531249",
"0.5309793",
"0.5305973",
"0.5303672",
"0.52879137",
"0.52851105",
"0.5271901",
"0.52701205"
] | 0.622516 | 17 |
Assign custom renderer for product create/edit form weee attribute element | public function execute(\Magento\Framework\Event\Observer $observer)
{
/** @var \Magento\Framework\Data\Form $form */
$form = $observer->getEvent()->getForm();
$attributes = $this->weeeTax->getWeeeAttributeCodes(true);
foreach ($attributes as $code) {
$weeeTax = $form->getElement($code);
if ($weeeTax) {
$weeeTax->setRenderer($this->layout->createBlock(\Magento\Weee\Block\Renderer\Weee\Tax::class));
}
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function processAction() {\n\t\t$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper ( 'redirector' );\n\t\t$form = $this->getForm ( \"/admin/productsattributes/process\" );\n\t\t$request = $this->getRequest ();\n\t\t\n\t\t// Create the buttons in the edit form\r\n\t\t$this->view->buttons = array(\r\n\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t);\r\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t// Check if we have a POST request\n\t\t\tif (! $request->isPost ()) {\n\t\t\t\treturn $this->_helper->redirector ( 'list', 'productsattributes', 'admin' );\n\t\t\t}\n\t\t\t\n\t\t\tif ($form->isValid ( $request->getPost () )) {\n\t\t\t\t$params = $request->getParams();\n\t\t\t\t\n\t\t\t\t$id = $params['attribute_id'];\n\t\t\t\t$code = $params['code'];\n\t\t\t\t$label = $params['label'];\n\t\t\t\t$type = $params['type'];\n\t\t\t\t$prefix = $params['prefix'];\n\t\t\t\t$suffix = $params['suffix'];\n\t\t\t\t$is_system_var = $params['system'];\n\t\t\t\t$description = $params['description'];\n\t\t\t\t$position = $params['position'];\n\t\t\t\t$is_visible_on_front = $params['is_visible_on_front'];\n\t\t\t\t$active = $params['active'];\n\t\t\t\t$system = $params['system'];\n\t\t\t\t$system_var = $params['system_var'];\n\t\t\t\t$defaultvalue = $params['defaultvalue'];\n\t\t\t\t$is_required = $params['is_required'];\n\t\t\t\t$is_comparable = $params['is_comparable'];\n\t\t\t\t$on_product_listing = !empty($params['on_product_listing']) && $params['on_product_listing'] == 1 ? true : false;\n\t\t\t\t$language_id = $params['language_id'];\n\t\t\t\t\n\t\t\t\t$id = ProductsAttributes::addNew($id, $code, $label, $type, $language_id, $position, $active, $prefix, $suffix, $description, $is_visible_on_front, $is_system_var, $system_var, $defaultvalue, $is_required, $is_comparable, $on_product_listing);\n\t\t\t\t\n\t\t\t\tif($id === false){\n\t\t\t\t\t$this->_helper->redirector ( 'list', 'productsattributes', 'admin', array ('mex' => \"There was an error during the saving process. Check all the parameters.\", 'status' => 'danger' ) );\n\t\t\t\t}\t\t\t\t\n\t\t\t\t$this->_helper->redirector ( 'edit', 'productsattributes', 'admin', array ('id' => $id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t\t\n\t\t\t} else {\n\t\t\t\t$this->view->form = $form;\n\t\t\t\t$this->view->title = $this->translator->translate(\"Hosting Plan Feature details\");\n\t\t\t\t$this->view->description = $this->translator->translate(\"Here you can fix the hosting plan feature details.\");\n\t\t\t\treturn $this->render ( 'applicantform' );\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->_helper->redirector ( 'edit', 'productsattributes', 'admin', array ('id' => $id, 'mex' => $e->getMessage (), 'status' => 'danger' ) );\n\t\t}\n\t}",
"protected function _beforeRender()\r\n {\r\n $this->_element->setAttributes($this->getAttribs());\r\n }",
"protected function _add_render_attributes() {\n \n // use parent attributes\n parent::_add_render_attributes();\n \n }",
"public function generate_renderer(){\n if(class_exists($this->type) && method_exists($this->type, 'render_content'))\n $this->renderer = new $this->type( $this->value, $this->control_settings);\n else\n $this->renderer = null;\n }",
"function create_product_attribute( $label_name ) {\n global $wpdb;\n\n $slug = sanitize_title( $label_name );\n\n if ( strlen( $slug ) >= 28 ) {\n return new WP_Error( 'invalid_product_attribute_slug_too_long', sprintf( __( 'Name \"%s\" is too long (28 characters max). Shorten it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( wc_check_if_attribute_name_is_reserved( $slug ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_reserved_name', sprintf( __( 'Name \"%s\" is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( taxonomy_exists( wc_attribute_taxonomy_name( $label_name ) ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_already_exists', sprintf( __( 'Name \"%s\" is already in use. Change it, please.', 'woocommerce' ), $label_name ), array( 'status' => 400 ) );\n }\n\n $data = array(\n 'attribute_label' => $label_name,\n 'attribute_name' => $slug,\n 'attribute_type' => 'select',\n 'attribute_orderby' => 'menu_order',\n 'attribute_public' => 0, // Enable archives ==> true (or 1)\n );\n\n $results = $wpdb->insert( \"{$wpdb->prefix}woocommerce_attribute_taxonomies\", $data );\n\n if ( is_wp_error( $results ) ) {\n return new WP_Error( 'cannot_create_attribute', $results->get_error_message(), array( 'status' => 400 ) );\n } else {\n\t\twisync_admin_notice__success( 'Created ' . $label_name . ' as Product Attribute.' );\n\t}\n\n $id = $wpdb->insert_id;\n\n do_action('woocommerce_attribute_added', $id, $data);\n\n wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );\n\n delete_transient('wc_attribute_taxonomies');\n}",
"public function run()\n {\n $productForm = $this->catalogProductEdit->getFormPageActions();\n $productForm->addNewAttribute();\n $this->catalogProductEdit->getAddAttributeModal()->createNewAttribute();\n }",
"public function CreateAttribute($attribute_data,$attribute_set_id){\n\n $attribute_code = $attribute_data['attribute_code'];\n $attribute_name = $attribute_data['attribute_name'];\n $field_type_id = $attribute_data['field_type_id'];\n $input_type = 'text';\n if($field_type_id == 1){\n $input_type = 'select';\n }else if($field_type_id ==4){\n $input_type = 'multiselect';\n }\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code,0);\n\n if(isset($result['message'])){\n\n $data['attribute'] = array(\n \"attribute_code\" => $attribute_code,\n \"frontend_input\" => $input_type,\n \"scope\" => \"global\",\n \"is_unique\" => 0,\n \"is_required\" => 0,\n \"is_searchable\" => 0,\n \"is_visible_in_advanced_search\" => 0,\n \"is_comparable\" => 0,\n \"is_used_for_promo_rules\" => 0,\n \"is_visible_on_front\" => 0,\n \"used_in_product_listing\" => 0,\n \"default_frontend_label\" => $attribute_name,\n \"frontend_labels\" => array(array(\"store_id\" => \"0\", \"label\" => $attribute_name))\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\",1,json_encode($data));\n\n $attribute_id = $result['attribute_id'];\n\n }else{\n $attribute_id = $result['attribute_id'];\n }\n\n $result2 = $this->curlRequest(\"/rest/V1/products/attribute-sets/attributes\",1,json_encode([\n \"attributeSetId\" => $attribute_set_id,\n \"attributeCode\" => $attribute_code,\n \"attributeGroupId\" => 130,\n \"sortOrder\" => 0\n ]) );\n\n return $attribute_id;\n\n }",
"protected function inputAttributes()\n {\n $this->input_attributes['name'] = $this->name;\n $this->input_attributes['type'] = 'submit';\n $this->input_attributes['value'] = $this->params['title'];\n }",
"public function catalogProductEditSetRenderer($observer)\n {\n $form = $observer->getForm();\n\n $elementIds = array('shipperhq_volume_weight', 'shipperhq_poss_boxes', 'shipperhq_master_boxes'\n , 'shipperhq_volume_weight');\n foreach($elementIds as $element_id)\n {\n $element = $form->getElement($element_id);\n if($element) {\n $element->setRenderer(\n Mage::app()->getLayout()->createBlock('shipperhq_shipper/adminhtml_catalog_product_edit_tab_dimensional')\n );\n }\n }\n }",
"public function CreateAttributeDiff($attribute_data,$attribute_set_id,$diff_attr){\n\n $diff_code = '_d';\n if($diff_attr == 'filter'){\n $diff_code = '_f';\n }\n\n $attribute_code = $attribute_data['attribute_code'] . $diff_code;\n $attribute_name = $attribute_data['attribute_name'] . $diff_code;\n $field_type_id = $attribute_data['field_type_id'];\n $input_type = 'text';\n\n $input_type = 'select';\n\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code,0);\n\n if( isset($result['message']) ){\n\n $data['attribute'] = array(\n \"attribute_code\" => $attribute_code,\n \"frontend_input\" => $input_type,\n \"scope\" => \"global\",\n \"default_value\" => \"\",\n \"is_unique\" => 0,\n \"is_required\" => 0,\n \"is_searchable\" => 0,\n \"is_visible_in_advanced_search\" => 0,\n \"is_comparable\" => 0,\n \"is_used_for_promo_rules\" => 0,\n \"is_visible_on_front\" => 0,\n \"used_in_product_listing\" => 0,\n \"default_frontend_label\" => $attribute_name,\n \"frontend_labels\" => array(array(\"store_id\" => \"0\", \"label\" => $attribute_name))\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\",1,json_encode($data));\n $attribute_id = $result['attribute_id'];\n\n\n\n //die();\n\n }else{\n $attribute_id = $result['attribute_id'];\n }\n\n $result2 = $this->curlRequest(\"/rest/V1/products/attribute-sets/attributes\",1,json_encode([\n \"attributeSetId\" => $attribute_set_id,\n \"attributeCode\" => $attribute_code,\n \"attributeGroupId\" => 130,\n \"sortOrder\" => 0\n ]) );\n\n return $attribute_id;\n }",
"function Hippo_Widget_Attributes() {\n\t\t\tnew Hippo_Widget_Attributes();\n\t\t}",
"function outputAttr($prod_id, $attr, $index, $v_index)\n {\n if (!$attr['visible'])\n return getMsg('CTL', 'CTL_PGE_NA');\n\n $output = '';\n\n // setting the style and value depending on the error\n $style = '';\n $value = @$attr['value'];\n if (isset($this -> _Errors[$prod_id]) && isset($this -> _Errors[$prod_id][$attr['view_tag']]))\n {\n $style = ' style=\"border: 1px solid; border-color: red;\"';\n if (isset($this -> _Posted_Data[$prod_id][$attr['view_tag']]))\n $value = $this -> _Posted_Data[$prod_id][$attr['view_tag']];\n }\n\n // tabbing\n $tabbing = ($this -> _tabbing == 'RIGHT')\n ? count($this -> _attrs) * $index + $v_index\n : count($this -> _Prod_IDs) * $v_index + $index;\n $tabbing = ' tabindex=\"' . $tabbing . '\"';\n\n switch($attr['input_type_name'])\n {\n case 'read-only':\n $output = prepareHTMLDisplay($value);\n break;\n\n case 'select':\n $values = array();\n foreach($attr['input_type_values'] as $k => $v)\n $values[] = array('value' => $k, 'contents' => $v);\n\n $output = HtmlForm :: genDropdownSingleChoice(array(\n 'onChange' => '',\n 'class' => 'input-sm',\n 'select_name' => 'posted_data[' . $prod_id .\n '][' . $attr['view_tag'] . ']',\n 'values' => $values,\n 'selected_value' => $value\n ), $style . $tabbing);\n break;\n\n case 'text':\n $size = 40;\n if ($attr['size'] < 50)\n $size = 8;\n if ($attr['size'] < 20)\n $size = 5;\n $output = '<input class=\"form-control input-sm\" type=\"text\"' .\n HtmlForm :: genInputTextField(\n $attr['max'],\n 'posted_data[' . $prod_id . '][' .\n $attr['view_tag'] . ']',\n $size,\n $value\n ) .\n $style . $tabbing . ' />';\n break;\n\n default:\n $output = getMsg('CTL', 'CTL_PGE_NA');;\n }\n\n return $output;\n }",
"protected function addAttributesToRender($writer)\n\t{\n\t\tif ($this->getEnableVisualEdit() && $this->getEnabled(true)) {\n\t\t\t$writer->addAttribute('id', $this->getClientID());\n\t\t\t$this->registerEditorClientScript($writer);\n\t\t}\n\n\t\tparent::addAttributesToRender($writer);\n\t}",
"public function renderElement($element) {\n $method = $element['#type'];\n if (!isset($element['#name']) && !in_array($element['#type'], array('markup', 'checkboxes'))) {\n if (!isset($element['#attributes']['name'])) {\n return '#name or #attributes[\\'name\\'] required!';\n } else {\n $element['#name'] = $element['#attributes']['name'];\n }\n }\n if (is_callable(array($this, $method))) {\n $custom_field_title = '';\n if (isset($element['#title']) && !empty($element['#title'])) {\n $custom_field_title = $element['#title'];\n }\n\n if (empty($custom_field_title) && isset($element['#name']) && !empty($element['#name'])) {\n $custom_field_title = $element['#name'];\n }\n if (!isset($element['#id'])) {\n if (isset($element['#attributes']['id'])) {\n $element['#id'] = $element['#attributes']['id'];\n } else {\n $_id = isset($this->_id) ? $this->_id . '-' : '';\n $element['#id'] = \"{$_id}{$element['#type']}-\"\n . $this->_count($element['#type']) . '-' . time();\n }\n }\n\n if (isset($this->_errors[$element['#id']])) {\n $element['#error'] = $this->_errors[$element['#id']];\n }\n // Add JS validation\n if (!empty($element['#validate'])) {\n if (isset($element['#validate']['required']) && !empty($element['#title'])) {\n // Asterisk\n $element['#title'] .= '*';\n }\n $element['#attributes']['data-wpt-validate'] = esc_html(self::json_encode(apply_filters('wptoolset_forms_field_js_validation_data_' . $this->_id, $element['#validate'])));\n $element['#attributes']['data-wpt-field-title'] = esc_js($custom_field_title);\n }\n if ($element['#type'] == 'radios' && !empty($element['#options'])) {\n foreach ($element['#options'] as &$option) {\n if (!empty($option['#validate'])) {\n $option['#attributes']['data-wpt-validate'] = esc_html(self::json_encode(apply_filters('wptoolset_forms_field_js_validation_data_' . $this->_id, $option['#validate'])));\n $option['#attributes']['data-wpt-field-title'] = esc_js($custom_field_title);\n }\n }\n }\n /**\n * WPML - lock CF is has option \"copy from original\".\n */\n if (is_admin() && function_exists('wpcf_wpml_field_is_copied') && wpcf_wpml_field_is_copied($element)) {\n $element['#title'] .= sprintf(\n '<img src=\"%s/images/locked.png\" alt=\"%s\" title=\"%s\" style=\"position:relative;left:2px;top:2px;\" />', WPCF_EMBEDDED_RES_RELPATH, __('This field is locked for editing because WPML will copy its value from the original language.', 'wpcf'), __('This field is locked for editing because WPML will copy its value from the original language.', 'wpcf')\n );\n $element['#attributes']['readonly'] = true;\n $element['#attributes']['disabled'] = true;\n }\n return $this->{$method}($element);\n }\n }",
"public function editAction() {\n\t\t$Session = new Zend_Session_Namespace ( 'Admin' );\n\t\t$form = $this->getForm ( '/admin/productsattributes/process' );\n\t\t\n\t\t// Create the buttons in the edit form\r\n\t\t$this->view->buttons = array(\r\n\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\tarray(\"url\" => \"/admin/productsattributes/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t);\n\t\t\n\t\t// Set the system field attribute title\n\t\t$panel = Isp::getPanel(); \n\t\tif(!empty($panel)){\n\t\t\t$form->getElement ( 'system_var' )->setLabel ( $panel );\n\t\t}\n\t\t\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t\n\t\tif (! empty ( $id ) && is_numeric ( $id )) {\n\t\t\t$rs = $this->productsattributes->getAllInfo ( $id, \"*, pad.label as label, pad.prefix as prefix, pad.suffix as suffix, pad.description as description, pad.language_id as language_id\", $Session->langid );\n\t\t\t\n\t\t\tif (! empty ( $rs )) {\n\t\t\t\t$this->view->id = $id;\n\t\t\t\t$rs['language_id'] = $Session->langid; // added to the form the language id selected \n\t\t\t\t$form->populate ( $rs );\n\t\t\t}\n\t\t\t\n\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/productsattributes/confirm/id/$id\", \"label\" => $this->translator->translate('Delete'), \"params\" => array('css' => null));\r\n\t\t\t\t\n\t\t}\n\t\t$this->view->title = $this->translator->translate(\"Attribute Group\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can edit the attribute group details.\");\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->render ( 'applicantform' );\n\t}",
"protected function _initRenderer()\n {\n if ($code = $this->getRequest()->getParam('code')) {\n $renderer = $this->_getConfig()->getRendererModelByCode($code);\n } else {\n $renderer = null;\n }\n Mage::register('blcg_collection_column_renderer', $renderer);\n return $renderer;\n }",
"public function renderLinkAttributeFields() {}",
"public function renderLinkAttributeFields() {}",
"protected function _add_render_attributes() {\n \n // use parent attributes\n parent::_add_render_attributes();\n \n $this->add_render_attribute(\n 'wrapper', 'class', [\n $this->get_name() . '-information',\n ]\n ); \n \n $this->add_render_attribute(\n 'wrapper', 'id', [\n $this->get_name() . '-information',\n ],\n true\n ); \n \n }",
"public function process(\\Magento\\Catalog\\Api\\Data\\ProductAttributeInterface $attribute);",
"protected function addAttributesToRender($writer)\n\t{\n\t\tparent::addAttributesToRender($writer);\n\t\tif(($butt=$this->getDefaultButton())!=='')\n\t\t\t$writer->addAttribute('id',$this->getClientID());\n\t}",
"public function getFormAttribs() \n\t {\n return [\n 'EMP_ID'=>['type'=>Form::INPUT_TEXT, 'options'=>['placeholder'=>'Enter ...']],\n 'EMP_NM'=>['type'=>Form::INPUT_TEXT, 'options'=>['placeholder'=>'Enter ...']],\n 'EMP_IMG'=>['type'=>Form::INPUT_TEXT],\n // 'actions'=>['type'=>Form::INPUT_RAW, 'value'=>Html::submitButton('Submit', ['class'=>'btn btn-primary'])];\n ];\n }",
"public function create()\n {\n return view('monkcommerce::monkcommerce-dashboard.admin.products.attributes.create');\n }",
"function drawAttribute( $attribute, $view )\r\n\t{\r\n\t\tglobal $tab_index;\r\n\r\n\t\t$tab_index++;\r\n\r\n\t\t$value = $this->getAttributeValue($attribute);\r\n\t\t$default = $this->getAttributeDefault($attribute);\r\n\t\t$attribute_type = $this->getAttributeType( $attribute );\r\n\t\t\r\n\t\tif ( !$this->IsAttributeVisible($attribute) ) {\r\n\t\t if ( $value != '' ) {\r\n echo '<input type=\"hidden\" id=\"'.$attribute.'\" name=\"'.$attribute.'\" value=\"'.$value.'\">';\r\n }\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ( $attribute_type == 'object' || $attribute_type == 'dictionary' )\r\n\t\t{\r\n\t\t\t$object = $this->getAttributeClass( $attribute );\r\n\t\t\t\r\n\t\t\tif ( $value != '' )\r\n\t\t\t{\r\n\t\t\t\t$object_it = $object->getExact($value);\r\n\t\t\t\t$displayValue = $object_it->getDisplayName();\r\n\t\t\t} \r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$displayValue = $value; \r\n\t\t}\r\n\r\n\t\tif ( !$this->IsAttributeModifiable($attribute) )\r\n\t\t{\r\n\t\t\techo '<input type=\"hidden\" id=\"'.htmlentities($attribute).'\" name=\"'.htmlentities($attribute).'\" value=\"'.htmlentities($value).'\">';\r\n\t\t echo '<span class=\"input-block-level well well-text\" style=\"word-break: break-all;padding: 4px 6px;margin-bottom: 10px;\">'.$displayValue.'</span>';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tswitch ( $attribute_type )\r\n\t\t\t{\r\n\t\t\t\tcase 'hugetext':\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<textarea class=\"input-block-level\" id=\"<? echo $attribute; ?>\" name=\"<? echo $attribute; ?>\"\r\n\t\t\t\t\t\t\t style=\"overflow-x:hidden;overflow-y: scroll;\"\r\n\t\t\t\t\t\t\t tabindex=\"<? echo $tab_index ?>\"\r\n\t\t\t\t\t\t\t wrap=\"virtual\" rows=\"34\" placeholder=\"<?=htmlentities($default,ENT_QUOTES | ENT_HTML401, APP_ENCODING)?>\"><? echo $value ?></textarea>\r\n\t\t\t\t\t<?\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'largetext':\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<textarea class=\"input-block-level\" id=\"<? echo $attribute; ?>\" name=\"<? echo $attribute; ?>\"\r\n\t\t\t\t\t\tstyle=\"overflow-x:hidden;overflow-y: scroll;\" \r\n\t\t\t\t\t\ttabindex=\"<? echo $tab_index ?>\" \r\n\t\t\t\t\t\twrap=\"virtual\" rows=\"6\" placeholder=\"<?=htmlentities($default,ENT_QUOTES | ENT_HTML401, APP_ENCODING)?>\"><? echo $value ?></textarea>\r\n\t\t\t\t\t<?\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 'text':\r\n\t\t\t\t\tif ( in_array($this->getObject()->getAttributeDbType( $attribute ), array('LARGETEXT', 'RICHTEXT')) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<textarea class=\"input-block-level\" id=\"<? echo $attribute; ?>\" name=\"<? echo $attribute; ?>\"\r\n\t\t\t\t\t\t\tstyle=\"overflow-x:hidden;overflow-y: scroll;\" \r\n\t\t\t\t\t\t\ttabindex=\"<? echo $tab_index ?>\" \r\n\t\t\t\t\t\t\twrap=\"virtual\" rows=\"6\" placeholder=\"<?=htmlentities($default,ENT_QUOTES | ENT_HTML401, APP_ENCODING)?>\"><? echo $value ?></textarea>\r\n\t\t\t\t\t\t<?\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<textarea class=\"input-block-level\" id=\"<? echo $attribute; ?>\" name=\"<? echo $attribute; ?>\"\r\n\t\t\t\t\t\t\tstyle=\"overflow-x:hidden;overflow-y: scroll;\" \r\n\t\t\t\t\t\t\ttabindex=\"<? echo $tab_index ?>\" \r\n\t\t\t\t\t\t\twrap=\"virtual\" rows=\"1\" placeholder=\"<?=htmlentities($default,ENT_QUOTES | ENT_HTML401, APP_ENCODING)?>\"><? echo $value ?></textarea>\r\n\t\t\t\t\t\t<?\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 'dictionary':\r\n\t\t\t\t\t$field = new FieldDictionary( $object );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$field->SetName($attribute);\r\n\t\t\t\t\t$field->SetValue($value);\r\n\t\t\t\t\t$field->SetId($attribute);\r\n\t\t\t\t\t$field->SetTabIndex($tab_index);\r\n\t\t\t\t\t$field->draw();\r\n\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t\t\t\r\n\t\t\t\tcase 'object':\r\n\t\t\t\t\tif ( $object->IsDictionary() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$field = new FieldDictionary( $object );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$field = new FieldAutoCompleteObject( $object );\r\n\t\t\t\t\t\t$field->setDefault($default);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$field->SetTabindex($tab_index); \r\n\t\t\t\t\t$field->SetName($attribute);\r\n\t\t\t\t\t$field->SetValue($value);\r\n\t\t\t\t\t$field->SetId($attribute);\r\n\t\t\t\t\t$field->draw();\r\n\r\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\r\n\r\n\t\t\t\tcase 'file':\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<span>\r\n\t\t\t\t\t<input class=\"input-block-level\" type=\"file\" id=\"<? echo $attribute; ?>\" name=\"<? echo $attribute; ?>\" value=\"<? echo $value ?>\" tabindex=\"<? echo $tab_index ?>\" placeholder=\"<?=htmlentities($default,ENT_QUOTES | ENT_HTML401, APP_ENCODING)?>\">\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<?\r\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t $field = $this->createFieldObject($attribute_type, $attribute);\r\n\t\t\t\t if ( $field ) {\r\n $field->SetTabindex($tab_index);\r\n $field->SetName($attribute);\r\n $field->SetValue($value);\r\n $field->SetId($attribute);\r\n $field->draw();\r\n }\r\n\t\t\t\t else {\r\n $this->drawCustomAttribute( $attribute, $value, $tab_index, $view );\r\n }\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function onDisplayProductAttributeOptions( $product_id )\n\t{\n\t\t$editable_by = 2;\n\t\t$app = JFactory::getApplication();\n\t\tif( $app->isAdmin() ) {\n\t\t\t$view = JRequest::getCmd('view', '' );\n\t\t\tif( $view == 'pos' ) { // display all for POS\n\t\t\t\t$editable_by = array( 0, 1, 2);\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t$vars = new JObject( );\n\t\t\n\t\t// Get extra fields for products\n\t\t$field_show = $this->getCustomFields( 'products', $product_id, true, $editable_by );\n\n\t\tif(count($field_show))\n\t\t{\n\t\t\t$vars->fields = $field_show;\n\t\t\t$html = $this->_getLayout( 'product_site_form', $vars );\n\t\t\techo $html;\n\t\t}\n\t}",
"public function testAdministerProductAttributes() {\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'colors_id',\n 'label' => 'Color Names',\n 'elementLabel' => 'Choose Color',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Color Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n $attribute = ProductAttribute::load('colors_id');\n // Check if elementLabel is saved and then diplayed as the default value.\n $this->assertEquals('Choose Color', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Color', $elementLabel);\n\n $colors = [\n [\n 'attribute' => 'colors_id',\n 'name' => 'Red',\n 'weight' => 1,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'ForestGreen',\n 'weight' => 2,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'Blue',\n 'weight' => 3,\n ],\n ];\n\n foreach ($colors as $values) {\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'sizes_id',\n 'label' => 'Size Names',\n 'elementLabel' => 'Choose Size',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Size Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/sizes_id$/');\n $attribute = ProductAttribute::load('sizes_id');\n $this->assertEquals('Choose Size', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Size', $elementLabel);\n\n foreach (range(1, 102) as $i) {\n $values = [\n 'attribute' => 'sizes_id',\n 'name' => $i,\n 'weight' => $i,\n ];\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('colors_id');\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->pageTextContains('Choose Color');\n $this->assertSession()->pageTextContains('sizes_id');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->pageTextContains('Choose Size');\n // Attribute names are truncated if they exceed 10 characters.\n $this->assertSession()->pageTextContains('Red, ForestGre…, Blue');\n // Only one hundred attribute names can be displayed. A counter (N more\n // values…) displayed for all the rest of the names.\n $this->assertSession()->pageTextContains('1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 (2 more values…)');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->linkNotExistsExact('Color Names');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->linkNotExistsExact('Size Names');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('colors_id');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->submitForm([\n 'attributes[colors_id]' => 'colors_id',\n 'attributes[sizes_id]' => 'sizes_id',\n ], t('Save'));\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // Now 'Color Names' and 'Size Names' should turn into links with\n // 'Choose Color' and 'Choose Size' elementLabel text.\n $this->assertSession()->linkExistsExact('Choose Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('Choose Color');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields\\/commerce_product_variation\\.default\\.attribute_colors_id$/');\n $this->submitForm([\n 'label' => 'My Color',\n ], t('Save settings'));\n\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields$/');\n $this->assertSession()->pageTextContains('My Color', 'The customer facing label is changed on the default variation type attribute field');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // After the 'Choose Color' is changed the link text should also be changed\n // to 'My Color' elementLabel text.\n $this->assertSession()->linkExistsExact('My Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n }",
"public function create()\n {\n $attributes = AttributeModel::all();\n $products = ProductModel::all();\n\n\n return view('admin/catalog/product_attribute/create', compact('attributes','products'));\n\n }",
"public function __construct()\n {\n $defaultAttributeSetId = \\Mage::getSingleton('eav/config')\n ->getEntityType(\\Mage_Catalog_Model_Product::ENTITY)\n ->getDefaultAttributeSetId();\n $set = \\Mage::getModel('eav/entity_attribute_set')->load(4);\n $gid = $set->getDefaultGroupId();\n\n $that = $this;\n $this->setDefaultParameters(array(\n 'type'=> 'text',\n 'input'=> 'text',\n 'label'=> 'Test Attribute',\n 'global'=> \\Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,\n 'is_required'=> '0',\n 'is_comparable'=> '0',\n 'is_searchable'=> '0',\n 'is_unique'=> '1',\n 'is_configurable'=> '1',\n 'user_defined'=> '1',\n 'attribute_code' => function() use($that) { return $that->nextValue('attribute_code', function($i){return 'attribute_fixture_code_' . $i; }); },\n 'frontend_label' => function() use($that) { return $that->nextValue('frontend_label', function($i){return 'Attribute Fixture ' . $i; }); },\n 'attribute_set_id' => $defaultAttributeSetId,\n 'attribute_group_id' => $gid\n ));\n }",
"public function render()\n {\n $name = 'attr_item_type_id';\n $script = <<<EOT\n $.ajax({\n url: '/admin/goods/goods_attribute/attr_item',\n type: 'get',\n async: false,\n data: {type_id:\"{$this->form->model()->$name}\",goods_id:\"{$this->form->model()->id}\"},\n success:function(res){\n $('#item').html(res);\n $('.selects').select2();\n }\n }) \n $(\"select{$this->getElementClassSelector()}\").change(function(){\n $.ajax({\n url: '/admin/goods/goods_attribute/attr_item',\n type: 'get',\n async: false,\n data: {type_id:\"{$this->form->model()->$name}\",goods_id:\"{$this->form->model()->id}\"},\n success:function(res){\n $('#item').html(res);\n $('.selects').select2();\n }\n }) \n })\nEOT;\n Admin::script($script);\n\n return parent::render();\n }",
"protected function _add_render_attributes() {\n \n // use parent attributes\n parent::_add_render_attributes();\n \n $this->add_render_attribute(\n 'wrapper', 'class', [\n $this->get_name() . '-map',\n ]\n ); \n \n $this->add_render_attribute(\n 'wrapper', 'id', [\n $this->get_name() . '-map',\n ],\n true\n ); \n \n }",
"public function createFieldFromField($attribute,&$form)\n {\n $out = '';\n \n if ($attribute['required'] === '1') {\n $attribute['title'] = $attribute['title'].' <span class=\"cp-obli\">*</span>';\n }\n\n $fileType = '';\n \n switch ($attribute['type']) {\n \n case 'text':\n \n $out .= $form->input($attribute['title'],'attribute_'.$attribute['id_attribute'],'text',$attribute['value']);\n break;\n \n case 'textarea':\n \n $out .= $form->textarea($attribute['title'],'attribute_'.$attribute['id_attribute'],$attribute['value']);\n break;\n \n case 'select':\n \n $out .= $form->select($attribute['title'],'attribute_'.$attribute['id_attribute'],$attribute['params']['filter_select'],$attribute['value']);\n break;\n \n case 'checkbox':\n \n $out .= '<label>'.$attribute['title'].'</label> ';\n $attribute['value'] = $this->_toArray($attribute['value']);\n\n foreach ($attribute['params']['filter_select'] as $key => $value) {\n \n $checked = ''; \n\n if ( in_array($key, $attribute['value']) ) { \n $checked = 'checked'; \n }\n\n $out .= $form->checkbox($value,'attribute_'.$attribute['id_attribute'].'_'.$key,'1',$checked);\n }\n \n break;\n \n case 'radio':\n\n $out .= '<label>'.$attribute['title'].'</label><br />';\n foreach ($attribute['params']['filter_select'] as $key => $value) {\n \n $checked = ''; \n if ( $attribute['value'] !== '' && (int) $key === (int) $attribute['value']) { \n $checked = 'checked'; \n }\n\n $out .= $form->radio($value,'attribute_'.$attribute['id_attribute'],$key,$checked);\n }\n\n break;\n\n case 'file':\n\n if ($attribute['params']['filter_file_zip']) { $fileType .= 'zip,'; }\n if ($attribute['params']['filter_file_png']) { $fileType .= 'png,'; }\n if ($attribute['params']['filter_file_jpg']) { $fileType .= 'jpg,'; }\n if ($attribute['params']['filter_file_gif']) { $fileType .= 'gif,'; }\n if ($attribute['params']['filter_file_swf']) { $fileType .= 'swf,'; }\n if ($attribute['params']['filter_file_pdf']) { $fileType .= 'pdf,'; }\n if ($attribute['params']['filter_file_doc']) { $fileType .= 'doc,'; }\n\n $fileType = substr($fileType, 0, -1);\n $attribute['title'] = $attribute['title'].' <span class=\"cp-obli\">*</span> <small>('.($fileType).')</small>';\n \n $out .= $form->file($attribute['title'],'attribute_'.$attribute['id_attribute']);\n if (!empty($attribute['value'])) {\n \n $pathFile = URL.'data/users/'.$attribute['value'];\n $linkPathFile = '<a href=\"'.$pathFile.'\" title=\"'.$pathFile.'\" target=\"blank\">'.$pathFile.'</a>';\n\n $out .= $linkPathFile;\n }\n \n break;\n \n }\n\n if (!empty($attribute['description'])) {\n $out .= '<div ><small>'.$attribute['description'].'</small></div>';\n }\n\n if (!empty($out)) {\n $out .= '<div class=\"separateur-tb\"></div>';\n }\n\n return $out; \n }",
"function init()\n {\n $this->defineAttribute('label', true, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('routeUrl', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('add', false, 'Nuova scheda', COMPONENT_TYPE_STRING);\n $this->defineAttribute('cssClass', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('buttonId', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('noLink', false, false, COMPONENT_TYPE_STRING);\n $this->defineAttribute('iconClass', false, 'fa-plus', COMPONENT_TYPE_STRING);\n\n parent::init();\n }",
"public function create()\n {\n $url = route('dashboard.attributes.store');\n $html = view('partials.form.form-attribute', ['url' => $url, 'idForm' => 'form-create'])->render();\n\n return response()->json(['html' => $html], 200);\n }",
"public function getAddEditForm($target = '/admin/CartOrderProductAttribute') {\n\t\t$form = new Form('CartOrderProductAttribute_addedit', 'post', $target);\n\t\t\n\t\t$form->setConstants( array ( 'section' => 'addedit' ) );\n\t\t$form->addElement( 'hidden', 'section' );\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$form->setConstants( array ( 'cartorderproductattribute_orders_products_attributes_id' => $this->getId() ) );\n\t\t\t$form->addElement( 'hidden', 'cartorderproductattribute_orders_products_attributes_id' );\n\t\t\t\n\t\t\t$defaultValues ['cartorderproductattribute_orderid'] = $this->getOrderid();\n\t\t\t$defaultValues ['cartorderproductattribute_productid'] = $this->getProductid();\n\t\t\t$defaultValues ['cartorderproductattribute_products_options'] = $this->getProducts_options();\n\t\t\t$defaultValues ['cartorderproductattribute_products_options_values'] = $this->getProducts_options_values();\n\t\t\t$defaultValues ['cartorderproductattribute_options_values_price'] = $this->getOptions_values_price();\n\t\t\t$defaultValues ['cartorderproductattribute_price_prefix'] = $this->getPrice_prefix();\n\t\t\t$defaultValues ['cartorderproductattribute_product_attribute_is_free'] = $this->getProduct_attribute_is_free();\n\t\t\t$defaultValues ['cartorderproductattribute_products_attributes_weight'] = $this->getProducts_attributes_weight();\n\t\t\t$defaultValues ['cartorderproductattribute_products_attributes_weight_prefix'] = $this->getProducts_attributes_weight_prefix();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_discounted'] = $this->getAttributes_discounted();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_base_included'] = $this->getAttributes_price_base_included();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_onetime'] = $this->getAttributes_price_onetime();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_factor'] = $this->getAttributes_price_factor();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_factor_offset'] = $this->getAttributes_price_factor_offset();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_factor_onetime'] = $this->getAttributes_price_factor_onetime();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_factor_onetime_offset'] = $this->getAttributes_price_factor_onetime_offset();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_qty_prices'] = $this->getAttributes_qty_prices();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_qty_prices_onetime'] = $this->getAttributes_qty_prices_onetime();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_words'] = $this->getAttributes_price_words();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_words_free'] = $this->getAttributes_price_words_free();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_letters'] = $this->getAttributes_price_letters();\n\t\t\t$defaultValues ['cartorderproductattribute_attributes_price_letters_free'] = $this->getAttributes_price_letters_free();\n\t\t\t$defaultValues ['cartorderproductattribute_products_options_id'] = $this->getProducts_options_id();\n\t\t\t$defaultValues ['cartorderproductattribute_products_options_values_id'] = $this->getProducts_options_values_id();\n\t\t\t$defaultValues ['cartorderproductattribute_products_prid'] = $this->getProducts_prid();\n\n\t\t\t$form->setDefaults( $defaultValues );\n\t\t}\n\t\t\t\t\t\n\t\t$form->addElement('text', 'cartorderproductattribute_orderid', 'orderid');\n\t\t$form->addElement('text', 'cartorderproductattribute_productid', 'productid');\n\t\t$form->addElement('text', 'cartorderproductattribute_products_options', 'products_options');\n\t\t$form->addElement('text', 'cartorderproductattribute_products_options_values', 'products_options_values');\n\t\t$form->addElement('text', 'cartorderproductattribute_options_values_price', 'options_values_price');\n\t\t$form->addElement('text', 'cartorderproductattribute_price_prefix', 'price_prefix');\n\t\t$form->addElement('text', 'cartorderproductattribute_product_attribute_is_free', 'product_attribute_is_free');\n\t\t$form->addElement('text', 'cartorderproductattribute_products_attributes_weight', 'products_attributes_weight');\n\t\t$form->addElement('text', 'cartorderproductattribute_products_attributes_weight_prefix', 'products_attributes_weight_prefix');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_discounted', 'attributes_discounted');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_base_included', 'attributes_price_base_included');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_onetime', 'attributes_price_onetime');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_factor', 'attributes_price_factor');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_factor_offset', 'attributes_price_factor_offset');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_factor_onetime', 'attributes_price_factor_onetime');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_factor_onetime_offset', 'attributes_price_factor_onetime_offset');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_qty_prices', 'attributes_qty_prices');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_qty_prices_onetime', 'attributes_qty_prices_onetime');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_words', 'attributes_price_words');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_words_free', 'attributes_price_words_free');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_letters', 'attributes_price_letters');\n\t\t$form->addElement('text', 'cartorderproductattribute_attributes_price_letters_free', 'attributes_price_letters_free');\n\t\t$form->addElement('text', 'cartorderproductattribute_products_options_id', 'products_options_id');\n\t\t$form->addElement('text', 'cartorderproductattribute_products_options_values_id', 'products_options_values_id');\n\t\t$form->addElement('text', 'cartorderproductattribute_products_prid', 'products_prid');\n\t\t$form->addElement('submit', 'cartorderproductattribute_submit', 'Submit');\n\n\t\tif ($form->validate() && $form->isSubmitted()) {\n\t\t\t$this->setOrderid($form->exportValue('cartorderproductattribute_orderid'));\n\t\t\t$this->setProductid($form->exportValue('cartorderproductattribute_productid'));\n\t\t\t$this->setProducts_options($form->exportValue('cartorderproductattribute_products_options'));\n\t\t\t$this->setProducts_options_values($form->exportValue('cartorderproductattribute_products_options_values'));\n\t\t\t$this->setOptions_values_price($form->exportValue('cartorderproductattribute_options_values_price'));\n\t\t\t$this->setPrice_prefix($form->exportValue('cartorderproductattribute_price_prefix'));\n\t\t\t$this->setProduct_attribute_is_free($form->exportValue('cartorderproductattribute_product_attribute_is_free'));\n\t\t\t$this->setProducts_attributes_weight($form->exportValue('cartorderproductattribute_products_attributes_weight'));\n\t\t\t$this->setProducts_attributes_weight_prefix($form->exportValue('cartorderproductattribute_products_attributes_weight_prefix'));\n\t\t\t$this->setAttributes_discounted($form->exportValue('cartorderproductattribute_attributes_discounted'));\n\t\t\t$this->setAttributes_price_base_included($form->exportValue('cartorderproductattribute_attributes_price_base_included'));\n\t\t\t$this->setAttributes_price_onetime($form->exportValue('cartorderproductattribute_attributes_price_onetime'));\n\t\t\t$this->setAttributes_price_factor($form->exportValue('cartorderproductattribute_attributes_price_factor'));\n\t\t\t$this->setAttributes_price_factor_offset($form->exportValue('cartorderproductattribute_attributes_price_factor_offset'));\n\t\t\t$this->setAttributes_price_factor_onetime($form->exportValue('cartorderproductattribute_attributes_price_factor_onetime'));\n\t\t\t$this->setAttributes_price_factor_onetime_offset($form->exportValue('cartorderproductattribute_attributes_price_factor_onetime_offset'));\n\t\t\t$this->setAttributes_qty_prices($form->exportValue('cartorderproductattribute_attributes_qty_prices'));\n\t\t\t$this->setAttributes_qty_prices_onetime($form->exportValue('cartorderproductattribute_attributes_qty_prices_onetime'));\n\t\t\t$this->setAttributes_price_words($form->exportValue('cartorderproductattribute_attributes_price_words'));\n\t\t\t$this->setAttributes_price_words_free($form->exportValue('cartorderproductattribute_attributes_price_words_free'));\n\t\t\t$this->setAttributes_price_letters($form->exportValue('cartorderproductattribute_attributes_price_letters'));\n\t\t\t$this->setAttributes_price_letters_free($form->exportValue('cartorderproductattribute_attributes_price_letters_free'));\n\t\t\t$this->setProducts_options_id($form->exportValue('cartorderproductattribute_products_options_id'));\n\t\t\t$this->setProducts_options_values_id($form->exportValue('cartorderproductattribute_products_options_values_id'));\n\t\t\t$this->setProducts_prid($form->exportValue('cartorderproductattribute_products_prid'));\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $form;\n\t\t\n\t}",
"function render_field( $field ) { ?>\n <input type=\"text\" value=\"<?php echo esc_attr( $field[ 'value' ] ); ?>\" id=\"<?php echo esc_attr( $field[ 'id' ] ); ?>\" name=\"<?php echo esc_attr( $field[ 'name' ] ); ?>\" class=\"rhicomoon-select-field <?php echo esc_attr( $field[ 'class' ] ); ?>\" data-json-url=\"<?php echo esc_attr( $field[ 'json_url' ] ); ?>\"/>\n <?php }",
"abstract public function attr(string $component_name, string $attr_data = null);",
"public function addAttributes($post_id)\n\t{\n\t\t$attr = 'custom';\n\t\t\n\t\twp_set_object_terms($post_id, '0', $attr);\n\n $thedata[sanitize_title($attr)] = array(\n \t'name' => wc_clean($attr),\n 'value' => '0',\n 'postion' => '0',\n 'is_visible' => '0',\n 'is_variation' => '1',\n 'is_taxonomy' => '1'\n );\n \n\t\tupdate_post_meta($post_id, '_product_attributes', $thedata);\n\t\t\t\t\t\t\n\t}",
"public function render_product_search_field( $value ) {\n\n\t\t// Custom attribute handling\n\t\t$custom_attributes = array();\n\n\t\tif ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) {\n\t\t\tforeach ( $value['custom_attributes'] as $attribute => $attribute_value ) {\n\n\t\t\t\t$custom_attributes[] = esc_attr( $attribute ) . '=\"' . esc_attr( $attribute_value ) . '\"';\n\t\t\t}\n\t\t}\n\n\t\t$field_description = WC_Admin_Settings::get_field_description( $value );\n\t\t$option_value = WC_Admin_Settings::get_option( $value['id'], $value['default'] );\n\t\t$product_ids = array_filter( array_map( 'absint', explode( ',', $option_value ) ) );\n\t\t$json_ids = array();\n\n\t\tforeach ( $product_ids as $product_id ) {\n\t\t\t$product = wc_get_product( $product_id );\n\n\t\t\tif ( is_object( $product ) ) {\n\t\t\t\t$json_ids[ $product_id ] = wp_kses_post( $product->get_formatted_name() );\n\t\t\t}\n\t\t}\n\t\t?><tr valign=\"top\">\n\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t<label for=\"<?php echo esc_attr( $value['id'] ); ?>\"><?php echo esc_html( $value['title'] ); ?></label>\n\t\t\t\t<?php echo $field_description['tooltip_html']; ?>\n\t\t\t</th>\n\t\t\t<td class=\"forminp forminp-<?php echo sanitize_html_class( $value['type'] ) ?>\">\n\t\t\t\t<?php if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) : ?>\n\t\t\t\t\t<select class=\"<?php echo esc_attr( $value['class'] ); ?>\" multiple=\"multiple\" style=\"<?php echo esc_attr( $value['css'] ); ?>\" name=\"<?php echo esc_attr( $value['id'] ); ?>[]\" data-placeholder=\"<?php echo esc_attr( $value['custom_attributes']['data-placeholder'] ); ?>\" data-action=\"<?php echo esc_attr( $value['custom_attributes']['data-action'] ); ?>\">\n\t\t\t\t\t\t<?php foreach ( $json_ids as $id => $name ) : ?>\n\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( $id ); ?>\" selected=\"selected\"><?php echo $name; ?></option>\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</select>\n\t\t\t\t<?php else: ?>\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\tid=\"<?php echo esc_attr( $value['id'] ); ?>\"\n\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t\tstyle=\"<?php echo esc_attr( $value['css'] ); ?>\"\n\t\t\t\t\t\tvalue=\"<?php echo esc_attr( $option_value ); ?>\"\n\t\t\t\t\t\tclass=\"<?php echo esc_attr( $value['class'] ); ?>\"\n\t\t\t\t\t\tdata-selected=\"<?php echo esc_attr( json_encode( $json_ids ) ); ?>\"\n\t\t\t\t\t\tdata-exclude=\"wc_customer_order_csv_export_grouped_products\"\n\t\t\t\t\t\t<?php echo implode( ' ', $custom_attributes ); ?>\n\t\t\t\t\t\t/> <?php echo $field_description['description']; ?>\n\t\t\t\t<?php endif; ?>\n\t\t\t</td>\n\t\t</tr><?php\n\t}",
"protected function addAttributesToRender($writer)\n\t{\n\t\tparent::addAttributesToRender($writer);\n\t\t$writer->addAttribute('id',$this->getClientID());\n\n\t\t$this->getPage()->getClientScript()->registerPradoScript('dragdrop');\n\t\t$this->getActiveControl()->registerCallbackClientScript(\n\t\t\t$this->getClientClassName(), $this->getPostBackOptions());\n\t}",
"protected function addAttributesToRender($writer)\n\t{\n\t\t$cs=$this->getPage()->getClientScript();\n\t\tif(self::$_first)\n\t\t{\n\t\t\t$code=\"jQuery(document).ready(function(){jQuery.datepicker.setDefaults(jQuery.datepicker.regional['{$this->getCurrentCulture()}']);});\";\n\t\t\t$cs->registerEndScript(sprintf('%08X', crc32($code)), $code);\n\t\t\tself::$_first=false;\n\t\t}\n\t\tparent::addAttributesToRender($writer);\n\t\t$options=TJavascript::encode($this->getOptions()->toArray());\n\t\t$code=\"jQuery('#\".$this->getWidgetID().\"').\".$this->getWidget().\"(\".$options.\");\";\n\t\t$cs->registerEndScript(sprintf('%08X', crc32($code)), $code);\n\t}",
"private function setupFieldsAttributes() {\n\n\t\tforeach ( $this->form as $field ) {\n\n\t\t\tif ( ! $field->hasAttribute( 'id' ) ) {\n\t\t\t\t$field->setAttribute( 'id', esc_attr( sanitize_title( $field->getName() ) ) );\n\t\t\t}\n\t\t}\n\n\t}",
"public function postCreate()\n {\n \tLog::info(\"postCreate in AttributeController\");\n\n \t$product_id = Input::get('product_id');\n \t\n \t$form = $this->attribute->getForm();\n \n \tLog::info(\"111111111111111111\");\n \tif (! $form->isValid()) {\n \t\tLog::info(\"22222222\");\n \t\treturn $this->redirectRoute('admin.attribute.index')\n \t\t->withErrors($form->getErrors())\n \t\t->withInput();\n \t}\n \tLog::info(\"3333333333333333333\");\n \n \t$attribute = $this->attribute->create($form->getInputData());\n \t\n \t$product = $this->product->findById($product_id);\n \t$product->attributes()->attach($attribute->id);\n \t\n \t$attributes = $this->product->findAttributesById($product_id);\n \t\n \t//var_dump($attributes);\n //\t$attributes = $this->product\n \n \treturn $attributes;\n }",
"protected function _prepareLayout()\n {\n parent::_prepareLayout();\n $this->getProductAttributes();\n $this->getAttributeExpression();\n $this->setTemplate('Commercers_AutoContent::attribute.phtml');\n return $this;\n }",
"public function setAttributes();",
"public function render_text_field( array $attr ) {\n ?>\n <tr>\n <td class=\"first\"><label for=\"<?php echo esc_attr( $attr['id'] ); ?>\"><?php echo esc_attr( $attr['label'] ); ?></label></td>\n <td><input type=\"text\" name=\"meta_input[<?php echo esc_attr( $attr['name'] ); ?>]\" size=\"<?php echo esc_attr( $attr['size'] ); ?>\" value=\"<?php echo esc_attr( $attr['value'] ); ?>\" id=\"<?php echo esc_attr( $attr['name'] ); ?>\"></td>\n </tr>\n <?php\n }",
"private function _setElementAttributes($element) {\n $attributes = '';\n\n $classes = array();\n $classes[] = $this->css_class . '-' . $element['#type'];\n $classes[] = 'form-' . $element['#type'];\n\n if ($this->form_settings['use_bootstrap']) {\n switch ($element['#type']) {\n case 'hidden':\n case 'button':\n case 'submit':\n case 'radio':\n case 'checkbox':\n case 'file':\n //cred-162\n case 'option':\n break;\n default:\n $classes[] = 'form-control';\n }\n } else {\n if ('hidden' != $element['#type']) {\n $classes[] = $element['#type'];\n }\n }\n\n if (isset($element['#attributes']) && !empty($element['#attributes'])\n ) {\n if (isset($element['#attributes']['class'])) {\n $element['#attributes']['class'] .= ' ' . implode(' ', $classes);\n } else {\n $element['#attributes']['class'] = implode(' ', $classes);\n }\n } else {\n $element['#attributes'] = array(\n 'class' => implode(' ', $classes)\n );\n }\n\n\n foreach ($element['#attributes'] as $attribute => $value) {\n // Prevent undesired elements\n if (in_array($attribute, array('id', 'name', 'options', 'actual_value', 'actual_options'))) {\n continue;\n }\n // Don't set disabled for checkbox\n if (\n $element['#type'] == 'checkbox' && (\n $attribute == 'disabled' || $attribute == 'readonly'\n )\n ) {\n continue;\n }\n\n // Set return string\n $attributes .= ' ' . $attribute . '=\"' . $value . '\"';\n }\n\n return $attributes;\n }",
"protected function _add_render_attributes() {\n \n // use parent attributes\n parent::_add_render_attributes();\n \n $this->add_render_attribute(\n 'wrapper', 'class', [\n $this->get_name() . '-background-image',\n ]\n ); \n \n }",
"public function RenderElement() {\n\n // prepare most important attributes\n $Attr= $this->BuildAttributes(array('type'=>'checkbox'));\n // prepare attribute \"value\", remember - this is not value of [$Value, $InitValue]\n $Attr['value']= $this->GetOption('Value');\n // prepare attribute \"checked\"\n $Attr['checked']= $this->IsChecked() ? 'checked' : '';\n // render tag\n return $this->Form->RenderTag('input', $Attr, false);\n }",
"public function generateAttributeField($attribute){\r\r\n\t\treturn Yii::app()->controller->renderPartial(\r\r\n\t\t\t\t'ext.Portfolio.views.'.$attribute['type'],\r\r\n\t\t\t\tarray('attribute'=>$attribute),\r\r\n\t\t\t\ttrue\r\r\n\t\t);\r\r\n\t}",
"protected function addAttributesToRender($writer)\n\t{\n\t\tparent::addAttributesToRender($writer);\n\t\tTBaseValidator::registerClientScriptValidator();\n\t}",
"public function __construct($name = null)\n {\n parent::__construct('product');\n $this->setAttribute('method', 'post');\n $this->add(array(\n 'name' => 'id',\n 'attributes' => array(\n 'type' => 'hidden',\n ),\n ));\n $this->add(array(\n 'name' => 'itemname',\n 'attributes' => array(\n 'type' => 'text',\n ),\n 'options' => array(\n 'label' => 'Item Name',\n ),\n ));\n $this->add(array(\n 'name' => 'description',\n 'attributes' => array(\n 'type' => 'text',\n ),\n 'options' => array(\n 'label' => 'Description',\n ),\n ));\n $this->add(array(\n 'name' => 'boughtat',\n 'attributes' => array(\n 'type' => 'text',\n ),\n 'options' => array(\n 'label' => 'Bought At',\n ),\n ));\n $this->add(array(\n 'name' => 'overheads',\n 'attributes' => array(\n 'type' => 'text',\n ),\n 'options' => array(\n 'label' => 'Overheads',\n ),\n ));\n $this->add(array(\n 'name' => 'soldat',\n 'attributes' => array(\n 'type' => 'text',\n ),\n 'options' => array(\n 'label' => 'Sold At',\n ),\n ));\n\n $this->add(array(\n 'type' => 'Zend\\Form\\Element\\Checkbox',\n 'name' => 'sold',\n 'options' => array(\n 'label' => 'Sold',\n 'use_hidden_element' => true,\n 'checked_value' => '1',\n 'unchecked_value' => '0'\n )\n ));\n $this->add(array(\n 'name' => 'profit',\n 'attributes' => array(\n 'type' => 'text'\n ),\n 'options' => array(\n 'label' => 'Profit'\n )\n ));\n $this->add(array(\n 'name' => 'submit',\n 'attributes' => array(\n 'type' => 'submit',\n 'value' => 'Go',\n 'id' => 'submitbutton',\n 'class' => 'btn btn-primary',\n ),\n ));\n }",
"public function init()\r\n {\r\n \t\r\n \r\n \t \t\r\n \t$this->setName('FormularioRamoAtividade');\r\n $ID_RAMO_ATIVIDADE = new Zend_Form_Element_Hidden('ID_RAMO_ATIVIDADE');\r\n $ID_RAMO_ATIVIDADE->addFilter('Int');\r\n $ID_RAMO_ATIVIDADE->removeDecorator('Label');\r\n \r\n $DS_RAMO_ATIVIDADE= new Zend_Form_Element_Text('DS_RAMO_ATIVIDADE');\r\n $DS_RAMO_ATIVIDADE->setLabel('RAMO DE ATIVIDADE')\r\n ->setRequired(true)\r\n ->addFilter('StripTags')\r\n ->addFilter('StringTrim')\r\n ->addValidator('NotEmpty')\r\n \t ->removeDecorator('DtDdWrapper')\r\n \t ->removeDecorator('HtmlTag')\r\n ->removeDecorator('Label')\r\n \t ->setAttrib('class', 'form-control')\r\n \t ->setAttrib('placeholder', 'Enter ramo de atividade');\r\n \r\n \t \r\n \t\t\t\t \r\n \t\t\t\t \r\n \r\n $submit = new Zend_Form_Element_Submit('submit');\r\n $submit->setLabel(\"Adiconar\");\r\n $submit->setAttrib('id', 'submitbutton');\r\n $submit->removeDecorator('DtDdWrapper')\r\n ->setAttrib('class', 'btn btn-primary button')\r\n ->removeDecorator('HtmlTag')\r\n ->removeDecorator('Label'); \r\n \r\n $this->addElements(array($ID_RAMO_ATIVIDADE,$DS_RAMO_ATIVIDADE,$submit)); \r\n $this->setDecorators( array( array('ViewScript', array('viewScript' => '/forms/formularioRamoAtividade.phtml')))); \r\n\t\r\n }",
"public function render(){\n\t\t$fhp; // form_helper_params\n\t\t$value = $this->_data['value'];\n\t\t$form_helper = 'input';\n\t\t$attributes = Arr::extract($this->_data,['id','required','maxlength','title','pattern','readonly','class','size','placeholder','multiple','accept','options']);\n\t\tif(!in_array($this->_data['type'],['radio'])) unset($attributes['options']);\n\t\tif($attributes['required']!==true) unset($attributes['required']);\n\t\tif($attributes['readonly']!==true) unset($attributes['readonly']);\n\t\tif(!$attributes['maxlength']) unset($attributes['maxlength']);\n\t\tif(!$attributes['size']) unset($attributes['size']);\n\t\t$fhp = [$this->_data['name'],$value,$attributes];\n\t\t//$name = $this->_data['name'];\n\t\t//open,close,input,button,checkbox,file,hidden,image,label,password,radio,select,submit,textarea,\n\t\t//$attr\n\t\tswitch($this->_data['type']){\n\t\t\tcase'form':\n\t\t\t\t$form_helper = $this->_data['data_type']; $fhp=[];\n\t\t\t\tbreak;\n\t\t\tcase'select':\n\t\t\t\t//unset\n\t\t\t\t$form_helper='select'; $fhp=[$this->_data['name'],$this->_data['options'],$value,$attributes];\n\t\t\t\tbreak;\n\t\t\tcase'checkbox':\n\t\t\t\t$fhp = [$this->_data['name'],1,!!($value),$attributes];\n\t\t\t\t$form_helper='checkbox';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//if($this->_data['type'] == 'radio') $fhp[2]['options'] = Arr::get($this->_data,'options');\n\t\t\t\tif(in_array($this->_data['type'],['file','select','checkbox','radio','hidden'])) $this->_data['inputtype'] = $this->_data['type'];\n\t\t\t\t//if()\n\t\t\t\tswitch($this->_data['data_type']){\n\t\t\t\t\tcase'int':\n\t\t\t\t\t\t$fhp[2]['type']='number';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase'text':\n\t\t\t\t\t\t$form_helper='textarea';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\tif($form_helper=='input') $fhp[2]['type']=$this->_data['inputtype'];\n\t\t/*switch($this->_data['data_type']){\n\t\t\tcase'form':\n\t\t\t\t\n\t\t\t\t\n\t\t\t}*/\n\t\treturn call_user_func_array([$this,$form_helper],$fhp);\n\t\t//->($this->_data['name']);\n\t\t//return json_encode($this->_datations);\n\t\t//return \n\t\t}",
"function create_custom_field() {\n $args = array(\n 'id' => 'custom_field_brand',\n 'label' => __( 'Detalhes da Marca'),\n 'class' => 'brand-custom-field',\n 'desc_tip' => true,\n 'description' => __( 'Enter the brand details.'),\n );\n woocommerce_wp_textarea_input( $args );\n}",
"protected function _getFieldRenderers()\n {\n// $renderers = parent::_getFieldRenderers();\n// $renderers['spc_api_credentials'] = $this->createCommand(array($this, 'renderLoginFields'));\n// return $renderers;\n }",
"public function edit(ProductAttributeList $attribute)\n {\n echo json_encode($attribute);\n }",
"function uds_pricing_render_product_options_property($name, $type, $product)\n{\n\t$out = \"<div>\";\n\t$out .= \"<label>$name</label>\";\n\t$html_name = sanitize_title_with_dashes($name);\n\tswitch($type) {\n\t\tcase 'checkbox':\n\t\t\t$checked = $product['properties'][$name] == 'on' ? \"checked='checked'\" : \"\" ;\n\t\t\t$out .= \"<input type='checkbox' name='{$html_name}[]' $checked />\";\n\t\t\tbreak;\n\t\tcase 'text':\n\t\tdefault:\n\t\t\t$out .= \"<input type='text' name='{$html_name}[]' value='{$product['properties'][$name]}' class='text' />\";\n\t}\n\t$out .= \"<div class='clear'></div>\";\n\t$out .= \"</div>\";\n\t\n\treturn $out;\n}",
"public function Create()\n {\n return view('admin.attribute.create-attribute');\n }",
"public function provideRender()\n {\n return [\n 'empty atttribs array test' => [\n 'expected' => '<input type=\"submit\" value=\"Submit\" class=\"btn btn-default\">',\n 'attribs' => [],\n ],\n\n ];\n }",
"function custom_add_artwork_attr( $attributes ){\n\t\t\t$attributes['class'] .= ' equalize col-xs-12 col-sm-6 col-md-4';\n\t\t\t$attributes['itemtype'] = 'http://schema.org/ArtworkArticle';\n\t\t\t// return the attributes\n\t\t\treturn $attributes;\n\t\t}",
"public function render(ElementInterface $element) {\n /**\n * Ser for input hidden nao gera as divs\n */\n if ($element instanceof \\Zend\\Form\\Element\\Hidden ||\n $element instanceof \\Zend\\Form\\Element\\Csrf) {\n return $this->getView()->formInput($element);\n } elseif ($element instanceof \\Zend\\Form\\Element\\Image) {\n $html = '<div class=\"form-group\">';\n $html .= $this->getView()->formImage($element);\n $html .= '</div>';\n return $html;\n return $this->getView()->formImage($element);\n } elseif ($element instanceof \\MySDK\\Form\\Element\\Code) {\n return $element->getValue();\n }elseif($element instanceof \\Zend\\Form\\Element\\Submit){\n //@todo melhorar renderzação do field ubmite\n return '<label for=\"\"></label><input name=\"' . $element->getName() . '\" placeholder=\"\" class=\"' . $element->getAttributes()['class'] . '\" value=\"' . $element->getValue() . '\" type=\"' . $element->getAttributes()['type'] . '\">';\n\n } else {\n $gridFieldClassPrefix = 'col-xs-';\n $gridFieldSizeDefault = 2;\n\n $size = $element->getOption('size') ? $element->getOption('size') : $gridFieldSizeDefault;\n $classError = $this->getView()->formElementErrors($element) ? \"has-error\" : '';\n $inputSize = $element->getOption('inputSize') ? $element->getOption('inputSize') : '';\n $classGrid = $element->getOption('classGrid') ? $element->getOption('classGrid') : '';\n $classFormGroup = $element->getOption('classFormGroup') ? $element->getOption('classFormGroup') : '';\n $getLabal = $element->getLabel();\n $getType = $element->getAttributes()['type'];\n $getName = $element->getAttributes()['name'];\n $getPlaceholder = $element->getAttributes()['placeholder']?$element->getAttributes()['placeholder']:'';\n $getClass = $element->getAttributes()['class'];\n $mask = $element->getOption('mask') ? $element->getOption('mask') : false;\n\n\n\n $html = '';\n // $html .= ' <div class=\"' . $gridFieldClassPrefix . $size . ' ' . $classGrid . '\">';\n $html .='<div class=\"row\">';\n $html .='<div class=\"' . $gridFieldClassPrefix . $size . '\">';\n\n $html .= ' <div class=\"form-group ' . ' ' . $classFormGroup . ' ' . $inputSize . ' ' . $classError . '\">';\n\n $html .= '<label for=\"' . $getName . '\">'.$getLabal.'</label>';\n $html .= '<input type=\"' . $getType . '\" name=\"' . $getName . '\" placeholder=\"' . $getPlaceholder . '\" class=\"' . $getClass . '\" value=\"\">';\n\n $html .= $this->getView()->formElementErrors()\n ->setMessageOpenFormat('<span class=\"help-block\">')\n ->setMessageSeparatorString('<br/>')\n ->setMessageCloseString('</span>')\n ->render($element);\n\n $html .= ' </div>';\n $html .= ' </div>';\n $html .= ' </div>';\n// $html .= ' </div>';\n\n if (false != $mask) {\n $html .= \"<script>\";\n $html .= \"$(document).ready(function(){ $('input[name=\\\"\" . $getName . \"\\\"]').mask('\" . $mask . \"') });\";\n $html .= \"</script>\";\n }\n\n return $html;\n }\n }",
"function dynamic($tag, $name, $value, $attribute){\r\n \t\t$attribute = $this->convertStringAtt($attribute);\r\n \t\t$tmp = '';\r\n\t\t$optionArray = array();\r\n\r\n\t\tif(\r\n\t\t\t$tag != \"select\" &&\r\n\t\t\t$tag != \"multySelect\" &&\r\n\t\t\t$tag != \"radioBox\" &&\r\n\t\t\t$tag != \"multyBox\" &&\r\n\t\t\t$tag != \"moveSelect\" &&\r\n\t\t\t$tag != \"changeSelect\"\r\n\t\t) return '';\r\n\t\t\r\n\t\tif($tag == \"multySelect\"){\r\n\t\t\t$tag = 'select';\r\n\t\t\t$attribute['multiple'] = 'multiple';\r\n\t\t}\r\n\r\n \t\tif(isset($attribute['data'])){\r\n\r\n\t\t\tif(is_array($attribute['data'])){\r\n\t\t\t\tforeach($attribute['data'] as $k => $v){\r\n\t\t\t\t\t$optionArray[$k] = (is_array($v) ? $v[0] : $v);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$tmp_arr = explode(\"%\",$attribute['data']);\r\n\t\t\t\t\r\n\t\t\t\tif($tmp_arr[0] == 'base'){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$infoArray = explode(\";\", $tmp_arr[1]);\r\n\t\t\t\t\t$optionArray = array();\r\n\t\t\t\t\tif(isset($infoArray[4]) && ($tag == 'select' || $tag == 'radioBox')){\r\n\t\t\t\t\t\tfor($i=4;isset($infoArray[$i]);$i++){\r\n\t\t\t\t\t\t\t$ex_def = split(\"[,:]\", $infoArray[$i]); // save old functionality\r\n\t\t\t\t\t\t\tif(isset($ex_def[1])){\r\n\t\t\t\t\t\t\t\t$optionArray[$ex_def[0]] = $ex_def[1];\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$optionArray[] = $infoArray[$i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$preg_ex = \"/^((.+) as )?[^a-zA-Z_]*([a-zA-Z_]+)[^a-zA-Z_]*$/i\";\r\n\t\t\t\t\t$var_1 = $infoArray[1];\r\n\t\t\t\t\tpreg_match($preg_ex,$infoArray[1],$ex);\r\n\t\t\t\t\tif($ex[1]){\r\n\t\t\t\t\t\t$var_1 = $ex[3];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$infoArray[1] = \"`\".$infoArray[1].\"`\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$var_2 = $infoArray[2];\r\n\t\t\t\t\tpreg_match($preg_ex, $infoArray[2], $ex);\r\n\t\t\t\t\tif($ex[1]){\r\n\t\t\t\t\t\t$var_2 = $ex[3];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$infoArray[2] = \"`\".$infoArray[2].\"`\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$criteria = '';//(isset($infoArray[3]) ? $infoArray[3] : ' order by `'.$var_2.'` ');\r\n\t\t\t\t\t$rdr = BASIC_SQL::init()->read_exec(\"select * from `\".$infoArray[0].\"` where 1=1 \".$criteria.\" \");\r\n\r\n\t\t\t\t\tfor($i=0;$rdr->read();$i++){\r\n\t\t\t\t\t if(!$rdr->test($var_2)){\r\n\t\t\t\t\t if(isset($GLOBALS['BASIC_LANG']) && is_object($GLOBALS['BASIC_LANG']) && $rdr->test($var_2.'_'.$GLOBALS['BASIC_LANG']->current())){\r\n\t\t\t\t\t $optionArray[$rdr->field($var_1)] = $rdr->field($var_2.'_'.BASIC_LANGUAGE::init()->current());\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t throw new Exception('Column '.$infoArray[0].'.'.$var_2.' no exist.');\r\n\t\t\t\t\t }\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t\t $optionArray[$rdr->field($var_1)] = $rdr->field($var_2);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if($tmp_arr[0] == 'query'){ // NEW\r\n\t\t\t\t \r\n\t\t\t\t\t$infoArray = explode(\";\", $tmp_arr[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!isset($infoArray[1])){\r\n\t\t\t\t\t $query = $infoArray[0];\r\n $query = preg_replace(\"[\\n\\t\\r]\",\"\",$query);\r\n \r\n preg_match('/select[ ]+(.+)[ ]+from/i',$query,$ex);\r\n if(isset($ex[1])){\r\n $ex[1] = preg_replace(\"/[` ]+/\",\"\",$ex[1]);\r\n \r\n $tmp = explode(',',$ex[1]);\r\n if(isset($tmp[1])){\r\n $infoArray[2] = $tmp[1];\r\n }else{\r\n $infoArray[2] = $tmp[0];\r\n }\r\n $infoArray[1] = $tmp[0];\r\n \r\n $infoArray[1] = preg_replace(\"/^[^\\.]+\\./\", \"\", $infoArray[1]);\r\n $infoArray[2] = preg_replace(\"/^[^\\.]+\\./\", \"\", $infoArray[2]);\r\n \r\n $infoArray[0] = preg_replace('/select[ ]+(.+)[ ]+from/i','select * from',$query);\r\n }else{\r\n throw new Exception('In query ['.$query.'] no declare id and text columns.');\r\n }\t\t\t\t \r\n\t\t\t\t\t}\r\n\t\t\t\t\tBASIC_SQL::init()->read_exec($infoArray[0]);\r\n\t\t\t\t\twhile($rdr->read()){\r\n\t\t\t\t if(!$rdr->test($infoArray[2])){\r\n\t\t\t\t\t if(isset($GLOBALS['BASIC_LANG']) && is_object($GLOBALS['BASIC_LANG']) && $rdr->test($infoArray[2].'_'.$GLOBALS['BASIC_LANG']->current())){\r\n\t\t\t\t\t $optionArray[$rdr->field($infoArray[1])] = $rdr->field($infoArray[2].'_'.BASIC_LANGUAGE::init()->current());\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t throw new Exception(500,'Column '.$infoArray[0].'.'.$infoArray[2].' no exist.');\r\n\t\t\t\t\t }\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t\t $optionArray[$rdr->field($infoArray[1])] = $rdr->field($infoArray[2]);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$ex = explode(\";\", $tmp_arr[1]);\r\n\t\t\t\t\tforeach($ex as $V){\r\n\t\t\t\t\t\t$spl = explode(\":\", $V);\r\n\t\t\t\t\t\tif(isset($spl[1])){\r\n\t\t\t\t\t\t\t$optionArray[$spl[0]] = $spl[1];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$attribute['data'] = $optionArray;\r\n\t\t}\r\n \t\treturn $this->controle($tag, $name, $value, $attribute);\r\n \t}",
"public function setupDynamicAttribs() {\n\t\t$foundAttribs = false;\n //look in request\n //FIXME try to grab the global Zend Request object somehow\n if(isset($_POST['mto_width']) ) {\n //if not, use some defaults\n\t\t\t$foundAttribs = true;\n $this->productWidth = @$_POST['mto_width'];\n } else {\n //if not, use some defaults\n $this->productWidth = @$this->_data['mto_width_min'];\n }\n\n if(isset($_POST['mto_height']) ) {\n\t\t\t$foundAttribs = true;\n $this->productHeight = @$_POST['mto_height'];\n\t\t} else {\n //if not, use some defaults\n $this->productHeight = @$this->_data['mto_height_min'];\n\t\t}\n\n if(isset($_POST['mto_depth']) ) {\n\t\t\t$foundAttribs = true;\n $this->productDepth = @$_POST['mto_depth'];\n\t\t} else {\n //if not, use some defaults\n $this->productDepth = @$this->_data['mto_height_min'];\n\t\t}\n\n //product line is sku minus '-CS'\n $this->productLine = substr($this->getData('sku'),0, -3);\n //calc sqft, round down\n\t\t//TODO add in fractional inches\n $this->productSqft = floor($this->productWidth * $this->productHeight);\n//var_dump($this->productWidth);exit();\n\t\treturn $foundAttribs;\n }",
"function filter_woocommerce_rest_prepare_product_object( $response, $object, $request ) {\n if( empty( $response->data ) ) {\n return $response;\n }\n\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n // Loop through the attributes on current product\n $attributes = $response->data['attributes'];\n foreach($attributes as $attrkey => $attribute) {\n\n /* ########################################################\n - Adding new swatch key to attribute response for color attributes,\n which holds the hex code for each swatch color option\n ######################################################## */\n // Get an array of attributes whose attribute type is color\n $color_type_attribute_taxonomies = array_filter($attribute_taxonomies, function($attribute_taxonomy) {\n return $attribute_taxonomy->attribute_type == 'color';\n });\n // Loop through the color type attributes\n foreach($color_type_attribute_taxonomies as $tax_object) {\n //Check if current attribute is a color type attribute\n if ($attribute['id'] == $tax_object->attribute_id) {\n // Get current attribute's options\n $options = $response->data['attributes'][$attrkey]['options'];\n // Get current attribute's terms\n $color_terms = get_terms('pa_' . $tax_object->attribute_name);\n foreach( $options as $option ) {\n foreach($color_terms as $term) {\n if ($term->name == $option) {\n // Add a new swatch with hex value for each color option\n $response->data['attributes'][$attrkey]['swatches'][$option] = get_term_meta( $term->term_id, 'product_attribute_color', true);\n }\n }\n }\n }\n }\n\n /* ########################################################\n - Adding attribute taxonomy to the attribute response\n - Adding attribute identifier to the attribute response\n - Adding more detailed option data to the attribute options response\n ######################################################## */\n foreach($attribute_taxonomies as $attribute_taxonomy) {\n if ($attribute['id'] == $attribute_taxonomy->attribute_id) {\n\n /* Add slug to current attribute response */\n $response->data['attributes'][$attrkey]['taxonomy'] = ('pa_' . $attribute_taxonomy->attribute_name);\n\n /* Add attribute identifier to current attribute response */\n $response->data['attributes'][$attrkey]['slug'] = $attribute_taxonomy->attribute_name;\n\n /* Replace default options data with detailed options data for current attribute */\n $options = $response->data['attributes'][$attrkey]['options'];\n $new_options = array();\n $attribute_terms = get_terms('pa_' . $attribute_taxonomy->attribute_name);\n\n foreach( $options as $option ) {\n foreach($attribute_terms as $attribute_term) {\n if ($attribute_term->name == $option) {\n $new_options[] = (object) [\n 'id' => $attribute_term->term_id,\n 'name' => $attribute_term->name,\n 'slug' => $attribute_term->slug,\n 'taxonomy' => $attribute_term->taxonomy,\n 'description' => $attribute_term->description,\n 'count' => $attribute_term->count\n ];\n }\n }\n }\n $response->data['attributes'][$attrkey]['options'] = $new_options;\n }\n }\n }\n\n /* ########################################################\n - Replacing Variation IDs with Variation details\n ######################################################## */\n\n // Get the current product object\n $variation_ids = $response->data['variations'];\n\n $detailed_variations = array_map(function($variation_id) {\n $variation = wc_get_product($variation_id);\n return (object) [\n 'variation_id' => $variation->get_id(),\n 'image_url' => wp_get_attachment_url($variation->get_image_id()),\n 'variation_regular_price' => $variation->get_regular_price(),\n 'variation_sale_price' => $variation->get_sale_price(),\n 'attributes' => $variation->get_attributes(),\n 'is_on_sale' => $variation->is_on_sale()\n ];\n }, $variation_ids);\n\n $response->data['variations'] = $detailed_variations;\n\n\n /* ########################################################\n - Get ALL Variation attributes for a product\n ######################################################## */\n if ($response->data['type'] == 'variable') {\n $variation_attributes = wc_get_product($response->data['id'])->get_variation_attributes();\n $variation_attributes = array_map(function($attribute) {\n return (array_values($attribute));\n }, $variation_attributes);\n $response->data['variation_attributes'] = $variation_attributes;\n }\n\n\n\n /* Return new response */\n return $response;\n}",
"public function show ( )\n {\n $tag = new Element ( 'input' );\n $tag -> class = 'field';\t\t // classe CSS\n $tag -> name = $this -> name;\n $tag -> value = $this -> value;\n $tag -> type = 'radio';\n \n // se o campo não é editável\n if ( !parent::getEditable ( ) ) {\n // desabilita a TAG input\n $tag -> readonly = \"1\";\n }\n \n if ( $this -> properties ) {\n foreach ( $this -> properties as $property => $value ) {\n $tag -> $property = $value;\n }\n }\n \n // exibe a tag\n $tag -> show ( );\n }",
"public function computeRendermodeAttribute(): void\n {\n $renderer = $this->getRenderer();\n $this->attributes['data-rendermode'] = $renderer->getMode() ?? 'default';\n }",
"function basel_compare_display_field( $field_id, $product ) {\n\n\t\t$type = $field_id;\n\n\t\tif ( 'pa_' === substr( $field_id, 0, 3 ) ) {\n\t\t\t$type = 'attribute';\n\t\t}\n\n\t\tswitch ( $type ) {\n\t\t\tcase 'basic':\n\t\t\t\techo '<div class=\"compare-basic-content\">';\n\t\t\t\t\techo '<a href=\"#\" class=\"basel-remove-button\" data-id=\"' . esc_attr( $product['id'] ) . '\"><span class=\"remove-loader\"></span>' . esc_html__( 'Remove', 'basel' ) . '</a>';\n\t\t\t\t\techo '<a class=\"product-image\" href=\"' . get_permalink( $product['id'] ) . '\">' . $product['basic']['image'] . '</a>';\n\t\t\t\t\techo '<h4 class=\"product-title\"><a href=\"' . get_permalink( $product['id'] ) . '\">' . $product['basic']['title'] . '</a></h4>';\n\t\t\t\t\techo wp_kses_post( $product['basic']['rating'] );\n\t\t\t\t\techo '<div class=\"price\">';\n\t\t\t\t\t\techo wp_kses_post( $product['basic']['price'] );\n\t\t\t\t\techo '</div>';\n\t\t\t\tif ( ! basel_get_opt( 'catalog_mode' ) ) {\n\t\t\t\t\techo apply_filters( 'basel_compare_add_to_cart_btn', $product['basic']['add_to_cart'] );\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\t\t\t\tbreak;\n\n\t\t\tcase 'attribute':\n\t\t\t\tif ( $field_id === basel_get_opt( 'brands_attribute' ) ) {\n\t\t\t\t\t$brands = wc_get_product_terms( $product['id'], $field_id, array( 'fields' => 'all' ) );\n\n\t\t\t\t\tif ( empty( $brands ) ) {\n\t\t\t\t\t\techo '-';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $brands as $brand ) {\n\t\t\t\t\t\t$image = get_term_meta( $brand->term_id, 'image', true );\n\n\t\t\t\t\t\tif ( ! empty( $image ) ) {\n\t\t\t\t\t\t\techo '<div class=\"basel-compare-brand\">';\n\t\t\t\t\t\t\t echo apply_filters( 'basel_image', '<img src=\"' . esc_url( $image ) . '\" title=\"' . esc_attr( $brand->name ) . '\" alt=\"' . esc_attr( $brand->name ) . '\" />' );\n echo '</div>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo wp_kses_post( $product[ $field_id ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo wp_kses_post( $product[ $field_id ] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'weight':\n\t\t\t\tif ( $product[ $field_id ] ) {\n\t\t\t\t\t$unit = $product[ $field_id ] !== '-' ? get_option( 'woocommerce_weight_unit' ) : '';\n\t\t\t\t\techo wc_format_localized_decimal( $product[ $field_id ] ) . ' ' . esc_attr( $unit );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\techo wp_kses_post( $product[ $field_id ] );\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function edit_component_tool_inputs_param_options_filter(&$form) {\n // use current time as form_key to enable webform component clone.\n $form['form_key']['#default_value'] = 'form_key_' . time();\n\n unset($form['validation']);\n unset($form['display']);\n\n $form = array_merge($form, get_edit_component_base_form_elements($form, 'filter'));\n\n // form field to edit attributes, available attributes for command includes:\n $form['extra']['attributes']['type'] = [\n '#type' => 'select',\n '#title' => t('Type'),\n '#description' => t('These values are defined in the module ' .\n l('/lib/galaxy/tools/parameters/dynamic_options.py', 'https://github.com/galaxyproject/galaxy/blob/master/lib/galaxy/tools/parameters/dynamic_options.py') .\n ' in the filter_types dictionary'),\n '#options' => drupal_map_assoc([\n 'data_meta',\n 'param_value',\n 'static_value',\n 'unique_value',\n 'multiple_splitter',\n 'attribute_value_splitter',\n 'add_value',\n 'remove_value',\n 'sort_by',\n ]),\n '#required' => TRUE,\n ];\n $form['extra']['attributes']['column'] = [\n '#type' => 'textfield',\n '#title' => t('Column'),\n '#description' => t('Column targeted by this filter - this attribute is \n unused and invalid if <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span> or \n <span style=\"color: #FF5666\">remove_value</span>. \n This can be a column index or a column name.'),\n ];\n $form['extra']['attributes']['name'] = [\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#description' => t('Name displayed for value to add (only used with \n <span style=\"color: #FF5666;\">type</span> of <span style=\"color: #FF5666\">add_value</span>).'),\n ];\n $form['extra']['attributes']['ref'] = [\n '#type' => 'textfield',\n '#title' => t('Reference file'),\n '#description' => t('The attribute name of the reference file (tool data) or \n input dataset. Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span> (required), \n <span style=\"color: #FF5666\">param_value</span> (required), or \n <span style=\"color: #FF5666\">remove_value</span> (optional).')\n ];\n $form['extra']['attributes']['key'] = [\n '#type' => 'textfield',\n '#title' => t('Key'),\n '#description' => t('When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span>, \n <span style=\"color: #FF5666\">param_value</span>, or \n <span style=\"color: #FF5666\">remove_value</span> - this is the name of \n the metadata key to filter by.'),\n ];\n $form['extra']['attributes']['multiple'] = [\n '#type' => 'radios',\n '#title' => t('Multiple'),\n '#description' => t('For types <span style=\"color: #FF5666\">data_meta</span> and \n <span style=\"color: #FF5666\">remove_value</span>, whether option values are multiple. \n Columns will be split by separator. Defaults to <span style=\"color: #FF5666\">false</span>.'),\n '#options' => drupal_map_assoc([\n 'true',\n 'false',\n ])\n ];\n $form['extra']['attributes']['separator'] = [\n '#type' => 'textfield',\n '#title' => t('Separator'),\n '#description' => t('When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span>, \n <span style=\"color: #FF5666\">multiple_splitter</span>, or \n <span style=\"color: #FF5666\">remove_value</span> - this is used to split \n one value into multiple parts. When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span> or \n <span style=\"color: #FF5666\">remove_value</span> this is only used if \n <span style=\"color: #FF5666\">multiple</span> is set to \n <span style=\"color: #FF5666\">true</span>.')\n ];\n $form['extra']['attributes']['keep'] = [\n '#type' => 'radios',\n '#title' => t('Keep'),\n '#description' => t('If <span style=\"color: #FF5666\">true</span>, keep columns \n matching the value, if <span style=\"color: #FF5666\">false</span> discard \n columns matching the value. Used when <span style=\"color: #FF5666\">type</span> \n is either <span style=\"color: #FF5666\">static_value</span> or \n <span style=\"color: #FF5666\">param_value</span>.'),\n '#options' => drupal_map_assoc([\n 'true',\n 'false',\n ]),\n '#default_value' => 'true',\n ];\n $form['extra']['attributes']['value'] = [\n '#type' => 'textfield',\n '#title' => t('Value'),\n '#description' => t('Target value of the operations - has slightly different \n meanings depending on type. For instance when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span> it is the value to add to the list \n and when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">static_value</span> it is the value compared against.')\n ];\n $form['extra']['attributes']['ref_attribute'] = [\n '#type' => 'textfield',\n '#title' => t('Reference attribute'),\n '#description' => t('Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">param_value</span>. Period (<span style=\"color: #FF5666\">.</span>) \n separated attribute chain of input (<span style=\"color: #FF5666\">ref</span>) \n attributes to use as value for filter.'),\n ];\n $form['extra']['attributes']['index'] = [\n '#type' => 'textfield',\n '#title' => t('Index'),\n '#description' => t('Used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span>, it is the index into the \n list to add the option to. If not set, the option will be added to \n the end of the list.'),\n ];\n $form['extra']['attributes']['meta_ref'] = [\n '#type' => 'textfield',\n '#title' => t('Meta reference'),\n '#description' => t('Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">remove_value</span>. Dataset to look for the \n value of metadata <span style=\"color: #FF5666\">key</span> to remove from the list.')\n ];\n // grab populated data from 'extra' column from webform_component table and\n // fill it as default values for edit component form fields.\n edit_component_form_fields_default_value($form);\n}",
"public function render() {\n $model = $this->storePath ? \"store-path=\\\"{$this->storePath}\\\"\" : '';\n $form = \":form=\\\"{$this->toProp()}\\\"\";\n\n\t\treturn \"<{$this->getComponent()} $form $model></{$this->getComponent()}>\";\n\t}",
"function render($element, $form)\n {\n }",
"public function render(Varien_Data_Form_Element_Abstract $element)\n {\n $this->setElement($element);\n $this->_setAddButton();\n return $this->toHtml();\n }",
"function es_display_custom_quickedit_product() {\n ?>\n\t<br class=\"clear\" />\n\t<h4>Custom Fields</h4>\n\t<label>\n\t\t<span class=\"title\"><?php _e( 'Member Price', 'woocommerce' ); ?></span>\n\t\t<span class=\"input-text-wrap\">\n\t\t\t<input type=\"text\" name=\"member_price\" class=\"text wc_input_price\" value=\"\">\n\t\t</span>\n\t</label>\n\t<br class=\"clear\" />\n <?php\n}",
"function clients_addAttribute($table_identifier,$attributeid=null) {\n\tglobal $Auth,$gSession;\n\n\t## get the template for now\n\t$select_template = new Template('interface/');\n\t$select_template->set_templatefile(array(\"header\" => \"add_attribute.tpl\",\"body\" => \"add_attribute.tpl\",\"footer\" => \"add_attribute.tpl\"));\n\n\t## first check if we got a attribute-id\n\tif(isset($attributeid)) {\n\t\t## okay we need to edit the supplied attribute\n\t\t$db_connection = new DB_Sql();\n\t\t$query = \"SELECT text FROM \".DB_PREFIX.$GLOBALS['_MODULE_DATAOBJECTS_DBPREFIX'].\"_\".$table_identifier.\" WHERE id='\".$attributeid.\"'\";\n\t\t$result_pointer = $db_connection->query($query);\n\t\t$db_connection->next_record();\n\t\t\n\t\t$attribute_value = $db_connection->Record[\"text\"];\n\t\t$select_template->set_var('value',$attribute_value);\n\t}\n\n\t## this is for storing and deleting a new value\n\t$actionURL = \"editor.php\";\n\t$actionURL = $gSession->url($actionURL);\n\t$select_template->set_var('actionURL',$actionURL);\n\t\n\t## prepare the language stuff\n\t$select_template->set_var(\"backIMG\",\"lang/\".$Auth->auth[\"language\"].\"_button_cancel.gif\");\n\t$select_template->set_var(\"saveIMG\",\"lang/\".$Auth->auth[\"language\"].\"_button_save.gif\");\n\t$select_template->set_var('language_header',LANG_MODULE_CLIENTS_AttributeTitle);\n\t$select_template->set_var('language_description',LANG_MODULE_CLIENTS_AttributeDesc);\n\t$select_template->set_var('NewEntry',LANG_MODULE_CLIENTS_AttributeNewEntry);\n\t\n\t## output the lang\n\t$select_template->set_var('LANG',$Auth->auth[\"language\"]);\n\t\t\t\n\t## here we initialize the hiddenfields\t\n\t$output = '<input type=\"hidden\" name=\"op\" value=\"save\">';\n\t$output .= '<input type=\"hidden\" name=\"attribute\" value=\"'.$table_identifier.'\">';\n\t$output .= '<input type=\"hidden\" name=\"attribute_id\" value=\"'.$attributeid.'\">';\n\t$output .= '<input type=\"hidden\" name=\"Session\" value=\"'.$gSession->id.'\">';\n\t$output .= \t'<input type=\"hidden\" name=\"source\" value=\"'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'\">';\n\t$select_template->set_var(\"hiddenfields\",$output);\n\t\n\t## and finally flush the footer\n\t$select_template->pfill_block(\"header\");\n\t$select_template->pfill_block(\"body\");\n\t$select_template->pfill_block(\"footer\");\n\n\t\n\t## finally we return the positive value\n\treturn $return_value;\n}",
"public function edit(ProductAttributes $productAttributes)\n {\n //\n }",
"public function render()\n {\n $parameters = $this->data['parameterArray'];\n $parameters['row'] = $this->data['databaseRow'];\n // Vars\n $uid = $parameters['row']['uid'];\n $pid = $parameters['row']['pid'];\n $name = $parameters['itemFormElName'];\n $value = $parameters['itemFormElValue'];\n $cType = $parameters['row']['CType'];\n $gridLayout = $parameters['row']['tx_gridelements_backend_layout'];\n // In case of new content elements, pid might be negative\n if ($pid < 1) {\n $pid = $this->getPidFromParentContentElement($pid);\n }\n // C-Type could be an array or a string\n if (is_array($cType) && isset($cType[0])) {\n $cType = $cType[0];\n }\n if (is_array($gridLayout) && isset($gridLayout[0])) {\n $gridLayout = $gridLayout[0];\n }\n // Get values\n $values = explode(',', $value);\n $this->valuesFlipped = array_flip($values);\n $this->valuesAvailable = [];\n // Get configuration\n $behaviours = $this->getMergedConfiguration($pid, 'behaviour', $cType);\n // Build checkboxes\n $this->checkboxesArray['default'] = [];\n $this->checkboxesArray['ctype'] = [];\n $this->checkboxesArray['gridLayout'] = [];\n if (isset($behaviours['properties']) && is_array($behaviours['properties'])) {\n foreach ($behaviours['properties'] as $contentElementKey => $label) {\n // GridElements: are able to provide grid-specific behaviours\n if (is_array($label) && $cType === 'gridelements_pi1' && !array_key_exists($contentElementKey, $this->defaultProperties)) {\n $contentElementKey = substr($contentElementKey, 0, -1);\n\n // Behaviour for all GridElements\n if ($contentElementKey == 'default' && !empty($label)) {\n foreach ($label as $gridLayoutKey => $gridLayoutBehaviourLabel) {\n $this->createElement($gridLayoutKey, $gridLayoutBehaviourLabel, 'ctype');\n }\n }\n // Behaviour only for selected GridElement\n elseif ($contentElementKey == $gridLayout && !empty($label)) {\n foreach ($label as $gridLayoutKey => $gridLayoutBehaviourLabel) {\n $this->createElement($gridLayoutKey, $gridLayoutBehaviourLabel, 'gridLayout');\n }\n }\n }\n // Normal CEs\n else {\n // Is default property!?\n if (array_key_exists($contentElementKey, $this->defaultProperties)) {\n $this->createElement($contentElementKey, $label, 'default');\n }\n // Is ctype specific!\n else {\n $this->createElement($contentElementKey, $label, 'ctype');\n }\n }\n }\n }\n // Merge checkbox groups\n $checkboxes = '';\n $checkboxes .= $this->getMergedCheckboxes('default');\n $checkboxes .= $this->getMergedCheckboxes('ctype', $cType);\n $checkboxes .= $this->getMergedCheckboxes('gridLayout', $gridLayout);\n if ($checkboxes === '') {\n $checkboxes = $this->getLanguageService()->sL('LLL:EXT:themes/Resources/Private/Language/locallang.xlf:behaviour.no_behaviour_available');\n }\n // Process current classes/identifiers\n $setClasses = array_intersect($values, $this->valuesAvailable);\n $setClass = htmlspecialchars(implode(' ', $setClasses));\n $setValue = htmlspecialchars(implode(',', $setClasses));\n // Allow admins to see the internal identifiers\n $inputType = 'hidden';\n if ($this->isAdminAndDebug()) {\n $inputType = 'text';\n }\n // Build hidden field structure\n $hiddenField = '<div>'.LF;\n $hiddenField .= '<div class=\"form-control-wrap\">'.LF;\n $hiddenField .= '<input class=\"form-control themes-hidden-admin-field '.$setClass.'\" ';\n $hiddenField .= 'readonly=\"readonly\" type=\"'.$inputType.'\" ';\n $hiddenField .= 'name=\"'.htmlspecialchars($name).'\" ';\n $hiddenField .= 'value=\"'.$setValue.'\" class=\"'.$setClass.'\">'.LF;\n $hiddenField .= '</div>'.LF;\n $hiddenField .= '</div>'.LF;\n // Missed classes\n $missedField = $this->getMissedFields($values, $this->valuesAvailable);\n\n return ['html' => '<div class=\"contentBehaviour\">'.$checkboxes.$hiddenField.$missedField.'</div>'];\n }",
"function render() {\n\t\tglobal $current_user, $user_identity;\n\n\t\t$r = '';\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\t\t$field_required = $this->get_attribute( 'required' );\n\t\t$placeholder = $this->get_attribute( 'placeholder' );\n\t\t$field_placeholder = ( ! empty( $placeholder ) ) ? \"placeholder='\" . esc_attr( $placeholder ) . \"'\" : '';\n\n\t\tif ( isset( $_POST[$field_id] ) ) {\n\t\t\t$this->value = stripslashes( (string) $_POST[$field_id] );\n\t\t} elseif (\n\t\t\tis_user_logged_in()\n\t\t\t&& ( ( defined( 'IS_WPCOM' ) && IS_WPCOM )\n\t\t\t || true === apply_filters( 'jetpack_auto_fill_logged_in_user', false )\n\t\t\t)\n\t\t) {\n\t\t\t// Special defaults for logged-in users\n\t\t\tswitch ( $this->get_attribute( 'type' ) ) {\n\t\t\tcase 'email';\n\t\t\t\t$this->value = $current_user->data->user_email;\n\t\t\t\tbreak;\n\t\t\tcase 'name' :\n\t\t\t\t$this->value = $user_identity;\n\t\t\t\tbreak;\n\t\t\tcase 'url' :\n\t\t\t\t$this->value = $current_user->data->user_url;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$this->value = $this->get_attribute( 'default' );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->value = $this->get_attribute( 'default' );\n\t\t}\n\n\t\t$field_value = Grunion_Contact_Form_Plugin::strip_tags( $this->value );\n\t\t$field_label = Grunion_Contact_Form_Plugin::strip_tags( $field_label );\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t$r .= \"\\n<div>\\n\";\n\t\t\t$r .= \"\\t\\t<label for='\" . esc_attr( $field_id ) . \"' class='grunion-field-label email\" . ( $this->is_error() ? ' form-error' : '' ) . \"'>\" . esc_html( $field_label ) . ( $field_required ? '<span>' . __( \"(required)\", 'jetpack' ) . '</span>' : '' ) . \"</label>\\n\";\n\t\t\t$r .= \"\\t\\t<input type='email' name='\" . esc_attr( $field_id ) . \"' id='\" . esc_attr( $field_id ) . \"' value='\" . esc_attr( $field_value ) . \"' class='email' \" . $field_placeholder . \" \" . ( $field_required ? \"required aria-required='true'\" : \"\" ) . \"/>\\n\";\n\t\t\t$r .= \"\\t</div>\\n\";\n\t\t\tbreak;\n\t\tcase 'textarea' :\n\t\t\t$r .= \"\\n<div>\\n\";\n\t\t\t$r .= \"\\t\\t<label for='contact-form-comment-\" . esc_attr( $field_id ) . \"' class='grunion-field-label textarea\" . ( $this->is_error() ? ' form-error' : '' ) . \"'>\" . esc_html( $field_label ) . ( $field_required ? '<span>' . __( \"(required)\", 'jetpack' ) . '</span>' : '' ) . \"</label>\\n\";\n\t\t\t$r .= \"\\t\\t<textarea name='\" . esc_attr( $field_id ) . \"' id='contact-form-comment-\" . esc_attr( $field_id ) . \"' rows='20' \" . $field_placeholder . \" \" . ( $field_required ? \"required aria-required='true'\" : \"\" ) . \">\" . esc_textarea( $field_value ) . \"</textarea>\\n\";\n\t\t\t$r .= \"\\t</div>\\n\";\n\t\t\tbreak;\n\t\tcase 'radio' :\n\t\t\t$r .= \"\\t<div><label class='grunion-field-label\" . ( $this->is_error() ? ' form-error' : '' ) . \"'>\" . esc_html( $field_label ) . ( $field_required ? '<span>' . __( \"(required)\", 'jetpack' ) . '</span>' : '' ) . \"</label>\\n\";\n\t\t\tforeach ( $this->get_attribute( 'options' ) as $option ) {\n\t\t\t\t$option = Grunion_Contact_Form_Plugin::strip_tags( $option );\n\t\t\t\t$r .= \"\\t\\t<label class='grunion-radio-label radio\" . ( $this->is_error() ? ' form-error' : '' ) . \"'>\";\n\t\t\t\t$r .= \"<input type='radio' name='\" . esc_attr( $field_id ) . \"' value='\" . esc_attr( $option ) . \"' class='radio' \" . checked( $option, $field_value, false ) . \" \" . ( $field_required ? \"required aria-required='true'\" : \"\" ) . \"/> \";\n\t\t\t\t$r .= esc_html( $option ) . \"</label>\\n\";\n\t\t\t\t$r .= \"\\t\\t<div class='clear-form'></div>\\n\";\n\t\t\t}\n\t\t\t$r .= \"\\t\\t</div>\\n\";\n\t\t\tbreak;\n\t\tcase 'checkbox' :\n\t\t\t$r .= \"\\t<div>\\n\";\n\t\t\t$r .= \"\\t\\t<label class='grunion-field-label checkbox\" . ( $this->is_error() ? ' form-error' : '' ) . \"'>\\n\";\n\t\t\t$r .= \"\\t\\t<input type='checkbox' name='\" . esc_attr( $field_id ) . \"' value='\" . esc_attr__( 'Yes', 'jetpack' ) . \"' class='checkbox' \" . checked( (bool) $field_value, true, false ) . \" \" . ( $field_required ? \"required aria-required='true'\" : \"\" ) . \"/> \\n\";\n\t\t\t$r .= \"\\t\\t\" . esc_html( $field_label ) . ( $field_required ? '<span>'. __( \"(required)\", 'jetpack' ) . '</span>' : '' ) . \"</label>\\n\";\n\t\t\t$r .= \"\\t\\t<div class='clear-form'></div>\\n\";\n\t\t\t$r .= \"\\t</div>\\n\";\n\t\t\tbreak;\n\t\tcase 'select' :\n\t\t\t$r .= \"\\n<div>\\n\";\n\t\t\t$r .= \"\\t\\t<label for='\" . esc_attr( $field_id ) . \"' class='grunion-field-label select\" . ( $this->is_error() ? ' form-error' : '' ) . \"'>\" . esc_html( $field_label ) . ( $field_required ? '<span>'. __( \"(required)\", 'jetpack' ) . '</span>' : '' ) . \"</label>\\n\";\n\t\t\t$r .= \"\\t<select name='\" . esc_attr( $field_id ) . \"' id='\" . esc_attr( $field_id ) . \"' class='select' \" . ( $field_required ? \"required aria-required='true'\" : \"\" ) . \">\\n\";\n\t\t\tforeach ( $this->get_attribute( 'options' ) as $option ) {\n\t\t\t\t$option = Grunion_Contact_Form_Plugin::strip_tags( $option );\n\t\t\t\t$r .= \"\\t\\t<option\" . selected( $option, $field_value, false ) . \">\" . esc_html( $option ) . \"</option>\\n\";\n\t\t\t}\n\t\t\t$r .= \"\\t</select>\\n\";\n\t\t\t$r .= \"\\t</div>\\n\";\n\t\t\tbreak;\n\t\tcase 'date' :\n\t\t\t$r .= \"\\n<div>\\n\";\n\t\t\t$r .= \"\\t\\t<label for='\" . esc_attr( $field_id ) . \"' class='grunion-field-label \" . esc_attr( $field_type ) . ( $this->is_error() ? ' form-error' : '' ) . \"'>\" . esc_html( $field_label ) . ( $field_required ? '<span>' . __( \"(required)\", 'jetpack' ) . '</span>' : '' ) . \"</label>\\n\";\n\t\t\t$r .= \"\\t\\t<input type='date' name='\" . esc_attr( $field_id ) . \"' id='\" . esc_attr( $field_id ) . \"' value='\" . esc_attr( $field_value ) . \"' class='\" . esc_attr( $field_type ) . \"' \" . ( $field_required ? \"required aria-required='true'\" : \"\" ) . \"/>\\n\";\n\t\t\t$r .= \"\\t</div>\\n\";\n\n\t\t\twp_enqueue_script( 'grunion-frontend', plugins_url( 'js/grunion-frontend.js', __FILE__ ), array( 'jquery', 'jquery-ui-datepicker' ) );\n\t\t\tbreak;\n\t\tdefault : // text field\n\t\t\t// note that any unknown types will produce a text input, so we can use arbitrary type names to handle\n\t\t\t// input fields like name, email, url that require special validation or handling at POST\n\t\t\t$r .= \"\\n<div>\\n\";\n\t\t\t$r .= \"\\t\\t<label for='\" . esc_attr( $field_id ) . \"' class='grunion-field-label \" . esc_attr( $field_type ) . ( $this->is_error() ? ' form-error' : '' ) . \"'>\" . esc_html( $field_label ) . ( $field_required ? '<span>' . __( \"(required)\", 'jetpack' ) . '</span>' : '' ) . \"</label>\\n\";\n\t\t\t$r .= \"\\t\\t<input type='text' name='\" . esc_attr( $field_id ) . \"' id='\" . esc_attr( $field_id ) . \"' value='\" . esc_attr( $field_value ) . \"' class='\" . esc_attr( $field_type ) . \"' \" . $field_placeholder . \" \" . ( $field_required ? \"required aria-required='true'\" : \"\" ) . \"/>\\n\";\n\t\t\t$r .= \"\\t</div>\\n\";\n\t\t}\n\n\t\treturn apply_filters( 'grunion_contact_form_field_html', $r, $field_label, ( in_the_loop() ? get_the_ID() : null ) );\n\t}",
"protected function _beforeToHtml(){\n\t\tif($this->getType()==\"featured/widget\")\n\t\t{\n\t\t\t$this->setWidgetOptions();\n\t\t}\n $this->setProductCollection($this->_getProductCollection());\n\t}",
"function form_init_elements()\r\n {\r\n parent::form_init_elements() ;\r\n\r\n $override = new FECheckBox('Override Z0 Record Validation') ;\r\n $this->add_element($override) ;\r\n }",
"public function actionCreate()\n {\n $product_id = Yii::$app->request->get('product_id');\n $product = Product::findOne($product_id);\n if (!$product) {\n throw new HttpException(400);\n }\n /** @var \\common\\models\\AttributeValue $model */\n $model = new $this->model(['product_id' => $product_id]);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['product/update', 'id' => $product_id]);\n } else {\n return $this->render($this->create_view, [\n 'model' => $model,\n ]);\n }\n }",
"function outputProduct($index, $prod_id, $prod_attrs)\n {\n global $application;\n\n $output = '';\n $v_index = 0;\n foreach($this -> _attrs as $k => $v)\n {\n $template_contents = array(\n 'LineBgColor' => (($index % 2) ? '#EEEEEE' : '#FFFFFF'),\n 'CellData' => $this -> outputAttr($prod_id, @$prod_attrs[$this -> _attrmap[$k]], $index, $v_index)\n );\n $this -> _Template_Contents = $template_contents;\n $application -> registerAttributes($this -> _Template_Contents);\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'product-cell.tpl.html',\n array()\n );\n $v_index++;\n }\n\n return $output;\n }",
"public function element() {\n\t\t$element = parent::element();\n\t\t$element->data('field', self::$fieldname);\n\t\treturn $element;\n\t}",
"public function getElementHtml(){\n $htmlElement = '<input id=\"color\" name=\"color\" data-ui-id=\"sales-order-status-edit-container-form-fieldset-element-text-color\" class=\"input-text admin__control-text\" type=\"color\" value=\"'.$this->getData('value').'\" >';\n return $htmlElement;\n }",
"public function getElementHtml(){\n $htmlElement = '<input id=\"color\" name=\"color\" data-ui-id=\"sales-order-status-edit-container-form-fieldset-element-text-color\" class=\"input-text admin__control-text\" type=\"color\" value=\"'.$this->getData('value').'\" >';\n return $htmlElement;\n }",
"public function init()\n {\n \t\n \t$this->setAttrib('enctype', 'multipart/form-data');\n \t \t\n \t$this->setName('FormularioOcorrencia');\n $id = new Zend_Form_Element_Hidden('id_ocorrencia');\n $id->addFilter('Int');\n \n \n \n\t\t$descricao = new Zend_Form_Element_Textarea('descricao');\n $descricao->setLabel('Descricao')\n ->setRequired(true);\n\t\t$descricao->removeDecorator('DtDdWrapper')\n ->removeDecorator('HtmlTag')\n ->removeDecorator('Label')\n ->setAttrib('class', 'form-control')\n \t->setAttrib('rows', '5');\n \n\t\t\n\t\t\n\t\t\n $submit = new Zend_Form_Element_Submit('submit');\n $submit->setLabel(\"Adiconar\");\n $submit->setAttrib('id', 'submitbutton');\n $submit->removeDecorator('DtDdWrapper')\n ->setAttrib('class', 'btn btn-primary')\n ->removeDecorator('HtmlTag')\n ->removeDecorator('Label');\n \n \n \n \n $this->addElements(array($id,$descricao,$submit)); \n \n $this->setDecorators( array( array('ViewScript', array('viewScript' => 'formularioOcorrencia.phtml'))));\n }",
"public function getHTML(){\n $twig = get_instance()->twig->getTwig();\n $template = $twig->load('sistema/theme/default/lib/field.twig');\n \n return $template->render(array(\n 'element_type' => $this->getElementName()\n , 'type' => $this->getFieldType()\n , 'id' => $this->getId()\n , 'name' => $this->getName()\n , 'title' => $this->getAttr('title')\n , 'class' => $this->getClass()\n , 'form_name' => $this->getFormName()\n , 'error_name' => $this->getErrorName()\n , 'attributes' => $this->getTagAttributes()\n , 'disabled' => $this->hasDisabled()\n ));\n }",
"public function renderCreateButton()\n {\n return new Tools\\CreateButton($this);\n }",
"public function create()\n {\n $product_attributes = Product_attributes::all();\n return view('product_attributes.create');\n }",
"protected function _getElementHtml(\\Magento\\Framework\\Data\\Form\\Element\\AbstractElement $element)\n{\n$element->setWysiwyg(true);\n// set configuration values\n$element->setConfig($this->wysiwygConfig->getConfig($element));\n\nreturn parent::_getElementHtml($element);\n}",
"public function setAttrib($field, $name, $value)\n\t{\n\t\t// Check for existence of a model\n\t\tif (NULL === ($model = $this->getModel())) {\n\t\t\tthrow new Scil_Services_Model_Decorator_Exception(__METHOD__.' no model available to process!');\n\t\t}\n\n\t\tif ( ! $this->_formFields[$field] instanceof Zend_Form_Element) {\n\t\t\tthrow new Scil_Services_Model_Decorator_Exception(__METHOD__.' The field : '.$field.' does not exist!');\n\t\t}\n\n\t\t$this->_formFields[$field]->setAttrib($name, $value);\n\t\treturn $this;\n\t}",
"public function render(Varien_Data_Form_Element_Abstract $element){\n return $this->toHtml();\n }",
"function vendor_defined_taxonomy() {\n // The targeted product attribute taxonomy\n return 'pa_color'; \n}",
"function create_product_attribute_term( $term_name, $attribute_name ) {\n\tif ( wp_insert_term( $term_name, $attribute_name ) ) {\n\t\twisync_admin_notice__success( $term_name . ' added to Product Attributes.' );\n\t} else {\n\t\twisync_admin_notice__error( 'Failed to add ' . $term_name . ' to Product Attributes.' );\n\t}\n}",
"public function beforeRender(){\n\n //render edit form with actual values from database\n $component_iterator = $this->getComponent(\"editForm\")->getComponents();\n $componenty = iterator_to_array($component_iterator);\n\n if ($this->actualListingValues != null){\n \n $optArray = $this->postageOptions;\n $postageCounter = $priceCounter = 0;\n \n foreach ($componenty as $comp){\n switch($comp->name){\n \n case 'product_name':\n $comp->setValue($this->actualListingValues['product_name']);\n break;\n case 'product_desc':\n $comp->setValue($this->actualListingValues['product_desc']);\n break;\n case 'price':\n $comp->setValue($this->actualListingValues['price']);\n break;\n case 'ships_from':\n $comp->setValue($this->actualListingValues['ships_from']);\n break;\n case 'ships_to';\n $comp->setValue($this->actualListingValues['ships_to']);\n break;\n case 'product_type':\n $comp->setValue($this->actualListingValues['ships_to']);\n break;\n case (strpos($comp->name, \"postage\")):\n //render all postage options into correct textboxes\n if (array_key_exists($postageCounter, $optArray)){\n $comp->setValue($optArray[$postageCounter]['option']);\n $postageCounter++;\n }\n break; \n case (strpos($comp->name, \"pprice\")):\n //render postage prices into correct textboxes\n if (array_key_exists($priceCounter, $optArray)){\n $comp->setValue($optArray[$priceCounter]['price']);\n $priceCounter++; \n } \n break; \n }\n }\n }\n \n $urlPath = $this->URL->path;\n \n //template variables shared between templates\n if ( strpos($urlPath, \"edit\" )|| strpos($urlPath, \"view\") \n || strpos($urlPath, \"buy\")){\n \n $lst = $this->hlp->sess(\"listing\");\n $imgs = $this->hlp->sess(\"images\");\n $this->template->listingDetails = $lst->listingDetails;\n $this->template->listingImages = $imgs->listingImages;\n }\n }",
"function custom_field_tag($name, $custom_value) {\t\n $custom_field = $custom_value['CustomField'];\n $field_name = 'custom_field_values.'.$custom_value['CustomField']['id'];\n\n switch($custom_field['field_format']) {\n case \"date\" :\n $out = $this->Form->input($field_name, array('type'=>'text', 'size'=>10, 'label'=>false, 'div'=>false)); \n // TODO : calender \n // $out .= calendar_for(field_id)\n break;\n case \"text\" :\n $out = $this->Form->input($field_name, array('type'=>'textarea', 'rows'=>3, 'style'=> 'width:90%', 'label'=>false, 'div'=>false ));\n break;\n case \"bool\" :\n $out = $this->Form->input($field_name, array('type'=>'checkbox', 'label'=>false, 'div'=>false));\n break;\n case \"list\" :\n $empty = true;\n $selected = null;\n $type = 'select';\n if($custom_field['is_required']) {\n $empty = false;\n if(empty($custom_field['default_value'])) {\n $options[] = '--- '.__('Please Select').' ---';\n } elseif(empty($this->request->data['custom_field_values'][$custom_value['CustomField']['id']])) {\n $selected = $custom_field['default_value'];\n }\n }\n App::Import('vendor', 'georgious-cakephp-yaml-migrations-and-fixtures/spyc/spyc');\n $list = Spyc::YAMLLoad($custom_value['CustomField']['possible_values']);\n $options = array();\n if(!empty($list)) {\n foreach($list as $item) {\n $options[$item] = $item;\n }\n }\n \n $out = $this->Form->input($field_name, array_merge(compact('type', 'empty', 'selected', 'options'), array('label'=>false, 'div'=>false)));\n break;\n default :\n $out = $this->Form->input($field_name, array('type'=>'text', 'label'=>false, 'div'=>false));\n break;\n }\n return $out;\n }",
"public function renderField()\n\t{\n\t\tif ($this->hasModel()) {\n\t\t\techo \\CHtml::activeFileField($this->model, $this->attribute, $this->options);\n\n\t\t} else {\n\t\t\techo \\CHtml::fileField($this->options['name'], $this->value, $this->options);\n\t\t}\n\t}",
"function minorite_form_element($variables) {\n $element = &$variables['element'];\n\n // Add element #id for #type 'item'.\n if (isset($element['#markup']) && !empty($element['#id'])) {\n $attributes['id'] = $element['#id'];\n }\n\n // If #title is not set, we don't display any label or required marker.\n if (!isset($element['#title'])) {\n $element['#title_display'] = 'none';\n }\n\n if (!isset($element['#title_display'])) {\n $element['#title_display'] = 'invisible';\n }\n\n $output = '';\n switch ($element['#title_display']) {\n case 'before':\n case 'invisible':\n $output .= theme('form_element_label', $variables);\n $output .= $element['#children'] . \"\\n\";\n break;\n\n case 'grid':\n $output .= '<p class=\"w-1\">' . theme('form_element_label', $variables) . \"</p>\\n\";\n $output .= '<p class=\"w-2\">' . $element['#children'] . \"</p>\\n\";\n break;\n\n case 'none':\n case 'after': // TODO.\n $output .= $element['#children'] . \"\\n\";\n break;\n }\n\n // If the element has help specified, append an icon.\n if (!empty($element['#description'])) {\n $help = theme('form_element_help', $variables);\n $grid = $element['#title_display'] == 'grid';\n $output .= ($grid ? '<p class=\"w-3\">' . $help . '</p>' : $help) . \"\\n\";\n }\n\n // If the element has grid specified, append a <p> tag.\n if (!empty($element['#grid'])) {\n $output = '<p class=\"' . $element['#grid'] . \"\\\">\\n\" . $output . \"</p>\\n\";\n }\n\n return $output;\n}",
"public function newAction() {\n\t\t$Session = new Zend_Session_Namespace ( 'Admin' );\n\t\t$this->view->form = $this->getForm ( \"/admin/productsattributes/process\" );\n\n\t\t// I have to add the language id into the hidden field in order to save the record with the language selected \n\t\t$this->view->form->populate ( array('language_id' => $Session->langid) );\n\t\t\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\t\t array(\"url\" => \"/admin/productsattributes/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t\n\t\t$this->view->title = $this->translator->translate(\"Attributes\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can edit the attribute details.\");\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function hydrate_product_form()\n {\n $em = EntityManagerSingleton::getInstance();\n\n $this->create_update_form->get('name')->setValue($this->product->getName());\n\n $this->create_update_form->get('product_id')->setValue($this->product->getId());\n $this->create_update_form->get('base_price')->setValue($this->product->getBasePrice());\n $this->create_update_form->get('discount_price')->setValue($this->product->getDiscountPrice());\n $this->create_update_form->get('tax')->setValue($this->product->getTax());\n $this->create_update_form->get('base_weight')->setValue($this->product->getBaseWeight());\n $this->create_update_form->get('description')->setValue($this->product->getDescription());\n $this->create_update_form->get('meta_description')->setValue($this->product->getPage()->getDescription());\n $this->create_update_form->get('keywords')->setValue($this->product->getPage()->getKeywords());\n $this->create_update_form->get('date_added')->setValue($this->product->getDateCreated()->format('m/d/Y'));\n $this->create_update_form->get('show_more_caption')->setValue($this->product->shouldShowMoreCaption());\n\n // Get the quantity and status from the skus\n $quantity = $this->product->getQuantityFromSkus();\n $status_override = $this->product->getStatusOverride();\n $status = $this->product->getStatus();\n\n if (!($status_override instanceof Status))\n $this->create_update_form->get('status_override')->setValue(0);\n else\n $this->create_update_form->get('status_override')->setValue($status_override->getId());\n\n if (!($status instanceof Status))\n $this->create_update_form->get('status')->setValue(0);\n else\n $this->create_update_form->get('status')->setValue($status->getId());\n\n\n $this->create_update_form->get('quantity')->setValue($quantity);\n $this->create_update_form->get('sort_order')->setValue($this->product->getSortOrder());\n $this->create_update_form->get('product_code')->setValue($this->product->getProductCode());\n\n // Place themes and categories in the category box\n $category_listings = [];\n $theme_ids = [];\n $ancestor_listing_name = \"\";\n $product_categories = $this->product->getProductCategories();\n\n foreach($product_categories as $product_category)\n {\n $category = $product_category->getCategory();\n\n // Place theme categories in the theme check box list\n if ($category->getId() == Category::THEME_CATEGORY_ID || (!is_null($category->getParentCategory()) && $category->getParentCategory()->getId() == Category::THEME_CATEGORY_ID))\n {\n $theme_ids[] = $category->getId();\n }\n else\n {\n $category_info = $em->getRepository('Library\\Model\\Category\\Category')->findCategoryAncestors($category);\n $category_ancestors = $category_info['ancestors'];\n\n if (count($category_ancestors) > 0)\n {\n // Construct listing name\n if (count($category_ancestors) > 0)\n {\n foreach ($category_ancestors as $ancestor)\n {\n $ancestor_listing_name .= $ancestor['name'] . \" >> \";\n }\n }\n }\n\n $category_name = $ancestor_listing_name . $category->getName();\n $category_listings[] = ['id' => $category->getId(), 'name' => $category_name];\n $ancestor_listing_name = \"\";\n }\n }\n\n return [$category_listings, $theme_ids];\n }",
"public static function create($product/*, IRenderer $renderer*//*, $forceProduct = ''*/){\n/*\n if(!is_object($product)){\n $productFactory = new \\WC_Product_Factory(); \n $product = $productFactory->get_product($product);\n }*/\n\n if($product->is_type('grouped')){\n return new GroupedHandler($product);\n }\n\n if($product->is_type('variable')){\n return new VariableHandler($product);\n }\n\n if($product->is_type('variation')){\n return new VariantHandler($product);\n }\n\n if($product->is_type('simple')){\n return new SimpleHandler($product);\n }\n\n return NULL;\n\n }",
"protected function getInput()\n\t{\n\t\t// Initialize some field attributes.\n\t\t$format = $this->element['format'] ? (string) $this->element['format'] : 'yy-mm-dd';\n\n\t\t// Build the attributes array.\n\t\t$attributes = array();\n\t\tif ($this->element['size'])\n\t\t{\n\t\t\t$attributes['size'] = (int) $this->element['size'];\n\t\t}\n\t\tif ($this->element['maxlength'])\n\t\t{\n\t\t\t$attributes['maxlength'] = (int) $this->element['maxlength'];\n\t\t}\n\t\tif ($this->element['class'])\n\t\t{\n\t\t\t$attributes['class'] = (string) $this->element['class'];\n\t\t}\n\t\tif ((string) $this->element['readonly'] == 'true')\n\t\t{\n\t\t\t$attributes['readonly'] = 'readonly';\n\t\t}\n\t\tif ((string) $this->element['disabled'] == 'true')\n\t\t{\n\t\t\t$attributes['disabled'] = 'disabled';\n\t\t}\n\t\t$attributes['time'] = false;\n\t\tif ((string) $this->element['time'] == 'true')\n\t\t{\n\t\t\t$attributes['time'] = true;\n\t\t}\n\t\tif ($this->element['onchange'])\n\t\t{\n\t\t\t$attributes['onchange'] = (string) $this->element['onchange'];\n\t\t}\n\n\t\t// Handle the special case for \"now\".\n\t\tif (strtoupper($this->value) == 'NOW')\n\t\t{\n\t\t\t$this->value = strftime($format);\n\t\t}\n\n\t\t// If a known filter is given use it.\n\t\tswitch (strtoupper((string) $this->element['filter']))\n\t\t{\n\t\t\tcase 'SERVER_UTC':\n\t\t\t\t// Convert a date to UTC based on the server timezone.\n\t\t\t\tif (intval($this->value))\n\t\t\t\t{\n\t\t\t\t\t// Get a date object based on the correct timezone.\n\t\t\t\t\t$date = new Date($this->value, 'UTC');\n\t\t\t\t\t$date->setTimezone(new DateTimeZone(App::get('config')->get('offset')));\n\n\t\t\t\t\t// Transform the date string.\n\t\t\t\t\t$this->value = $date->format('Y-m-d H:i:s', true, false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'USER_UTC':\n\t\t\t\t// Convert a date to UTC based on the user timezone.\n\t\t\t\tif (intval($this->value))\n\t\t\t\t{\n\t\t\t\t\t// Get a date object based on the correct timezone.\n\t\t\t\t\t$date = new Date($this->value, 'UTC');\n\t\t\t\t\t$date->setTimezone(new DateTimeZone(App::get('user')->getParam('timezone', App::get('config')->get('offset'))));\n\n\t\t\t\t\t// Transform the date string.\n\t\t\t\t\t$this->value = $date->format('Y-m-d H:i:s', true, false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$attributes['id'] = $this->id;\n\t\t$attributes['format'] = $format;\n\n\t\treturn Input::calendar($this->name, $this->value, $attributes);\n\t}",
"public function renderTag(InputField $field){\n\t\tif(!isset($field->attribs['class'])){\n\t\t\t$field->attribs['class'] = \"\";\n\t\t}\n\t\tif(!isset($field->attribs['type']) && !empty($this->attribType)){\n\t\t\t$field->attribs['type'] = $this->attribType;\n\t\t}\n\t\tif(!is_null($field->getHideInUrl())){\n\t\t\t$field->attribs['data-hide-in-url'] = $field->getHideInUrl();\n\t\t}\n\t\tif(!empty($field->getCascadeTo())){\n\t\t\t$field->attribs['class'] = \"cascade \".$field->attribs['class'];\n\t\t}\n\t\t$field->attribs['class'] = \"inputter \".$this->settings['namespace'].\" \".$field->attribs['class'];\n\n\t\t// Create string of all the attributes to be inserted into the HTML tag\n\t\t$attributes = \"\";\n\t\t$attributes .= \"id='\".$field->getId().\"' \";\n\t\t$attributes .= \"name='\".$field->getName().\"' \";\n\t\t$attributes .= \"data-name='\".$field->getName().\"' \";\n\t\t$attributes .= \"data-type='\".$field->getType().\"' \";\n\t\tforeach($field->attribs as $attrName => $attrValue){\n\t\t\t$attributes .= $attrName.\"='\".$attrValue.\"' \";\n\t\t}\n\n\t\t$tag = \"\";\n\t\t$numTags = 1;\n\n\t\t// Get number of tags if radio/checkbox\n\t\tif($field->getType() == \"radio\" || $field->getType() == \"checkbox\"){\n\t\t\t$numTags = count($field->contents);\n\t\t}\n\n\t\t// Loop through tag creation\n\t\tfor($i = 0; $i < $numTags; $i++){\n\t\t\t$tempTag = \"<\".$field->getTag().\" \".$attributes.\"></\".$field->getTag().\">\";\n\n\t\t\t// Add a suffix number to the tag's ID if there is more than one tag (radio/checkbox)\n\t\t\tif($numTags > 1){\n\t\t\t\t$tempTag = str_replace(\"id='\".$field->id.\"'\", \"id='\".$field->id.$i.\"'\", $tempTag);\n\t\t\t}\n\n\t\t\t$tag .= $tempTag;\n\t\t}\n\n\t\treturn $tag;\n\t}"
] | [
"0.6033033",
"0.59332925",
"0.5881972",
"0.58099",
"0.5770208",
"0.57463235",
"0.5741194",
"0.5665767",
"0.56270146",
"0.5617247",
"0.5613511",
"0.5611123",
"0.56069696",
"0.56007683",
"0.5566038",
"0.5563113",
"0.554752",
"0.554752",
"0.5543203",
"0.55421084",
"0.5537036",
"0.54763764",
"0.54760695",
"0.5466068",
"0.54571337",
"0.5429904",
"0.5415592",
"0.540615",
"0.54053843",
"0.5390775",
"0.5381517",
"0.5372396",
"0.53642344",
"0.5363132",
"0.53603584",
"0.53438157",
"0.53405124",
"0.5333314",
"0.5324711",
"0.5318129",
"0.53139234",
"0.5306305",
"0.52961665",
"0.528659",
"0.5267301",
"0.5265953",
"0.52614456",
"0.52556455",
"0.5254522",
"0.52523935",
"0.52491593",
"0.5246182",
"0.5243286",
"0.5241729",
"0.524125",
"0.52408594",
"0.5240857",
"0.5239239",
"0.52280176",
"0.52251345",
"0.52130973",
"0.52116704",
"0.52079195",
"0.5195027",
"0.5192833",
"0.5192209",
"0.51900077",
"0.51846886",
"0.5163913",
"0.51586455",
"0.5152109",
"0.5144216",
"0.51344204",
"0.5132556",
"0.5124945",
"0.5112056",
"0.511156",
"0.51053685",
"0.5096432",
"0.5079322",
"0.50752026",
"0.50748086",
"0.50748086",
"0.50731325",
"0.50609547",
"0.50577384",
"0.5055224",
"0.50537777",
"0.50495124",
"0.5042106",
"0.50376344",
"0.5034802",
"0.5034272",
"0.50317633",
"0.50309795",
"0.5029546",
"0.50247926",
"0.50141394",
"0.50129515",
"0.5005673",
"0.5005387"
] | 0.0 | -1 |
Determine if the user is authorized to make this request. | public function authorize()
{
/*
| -----------------------------------------------------------------------
| *return false devuelve un error HTTP Response 403 Forbidden (prohibido)
| *return true Verifica si la validación es correcta
| -----------------------------------------------------------------------
*/
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() != null;\n }",
"public function authorize(): bool\n {\n return $this->user() !== null;\n }",
"public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }",
"public function authorize()\n {\n return !is_null($this->user());\n }",
"public function authorize()\n {\n return request()->user() != null;\n }",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }",
"public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }",
"public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }",
"public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }",
"public function isAuthorized() {}",
"public function authorize()\n {\n return request()->loggedin_role === 1;\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }",
"public function authorize()\n {\n return auth()->check() ? true : false;\n }",
"public function authorize()\n {\n return auth()->check() ? true : false;\n }",
"public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }",
"public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }",
"public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }",
"public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }",
"function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }",
"public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }",
"public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"public function isAuthorized() {\n\t\treturn true;\n\t}",
"public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}",
"public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }",
"public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }",
"public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }",
"public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }",
"public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }",
"public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }",
"public function hasAuthorized() {\n return $this->_has(1);\n }",
"public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }",
"public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }",
"public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }",
"public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }",
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }",
"public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return \\Auth::check() ? true : false;\n }",
"public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function authorize()\n {\n return !empty(Auth::user());\n }",
"public function isAuthorized() {\n\t\t\n\t}",
"public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }",
"public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }",
"public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }",
"public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }",
"public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }",
"public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }",
"public function authorize()\n {\n return $this->auth->check();\n }",
"public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }",
"public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->container['auth']->check();\n }",
"function isAuthorized($request) {\n return true;\n }",
"public function authorize()\n {\n return Auth::guest() || isMember();\n }",
"public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }",
"public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }",
"public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }",
"public function authorize()\n {\n return TRUE;\n }",
"public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }",
"public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }",
"public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }",
"public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }",
"public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}",
"public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }",
"public function authorize()\n {\n // User system not implemented\n return true;\n }",
"public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }",
"public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }",
"public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }",
"public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }",
"public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }",
"public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }"
] | [
"0.8400091",
"0.8376151",
"0.8376151",
"0.8343046",
"0.8252765",
"0.82470274",
"0.82118946",
"0.8145545",
"0.8110389",
"0.8082113",
"0.7991577",
"0.7989312",
"0.7982695",
"0.79595965",
"0.79507434",
"0.794834",
"0.7925477",
"0.7914969",
"0.7899856",
"0.7893212",
"0.78900343",
"0.7888994",
"0.78601307",
"0.78408074",
"0.78408074",
"0.78372097",
"0.7823834",
"0.7811764",
"0.78082436",
"0.77920574",
"0.778678",
"0.7780834",
"0.77797455",
"0.7762395",
"0.7753989",
"0.7717805",
"0.7717805",
"0.7715764",
"0.7713016",
"0.7703022",
"0.7693164",
"0.76921535",
"0.7690499",
"0.7689976",
"0.7673568",
"0.7666598",
"0.7665594",
"0.7654846",
"0.764989",
"0.7642104",
"0.76419175",
"0.76415265",
"0.76339245",
"0.7629985",
"0.76287305",
"0.7627034",
"0.76196754",
"0.76196754",
"0.76125336",
"0.76029867",
"0.76025975",
"0.7602217",
"0.7602217",
"0.7601853",
"0.7599287",
"0.75959945",
"0.75878304",
"0.75853646",
"0.75802433",
"0.756261",
"0.75532365",
"0.75522506",
"0.7550781",
"0.7543391",
"0.75425404",
"0.75393015",
"0.75372255",
"0.7528432",
"0.7515795",
"0.7513582",
"0.7498955",
"0.74950546",
"0.7494261",
"0.7491022",
"0.74871314",
"0.748663",
"0.7479677",
"0.74769044",
"0.7472495",
"0.7470842",
"0.7465162",
"0.7464345",
"0.7462356",
"0.7461828",
"0.7461126",
"0.744885",
"0.7438837",
"0.74345404",
"0.7433543",
"0.743183",
"0.74237186"
] | 0.0 | -1 |
Get the validation rules that apply to the request. | public function rules()
{
/*
| -------------------------------------
| *Reglas de validación
| *'required' el campo es obligatorio
| -------------------------------------
*/
return [
'title' => 'required',
'url' => 'required',
'description' => 'required',
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }",
"public function getRules()\n {\n return $this->validator->getRules();\n }",
"public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }",
"public function rules()\n {\n return $this->validationRules;\n }",
"public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }",
"public static function getRules()\n {\n return (new static)->getValidationRules();\n }",
"public function getRules()\n {\n return $this->validation_rules;\n }",
"public function getValidationRules()\n {\n return [];\n }",
"public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }",
"public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }",
"public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }",
"protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }",
"public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }",
"public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }",
"public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }",
"public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }",
"public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }",
"protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }",
"public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }",
"protected function getValidRules()\n {\n return $this->validRules;\n }",
"public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }",
"public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }",
"public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }",
"public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n { \n return $this->rules;\n }",
"public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }",
"public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }",
"public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }",
"public function validationRules()\n {\n return [];\n }",
"public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }",
"public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }",
"public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }",
"public function rules()\n {\n return static::$rules;\n }",
"function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}",
"public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }",
"public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }",
"public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }",
"protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }",
"public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }",
"public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }",
"public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }",
"public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }",
"public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }",
"public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }",
"abstract protected function getValidationRules();",
"public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }",
"public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }",
"public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }",
"public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }",
"public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }",
"public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }",
"public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }",
"public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }",
"public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }",
"public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }",
"public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }",
"public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }",
"public function getValidationRules() : array;",
"public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }",
"public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }",
"public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }",
"public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }",
"public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}",
"public function rules()\n {\n $rules = array();\n return $rules;\n }",
"public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }",
"public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }",
"public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }",
"protected function get_validation_rules()\n {\n }",
"public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }",
"public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }",
"public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }",
"public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }",
"public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }",
"public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }",
"public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }",
"public function rules(Request $request)\n {\n return Qc::$rules;\n }",
"public function defineValidationRules()\n {\n return [];\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }",
"public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }"
] | [
"0.8342797",
"0.8013068",
"0.79357624",
"0.79257727",
"0.7922943",
"0.7903906",
"0.7859204",
"0.7789624",
"0.7783409",
"0.77624106",
"0.773673",
"0.7732383",
"0.77094924",
"0.7691624",
"0.7684878",
"0.7682184",
"0.7682184",
"0.7682184",
"0.7682184",
"0.7682184",
"0.7682184",
"0.76753145",
"0.76747704",
"0.76653886",
"0.7656984",
"0.7641385",
"0.7629662",
"0.7629557",
"0.7617277",
"0.76092637",
"0.7607173",
"0.7602176",
"0.7598716",
"0.7597812",
"0.7591812",
"0.75902253",
"0.7587347",
"0.7579866",
"0.75553906",
"0.7555079",
"0.75503534",
"0.75459445",
"0.7540463",
"0.7536189",
"0.75356364",
"0.75300074",
"0.75181943",
"0.7514811",
"0.75078565",
"0.7506201",
"0.75052506",
"0.7498871",
"0.7495198",
"0.7494957",
"0.7493081",
"0.74902064",
"0.7489407",
"0.74890095",
"0.7485984",
"0.74858546",
"0.7478957",
"0.74781555",
"0.74693084",
"0.74632835",
"0.7461654",
"0.746117",
"0.745908",
"0.74546385",
"0.7453331",
"0.7452256",
"0.7449815",
"0.74481654",
"0.7441297",
"0.74408644",
"0.7435215",
"0.743476",
"0.7432712",
"0.74296844",
"0.74289936",
"0.7423239",
"0.7418971",
"0.74155754",
"0.7413715",
"0.7413531",
"0.7412177",
"0.7409704",
"0.740534",
"0.74039155",
"0.7403364",
"0.740084",
"0.73900056",
"0.73831314",
"0.73729247",
"0.7370593",
"0.73688376",
"0.73608065",
"0.7355452",
"0.7346383",
"0.73441696",
"0.73426807",
"0.73349255"
] | 0.0 | -1 |
Create a new Halcyon model instance. | public function __construct(array $attributes = [])
{
$this->bootIfNotBooted();
$this->bootNicerEvents();
parent::__construct();
$this->syncOriginal();
$this->fill($attributes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createModel()\n {\n return new LeafModel();\n }",
"protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }",
"public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }",
"protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }",
"protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }",
"public function createModel()\n {\n }",
"protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }",
"abstract protected function newModel(): Model;",
"public static function model()\n {\n return new self;\n }",
"public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}",
"protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }",
"public function make() {}",
"function __construct() {\n $this->loteModel = new loteModel();\n }",
"abstract protected function modelFactory();",
"protected function makeModel()\n {\n return factory(Employee::class)->create();\n }",
"public function getModel()\n {\n $model = new $this->versionable_type();\n $model->unguard();\n $model->fill(unserialize($this->model_data));\n $model->exists = true;\n $model->reguard();\n return $model;\n }",
"public function create(): Model;",
"protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }",
"public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}",
"private function makeModel($ip)\n {\n return $this->model->newInstance($ip);\n }",
"public function make();",
"public function createModel() {\n return null;\n }",
"public function make($modelClass);",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function __construct(HOPDONG $model, Request $request)\n {\n $this->model = $model;\n }",
"public function __construct()\n {\n $config = new \\Config\\Encryption();\n $config->key = 'aBigsecret_ofAtleast32Characters';\n $config->driver = 'OpenSSL';\n\n $this->enkripsi = \\Config\\Services::encrypter($config);\n\n $this->webModel = new PenggunaWebModel();\n $this->mobileModel = new PenggunaMobileModel();\n }",
"function __construct () {\n\t\t$this->_model = new Model();\n\t}",
"public function getModel()\n {\n $modelData = is_resource($this->model_data)\n ? stream_get_contents($this->model_data,-1,0)\n : $this->model_data;\n\n $className = self::getActualClassNameForMorph($this->versionable_type);\n $model = new $className();\n $model->unguard();\n $model->fill(unserialize($modelData));\n $model->exists = true;\n $model->reguard();\n return $model;\n }",
"public abstract function make();",
"public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }",
"function createModel($name, array $conf);",
"protected function cliModelInit()\n {\n }",
"public static function create() {}",
"public static function create() {}",
"public static function create() {}",
"public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }",
"function __construct() {\n $this->model = new HomeModel();\n }",
"public function buildModel() {}",
"private function loadModel() {\n // name as requested resource.\n $name = $this->name.'Model';\n $path = str_replace(kPlaceholder, $this->version, kModelsFolder);\n $path = $path . $name . \".php\";\n // If it does not exist, go with\n // the default Model class.\n if (!file_exists($path)) {\n return new Model();\n } else {\n if (!class_exists($name)) {\n include $path;\n }\n\n return new $name();\n }\n }",
"protected function createBaseModel()\n {\n $name = $this->qualifyClass('Model');\n $path = $this->getPath($name);\n\n if (!$this->files->exists($path)) {\n $this->files->put(\n $path,\n $this->files->get(__DIR__.'/../../stubs/model.base.stub')\n );\n }\n }",
"protected function getModelInstance()\n {\n return new $this->model();\n }",
"public static function newModel(...$params) : Model\n {\n $model = new Model();\n $count = $params ? count($params) : 0;\n\n if ($count === 1)\n {\n $model->loadModelFromText($params[0]);\n }\n\n if ($count === 2 && $params[0])\n {\n $model->loadModel($params[0]);\n }\n\n return $model;\n }",
"protected function getNewModel()\n {\n $modelName = $this->getModelName();\n return new $modelName;\n }",
"static function create(): self;",
"function __construct()\n {\n // load model\n Load::loadModel(\"helpDesk\");\n }",
"function __construct()\n {\n $this->pembeli = new Model_Pembeli();\n }",
"protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}",
"protected function createModel()\n {\n $model = new EventProcessingSubLeafModel();\n $model->instantEvent->attachHandler(function(){\n $this->model->output = \"instant\";\n });\n $model->delayedEvent->attachHandler(function(){\n $this->runBeforeRender(function(){\n $this->model->output = \"delayed\";\n });\n });\n return $model;\n }",
"public static function factory(App $app, $model_name)\n {\n if (!isset($app) || (isset($app) && !$app instanceof App))\n Throw new Error('App object not set', 1000);\n\n // Framework, SMF or App model? Create proper namespace.\n $model_class = ($app->isSecure() ? '\\\\Web\\\\Framework\\\\AppsSec' : '\\\\Web\\\\Apps') . \"\\\\\" . $app->getName() . '\\\\Model\\\\' . $model_name . 'Model';\n\n // Create and return modelobject\n $model = new $model_class($model_name);\n\n // Inject app object\n $model->injectApp($app);\n\n return $model;\n }",
"public function create(){}",
"public function create() {}",
"protected function newModel(): Model\n {\n return (new $this->model)->fresh();\n }",
"public function __construct()\n {\n $this->imageModel = new ImageModel();\n $this->userModel = new User();\n $this->psychologySupervisorModel = new PsychologySupervisor();\n $this->registerSupervisionModel = new RegisterSupervision();\n $this->updateSupervisionModel = new UpdateSupervisionModel();\n }",
"protected function setModel()\n {\n $class = 'Src\\Modules\\\\' . $this->module_name . '\\Models\\\\' . $this->class . 'Model';\n $this->model = new $class;\n $this->model->setModuleName( $this->module_name );\n $this->model->run();\n }",
"protected function _newModel($class)\n {\n // instantiate\n $model = new $class($this);\n \n // done!\n return $model;\n }",
"public function __construct(FeatureModel $model)\n {\n $this->model = $model;\n }",
"public function getNewModel( array $attributes = array() ) {\n\t\treturn $this->model->newInstance( $attributes );\n\t}",
"protected static function getModel()\n {\n $modelName = get_called_class();\n $model = new $modelName();\n $model->setFetchMode(\\Phalcon\\Db::FETCH_OBJ);\n return $model;\n }",
"function __construct()\n {\n parent::__construct();\n $this->load->model('BH');\n\n }",
"public function createProtocol()\n {\n }",
"public function __construct()\n {\n $this->model = new BaseModel;\n }",
"public function new()\n\t{\n\t\t//\n\t}",
"public function new()\n\t{\n\t\t//\n\t}",
"public function __construct() {\n $this->model = new Model_Jiafuyun_Regulator();\n\t}",
"public function createModel($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->createModelWithOptions($request, $runtime);\n }",
"public function create()\n {}",
"public function getModel()\n {\n return new $this->model;\n }",
"public function newModel($name)\n {\n $class = $this->getClass($name);\n return $this->_newModel($class);\n }",
"public function create(){\r\n\treturn new $this->class();\r\n }",
"public function __construct(){\n\t\tinclude_once(\"model/crews_model.php\");\n\t\t$this->model = new crews_model();\n\t}",
"public function model($model) {\n // Require model file\n require_once \"../app/models/{$model}.php\";\n\n // Instantiate model\n return new $model();\n }",
"public function __construct(Model $Config){\n\t\tparent::__construct($Config);\n\t\t\n\t\tRun::fromHelpers('BrowserDetection/Requirements/BrowserDetection.php');\n\t\t\n\t\t$this->_instance = new BrowserDetection(\n\t\t\t$this->getConfig()->get('debug')\n\t\t);\n\t}",
"public function create() {\n \n }",
"public function create() {\n \n }",
"public static function model() {\n //here __CLASS__ or self does not work because these will return coreModel class name but this is an abstract class so php will generate an error.\n //get_called_class() will return the class name where model is called.It may be the child.\n $class = get_called_class();\n return new $class;\n }",
"private function _makeModel($controller_name, $storage_type)\n\t{\n\t\t$model\t\t= $controller_name . 'Model';\n\t\t\t\t\n\t\t$storage\t= $this->_makeTemplateStorage($storage_type);\n\t\t$log\t\t= $this->makeLogger();\n\t\t$db\t\t\t= $this->_makeDatabase();\n\t\t\n\t\treturn new $model($storage, $storage_type, $log, $db);\n\t}",
"public function create(array $attributes) : Model;",
"private function newModel(){\n\t\t$this->assign('title', 'New Model');\n\t\t$this->assign('types', $this->getModelTypes());\n\t\t$this->display('model/new.tpl');\n\t}",
"public function createModel()\n {\n return \\Model::factory(Group::class)->create();\n }",
"private static function newModel(string $model, array $attributes = [])\n {\n return new $model(...array_values($attributes));\n }",
"public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }",
"public function __construct(){\n // $this->team = new \\Model\\Business\\Department();\n $this->config = new \\Model\\Business\\YearPerformanceConfigCyclical();\n $this->record = new \\Model\\Business\\RecordYearPerformanceQuestions();\n $this->question = new \\Model\\Business\\YearPerformanceFeedbackQuestions();\n }",
"public function __construct()\n {\n $this->model = New Checklist();\n $this->modelEvents = New Event();\n $this->fractal = new Manager();\n }",
"public function new()\n {\n //\n }",
"public function new()\n {\n //\n }",
"private function initialize() {\n\t\t$f_code = chr(1);\n\t\t$this->region();\n\t\t$enc_key = $this->create_key(37);\n\t\t$model = str_pad('PHP_BMA', 16, chr(0), STR_PAD_RIGHT);\n\n\t\t$data = $f_code.$enc_key.$this->region().$model;\n\t\t$response = $this->send(self::$initialize_uri, self::GENERATE_SIZE, $this->encrypt($data));\n\t\t$data = $this->decrypt(substr($response, 8), $enc_key);\n\n\t\t$this->_set_sync(substr($response, 0, 8));\n\t\t$this->_set_secret(substr($data, 0, 20));\n\t\t$this->set_serial(substr($data, 20));\n\t}",
"public function create() {\n\t \n }",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public function __construct()\n {\n $this->_policyModel = new Datasource_Insurance_LegacyPolicies();\n $this->_enquiryModel = new Datasource_ReferencingLegacy_Enquiry();\n \n $this->_declinerenewalModel = new Datasource_Insurance_Policy_DeclineRenewal();\n $this->_declinerenewalquestionsModel = new Datasource_Insurance_Policy_DeclineRenewalQuestions();\n $this->_declinerenewalresponsesModel = new Datasource_Insurance_Policy_DeclineRenewalResponses();\n }",
"public function getModel()\n {\n return $this->model->newInstance();\n }",
"private function createModel()\n\t{\n\t\treturn new Image();\t\t\n\t}",
"public function __construct()\n\t{\n\t\t// \\ladybug_dump($model);\n\t}",
"public function __construct($initModel = true) {\n if ($initModel)\n $this->model = new Model();\n }",
"protected function __construct()\n {\n $this->_module = new Reuse_Ack_Model_Module;\n }",
"public function __construct() {\n $this->load = new Load();\n $this->model = new Model();\n }",
"public function model($model) {\r\n require_once \"../app/models/$model.php\";\r\n return new $model; //return class\r\n }",
"public function create();"
] | [
"0.60297686",
"0.59523946",
"0.59241045",
"0.58935",
"0.58167464",
"0.57155144",
"0.57107437",
"0.5598737",
"0.5597764",
"0.55262494",
"0.5496319",
"0.548385",
"0.5480709",
"0.54763633",
"0.5468845",
"0.53488064",
"0.53470814",
"0.5345576",
"0.52829903",
"0.5282083",
"0.52762634",
"0.5253823",
"0.525013",
"0.5238111",
"0.5238111",
"0.5235533",
"0.52216905",
"0.52215785",
"0.52143383",
"0.5212128",
"0.5201976",
"0.52016056",
"0.519",
"0.5174598",
"0.5174598",
"0.5174598",
"0.5174459",
"0.5167429",
"0.5164252",
"0.5150819",
"0.5126083",
"0.50997674",
"0.5094254",
"0.5093329",
"0.507575",
"0.5059575",
"0.50591666",
"0.5053303",
"0.504743",
"0.5042379",
"0.50396836",
"0.5034089",
"0.50313663",
"0.5021229",
"0.502119",
"0.5018904",
"0.5013919",
"0.4982769",
"0.4979183",
"0.49771476",
"0.49758008",
"0.4971241",
"0.49678028",
"0.49678028",
"0.49598262",
"0.4958304",
"0.49516773",
"0.4949985",
"0.49313974",
"0.49313566",
"0.49298552",
"0.49293032",
"0.49284312",
"0.49255475",
"0.49255475",
"0.4922959",
"0.49229217",
"0.49225467",
"0.49202687",
"0.49090528",
"0.4907622",
"0.48970997",
"0.48939997",
"0.48920837",
"0.4888952",
"0.4888952",
"0.48787174",
"0.48772252",
"0.48747355",
"0.48747355",
"0.48747355",
"0.48747355",
"0.4869305",
"0.48658016",
"0.4862398",
"0.48555517",
"0.4855457",
"0.48488423",
"0.4844754",
"0.48420307",
"0.4833293"
] | 0.0 | -1 |
Check if the model needs to be booted and if so, do it. | protected function bootIfNotBooted()
{
$class = get_class($this);
if (!isset(static::$booted[$class])) {
static::$booted[$class] = true;
$this->fireModelEvent('booting', false);
static::boot();
$this->fireModelEvent('booted', false);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::booting();\n static::boot();\n static::booted();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::boot();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n }\n }",
"public static function booted(): bool\n {\n return self::booted();\n }",
"private function booted()\n {\n }",
"public function isBooted();",
"protected static function booted()\n {\n //\n }",
"protected static function booted()\n {\n //\n }",
"public static function installModel() {\r\n return GearSection::createTables() && GearOption::createTables();\r\n }",
"public static function hasBeenBootstrapped(){\n return \\Illuminate\\Foundation\\Application::hasBeenBootstrapped();\n }",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t\tModel::unguard();\n\t}",
"public static function boot()\n {\n parent::boot();\n\n self::observe(new ModelObserver);\n }",
"protected static function booting()\n {\n //\n }",
"public function boot()\n {\n // Nothing to boot\n }",
"public static function isBooted(){\n return \\Illuminate\\Foundation\\Application::isBooted();\n }",
"protected function boot()\n {\n $this->setModel();\n }",
"public function isBooted()\n {\n return $this->booted;\n }",
"public function boot()\n {\n if (!$this->isEnabled()) return;\n\n parent::boot();\n }",
"public function init() {\n//\t\tif (checkTable()) {\n//\t\t\t$this->model->upgrade();\n//\t\t}\n//\t\telse {\n\t\t\t$this->model->install();\n\t\t\t$this->loadDefaults();\n//\t\t}\n\t\t\n\t}",
"abstract public function boot();",
"abstract public function boot();",
"abstract public function boot();",
"abstract public function boot();",
"public static function booted()\n {\n }",
"public static function booted()\n {\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function($model)\n {\n $model->id = $model->cardmarket_expansion_id;\n\n if (! $model->game_id) {\n $model->game_id = 1;\n }\n\n return true;\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n self::creating(function ($model) {\n $model->is_borrowed = false;\n return $model;\n });\n }",
"public function isBooted(): bool\n {\n return $this->booted;\n }",
"public function isBooted(): bool\n {\n return $this->booted;\n }",
"public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }",
"public function canBoot(): bool;",
"public function hasBeenBootstrapped(): bool\n {\n return $this->hasBeenBootstrapped;\n }",
"private function get_is_booted(): bool\n\t{\n\t\treturn $this->status >= self::STATUS_BOOTED;\n\t}",
"public function isInitializeNeeded()\n {\n return true;\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function($model)\n {\n if (! $model->user_id) {\n $model->user_id = auth()->user()->id;\n }\n\n if (! $model->language_id) {\n $model->language_id = self::DEFAULT_LANGUAGE;\n }\n\n if (! $model->condition) {\n $model->condition = self::DEFAULT_CONDITION;\n }\n\n return true;\n });\n }",
"public static function boot()\n {\n self::getInstance()->boot();\n }",
"public function boot()\n\t{\t\n\t}",
"public function isReadyToUse()\n {\n return true;\n }",
"function boot() {\n\t\tif ( !$this->hasBooted ) {\n\t\t\tregister_shutdown_function( array( &$this, 'shutdown' ) );\n\t\t\tif ( !empty($this->bootFile) ) {\n\t\t\t\trequire_once $this->path( \"/XOOPS/Boot/$this->bootFile\" );\n\t\t\t}\n\t\t\t// @TODO-2.3: This shouldn't be there but is kept temporarily until the\n\t\t\t// old common.php has been cleaned up as it should\n\t\t\tinclude_once XOOPS_ROOT_PATH.\"/include/common.php\";\n\n\t\t\tif ( isset( $_SESSION[$this->xoBundleIdentifier]['currentUser'] ) ) {\n\t\t\t\t$this->acceptUser( $_SESSION[$this->xoBundleIdentifier]['currentUser'] );\n\t\t\t}\n\t\t\tif ( $this->launchStartupItems() ) {\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\t$this->hasBooted = true;\n\t\t}\n\t\treturn true;\n\t}",
"public static function bootAutoValidation()\n {\n static::saving(function (Validates $model) {\n return (self::$active) ? $model->validate() : true;\n });\n }",
"public function hasBootstrap()\n {\n return $this->bootstrap != null;\n }",
"public function isBooted() {\n\t\treturn (bool)$this->booted;\n\t}",
"public function boot()\n {}",
"public function boot()\n {}",
"public static function boot () {\n parent::boot();\n self::observe(new ModelParameterObserver());\n }",
"public function boot(){}",
"public function boot(): void;",
"public function runAtBoot() {\r\n\t\tif (isset ( $this->data )) {\r\n\t\t\t$this->configure ();\r\n\t\t\t$this->start ();\r\n\t\t} else {\r\n\t\t\t$this->logger->warn ( \"No WAN config found.\" );\r\n\t\t}\r\n\t}",
"private function get_is_booting(): bool\n\t{\n\t\treturn $this->status === self::STATUS_BOOTING;\n\t}",
"public function hasBaseModel()\n\t{\n\t\treturn ! empty($this->resource->models_base);\n\t}",
"function __autoload($modelname){\n\tif(Model::exists($modelname)){\n\t\tinclude Model::getFullPath($modelname);\n\t} \n}",
"abstract protected static function boot();",
"public function boot() {\n\t\t// no-op\n\t}",
"public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }",
"public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }",
"protected static function booted()\n {\n // Clear availability if the clear_availability flag is set\n static::saving(function ($availability) {\n if(!empty($availability->clear_existing)) {\n $availability->location->clearAvailability(empty($availability->id) ? null : $availability->id);\n }\n unset($availability->clear_existing);\n\n if(empty($availability->availability_time)) {\n $availability->availability_time = Carbon::today()->addDays(3);\n }\n });\n }",
"public function boot()\n\t{\n\t\t\n\t}",
"public function boot()\n\t{\n\t\t\n\t}",
"public function boot() : void;",
"public function boot();",
"public function boot();",
"public function boot();",
"public function boot();",
"public function bootedCallback()\n {\n Validation::lock();\n }",
"function post_model_init($from_cache = FALSE)\n {\n }",
"private function bootload(): void\n {\n $this->bootloader->bootload(static::LOAD);\n }",
"public function boot($reset = true)\n {\n self::$metaNAMESPACE = env('ODataMetaNamespace', 'Data');\n // If we aren't migrated, there's no DB tables to pull metadata _from_, so bail out early\n try {\n if (!Schema::hasTable(config('database.migrations'))) {\n return;\n }\n } catch (\\Exception $e) {\n return;\n }\n\n assert(false === self::$isBooted, 'Provider booted twice');\n $isCaching = true === $this->getIsCaching();\n $meta = Cache::get('metadata');\n $hasCache = null != $meta;\n\n if ($isCaching && $hasCache) {\n App::instance('metadata', $meta);\n return;\n }\n $meta = App::make('metadata');\n if (false !== $reset) {\n $this->reset();\n }\n\n $stdRef = new \\ReflectionClass(Model::class);\n $abstract = $meta->addEntityType($stdRef, static::POLYMORPHIC, true, null);\n $meta->addKeyProperty($abstract, 'PrimaryKey', TypeCode::STRING);\n\n $meta->addResourceSet(static::POLYMORPHIC, $abstract);\n\n $modelNames = $this->getCandidateModels();\n $objectModel = $this->extract($modelNames);\n $objectModel = $this->unify($objectModel);\n $this->verify($objectModel);\n $this->implement($objectModel);\n $this->completedObjectMap = $objectModel;\n $key = 'metadata';\n $this->handlePostBoot($isCaching, $hasCache, $key, $meta);\n self::$isBooted = true;\n }",
"public function boot():void\n {\n //\n }",
"public function bootstrapSystem() {}",
"public function bootstrapSystem() {}",
"public function boot(): void\n {\n //\n }",
"public function boot(): void\n {\n //\n }",
"public function boot(): void\n {\n //\n }",
"public function boot(): void\n {\n //\n }",
"public static function boot();",
"protected static function boot()\n {\n parent::boot();\n\n //\n }",
"public static function boot() \n\t{\n\t\tparent::boot();\n \n // NasabahModel::observe(new ClosedDoorModelObserver());\n\t}",
"protected function onBoot() {}",
"protected static function boot()\n {\n parent::boot();\n\n static::saving(function($model) { \n \t$model->when(is_null($model->code), function() use ($model) {\n \t\t$model->fillCode();\n \t});\n });\n }",
"protected function setup_models()\n\t{\n\t}",
"public function boot(): void\n {\n }",
"public function boot(): void\n {\n }",
"function post_model_init($from_cache = FALSE)\n\t{\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function(self $model)\n {\n $model->setCreatedAt($model->freshTimestamp());\n\n return true;\n });\n }",
"public function boot()\n\t{\n\n\t}",
"public function boot()\n\t{\n\n\t}",
"public function boot()\n\t{\n\n\t}",
"public function makeModel()\n {\n $modelPath = $this->getPath($this->getModelName());\n if(!$this->files->exists($modelPath)) {\n $this->call('make:model', [\n 'name' => $this->getModelName()\n ]);\n\n return true;\n }\n\n return false;\n }",
"protected static function boot()\n {\n }",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t}",
"public function boot()\n {\n // no-op\n }",
"public static function boot()\n {\n parent::boot();\n self::observe(ConsumerModelObserver::class);\n }",
"public function boot(): void\n {\n parent::boot();\n }",
"public function boot(): void\n {\n parent::boot();\n }",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}"
] | [
"0.7757148",
"0.7738016",
"0.68692267",
"0.6569194",
"0.6398186",
"0.6320947",
"0.62552536",
"0.62552536",
"0.6254373",
"0.6200845",
"0.6198142",
"0.617447",
"0.6161423",
"0.61529565",
"0.60718995",
"0.605006",
"0.6036296",
"0.6030147",
"0.60175306",
"0.60129666",
"0.60129666",
"0.60129666",
"0.60129666",
"0.60127753",
"0.60127753",
"0.59851664",
"0.5978605",
"0.59676176",
"0.59676176",
"0.5953381",
"0.5949521",
"0.59348875",
"0.59238863",
"0.5897527",
"0.5878463",
"0.5869092",
"0.5853743",
"0.58485335",
"0.5840932",
"0.5829121",
"0.5828091",
"0.5807052",
"0.58019143",
"0.58019143",
"0.577786",
"0.57694274",
"0.57594144",
"0.5758361",
"0.57519746",
"0.573422",
"0.5723207",
"0.5713764",
"0.5713341",
"0.5710811",
"0.5710811",
"0.57103294",
"0.57072914",
"0.57072914",
"0.5691704",
"0.5686223",
"0.5686223",
"0.5686223",
"0.5686223",
"0.5680105",
"0.5676804",
"0.56753623",
"0.56597996",
"0.565881",
"0.5657134",
"0.5655649",
"0.5650991",
"0.5650991",
"0.5650991",
"0.5650991",
"0.5645607",
"0.56428456",
"0.5636195",
"0.5628718",
"0.56269467",
"0.56176436",
"0.5607372",
"0.5607372",
"0.56001985",
"0.55990195",
"0.55861455",
"0.55861455",
"0.55861455",
"0.5585771",
"0.55846304",
"0.5581307",
"0.55796146",
"0.5579308",
"0.55781186",
"0.55781186",
"0.55739295",
"0.55739295",
"0.55739295",
"0.55739295",
"0.55739295",
"0.55739295"
] | 0.74536496 | 2 |
The "booting" method of the model. | protected static function boot()
{
static::bootTraits();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function booting()\n {\n //\n }",
"protected static function booted()\n {\n //\n }",
"protected static function booted()\n {\n //\n }",
"public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }",
"public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }",
"private function booted()\n {\n }",
"protected static function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n\t{\t\n\t}",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n\t{\n\t\t\n\t}",
"public function boot()\n\t{\n\t\t\n\t}",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t\tModel::unguard();\n\t}",
"public function boot()\r\n\t{\r\n\t\t\r\n\t}",
"public function boot() {\n\t\t//\n\n\t\tparent::boot();\n\t}",
"public function boot(){}",
"public static function booted()\n {\n }",
"public static function booted()\n {\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {}",
"public function boot()\n {}",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n //\n }",
"public function boot()\n {\n parent::boot();\n //\n }",
"public function boot()\n\t{\n\t\tparent::boot();\n\t}",
"public function boot()\n\t{\n\t\tparent::boot();\n\t}",
"public static function boot() \n\t{\n parent::boot();\n }",
"public function boot()\n {\n parent::boot();\n \n //\n }",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t}",
"public function boot()\n {\n // parent::boot();\n }",
"protected static function boot()\n {\n parent::boot();\n }",
"public function boot()\n\t{\n\n\t}",
"public function boot()\n\t{\n\n\t}",
"public function boot()\n\t{\n\n\t}",
"public function boot()\n {\n parent::boot();\n\n // ...\n }",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}",
"public function boot()\n\t{\n\t\t//\n\t}"
] | [
"0.7670344",
"0.7390779",
"0.7390779",
"0.7292516",
"0.7292516",
"0.7270451",
"0.72549695",
"0.72524065",
"0.72169435",
"0.72169435",
"0.72169435",
"0.72169435",
"0.72169435",
"0.72169435",
"0.72169435",
"0.72169435",
"0.72169435",
"0.72143155",
"0.72143155",
"0.7200063",
"0.71995884",
"0.71905303",
"0.7179543",
"0.7171871",
"0.7171871",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.71704215",
"0.7156266",
"0.7156266",
"0.7148268",
"0.71478647",
"0.71478647",
"0.7145683",
"0.7145683",
"0.71342593",
"0.7117941",
"0.71057636",
"0.7100245",
"0.7098553",
"0.7087564",
"0.7087564",
"0.7087564",
"0.7072174",
"0.7067861",
"0.7067861",
"0.7067861",
"0.7067861",
"0.7067861",
"0.7067861",
"0.7067861"
] | 0.0 | -1 |
Boot all of the bootable traits on the model. | protected static function bootTraits()
{
foreach (class_uses_recursive(get_called_class()) as $trait) {
if (method_exists(get_called_class(), $method = 'boot'.class_basename($trait))) {
forward_static_call([get_called_class(), $method]);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function boot()\n {\n static::bootTraits();\n }",
"protected static function boot()\n {\n static::bootTraits();\n }",
"protected static function boot()\n {\n static::bootTraits();\n }",
"public static function bootTraits( ) : void {\n $class = static::class;\n $booted = [ ];\n static::$traitInitializers[ $class ] = [ ];\n foreach ( class_uses_recursive( $class ) as $trait ) {\n $method = 'boot' . class_basename( $trait );\n if ( method_exists( $class , $method ) && ! in_array( $method , $booted ) ) {\n forward_static_call( [ $class , $method ] );\n $booted[ ] = $method;\n }\n if ( method_exists( $class , $method = 'initialize' . class_basename( $trait ) ) ) {\n static::$traitInitializers[ $class ][ ] = $method;\n static::$traitInitializers[ $class ] = array_unique( static::$traitInitializers[ $class ] );\n }\n }\n }",
"protected static function bootTraits()\n {\n $traits = function_exists('class_uses_recursive') ? class_uses_recursive(get_called_class()) : class_uses(get_called_class());\n foreach ($traits as $trait)\n {\n if (method_exists(get_called_class(), $method = 'boot'.class_basename($trait)))\n {\n forward_static_call([get_called_class(), $method]);\n }\n }\n }",
"protected static function bootTraits()\n {\n $class = static::class;\n\n $booted = [];\n\n static::$traitInitializers[$class] = [];\n\n foreach (class_uses_recursive($class) as $trait) {\n $method = 'boot'.class_basename($trait);\n\n if (method_exists($class, $method) && ! in_array($method, $booted)) {\n forward_static_call([$class, $method]);\n\n $booted[] = $method;\n }\n\n if (method_exists($class, $method = 'initialize'.class_basename($trait))) {\n static::$traitInitializers[$class][] = $method;\n\n static::$traitInitializers[$class] = array_unique(\n static::$traitInitializers[$class]\n );\n }\n }\n }",
"protected static function bootTraits()\n {\n $class = static::class;\n\n foreach (class_uses_recursive($class) as $trait) {\n if (method_exists($class, $method = 'boot'.class_basename($trait))) {\n forward_static_call([$class, $method]);\n }\n }\n }",
"public function boot()\n {\n $this->bootBootedTrait();\n }",
"protected function boot()\n {\n foreach ($this->getKernel()->getPlugins() as $plugin) {\n $plugin->boot($this);\n }\n }",
"protected function boot()\n {\n $this->setModel();\n }",
"public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }",
"public function boot()\n {\n static::bootMethods();\n }",
"public function boot()\n {\n $this->bootCacheBusting();\n $this->bootSharedProperties();\n }",
"public function boot()\n {\n $this->bootPackages();\n }",
"public function boot()\n {\n $this->bootViews();\n $this->bootCanonicalViewComposer();\n $this->registerBlueprints();\n $this->registerViewInactiveMacro();\n $this->bootMacros();\n }",
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::booting();\n static::boot();\n static::booted();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"public function boot(): void\n {\n $this->bootConfig();\n $this->bootDatabase();\n }",
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::boot();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t\tModel::unguard();\n\t}",
"public function boot()\n {\n parent::boot();\n $this->customBoot();\n }",
"public function boot(): void\n {\n foreach ($this->observers as $model => $observer) {\n foreach ($observer as $item) {\n $model::observe($item);\n }\n }\n\n foreach ($this->listen as $event => $listeners) {\n foreach (array_unique($listeners, SORT_REGULAR) as $listener) {\n Event::listen($event, $listener);\n }\n }\n }",
"public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }",
"protected function bootIfNotBooted()\n {\n $class = get_class($this);\n\n if (!isset(static::$booted[$class])) {\n static::$booted[$class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::boot();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"protected static function booting()\n {\n //\n }",
"protected static function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot() {\n\t\t//\n\n\t\tparent::boot();\n\t}",
"public function boot(){\n\n\t\t$this->bootConfig();\n\n\t}",
"protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n foreach (static::$handleableEvents as $event) {\r\n static::$event(function($model) use ($event) {\r\n /** @var Model $model */\r\n return $model->handleEvent($event);\r\n });\r\n }\r\n }",
"protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}",
"abstract public function boot();",
"abstract public function boot();",
"abstract public function boot();",
"abstract public function boot();",
"protected static function boot()\n {\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public function boot()\n {\n //\n\n parent::boot();\n }",
"public static function boot() {\n parent::boot();\n }",
"public static function boot() {\n parent::boot();\n }",
"public static function boot()\n {\n self::getInstance()->boot();\n }",
"public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }",
"public function boot()\r\n {\r\n parent::boot();\r\n\r\n //\r\n }",
"public function boot() {\n\t\t//\n\t}",
"public function boot() {\n\t\t//\n\t}",
"public function boot()\n {\n parent::boot();\n\n // ...\n }",
"public function boot()\n {\n parent::boot();\n \n //\n }",
"public function boot()\n\t{\n\t\tparent::boot();\n\t}",
"public function boot()\n\t{\n\t\tparent::boot();\n\t}",
"protected static function boot()\n {\n /** We MUST call the parent boot method in this case the:\n * \\Illuminate\\Database\\Eloquent\\Model\n */\n parent::boot();\n }",
"protected static function booted()\n {\n //\n }",
"protected static function booted()\n {\n //\n }",
"public function boot(): void\n {\n $this->bindImplementations();\n }",
"public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }",
"public function boot()\n {\n parent::boot();\n User::observe(UserObserver::class);\n Lead::observe(LeadObserver::class);\n Contact::observe(ContactObserver::class);\n Business::observe(BusinessObserver::class);\n Lender::observe(LenderObserver::class);\n Application::observe(ApplicationObserver::class);\n }",
"public function boot()\n {\n parent::boot();\n\n Workflow::observe(WorkflowObserver::class);\n Recipe::observe(RecipeObserver::class);\n Vote::observe(VoteObserver::class);\n }",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t}",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }",
"public function boot()\n {\n parent::boot();\n\n //\n }"
] | [
"0.79026926",
"0.79026926",
"0.79026926",
"0.7606671",
"0.7461718",
"0.7451545",
"0.7417128",
"0.74089307",
"0.6662075",
"0.6616231",
"0.66031927",
"0.65557903",
"0.6404938",
"0.6398934",
"0.63755596",
"0.6372214",
"0.6357444",
"0.63439137",
"0.63296634",
"0.63077223",
"0.63026154",
"0.6290776",
"0.628746",
"0.6253535",
"0.6243674",
"0.62334925",
"0.62312454",
"0.6225425",
"0.6221242",
"0.6216006",
"0.6216006",
"0.6216006",
"0.6216006",
"0.61975235",
"0.6186124",
"0.6186124",
"0.6186124",
"0.6186124",
"0.6186124",
"0.6186124",
"0.6186124",
"0.6186124",
"0.6186124",
"0.61744255",
"0.61744255",
"0.61671084",
"0.6153134",
"0.6153134",
"0.6152791",
"0.6152791",
"0.614933",
"0.61437833",
"0.6143016",
"0.6143016",
"0.61384314",
"0.6127705",
"0.6127705",
"0.61262494",
"0.61203545",
"0.6118137",
"0.61163306",
"0.61091983",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797",
"0.6106797"
] | 0.74236524 | 6 |
Clear the list of booted models so they will be rebooted. | public static function clearBootedModels()
{
static::$booted = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function clearBootedModels();",
"public function clearModels();",
"protected static function booted(): void\n {\n static::deleting(function (Model $model) {\n $model->removeAllImages();\n });\n }",
"protected function forgetAddedModels()\n {\n $this->quantities = $this->modelPopulators = [];\n }",
"public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }",
"public static function clear()\n {\n self::$drivers = array();\n }",
"public static function reset()\n {\n self::$toLoad = array();\n }",
"public static function reset()\n {\n self::resetDefault();\n self::$instances = array();\n }",
"public static function reset()\n\t{\n\t\tstatic::$instances = [];\n\t}",
"protected static function boot()\n {\n \tparent::boot();\n\n \tstatic::deleting(function($model) {\n \t\t$model->attributes()->sync([]);\n \t});\n }",
"public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }",
"public function clearAllDevices(){\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('DELETE FROM Devices');\n\t\t$req->execute();\n\t\t\n\n\n\t}",
"public function cleanModuleList()\n {\n /**\n * @var \\Magento\\TestFramework\\ObjectManager $objectManager\n */\n $objectManager = \\Magento\\TestFramework\\Helper\\Bootstrap::getObjectManager();\n $objectManager->removeSharedInstance(ModuleList::class);\n $objectManager->removeSharedInstance(ModuleListInterface::class);\n }",
"public static function resetAll(): void\n {\n static::getFacadeRoot()->resetAll();\n }",
"public function resetCharacteristics() {\n\t\t$characteristics = array_combine(array(\n\t\t\t'contains_model', 'contains_datasource', 'contains_behavior', 'contains_controller',\n\t\t\t'contains_component', 'contains_view', 'contains_helper', 'contains_theme', 'contains_vendor',\n\t\t\t'contains_shell', 'contains_test', 'contains_lib', 'contains_resource', 'contains_config'\n\t\t), array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));\n\n\t\t$this->out(__('Resetting all characteristics'));\n\t\t$this->Package->updateAll($characteristics);\n\n\t\t$this->out(__('* Successfully reset all characteristics'));\n\t\t$this->_stop();\n\t}",
"public function reset() {\n\t\t$this->registered = array();\n\t}",
"public static function reboot(): void\n {\n //====================================================================//\n // Clear Module Configuration Array\n if (isset(self::core()->conf)) {\n self::core()->conf = null;\n }\n //====================================================================//\n // Clear Webservice Configuration\n if (isset(self::core()->soap)) {\n self::core()->soap = null;\n }\n //====================================================================//\n // Clear Module Local Objects Classes\n if (isset(self::core()->objects)) {\n self::core()->objects = array();\n }\n //====================================================================//\n // Reset Commits Manager\n CommitsManager::reset();\n //====================================================================//\n // Clear Module Log\n self::log()->cleanLog();\n self::log()->deb('Splash Module Rebooted');\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::deleting(function($model) {\n $model->categories()->detach();\n $model->attributes()->detach();\n\n // Delete product images\n $disk = 'uploads';\n\n foreach ($model->images as $image) {\n // Delete image from disk\n\n Storage::disk($disk)->delete($image->name);\n\n\n // Delete image from db\n $image->delete();\n }\n });\n }",
"public function clear() {\n\t\t$this->backends = [];\n\t\t$this->initializedBackends = [];\n\t}",
"public function reset() : void\n {\n $this->getFilesystemLoader()->reset();\n }",
"public function clearModels()\n {\n $this->_models = array();\n return $this;\n }",
"protected static function boot()\n\t{\n\t\tparent::boot();\n\t\tModel::unguard();\n\t}",
"private function reset()\n {\n $this->human->reset();\n $this->machine->reset();\n $this->memory->reset();\n }",
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::boot();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"protected function reset(): void\n {\n $this->bot = null;\n $this->client = null;\n $this->device = null;\n $this->os = null;\n $this->brand = '';\n $this->model = '';\n $this->parsed = false;\n }",
"public function resetDataModel() {\r\n $this->arrModel = array();\r\n $intPackageId = NULL;\r\n }",
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::booting();\n static::boot();\n static::booted();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::deleting(function ($model) {\n $model->roles()->detach();\n $model->routes()->detach();\n $model->actions()->detach();\n });\n }",
"public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}",
"public function unsetAll() {\n\t\tparent::unsetAll();\n\t}",
"protected function clear()\n {\n static::destroyApplication();\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 purge(): void\n {\n $this->boot();\n $this->configuration->eventDispatcher()->dispatch(new Clear($this));\n }",
"public static function reset() {\n\t\tself::$objects = array();\n\t}",
"public function reset()\n {\n $this->env = array();\n $this->object_handlers = array();\n $this->pagetitle = '';\n }",
"public function resetAll()\n {\n $this->reset();\n $this->resetFlash();\n }",
"protected static function booted()\n\t{\n\t\tstatic::deleting(function ($university) {\n\t\t\t$university->faculties->each->delete();\n\t\t\t$university->posts->each->delete();\n\t\t\t$university->events->each->delete();\n\t\t});\n\t}",
"public function clear()\n {\n foreach ($this->backends as $b) {\n $b->clear();\n }\n }",
"public function clearModules();",
"private function _unsetSetup()\n\t{\n\t\tforeach ( $this->_setup as $setup )\n\t\t{\n\t\t\t$setup->disconnect();\n\t\t}\n\n\t\t$this->_setup = null;\n\t\t$this->_setup = array();\n\t}",
"protected function reset()\n {\n $this->config = array();\n $this->pathsToIgnore = array();\n }",
"public function clearCMDTAppareils()\n {\n $this->collCMDTAppareils = null; // important to set this to NULL since that means it is uninitialized\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 static function booted()\n\t{\n\t\tstatic::deleting(function ($tool) {\n\t\t\t$tool->comments()->delete();\n\t\t\t$tool->files->each->delete();\n\t\t\t$tool->tags()->detach();\n\t\t});\n\t}",
"protected function resetSingletons() {}",
"protected static function boot()\n {\n static::treeBoot();\n\n static::deleting(function ($model) {\n $model->roles()->detach();\n });\n }",
"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::system] = null;\n $this->values[self::platform] = null;\n $this->values[self::channel] = null;\n $this->values[self::version] = null;\n }",
"protected function _clearCache() {\n\t\t\tCache::clear(false, '_cake_model_');\n\t\t\tClassRegistry::flush();\n\t\t}",
"protected function resetSynchronised()\n {\n /*\n * Lists\n */\n\n /** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */\n $lists = Mage::getModel('lapostaconnect/list')->getCollection();\n\n /** @var $list Laposta_Connect_Model_List */\n foreach ($lists as $list) {\n $list->setLapostaId('');\n $list->setWebhookToken('');\n $list->setSyncTime(null);\n }\n\n $lists->save();\n\n Mage::helper('lapostaconnect')->log('Lists reset OK.');\n\n /*\n * Fields\n */\n\n $fields = Mage::getModel('lapostaconnect/field')->getCollection();\n\n /** @var $field Laposta_Connect_Model_Field */\n foreach ($fields as $field) {\n $field->setLapostaId('');\n $field->setLapostaTag('');\n $field->setSyncTime(null);\n }\n\n $fields->save();\n\n Mage::helper('lapostaconnect')->log('Fields reset OK.');\n\n /*\n * Subscribers\n */\n\n /** @var $subscribers Laposta_Connect_Model_Mysql4_Subscriber_Collection */\n $subscribers = Mage::getModel('lapostaconnect/subscriber')->getCollection();\n\n /** @var $subscriber Laposta_Connect_Model_Subscriber */\n foreach ($subscribers as $subscriber) {\n $subscriber->setLapostaId('');\n $subscriber->setSyncTime(null);\n }\n\n $subscribers->save();\n\n Mage::helper('lapostaconnect')->log('Subscribers reset OK.');\n }",
"private function resetAll()\n {\n $this->resetJobManager();\n self::clearCurrentJob(null);\n RetailcrmLogger::output('CLI command lock was cleared.');\n }",
"public static function cleanAllLists() {\r\n \tself::$list=array();\r\n }",
"public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }",
"public static function clearInstancePool()\n\t{\n\t\tself::$instances = array();\n\t}",
"public static function clearInstancePool()\n\t{\n\t\tself::$instances = array();\n\t}",
"public static function clearInstancePool()\n\t{\n\t\tself::$instances = array();\n\t}",
"public static function clearInstancePool()\n\t{\n\t\tself::$instances = array();\n\t}",
"public static function clearInstancePool()\n\t{\n\t\tself::$instances = array();\n\t}",
"public static function reset()\n {\n self::$config = null;\n self::$configLoaded = false;\n }",
"public function reset() {\n $this->folders = NULL;\n }",
"public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }",
"protected function bootIfNotBooted()\n {\n $class = get_class($this);\n\n if (!isset(static::$booted[$class])) {\n static::$booted[$class] = true;\n\n $this->fireModelEvent('booting', false);\n\n static::boot();\n\n $this->fireModelEvent('booted', false);\n }\n }",
"public function clearDiscovery();",
"public function clearAll() {}",
"public static function boot()\n {\n parent::boot();\n static::deleting(function($project)\n {\n $project->accesses()->delete();\n $project->checklistAnswers()->delete();\n $project->bugs()->delete();\n $project->memos()->delete();\n $project->documentation()->delete();\n $project->internaldocumentation()->delete();\n $project->notifications()->delete();\n $project->mockupCategories()->delete();\n\n // In order to trigger static::delete in Mockup Model\n foreach ($project->mockups as $mockup) {\n $mockup->delete();\n }\n });\n }",
"protected static function booted()\n {\n static::addGlobalScope(new DeletedAtScope());\n }",
"public static function clear(): void\n {\n self::$dialects = [];\n self::$definitions = [];\n self::$loaded = [];\n }",
"public function resetLookupCollections()\n\t{\n\t\t$this->lookupCollections[] = null;\n\t}",
"public function clear_all()\n {\n }",
"private function nuke()\n {\n \\lib\\Model\\ModelCache::clear($this);\n $this->__new=true;\n $this->__fields=array();\n $this->__isDirty=false;\n $this->__dirtyFields=array();\n }",
"protected function clearAllPersistentData()\r\n {\r\n }",
"public function clearAllCommand()\n {\n $this->eventRepository->removeAll();\n $this->eventSourceRepository->removeAll();\n }",
"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 static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }",
"public function clearAll();",
"public function clearAll();",
"public function clear_model($uniqueid, $modelversionoutputdir);",
"public static function boot()\n {\n parent::boot();\n\n //delete your related models here, for example\n static::deleting(function($video)\n {\n foreach($video->videoImage as $image)\n {\n $image->delete();\n } \n\n foreach($video->userHistory as $history)\n {\n $history->delete();\n } \n\n foreach($video->userRating as $rating)\n {\n $rating->delete();\n } \n\n foreach($video->userWishlist as $wishlist)\n {\n $wishlist->delete();\n } \n });\t\n\n }",
"public function reset(): void\n {\n $this->data = [];\n $this->relationships = [];\n }",
"public function reset() {\n\t\t\t$this->arList = NULL; \t\n\t\t}",
"public function reset()\n {\n $this->values[self::APP_NAME] = null;\n $this->values[self::SVR_NAME] = null;\n $this->values[self::SVR_POOL] = null;\n $this->values[self::TASK_CMD] = null;\n $this->values[self::TASK_ID] = null;\n $this->values[self::SUBTASK_ID] = null;\n $this->values[self::CMD_ID] = null;\n }",
"public static function clear()\n {\n self::$config = array();\n }",
"protected function resetExistingTables()\n {\n $this->existingTables = null;\n }",
"public function reset() {\n\t\t$this->mimetypes = [];\n\t\t$this->mimetypeIds = [];\n\t}",
"public function detachAll() {}",
"public function reset()\n {\n $this->values[self::_NORMAL_STAGE_STARS] = array();\n $this->values[self::_ELITE_STAGE_STARS] = array();\n $this->values[self::_ELITE_DAILY_RECORD] = array();\n $this->values[self::_ELITE_RESET_TIME] = null;\n $this->values[self::_SWEEP] = null;\n $this->values[self::_ACT_DAILY_RECORD] = array();\n $this->values[self::_ACT_RESET_TIME] = null;\n }",
"public function tearDown() {\n foreach ($this->registered as $l) {\n \\lang\\ClassLoader::removeLoader($l);\n }\n }",
"public function reset(): void\n {\n $this->_add = new SplObjectStorage();\n $this->_delete = new SplObjectStorage();\n }",
"private function clear(): void\n {\n $this->centralDirectoryRecords = [];\n $this->offset = 0;\n\n if($this->operationMode === OperationMode::NORMAL) {\n $this->ready = false;\n $this->recordedSimulation = [];\n } else {\n $this->operationMode = OperationMode::NORMAL;\n }\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 }",
"private function _load_models()\r\n {\r\n foreach ($this->models as $model)\r\n {\r\n $this->load->model($this->_model_name($model), $model);\r\n }\r\n }",
"public function reset()\n {\n $this->models = null;\n return $this;\n }",
"public function forgetInstances()\n {\n $this->instances = [];\n }",
"protected function bootIfNotBooted()\n {\n if (! isset(static::$booted[static::class])) {\n static::$booted[static::class] = true;\n }\n }",
"public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}",
"private function _load_models()\n {\n foreach ($this->models as $model)\n {\n $this->load->model($this->_model_name($model), $model);\n }\n }",
"public final function destroy_all()\n {\n }",
"public function deleteAllDependents() {\n\t\t$this->dependents = array();\n\t}",
"public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesList());\n }"
] | [
"0.8700318",
"0.72563404",
"0.66823345",
"0.66046894",
"0.6544441",
"0.63992864",
"0.63572377",
"0.6318385",
"0.6299947",
"0.62808114",
"0.6279543",
"0.6196935",
"0.616978",
"0.6148886",
"0.6119523",
"0.61061716",
"0.6072173",
"0.6064169",
"0.6059776",
"0.6058886",
"0.6057026",
"0.5983577",
"0.59491426",
"0.5946936",
"0.5938106",
"0.5931766",
"0.5930907",
"0.5925575",
"0.59067714",
"0.58825743",
"0.5866231",
"0.58515453",
"0.58484274",
"0.58144367",
"0.58058393",
"0.58022785",
"0.57966375",
"0.5775653",
"0.5775133",
"0.5771819",
"0.5751281",
"0.5737997",
"0.5733131",
"0.5722156",
"0.57133627",
"0.571019",
"0.571016",
"0.57051414",
"0.567556",
"0.56742257",
"0.56736934",
"0.56651187",
"0.5657526",
"0.56531054",
"0.56531054",
"0.56531054",
"0.56531054",
"0.56531054",
"0.5650076",
"0.5648886",
"0.5647893",
"0.56459296",
"0.5637851",
"0.56368285",
"0.5627626",
"0.561878",
"0.5613659",
"0.56055826",
"0.5597558",
"0.55831194",
"0.55733144",
"0.55714935",
"0.5568048",
"0.5563661",
"0.55598766",
"0.55598766",
"0.5540799",
"0.5508164",
"0.5502058",
"0.55003864",
"0.5495786",
"0.54954207",
"0.54901904",
"0.5489257",
"0.5480602",
"0.54791516",
"0.5469937",
"0.54684365",
"0.5468316",
"0.54675156",
"0.5466993",
"0.5464949",
"0.5456633",
"0.54563844",
"0.54553574",
"0.54525924",
"0.54502636",
"0.5446699",
"0.54295754"
] | 0.89517516 | 1 |
Bind some nicer events to this model, in the format of method overrides. | protected function bootNicerEvents()
{
$class = get_called_class();
if (isset(static::$eventsBooted[$class])) {
return;
}
$radicals = ['creat', 'sav', 'updat', 'delet', 'fetch'];
$hooks = ['before' => 'ing', 'after' => 'ed'];
foreach ($radicals as $radical) {
foreach ($hooks as $hook => $event) {
$eventMethod = $radical . $event; // saving / saved
$method = $hook . ucfirst($radical); // beforeSave / afterSave
if ($radical != 'fetch') $method .= 'e';
self::$eventMethod(function($model) use ($method) {
$model->fireEvent('model.' . $method);
if ($model->methodExists($method))
return $model->$method();
});
}
}
/*
* Hook to boot events
*/
static::registerModelEvent('booted', function($model){
$model->fireEvent('model.afterBoot');
if ($model->methodExists('afterBoot'))
return $model->afterBoot();
});
static::$eventsBooted[$class] = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModelEvents();",
"protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n foreach (static::$handleableEvents as $event) {\r\n static::$event(function($model) use ($event) {\r\n /** @var Model $model */\r\n return $model->handleEvent($event);\r\n });\r\n }\r\n }",
"abstract public function apply(Event $event) : Model;",
"public static function bootHasAttributeEvents()\n {\n // Event fired after a model has been successfully saved (inserted or updated) by Laravel\n static::saved(function($model) {\n $model->fireAttributeEvents();\n $model->callAttributeSavedMethods();\n });\n }",
"public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }",
"public static function __events () {\n \n }",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"function bindEventObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'Events', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->event_id))\r\n\t {\r\n\t $table->load( $this->event_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t if (!array_key_exists($prop, $properties))\r\n\t\t {\r\n\t\t $this->$prop = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}",
"public function attachEvents();",
"public function attachEvents();",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function xAdmin_ConversionEvent() {\n parent::Base_Admin_Controller();\n }",
"function allevents_widget() {\n\t\tparent::__construct( false, 'Row Seats Events' );\n\t}",
"public function events() {\n return array_merge(parent::events(), array(\n 'onBeforeSave' => 'beforeSave',\n 'onAfterSave' => 'afterSave',\n 'onBeforeDelete' => 'beforeDelete',\n 'onAfterDelete' => 'afterDelete',\n 'onBeforeFind' => 'beforeFind',\n 'onAfterFind' => 'afterFind',\n ));\n }",
"public function implementedEvents() {\n\t\treturn parent::implementedEvents() + [\n\t\t\t'Visualisation.onCheck' => array('callable' => 'onCheck', 'passParams' => true)\n\t\t];\n\t}",
"public static function events();",
"function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }",
"public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }",
"protected static function bootEvent()\n {\n static::saving(function (Item $model) {\n if (is_null($model->getAttributeFromArray('quantity_per_bundle'))) {\n $model->quantity_per_bundle = $model->getDenominationRelationValue()->quantity_per_bundle;\n }\n\n if (!$model->is_order_custom_quantity) {\n $model->quantity = $model->countQuantityAttribute();\n }\n });\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function($model)\n {\n //dd($model);\n });\n\n static::updated(function($model)\n {\n //dd($model);\n });\n\n\n }",
"public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}",
"abstract function HookEvents();",
"public static function boot()\n {\n parent::boot();\n\n static::saving(function ($model) {\n $model->slug = $model->id .'-'. str_slug($model->title);\n });\n }",
"public function implementedEvents() {\n\t\treturn array(\n\t\t\t'Crud.initialize' => 'initialize'\n\t\t);\n\t}",
"private function installEvents()\n {\n $this->load->model('setting/event');\n\n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/customer/editCustomer/after',\n 'extension/payment/mundipagg_events/onCustomerEdit'\n );\n \n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/address/addAddress/after',\n 'extension/payment/mundipagg_events/onAddressAdd'\n );\n }",
"protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }",
"public function __construct()\n {\n parent::__construct('BaseEvent');\n }",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"public function setEventHandlers()\n {\n Event::on(Menu::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n });\n \n // Set eventhandlers for the 'MenuItem' model\n Event::on(MenuItem::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n }); \n }",
"function __construct()\n\t{\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}",
"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}",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n /*\r\n $event->beforeDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (DragConfig $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function EventHelper()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC')\n ));\n \n $this->set('events', $eventdata); \n }",
"protected function initializeEvents()\n\t{\n\t\tparent::initializeEvents();\n\t\t$this->events->add('beforeRender');\n\t\t$this->events->add('render');\n\t}",
"public function bootRevisionable()\n {\n if (!property_exists(get_class($this->model), 'revisionable') && !$this->model->getDynamicProperties()['revisionable']) {\n throw new Exception(sprintf(\n 'You must define a $revisionable property in %s to use the Revisionable behavior.',\n get_class($this->model)\n ));\n }\n\n $this->model->bindEvent('model.afterUpdate', function () {\n $this->model->revisionableAfterUpdate();\n });\n\n $this->model->bindEvent('model.afterDelete', function () {\n $this->model->revisionableAfterDelete();\n });\n }",
"private function registerDefaultEventSourcingBindings() : void\n {\n $this->app->bind(\n AggregateFactory::class,\n PublicConstructorAggregateFactory::class\n );\n\n $this->app->bind(\n Serializer::class,\n SimpleInterfaceSerializer::class\n );\n\n $this->app->singleton(\n EventBus::class,\n SimpleEventBus::class\n );\n }",
"protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\n\t}",
"public function boot()\r\n {\r\n parent::boot();\r\n /* Model Start */\r\n\r\n //StaffTransfer\r\n \\App\\Models\\HR\\Attendance\\StaffTransfer::creating(function ($model) {\r\n $model->onCreating();\r\n });\r\n \\App\\Models\\HR\\Attendance\\StaffTransfer::saving(function ($model) {\r\n $model->onSaving();\r\n });\r\n //Attendance\r\n \\App\\Models\\HR\\Attendance\\Attendance::saving(function ($model) {\r\n $model->onSaving();\r\n });\r\n\r\n /* Model End */\r\n }",
"public function event()\n\t{\n\t\tif (defined('ADMIN_THEME'))\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_admin', null));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_entry_form', null));\n\t\t}\n\t}",
"public static function boot()\n {\n // Call default functionality (required)\n parent::boot();\n\n // Check the translate plugin is installed\n if (!class_exists('RainLab\\Translate\\Behaviors\\TranslatableModel')) {\n return;\n }\n\n // Extend the constructor of the model\n self::extend(function ($model) {\n // Implement the translatable behavior\n $model->implement[] = 'RainLab.Translate.Behaviors.TranslatableModel';\n\n });\n }",
"abstract protected function handle($event);",
"public function inflect($event, $eventHandler);",
"protected static function boot()\n {\n parent::boot();\n\n static::saving(function($model) { \n \t$model->when(is_null($model->code), function() use ($model) {\n \t\t$model->fillCode();\n \t});\n });\n }",
"public function boot()\n {\n BelongsTo::setEventDispatcher($this->app['events']);\n HasMany::setEventDispatcher($this->app['events']);\n HasOne::setEventDispatcher($this->app['events']);\n MorphMany::setEventDispatcher($this->app['events']);\n MorphOne::setEventDispatcher($this->app['events']);\n MorphTo::setEventDispatcher($this->app['events']);\n }",
"function _init(&$event)\r\n\t\t{\r\n\t\t\tparent::_init($event);\r\n\t\t\t\r\n\t\t\t$this->inp\t\t\t\t=\t&$event->object('input_validation', array(&$event));\r\n\t\t\t$this->data_validation\t=\t&$event->object('data_validation', array(&$event));\r\n\t\t}",
"public function onUpdate($options){\r\n $this->_fk['onupdate'] = strtoupper($options);\r\n return $this;\r\n }",
"public function implementedEvents() {\n\t\treturn array(\n\t\t\t'Crud.beforeHandle' => array('callable' => 'beforeHandle', 'priority' => 10),\n\t\t\t'Crud.setFlash' => array('callable' => 'setFlash', 'priority' => 5),\n\n\t\t\t'Crud.beforeRender' => array('callable' => 'respond', 'priority' => 100),\n\t\t\t'Crud.beforeRedirect' => array('callable' => 'respond', 'priority' => 100)\n\t\t);\n\t}",
"public static function bootSearchTrait()\n {\n self::saved(\n function ($model) {\n App::offsetGet('search')->update($model);\n }\n );\n\n self::deleting(\n function ($model) {\n App::offsetGet('search')->delete($model);\n }\n );\n }",
"public function implementedEvents() {\n return [\n 'Crud.beforeHandle' => ['callable' => 'beforeHandle', 'priority' => 50],\n 'Crud.beforeSave' => ['callable' => 'beforeSave', 'priority' => 50],\n 'Crud.beforeRender' => ['callable' => 'beforeRender', 'priority' => 50],\n ];\n }",
"public static function bootAmountable()\n {\n static::extend(function ($model) {\n $model->rules = array_merge($model->rules, [\n 'amount_exact' => 'numeric|min:0',\n 'amount_percentage' => 'numeric|min:0|max:100',\n ]);\n\n $model->purgeable = array_merge($model->purgeable, [\n 'amount_exact',\n 'amount_percentage',\n ]);\n\n $model->attributes = array_merge($model->attributes, [\n 'amount_exact' => 0,\n 'amount_percentage' => 0,\n ]);\n\n $model->addFillable('amount_exact', 'amount_percentage');\n\n $model->bindEvent('model.beforeSave', function () use ($model) {\n $model->setAmount();\n });\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n self::created(function ($productProvider) {\n $product = ProductModel::find($productProvider->product);\n if (!$product->franchise){\n $product->updatePrice();\n }\n });\n\n self::updated(function ($productProvider) {\n $product = ProductModel::find($productProvider->product);\n if (!$product->franchise){\n $product->updatePrice();\n }\n });\n }",
"protected static function boot()\n {\n parent::boot();\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName()).\n */\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n \n return true;\n });\n }",
"protected static function bootAuditable()\n {\n foreach (static::getAuditableEvents() as $eventName) {\n static::$eventName(function (AuditableInterface $model) use ($eventName) {\n Auditor::record($eventName, $model);\n });\n }\n }",
"public function boot()\n {\n Event::listen('eloquent.created: *', function($data,$data2) {\n $this->save_event('crear',$data2);\n });\n\n Event::listen('eloquent.updated: *', function($data,$data2) {\n $this->save_event('actualizar',$data2);\n });\n\n Event::listen('eloquent.deleting: *', function($data,$data2) {\n $this->save_event('borrar',$data2);\n });\n }",
"public function send_events()\n {\n }",
"public static function bootHistoryTrait() {\n// parent::boot();\n\n foreach (static::getRecordActivityEvents() as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n try {\n $modelRevisionObj = self::getRevisionObject($model);\n \n $diff = static::getDiff($model);\n\n if (!$diff['before'] && !$diff['after']) {\n return true;\n }\n\n $relations = $model->getRelations();\n \n foreach ($diff['before'] as $key => $value) {\n\n if (static::isRelated($key)) {\n $relatedModel = static::getRelatedModel($model, $key);\n \n //check related model need to be logged\n if(!$relatedModel)\n continue;\n \n //load related model and get old value\n $relatedModelObj = new $relatedModel;\n $relModel = $relatedModelObj::find($value);\n\n $relations = static::getRelatedModelRelations($model, $key);\n\n $modelBefore = $relModel->load($relations);\n\n //get new value\n $relModel = $relatedModelObj::find($diff['after'][$key]);\n $modelAfter = $relModel->load($relations);\n\n $accessColumnValue = static::getRelatedModelColumn($model, $key);\n\n $row['old_value'] = array_get($modelBefore->toArray(), $accessColumnValue);\n $row['new_value'] = array_get($modelAfter->toArray(), $accessColumnValue);\n } else {\n $row['old_value'] = $value;\n $row['new_value'] = $diff['after'][$key];\n }\n\n $mutator = 'get' . studly_case($key) . 'Attribute';\n \n if (method_exists($model, $mutator)) {\n $key = $model->$mutator($key);\n }\n \n $row['column'] = $key;\n\n $foreign_key = $model->foreign_key;\n// \n// //set history relation col to appropriate value\n $row['revisionable_id'] = $model->$foreign_key;\n $row['user_id'] = \\Auth::user()->id;\n\n $modelRevisionObj::create($row);\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n });\n \n return true;\n }\n }",
"public function events()\n {\n return [\n ActiveRecord::EVENT_BEFORE_VALIDATE => 'beforeValidate',\n ];\n }",
"public static function boot() {\n parent::boot();\n\n // create a event to happen on updating\n static::updating(function($table) {\n $table->updated_by = Auth::user()->username;\n });\n\n // create a event to happen on saving\n static::creating(function($table) {\n if (Auth::check()){\n $table->created_by = Auth::user()->username;\n }\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }",
"public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }",
"function before_validation_on_update() {}",
"public static function convert($_event)\n {\n\n }",
"public function actionIndex(){\r\n\r\n// $event = new Message();\r\n//\r\n// $event->message = 'messages';\r\n//\r\n// $this->on(Personal::EVENT_HELLO, [$personal, 'sayHello']);\r\n//\r\n// $this->on(Personal::EVENT_HELLO, [$personal, 'sayTest']);\r\n//\r\n// $this->off(Personal::EVENT_HELLO, [$personal, 'sayHello']);\r\n\r\n //类级别处理程序\r\n// Event::on(Personal::className(), Personal::EVENT_HELLO, function($event){\r\n// var_dump($event->sender);\r\n// });\r\n//\r\n//// $this->trigger(Personal::EVENT_HELLO, $event);\r\n// Event::trigger(Personal::className(), Personal::EVENT_HELLO);\r\n\r\n// Yii::$app->on(Personal::EVENT_HELLO, function($event){\r\n// echo get_class($event->sender);\r\n// });\r\n// Yii::$app->trigger(Personal::EVENT_HELLO, new Event(['sender' => new Personal]));\r\n\r\n// $myClass = new MyClass();\r\n $personal = new Personal();\r\n $myBehavior = new MyBehavior();\r\n\r\n// Step 3: 将行为绑定到类上\r\n $personal->attachBehavior('myBehavior', $myBehavior);\r\n\r\n// Step 4: 访问行为中的属性和方法,就和访问类自身的属性和方法一样\r\n echo $personal->property1;\r\n echo $personal->method1();\r\n echo $personal->prop1;\r\n echo $personal->prop2;\r\n// echo $personal->prop3;\r\n// echo $personal->prop4;\r\n echo $personal->foo();\r\n// echo $personal->bar();\r\n $b = $personal->getBehaviors('myBehavior2');\r\n echo $b;exit;\r\n// $personal = new Personal();\r\n// $personal->trigger(Personal::EVENT_HELLO);\r\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 }",
"function eventclass_slot()\n\t{\n\n//\tonscreen events\n\n\t}",
"protected function registerModelBindings()\n {\n $this->app->bind(LogContract::class, Log::class);\n }",
"public function events()\n\t{\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Weblog get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t='yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tcategory url titles?\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tdetect special cases\n\t\t//--------------------------------------------\n\n\t\tif ( ! $this->parent_method)\n\t\t{\n\t\t\t$this->parent_method = __FUNCTION__;\n\t\t}\n\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$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' => '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' => 'date_range_end',\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' => 'show_days',\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' => 'show_weeks',\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' => 'show_months',\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' => 'show_years',\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' => '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' => 'prior_occurrences_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' => 'prior_exceptions_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' => 'upcoming_occurrences_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' => 'upcoming_exceptions_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' => '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' => 'event_offset',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 0\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'orderby',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'event_start_date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'sort',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'ASC'\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// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// For the purposes of this method, if an event_id or event_name\n\t\t// has been specified, we want to ignore date range parameters.\n\t\t// -------------------------------------\n\t\t/*\n\t\tif ($this->P->value('event_id') !== FALSE OR $this->P->value('event_name') !== FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', FALSE);\n\t\t\t$this->P->set('date_range_end', FALSE);\n\t\t}\n\t\t*/\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching events');\n\n\t\t$ids = $this->data->fetch_event_ids($this->P);\n\n\t\t/*$category = FALSE;\n\n\t\tif (FALSE AND isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}\n\n\t\t$ids = $this->data->fetch_event_ids($this->P, $category);*/\n\n\t\t// -------------------------------------\n\t\t// No events?\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No events, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// We also need the \"parent\" entry id, if it hasn't been provided\n\t\t// -------------------------------------\n\n\t\tforeach ($ids as $k => $v)\n\t\t{\n\t\t\tif (! isset($ids[$v]))\n\t\t\t{\n\t\t\t\t$ids[$v] = $v;\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_event_ids' hook.\n\t\t// - Do something with the event IDs\n\n\t\tif (ee()->extensions->active_hook('calendar_events_event_ids') === TRUE)\n\t\t{\n\t\t\t$ids = ee()->extensions->call('calendar_events_event_ids', $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD . \"(.+?)\" .\n\t\t\t\t\t LD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD . \"(.+?)\" . LD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t$var_pairs = array(\n\t\t\t'occurrences',\n\t\t\t'exceptions',\n\t\t\t'rules'\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_pair as $name => $params)\n\t\t{\n\t\t\tif (in_array($name, $var_pairs))\n\t\t\t{\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[$name]['id'] = '';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($var_pairs as $pair)\n\t\t\t{\n\t\t\t\tif (strpos($name.' ', $pair) !== 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$new_name = $name.' id=\"\"';\n\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[] \t\t\t\t\t= ee()->TMPL->var_pair[$name];\n\t\t\t\tee()->TMPL->var_pair[$new_name]['id'] \t= '';\n\t\t\t\t// Leave the old name behind so we can pick it up later and use it\n\t\t\t\tee()->TMPL->var_pair[$pair] \t\t\t= $name;\n\n\t\t\t\tunset(ee()->TMPL->var_pair[$name]);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\t$var_dates = array(\n\t\t\t'event_start_date'\t=> FALSE,\n\t\t\t'event_start_time'\t=> FALSE,\n\t\t\t'event_end_date'\t=> FALSE,\n\t\t\t'event_end_time'\t=> FALSE,\n\t\t\t'event_first_date'\t=> FALSE,\n\t\t\t'event_last_date'\t=> FALSE,\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t{\n\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t{\n\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\thash fix for EE 2.8.2\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\tDue to the new conditionals parser\n\t\t\t\t\t//\teverything is just whack, so we have\n\t\t\t\t\t//\tto hash and replace formats because\n\t\t\t\t\t//\tEE is just barfing on it now :/.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//EE 2.9+ converting quotes and escaping on its conditional\n\t\t\t\t\t//tokenizer so we now have to match escaped quotes\n\t\t\t\t\t//This should be backward compatible.\n\t\t\t\t\tpreg_match(\"/format=(\\\\\\'|\\'|\\\\\\\"|\\\"])(.*)?\\\\1/i\", $k, $matches);\n\n\t\t\t\t\tif ( ! empty($matches))\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_k = $k;\n\t\t\t\t\t\t$k = str_replace($matches[0], md5($matches[0]), $k);\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace($old_k, $k, ee()->TMPL->tagdata);\n\n\t\t\t\t\t\t//EE 2.9's new conditional parser also screws with how\n\t\t\t\t\t\t//template variables were pulling out the formats for\n\t\t\t\t\t\t//us due to the quote conversion and escaping\n\t\t\t\t\t\t//so we are fixing it here with this since we are\n\t\t\t\t\t\t//capturing it ourselves and converting to hashes\n\t\t\t\t\t\t//anyway.\n\t\t\t\t\t\tif ($v == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$v = $matches[2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$var_dates[$name][$k] = $v;\n\t\t\t\t\tee()->TMPL->var_single[$k] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel;\n\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] \t\t\t= implode('|', array_keys($ids));\n\n\t\t//if we have event names, lets set them for the URL title\n\t\tif ( ! in_array(ee()->TMPL->fetch_param('event_name'), array(FALSE, ''), TRUE))\n\t\t{\n\t\t\tee()->TMPL->tagparams['url_title'] = ee()->TMPL->fetch_param('event_name');\n\t\t}\n\n\t\tee()->TMPL->tagparams[$this->sc->channel] \t= CALENDAR_EVENTS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tee()->TMPL->var_single \t\t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_events_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_events_channel_query', $channel->query, $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Trim IDs and build events\n\t\t// -------------------------------------\n\n\t\t$new_ids = array();\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t}\n\n\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t// -------------------------------------\n\t\t// Turn these IDs into events\n\t\t// -------------------------------------\n\n\t\t$events = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching Calendar_event class');\n\n\t\tif ( ! class_exists('Calendar_event'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t}\n\n\t\t$calendars = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Creating events');\n\n\t\tforeach ($event_data as $k => $edata)\n\t\t{\n\t\t\t$start_ymd\t= ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') : '';\n\t\t\t$end_ymd\t= ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd');\n\n\t\t\t$temp\t\t= new Calendar_event($edata, $start_ymd, $end_ymd);\n\n\t\t\tif (! empty($temp->dates))\n\t\t\t{\n\t\t\t\t$temp->prepare_for_output();\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Eliminate times we don't care about\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('date_range_start', 'ymd') != '')\n\t\t\t\t{\n\t\t\t\t\tforeach ($temp->dates as $ymd => $times)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($times as $range => $data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($data['end_date']['ymd'].$data['end_date']['time'] <\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telseif ($data['date']['ymd'].$data['date']['time'] >\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (empty($temp->dates[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($temp->dates[$ymd]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Recheck to ensure our dates array isn't empty now\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t{\n\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No point in stressing ourselves out if $calendars is empty\n\t\t// -------------------------------------\n\n\t\tif (empty($calendars))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Fetch information about the calendars\n\t\t// -------------------------------------\n\n\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t// -------------------------------------\n\t\t// Prep variable aliases\n\t\t// -------------------------------------\n\n\t\t$variables = array(\n\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t'author'\t\t=> 'event_author',\n\t\t\t'status'\t\t=> 'event_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\n\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare to reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\t$calendar_orderby_params = array(\n\t\t\t'event_title',\n\t\t\t'event_start_date',\n\t\t\t'event_start_hour',\n\t\t\t'event_start_time',\n\t\t\t'occurrence_start_date'\n\t\t);\n\n\t\t$orders \t\t\t\t= explode('|', $this->P->value('orderby'));\n\t\t$sorts \t\t\t\t\t= explode('|', $this->P->value('sort'));\n\t\t$calendar_orders \t\t= array();\n\t\t$calendar_order_data \t= array();\n\n\t\tforeach ($orders as $k => $order)\n\t\t{\n\t\t\tif (in_array($order, $calendar_orderby_params))\n\t\t\t{\n\t\t\t\t$sort = (isset($sorts[$k])) ? $sorts[$k] : 'desc';\n\t\t\t\t$calendar_orders[$order] = $sort;\n\t\t\t\t$calendar_order_data[$order] = array();\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tremove non-existant entry ids first\n\t\t//--------------------------------------------\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\tif ( ! isset($events[$row['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tcalculate offset and event timeframe\n\t\t//\ttotal before we parse tags\n\t\t//--------------------------------------------\n\n\t\t$offset = ($this->P->value('event_offset') > 0) ? $this->P->value('event_offset') : 0;\n\n\t\t$this->event_timeframe_total = count($channel->query->result) - $offset;\n\n\t\t// -------------------------------------\n\t\t// Add variables to the query result\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding variables to channel query result');\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['screen_name'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['username'];\n\n\t\t\t$channel->query->result[$k]['event_timeframe_total'] = $this->event_timeframe_total;\n\n\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t// -------------------------------------\n\t\t\t// Alias\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($variables as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Event variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($events[$entry_id]->default_data as $key => $val)\n\t\t\t{\n\t\t\t\tif (! is_array($val))\n\t\t\t\t{\n\t\t\t\t\tif ($val === 'y' OR $val === 'n')\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = ($val == 'y') ? TRUE : 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$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach ($val as $vkey => $vval)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($vval === 'y' OR $vval === 'n')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][\n\t\t\t\t\t\t\t\t'event_'.$key.'_'.$vkey\n\t\t\t\t\t\t\t] = ($vval == 'y') ? TRUE : FALSE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key.'_'.$vkey] = $vval;\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\t// -------------------------------------\n\t\t\t// Prepare to orderby event_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_date']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_start_date'][$k] =\n\t\t\t\t\t$events[$entry_id]->default_data['start_date'] .\n\t\t\t\t\t$events[$entry_id]->default_data['start_time'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Prepare to orderby occurrence_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['occurrence_start_date']))\n\t\t\t{\n\t\t\t\t$date = reset(reset($events[$entry_id]->dates));\n\t\t\t\t$time = (isset($date['start_time'])) ? $date['start_time'] : $date['date']['time'];\n\t\t\t\t$date = $date['date']['ymd'];\n\t\t\t\t$calendar_order_data['occurrence_start_date'][$k] = $date.$time;\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start time\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_time']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = '0000';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = $events[$entry_id]->default_data['start_time'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start hour\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_hour']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] = '00';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] \t= substr($events[$entry_id]->default_data['start_time'], 0, 2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by event title\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_title']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_title'][$k] = $channel->query->result[$k]['title'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrence variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_occurrence_total'] \t= count($events[$entry_id]->occurrences);\n\t\t\t$channel->query->result[$k]['event_has_occurrences'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_occurrence_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Exception variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_exception_total'] \t= count($events[$entry_id]->exceptions);\n\t\t\t$channel->query->result[$k]['event_has_exceptions'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_exception_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Rule variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_rule_total'] \t\t= count($events[$entry_id]->rules);\n\t\t\t$channel->query->result[$k]['event_has_rules'] \t\t\t= (\n\t\t\t\t$channel->query->result[$k]['event_rule_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t//-------------------------------------\n\t\t\t// Does the event end?\n\t\t\t// we have to check all rules to make sure\n\t\t\t// in case this is a complex rule\n\t\t\t//-------------------------------------\n\n\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = FALSE;\n\n\t\t\tif ($channel->query->result[$k]['event_recurs'] == 'y')\n\t\t\t{\n\t\t\t\tforeach ($events[$entry_id]->rules as $event_rule)\n\t\t\t\t{\n\t\t\t\t\tif ($event_rule['rule_type'] == '+' AND\n\t\t\t\t\t\t($event_rule['repeat_years'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_months'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_days'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_weeks'] != 0) AND\n\t\t\t\t\t\t$event_rule['last_date'] == 0 \tAND\n\t\t\t\t\t\t$event_rule['stop_after'] == 0\n\t\t\t\t\t )\n\t\t\t\t\t{\n\t\t\t\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*$never_ending = $channel->query->result[$k]['event_never_ends'] = (\n\t\t\t\t$channel->query->result[$k]['event_last_date'] == 0 AND\n\t\t\t\t$channel->query->result[$k]['event_recurs'] == 'y'\n\t\t\t);*/\n\n\t\t\t// -------------------------------------\n\t\t\t// Calendar variables\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendars[$events[$entry_id]->default_data['calendar_id']]))\n\t\t\t{\n\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (substr($key, 0, 9) != 'calendar_')\n\t\t\t\t\t{\n\t\t\t\t\t\t$key = 'calendar_'.$key;\n\t\t\t\t\t}\n\n\t\t\t\t\t//add in calendar data\n\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\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//really?\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Date variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($var_dates as $name => $vals)\n\t\t\t{\n\t\t\t\t$which = '';\n\n\t\t\t\tif ($vals === FALSE)\n\t\t\t\t{\n\t\t\t\t\t$vals = array();\n\t\t\t\t}\n\n\t\t\t\tif ($name == 'event_last_date')\n\t\t\t\t{\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_last_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($name == 'event_first_date')\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_first_date']\t= $channel->query->result[$k]['event_start_ymd'];\n\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_first_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$which\t= ($name == 'event_first_date' OR strpos($name, '_start_') !== FALSE) ? 'start' : 'end';\n\t\t\t\t$year\t= $events[$entry_id]->default_data[$which.'_year'];\n\t\t\t\t$month\t= $events[$entry_id]->default_data[$which.'_month'];\n\t\t\t\t$day\t= $events[$entry_id]->default_data[$which.'_day'];\n\n\t\t\t\t$time \t= $events[$entry_id]->default_data[$which.'_time'];\n\n\t\t\t\tif ($time == 0)\n\t\t\t\t{\n\t\t\t\t\tif ($which == 'start')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour \t= '00';\n\t\t\t\t\t\t$minute = '00';\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$hour\t= '23';\n\t\t\t\t\t\t$minute = '59';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$minute = substr($time, -2, 2);\n\t\t\t\t\t$hour \t= substr($time, 0, strlen($time) - 2);\n\t\t\t\t}\n\n\t\t\t\t//year month and day are a tad fubar when\n\t\t\t\t//we are looking at a repeat occurence with an enddate\n\t\t\t\t//because the end time is indeed correct, but end date\n\t\t\t\t//is expected to be the end of all of the occurrences\n\t\t\t\t//however, if this is never ending, thats different\n\n\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\n\t\t\t\tif ( ! $never_ending AND\n\t\t\t\t\t $name = \"event_last_date\")\n\t\t\t\t{\n\t\t\t\t\t$real_end_date = ($channel->query->result[$k]['event_last_date'] != 0) ?\n\t\t\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_last_date'] :\n\t\t\t\t\t\t\t\t\t\t$events[$entry_id]->default_data['end_date']['ymd'];\n\n\n\t\t\t\t\t$end_time_year \t= substr($real_end_date, 0, 4);\n\t\t\t\t\t$end_time_month = substr($real_end_date, 4, 2);\n\t\t\t\t\t$end_time_day \t= substr($real_end_date, 6, 2);\n\n\t\t\t\t\t$this->CDT->change_datetime(\n\t\t\t\t\t\t$end_time_year,\n\t\t\t\t\t\t$end_time_month,\n\t\t\t\t\t\t$end_time_day,\n\t\t\t\t\t\t$hour,\n\t\t\t\t\t\t$minute\n\t\t\t\t\t);\n\n\t\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\t\t\t\t\t//special treatment on end dates of occurrences if its not infinite\n\t\t\t\t\tif ( ! $never_ending AND stristr($key, 'event_last_date'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$end_time_dta,\n\t\t\t\t\t\t\t$format,\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//else, parse as normal\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t\t$format,\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\n\n\t\t\t\t/*\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\n\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t$format,\n\t\t\t\t\t\t'%'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Shorthand date/time variables\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($which)\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_hour']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_minute']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// The foreach may have emptied the query results\n\t\t// -------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n//ee()->TMPL->log_item('Calendar: Weblog query is empty, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\tunset($CDT);\n\n\t\t// -------------------------------------\n\t\t// Reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($calendar_order_data))\n\t\t{\n\t\t\tee()->TMPL->log_item('Calendar: Reordering');\n\n\t\t\t$args \t= array();\n\t\t\t$temps \t= array();\n\n\t\t\tforeach ($calendar_orders as $k => $v)\n\t\t\t{\n\t\t\t\t//add order array\n\t\t\t\t$args[] =& $calendar_order_data[$k];\n\n\t\t\t\t//constant for order type\n\n\t\t\t\t//contants cannot be passed by ref because its not a variable\n\t\t\t\t$temps[$k] = constant('SORT_'.strtoupper($v));\n\n\t\t\t\t$args[] =& $temps[$k];\n\t\t\t}\n\n\t\t\t//this will order the result\n\t\t\t$args[] =& $channel->query->result;\n\n\t\t\tcall_user_func_array('array_multisort', $args);\n\n\t\t\t//cleanup\n\t\t\tunset($args);\n\t\t\tunset($temps);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tpagination for the events tag\n\t\t//--------------------------------------------\n\t\t//\tany tags using this might have different needs\n\t\t//\tso we only want to paginate for original events\n\t\t//\ttag usage\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\t//$this->event_timeframe_total = count($channel->query->result);\n\n\t\tif ($this->parent_method === 'events' AND\n\t\t\t$this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> ee()->TMPL->tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_events_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_events_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//ee()->TMPL->tagdata\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Apply event_limit=\"\" parameter\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('event_limit'))\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset,\n\t\t\t\t$this->P->value('event_limit')\n\t\t\t);\n\t\t}\n\t\telse if ($offset > 0)\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\toffset too much? buh bye\n\t\t//--------------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t// \tWe will reassign the $channel->query->result with our\n\t\t// \treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t$occurrence_hash = '9b8b2cde1a14e29a8791ceccdaab6cf9d92b37a4';\n\n\t\t//we have to prevent occurrenct count from being borked\n\t\tee()->TMPL->tagdata = str_replace('occurrence_count', $occurrence_hash, ee()->TMPL->tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\t\t$channel->parse_channel_entries();\n\n\t\t$channel->return_data = str_replace($occurrence_hash, 'occurrence_count', $channel->return_data);\n\n\t\t// -------------------------------------\n\t\t// Parse Calendar variable pairs\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing variable pairs');\n\n\t\tforeach ($var_pairs as $var)\n\t\t{\n\t\t\tif (isset(ee()->TMPL->var_pair[$var]))\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Iterate through the events\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tforeach ($events as $k => $data)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Does this event have this var pair?\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif (strpos($channel->return_data, LD.$var.' ') !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$var_tag = (! is_array(ee()->TMPL->var_pair[$var])) ? ee()->TMPL->var_pair[$var] : $var;\n\n\t\t\t\t\t\tif (preg_match_all(\"/\".LD.$var_tag.' id=\"'.$k.'\"'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').$var.RD.'/s', $channel->return_data, $matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Iterate through the variables associated with this pair\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($matches[1] as $key => $match)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = \"prep_{$var}_output\";\n\t\t\t\t\t\t\t\t$match = $this->$method($match, $data, FALSE);\n\t\t\t\t\t\t\t\t$channel->return_data = str_replace($matches[0][$key], $match, $channel->return_data);\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}\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t//$channel->add_pagination_data();\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via channel module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $this->parse_pagination($channel->return_data);\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t// -------------------------------------\n\t\t//\tlets reverse any unparsed items\n\t\t//\tin case someone is actually writing\n\t\t//\tout the phrase 'event_url_title'\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\t}",
"protected static function boot() {\n\t\tparent::boot(); /**\n\t\t * Attach to the 'creating' Model Event to provide a UUID\n\t\t * for the `id` field (provided by $model->getKeyName())\n\t\t */\n\t\tstatic::creating(function ($model) {\n\n\t\t\t$model->{$model->getKeyName()} = (string) 'cus_' . $model->generateKey();\n\t\t\t$model->user_id = (isset($model->attributes['user_id'])) ? $model->attributes['user_id'] : $model->getUserId();\n\t\t});\n\t}",
"public function boot()\n {\n $this->mapBindings();\n\n parent::boot();\n }",
"public function onBeforeSave($event);",
"public static function registerListeners()\n {\n static::creating('Wildside\\Userstamps\\Listeners\\Creating@handle');\n static::updating('Wildside\\Userstamps\\Listeners\\Updating@handle');\n\n if( method_exists(get_called_class(), 'deleting') )\n {\n static::deleting('Wildside\\Userstamps\\Listeners\\Deleting@handle');\n }\n\n if( method_exists(get_called_class(), 'restoring') )\n {\n static::restoring('Wildside\\Userstamps\\Listeners\\Restoring@handle');\n }\n }",
"private function _initEvents()\n {\n $onOrder = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $sidx = $params['sidx'];\n\n switch (strtoupper($params['sord'])) {\n case 'DESC':\n $sord = Solarium_Query_Select::SORT_DESC;\n break;\n default:\n $sord = Solarium_Query_Select::SORT_ASC;\n break;\n }\n\n $query = $dataSource->getQuery();\n $query->clearSorts();\n $query->addSort($sidx, $sord);\n };\n\n $this->_onOrder = $onOrder;\n\n $onFilter = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $solariumQueryHelper = new Solarium_Query_Helper();\n $filters = json_decode($params['filters']);\n\n $query = $dataSource->getQuery();\n $queryString = '';\n\n foreach ($filters->rules as $field) {\n if ('' != $field->data) {\n $queryString .= $field->field . ':'\n . $solariumQueryHelper->escapeTerm($field->data) . ' AND ';\n }\n }\n\n if ('' != $queryString) {\n $queryString = substr($queryString, 0, strlen($queryString) - 4);\n $query->setQuery($queryString);\n }\n };\n\n $this->_onFilter = $onFilter;\n }",
"public function event()\n {\n $this->CI->type->add_css('textarea_limited', 'textarea_limited.css');\n $this->CI->type->add_js('textarea_limited', 'jquery.textareaCounter.plugin.js');\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function($model) {\n $model->reference = $model->generateReference();\n });\n }",
"public static function bootOnimage(): void\n {\n static::saving(function (Model $model) {\n $model->onimageSavingObserver();\n });\n\n static::saved(function (Model $model) {\n $model->onimageSavedObserver();\n });\n\n// static::deleting(function (Model $model) {\n// return $model->deleteTranslations();\n// });\n//\n// static::retrieved(function (Model $model) {\n// $model->getTranslations();\n// $model->getAvailableTranslations();\n// });\n }",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public static function boot()\n {\n parent::boot();\n\n // Add functionality for creating a model\n static::creating(function (RestfulModel $model) {\n // If the PK(s) are missing, generate them\n $uuidKeyName = $model->getKeyName();\n\n if( $model->incrementing ) {\n $model->$uuidKeyName = null;\n } else if ( ! array_key_exists($uuidKeyName, $model->getAttributes())) {\n $model->$uuidKeyName = Uuid::uuid4()->toString();\n }\n\n });\n\n // Add functionality for updating a model\n static::updating(function (RestfulModel $model) {\n // Disallow updating UUID keys\n if ($model->getAttribute($model->getKeyName()) != $model->getOriginal($model->getKeyName())) {\n throw new BadRequestHttpException('Updating the UUID of a resource is not allowed.');\n }\n\n // Disallow updating immutable attributes\n if (! empty($model->immutableAttributes)) {\n // For each immutable attribute, check if they have changed\n foreach ($model->immutableAttributes as $attributeName) {\n if ($model->getOriginal($attributeName) != $model->getAttribute($attributeName)) {\n throw new BadRequestHttpException('Updating the \"'.camel_case($attributeName).'\" attribute is not allowed.');\n }\n }\n }\n });\n }",
"protected static function boot()\n {\n parent::boot();\n\n /**\n * Apply logic while creating a new instance of parent model.\n */\n static::creating(function ($model)\n {\n if (!app()->runningInConsole())\n {\n $model->created_by = auth()->user()->id;\n }else{\n $model->created_by = 1;\n }\n $model->created_at = now()->timezone(config('dashboard.time_zone'));\n });\n /**\n * Apply logic while updating a new instance of parent model.\n */\n\n static::updating(function ($model)\n {\n $model->updated_by = auth()->user()->id;\n $model->updated_at = now()->timezone(config('dashboard.time_zone'));\n });\n\n /**\n * Apply logic while deleting a new instance of parent model.\n */\n\n static::deleting(function ($model)\n {\n $model->deleted_by = auth()->user()->id;\n });\n\n /**\n * Apply logic after a new instance of parent model is created .\n */\n\n static::created(function ($model)\n {\n static::reportDetails($model,'Created');\n });\n\n /**\n * Apply logic after a new instance of parent model is updated .\n */\n\n static::updated(function ($model)\n {\n static::reportDetails($model,'Updated');\n });\n /**\n * Apply logic after an instance of parent model is restored .\n */\n static::restored(function ($model)\n {\n static::reportDetails($model,'Restored');\n });\n\n /**\n * Apply logic while after an instance of parent model is deleted .\n */\n\n static::deleted(function ($model)\n {\n static::reportDetails($model,'Deleted');\n });\n\n /**\n * Apply logic after an instance of parent model is forcefully deleted .\n */\n\n static::forceDeleted(function ($model)\n {\n static::reportDetails($model,'Forcefully Deleted');\n });\n\n\n }",
"protected static function boot()\n {\n parent::boot();\n\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName())\n */\n static::creating(function ($model) {\n static::setUuidAttributes($model); // @codeCoverageIgnore\n });\n }",
"public static function getSubscribedEvents()\n {\n // event and that the preSetData method should be called.\n return array(FormEvents::PRE_SET_DATA => 'preSetData');\n }",
"public static function getSubscribedEvents()\n {\n // event and that the preSetData method should be called.\n return array(FormEvents::PRE_SET_DATA => 'preSetData');\n }",
"public static function getSubscribedEvents()\n {\n // event and that the preSetData method should be called.\n return array(FormEvents::PRE_SET_DATA => 'preSetData');\n }",
"protected function linkEventDispatcherToSuperclasses()\n {\n \\phpDocumentor_Reflection_Abstract::$event_dispatcher = $this['event_dispatcher'];\n \\phpDocumentor_Parser_Abstract::$event_dispatcher = $this['event_dispatcher'];\n \\phpDocumentor_Transformer_Abstract::$event_dispatcher = $this['event_dispatcher'];\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"public function getSubscribedEvents()\n {\n return array(\n 'prePersist',\n 'preUpdate'\n );\n }",
"protected function fireAttributeEvents()\n {\n foreach($this->getAttributeEvents() as $attributeValue => $classOrMethod) {\n [$attribute, $v] = explode(':', $attributeValue);\n\n // Skip if the attribute does not exist or if it has not been changed\n if(!array_key_exists($attribute, $this->attributes)) continue;\n if(!$this->isDirty($attribute)) continue;\n\n // Get the value of the attribute\n $value = $this->getAttributeValue($attribute);\n\n // Decide if we are to fire the event based on if the value matches the specified attribute event\n if($v === '*' // Any - always call no matter what the value is\n || $v === 'true' && $value === true // bool(true)\n || $v === 'false' && $value === false // bool(false)\n || is_numeric($v) && strpos($v, '.') !== false && $value === (float) $v // float\n || is_numeric($v) && $value === (int) $v // int\n || $v === $value\n ) {\n $this->fireModelEvent($attribute, false);\n }\n }\n }",
"function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}",
"function eventclass_offeraride()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeInsert\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function($model) {\n /** @var \\Metafields\\Models\\Metafield $model */\n $model->addsValuesTableIfNotExists($model->attributes['model']);\n $model->generateFieldNameFromTitle();\n $model->addValuesModelFieldIfNotExists();\n });\n\n static::updating(function($model) {\n /** @var \\Metafields\\Models\\Metafield $model */\n $model->generateFieldNameFromTitle();\n $model->renameValuesFieldIfChanged();\n });\n\n static::deleting(function($model) {\n /** @var \\Metafields\\Models\\Metafield $model */\n $model->deleteValuesField();\n });\n }",
"public static function bootUuids()\n {\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName())\n */\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = (string)Uuid::generate();\n });\n\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName())\n */\n static::pivotAttaching(function ($model, $pivotRelation, $pivotIds, $pivotIdsAttributes) {\n $pivotRelation->attributes['id'] = (string)Uuid::generate();\n });\n\n }",
"public function boot()\n {\n $this->bindResolveItemEvent();\n $this->bindReferencesGeneratedEvent();\n }",
"protected function setListeners()\n\t{\n\t\t$this->templates->listenEmitBasic('foreach', array($this, 'tpl_foreach'));\n\t\t$this->templates->listenEmitBasic('not-last', array($this, 'tpl_not_last'));\n\t}",
"public function HookEvents() {\n\t\tadd_action( 'add_attachment', array( $this, 'EventFileUploaded' ) );\n\t\tadd_action( 'delete_attachment', array( $this, 'EventFileUploadedDeleted' ) );\n\t\tadd_action( 'admin_init', array( $this, 'EventAdminInit' ) );\n\t}",
"protected static function boot()\n {\n /** We MUST call the parent boot method in this case the:\n * \\Illuminate\\Database\\Eloquent\\Model\n */\n parent::boot();\n }",
"public static function boot()\n {\n parent::boot();\n\n if (Auth::check()) {\n // create a event to happen on creating\n static::creating(function ($table) {\n $table->created_by = Auth::user()->id;\n $table->updated_by = Auth::user()->id;\n $table->company_id = 3; //Auth::user()->company_id;\n });\n\n // create a event to happen on updating\n static::updating(function ($table) {\n $table->updated_by = Auth::user()->id;\n });\n }\n }",
"public static function boot()\n {\n parent::boot();\n\n if (Auth::check()) {\n // create a event to happen on creating\n static::creating(function ($table) {\n $table->created_by = Auth::user()->id;\n $table->updated_by = Auth::user()->id;\n $table->company_id = 3; //Auth::user()->company_id;\n });\n\n // create a event to happen on updating\n static::updating(function ($table) {\n $table->updated_by = Auth::user()->id;\n });\n }\n }",
"public function __construct()\n {\n //нельзя передавать никакие парпметры в конструктор, даже если в событие передаются!!!\n }"
] | [
"0.6627599",
"0.60743034",
"0.5910263",
"0.59091705",
"0.5827657",
"0.5777322",
"0.57460344",
"0.57268727",
"0.57248527",
"0.57248527",
"0.5663562",
"0.5639806",
"0.55048853",
"0.54647875",
"0.5440618",
"0.5407723",
"0.54037166",
"0.5395376",
"0.536985",
"0.53661704",
"0.5299398",
"0.5288973",
"0.52853596",
"0.52635",
"0.52384955",
"0.5238481",
"0.52211046",
"0.522093",
"0.52155364",
"0.52152437",
"0.5208436",
"0.52083254",
"0.5163015",
"0.514268",
"0.5113249",
"0.5112412",
"0.51029325",
"0.50983",
"0.508583",
"0.507682",
"0.5054787",
"0.50547564",
"0.50513417",
"0.50491065",
"0.50414777",
"0.5028239",
"0.50272",
"0.5025051",
"0.5019676",
"0.50165683",
"0.5014519",
"0.5011828",
"0.50115496",
"0.49913806",
"0.4984693",
"0.4984204",
"0.49821264",
"0.49731636",
"0.4955428",
"0.49523017",
"0.4949457",
"0.4949457",
"0.49444437",
"0.49432564",
"0.49430606",
"0.4939691",
"0.49278125",
"0.4923827",
"0.4922885",
"0.4921863",
"0.4920794",
"0.49195158",
"0.4912631",
"0.49073017",
"0.49057794",
"0.4877351",
"0.48728594",
"0.4870848",
"0.48697022",
"0.48677915",
"0.48633114",
"0.48613042",
"0.48613042",
"0.48613042",
"0.48600855",
"0.48573095",
"0.48485252",
"0.48342714",
"0.4823573",
"0.48207244",
"0.48182297",
"0.48165622",
"0.48150975",
"0.4813799",
"0.48117945",
"0.48092312",
"0.4807608",
"0.47979507",
"0.47979507",
"0.47938862"
] | 0.59901035 | 2 |
Returns the file name without the extension. | public function getBaseFileNameAttribute()
{
$pos = strrpos($this->fileName, '.');
if ($pos === false) {
return $this->fileName;
}
return substr($this->fileName, 0, $pos);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFileName()\n {\n return basename($this->file, '.' . $this->getExtension());\n }",
"public function fileName()\n {\n return $this->getCleanString(self::$_file_name_clean);\n }",
"function file_ext_strip($filename){\n\t return preg_replace('/.[^.]*$/', '', $filename);\n\t}",
"public function get_file_name()\n {\n if( is_null( $this->file_name ) ) return NULL;\n $pos1 = strrpos( $this->file_name, '/' );\n $pos2 = strrpos( $this->file_name, '.' );\n return false === $pos2\n ? substr( $this->file_name, false === $pos1 ? 0 : $pos1 + 1 )\n : substr( $this->file_name, false === $pos1 ? 0 : $pos1 + 1, $pos2 - $pos1 - 1 );\n }",
"public function getFileWithoutExt(string $sFile): string\n {\n return pathinfo($sFile, PATHINFO_FILENAME);\n }",
"protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }",
"private function _getFileSuffix()\n {\n if (strrpos($this->_originalName, '.'))\n {\n return substr($this->_originalName, strrpos($this->_originalName, '.') +1);\n }\n else \n {\n return '';\n }\n }",
"public function getFileName()\n {\n return basename($this->path);\n }",
"public static function stripExtFromFile( $filename ) : string\n {\n $class = explode(\n \".\",\n $filename\n\n );\n return $class[0];\n }",
"private function stripExtFromFile( $filename ) : string\n {\n $class = explode(\n \".\",\n $filename\n\n );\n return $class[0];\n }",
"function file_get_filename($filename)\r\n\t{\r\n\t\treturn substr($filename, 0, strrpos($filename, \".\"));\r\n\t}",
"protected function getOnlyFileName($file)\n {\n return pathinfo($file, PATHINFO_BASENAME);\n }",
"public function getFilenamePlain() : string\n {\n return $this->getFilename(true);\n }",
"function getFileName(string $filename) : string {\n $names = explode(\".\",$filename);\n array_pop($names);\n return implode(\"\",$names); \n}",
"public function getFilename()\r\n {\r\n return pathinfo($this->filename, PATHINFO_BASENAME);\r\n }",
"function no_ext($filename) {\n\t$filebroken = explode('.', $filename);\n\tarray_pop($filebroken);\n\n\treturn implode('.', $filebroken);\n\n}",
"function getNameWithoutExtension() ;",
"private function fileName()\n\t{\n\t\treturn $this->files[count($this->files) - 1];\n\t}",
"public function getNameWithoutExtension() {}",
"public function getNameWithoutExtension() {}",
"public function getFileName(): string\n {\n if (strpos($this->savefileName, '.php') === false) {\n return $this->savefileName . $this->extension;\n }\n return $this->savefileName;\n }",
"function removeExtension($filename) {\n $file = substr($filename, 0,strrpos($filename,'.')); \n return $file;\n }",
"function file_ext($filename) {\n\t if( !preg_match('/./', $filename) ) return '';\n\t return preg_replace('/^.*./', '', $filename);\n\t}",
"public function getFileName()\n {\n $value = $this->get(self::FILENAME);\n return $value === null ? (string)$value : $value;\n }",
"public function generateProcessedFileNameWithoutExtension() {}",
"public function getFilename()\n {\n $file = basename($this->srcPath);\n\n $ops = str_replace(array('&', ':', ';', '?', '.', ','), '-', $this->operations);\n return trim($ops . '-' . $file, './');\n }",
"function getFileNameWithExtension()\n {\n return $this->fileNameWithExt;\n }",
"public function extractFileName(): string\n {\n $name = $this->extractMeta('name') ?: $this->extractMeta('filename');\n\n if ( ! $this->isValidFilename($name)) {\n return '';\n }\n\n return $name;\n }",
"function stripExt($file) {\n return preg_replace('#\\.[^.]*$#', '', $file);\n }",
"public function getFilename()\n {\n return '';\n }",
"public static function getFilenameWithoutExtension($path)\r\n\t{\r\n\t\t$file=self::getFilename($path);\r\n\t\t$posDot=strrpos($file, \".\");\r\n\t\tif ($posDot===false) return $file;\r\n\t\telse return substr($file, 0, $posDot);\r\n\t}",
"public function getBaseName()\n {\n return basename($this->file);\n }",
"public function getExtensionFromName()\n {\n $vars = explode('.', $this->getClientFilename());\n return strtolower(array_pop($vars));\n }",
"function filename($filedata) {\r\n\t\treturn substr($filedata['name'], 0, strrpos($filedata['name'], '.'));\r\n\t}",
"function getFileBasename() {\n\t\treturn basename($this->getFilename());\n\t}",
"public function GetRealFileName()\n {\n $oFileType = $this->GetFileType();\n\n return $this->id.'.'.$oFileType->sqlData['file_extension'];\n }",
"public function fileName() {\n $name = time() . $this->file->getClientOriginalName();\n $extension = $this->file->getClientOriginalExtension();\n return \"{$name}.{$extension}\";\n }",
"public static function getWithoutExtension(string $pathFile): string\n {\n $pos = strrpos($pathFile, '.');\n if ($pos !== false) {\n return substr($pathFile, 0, $pos);\n } else { // no extension\n return $pathFile;\n }\n }",
"public function filename(): string\n {\n return Str::random(6) . '_' . $this->type . $this->fileExtension();\n }",
"public function getFileName($file){\n\t\t$file = explode('/',$file);\n\t\t$file = $file[count($file) -1];\n\t\treturn $file;\n\t}",
"public static function getFilenameWithoutExtension(string $path, string $extension = null): string\n {\n if ('' === $path) {\n return '';\n }\n\n if (null !== $extension) {\n // remove extension and trailing dot\n return rtrim(basename($path, $extension), '.');\n }\n\n return pathinfo($path, \\PATHINFO_FILENAME);\n }",
"public function getNameWithExtension() {\n if ( ! $this->exists) return '';\n\n $extension = pathinfo($this->name, PATHINFO_EXTENSION);\n\n if ( ! $extension && $this->extension) {\n return $this->name .'.'. $this->extension;\n }\n\n return $this->name;\n }",
"public function getName()\n\t{\n\t\treturn str_replace(\".{$this->getExtension()}\", '', $this->path);\n\t}",
"public function getFileName()\n {\n return \"{$this->getUserOS()}-{$this->getDriver()}{$this->getFileExtension()}\";\n }",
"public static function stripExt($file) {\n return preg_replace('#\\.[^.]*$#', '', $file);\n }",
"public static function GetFileNameWOExtension($filename)\n\t{\n\t\t$name = '';\n\t\t\n\t\t$arr = explode('.', basename($filename));\n\t\t\n\t\tif (is_array($arr) && count($arr) >= 2)\n\t\t{\n\t\t\tunset($arr[ count($arr)-1 ]);\n\t\t}\n\t\t$name = implode('.', $arr);\n\t\t\n\t\treturn $name;\n\t}",
"private function _getFileExtension($filename)\n {\n if (empty($filename)) {\n return '';\n }\n\n $split = explode('.', $filename);\n return $split[1];\n }",
"public function getFilename() {\n\t\t\n\t\t$filename = $this->filename;\n\t\t\n\t\tif(file_exists($this->path . $filename) && $this->rename_if_exists === true) {\n\t\t\n\t\t\t//Explode the filename, pop off the extension and put it back together\n\t\t\t$parts = explode('.', $filename);\n\n\t\t\t$extension = array_pop($parts);\n\n\t\t\t$base_filename = implode('.', $parts);\n\t\t\t\n\t\t\t$count = 1;\n\t\t\t\n\t\t\tdo {\n\t\t\t\t$count++;\n\t\t\t} while(file_exists($this->path . $base_filename . '_' . $count . '.' . $extension));\n\t\t\t\n\t\t\t$filename = $base_filename . '_' . $count . '.' . $extension;\n\t\t\n\t\t}\n\t\t\n\t\treturn $filename;\n\t\t\n\t}",
"public static function getAssetFileName()\n {\n return preg_replace('/\\?.*/', '', basename($_SERVER['REQUEST_URI']));\n }",
"public static function getFileExtension(string $filename): string\n {\n $filename = basename($filename);\n\n // remove possible query string\n $pos = strpos($filename, '?');\n if ($pos !== false) {\n $filename = substr($filename, 0, $pos);\n }\n\n // retrieve the extension\n $pos = strrpos($filename, '.');\n if ($pos !== false) {\n return strtolower(substr($filename, $pos + 1));\n }\n\n return '';\n }",
"public function getFileName()\n {\n return $this->language.'/'.strtolower($this->getName());\n }",
"public function getName() {\r\n if ($this->pathname) {\r\n return basename($this->pathname);\r\n } else {\r\n return \"\";\r\n }\r\n }",
"public function basename();",
"function getFileExtension($fileName)\n{\n\t$pos = strrpos($fileName, \".\");\n\tif( $pos === FALSE ) \n\t\treturn \"\";\n\t\t\n\treturn substr($fileName, $pos + 1);\n}",
"protected function ___filename() {\n\t\treturn $this->pagefiles->path . $this->basename;\n\t}",
"private function get_filename( $fileroute = '' )\n\t{\n\t\treturn substr( $filename, strrpos( $filename, '/' ) + 1);\t\n\t}",
"public function getFilename()\n {\n if (!$this->fileName) {\n $matcher = $this->getFileMatcher();\n $this->fileName = $this->searchFile($matcher);\n }\n\n return $this->fileName;\n }",
"public function getFileBaseName($extension = \".txt\")\n\t{\n\t\treturn basename($this->fileName,\".txt\");\n\t}",
"public function getBaseName() {\n\t\treturn basename($this->getPath());\n\t}",
"public function get_full_file_name() {\r\n return (string) $this->full_file;\r\n }",
"private function getFullFileName(string $fileName): string\n {\n return Normalizer::snakeString($fileName).'.'.self::FILE_EXTENSION;\n }",
"public function getFullname(){\n\t \treturn $this->filename.'.'.$this->extension;\n\t }",
"public function getFilename() : string\n {\n return $this->fileName;\n }",
"public function name() {\n\t\treturn basename($this->path);\n\t}",
"public function getFilename($filename = null){\n\t\t$originalName = str_replace('\\\\','/',$filename);\n\t\t$pos = strrpos($originalName,'/');\n\t\treturn (false === $pos ? $originalName : substr($originalName,$pos+1));\n\t}",
"public function getBasename()\n\t{\n\t\treturn $this->getFilename().'.'.$this->getExtension();\n\t}",
"public function filename() : string {\n return $this->name;\n }",
"public function GetName()\n\t{\n\t\tif (!empty($this->path))\n\t\t\treturn basename($this->path);\n\n\t\treturn '';\n\t}",
"public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }",
"public function getFilename();",
"public function getFilename();",
"protected function _extractExtension( $filename )\n {\n $ret = '';\n $dotPosition = strrpos( $filename, '.' );\n if ( false === $dotPosition ) {\n return $ret;\n }\n \n $ret = substr( $filename, ++$dotPosition );\n return $ret;\n }",
"public function getBasename()\n {\n return str_replace(':', '.', basename($this->filepath));\n }",
"public function get_file_name() {\n\t\treturn $this->file;\n\t}",
"public function getName($file)\n {\n return pathinfo($file)['basename'];\n }",
"public static function filename($file)\n {\n $info = pathinfo($file);\n $dt = static::now();\n $postfix = $dt->format(Config::get('settings.file_datetime_format'));\n if(isset($info['extension']) and !empty($info['extension']))\n {\n $filename = $info['filename'].'_'.$postfix.'.'.$info['extension'];\n } else {\n $filename = $info['filename'].'_'.$postfix;\n }\n \n return $filename;\n }",
"public function getFilename()\n {\n return static::filename($this->path);\n }",
"public function getName()\n {\n return $this->file->getName();\n }",
"public function getFileAsName()\n {\n if (self::TYPE_NATURAL === $this->_type) {\n $nameParts = array(\n $this->lastName,\n $this->middleName,\n $this->firstName,\n );\n } else {\n $nameParts = array($this->companyName);\n }\n $fileas = implode(' ', $nameParts);\n\n return $fileas;\n\n }",
"protected function getFileName($name)\n {\n $extension = (string) $this->extension;\n if (substr($name, 0 - strlen($extension)) !== $extension) {\n $name .= $extension;\n }\n\n return $name;\n }",
"public function getFileName() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filename\", FALSE);\n\t}",
"function _getFileName()\r\n\t{\r\n\t\t$f = $this->pathHomeDir . '/' . $this->pathLocale . '/' . $this->pathFile . \".\" . $this->pathEx;\r\n\t\treturn $f;\r\n\t}",
"public function getExtension()\n {\n return substr(strrchr($this->getBasename(), '.'), 1);\n }",
"public function getFileName()\n {\n return realpath($this->node->getAttribute('fileName', ''));\n }",
"public function getFileSuffix()\n {\n return '_'.$this->sqlData['cmsident'];\n }",
"public function getOriginalExtension(): string\n {\n return pathinfo($this->originalName, PATHINFO_EXTENSION);\n }",
"public function getFileName();",
"public function getFileName();",
"public function getFileName();",
"public static function cleanFilename($dirty_filename) {\n $split = explode('.', $dirty_filename);\n $ext = array_pop($split);\n return \\Str::slug(urldecode( implode('.', $split) )).'.'.$ext;\n }",
"public function getFileName() {\n return $this->name;\n }",
"private function getFileName(){\n $name = $this->pluginName;\n $text = \"\";\n $lastCapital = true;\n for($i = 0; $i < strlen($name); $i++){\n if($name[$i] !== strtolower($name[$i])){\n if(!$lastCapital){\n $text .= \"_\";\n }\n $lastCapital = true;\n } else {\n $lastCapital = false;\n }\n $text .= strtolower($name[$i]);\n }\n return str_replace(\"nfx\", \"nfx_\", $text);\n }",
"public function extension()\n {\n return '';\n }",
"function getExt($filename){\n return strtolower(substr(strrchr($fileName, '.'), 1));\n}",
"public function extension( $fileName ) {\n\t\treturn strtolower( substr( strrchr( $fileName, '.' ), 1 ) );\n\t}",
"public function filename($name)\n {\n if (substr($name, -5) !== '.'.static::$file_type) {\n $name = $this->path.'/'.File::sanitize(md5($name).'.'.static::$file_type);\n }\n\n return $name;\n }",
"public function filename()\n\t{\n\t\treturn $this->_filename();\n\t}",
"public function getName(){\n if ($this->file)\n return $this->file->getName();\n }",
"public function resolveExtension()\n {\n if (($pos = strrpos($this->path, '.')) !== false) {\n return substr($this->path, $pos + 1);\n }\n\n return '';\n }",
"public function basename() {\n\t\t// @version 1.2.0 Use filename then fallback to path\n\t\t$path = $this->data('name') ?: $this->path();\n\n\t\treturn pathinfo($path, PATHINFO_BASENAME);\n\t}"
] | [
"0.81711096",
"0.7957715",
"0.7883327",
"0.78741014",
"0.7840685",
"0.78385985",
"0.78074",
"0.77643967",
"0.7749171",
"0.7729871",
"0.7691143",
"0.7681457",
"0.7643441",
"0.76256984",
"0.7596352",
"0.7593597",
"0.75891966",
"0.75736976",
"0.75505614",
"0.7548727",
"0.75468695",
"0.7537876",
"0.7536921",
"0.7507935",
"0.7507689",
"0.7501222",
"0.7498063",
"0.74899656",
"0.74888754",
"0.7470476",
"0.74601966",
"0.7439941",
"0.7436234",
"0.7432166",
"0.7409328",
"0.74089915",
"0.73894185",
"0.73842865",
"0.7361882",
"0.73564595",
"0.7329164",
"0.7327916",
"0.7307959",
"0.72843516",
"0.7275582",
"0.72502756",
"0.72042894",
"0.71967995",
"0.7194788",
"0.7181962",
"0.71811414",
"0.7173581",
"0.7167462",
"0.7151513",
"0.714693",
"0.7140751",
"0.7131241",
"0.7117967",
"0.70991385",
"0.7090854",
"0.70862204",
"0.7081999",
"0.70623183",
"0.7060377",
"0.7057988",
"0.7051689",
"0.70487875",
"0.7027348",
"0.70122457",
"0.700934",
"0.700934",
"0.70024747",
"0.7000672",
"0.69654596",
"0.69590765",
"0.6958922",
"0.6954304",
"0.6947945",
"0.69473916",
"0.69382143",
"0.69328177",
"0.69303787",
"0.6926984",
"0.6923362",
"0.6916257",
"0.6913609",
"0.69109935",
"0.69109935",
"0.69109935",
"0.69089407",
"0.69070244",
"0.690515",
"0.6895115",
"0.6894367",
"0.6890669",
"0.6887958",
"0.6887213",
"0.6881373",
"0.68801004",
"0.6866217"
] | 0.7193177 | 49 |
Adds an attribute to the purgeable attributes list | public function addPurgeable($attributes = null)
{
$attributes = is_array($attributes) ? $attributes : func_get_args();
$this->purgeable = array_merge($this->purgeable, $attributes);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddAttribute() {\n $db = Core::GetDB();\n\n $id = Core::GetFromPOST('id');\n $attrs = Core::GetFromPOST('attrs');\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}",
"public function add_attribute(HTMLAttribute $attribute){\n array_push($this -> attributes, $attribute);\n }",
"public function remove_attribute(string $attribute){\n foreach($this -> attributes as $key => $value){\n if($value -> get_name() === $attribute){\n array_splice($this -> attributes, $key, 1);\n }\n }\n }",
"public function add(Attribute $attribute)\n {\n $this->items[$attribute->getName()] = $attribute;\n }",
"public function removeAttribute($attribute)\n {\n array_forget($this->attributes, $attribute);\n\n $this->update();\n }",
"public function removeAttributes()\n\t{\n\t\tforeach ($this->argsArray(func_get_args()) as $a) {\n\t\t\t$this->removed_attrs[] = $a;\n\t\t}\n\t}",
"protected function _flagAttributeAsModified($attribute) {\n\t\tif (!in_array($attribute, $this->_modifiedAttributes)) {\n\t\t\t$this->_modifiedAttributes[] = $attribute;\n\t\t}\n\t}",
"public function addAttributes($attributes)\n {\n $this->_attributes = array_unique(\n array_merge(\n $this->_attributes,\n array_keys($attributes)\n )\n );\n }",
"function AddAttr() {\n $db = Core::GetDB();\n\n $title = urldecode(Core::GetFromPOST('title'));\n\n $res = $db->Query(\"SELECT data_xml_item_id FROM data_xml_items WHERE title = ? LIMIT 1\", array(\n array(1, $title, IDBController::PARAM_STR)\n ));\n $id = $res->FetchRow();\n $id = $id[0];\n\n $attrs = array(urldecode(Core::GetFromPOST('attr')));\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}",
"public function removeAttribute(AttributeValueInterface $attribute);",
"private function removeAttribute( $attr )\n {\n if (isset($this->attributeTypes[$attr]) || array_key_exists($attr, $this->attributeTypes))\n unset( $this->attributeTypes[$attr] ); // forma de remover un valor de un array...\n }",
"function useattrib($attribute) { atkuse(\"attribute\", $attribute); }",
"public function removeAllAttributes()\n {\n $this->attr = [];\n }",
"function addAttribute($name, $value) {\n $this->_attributes[$name] = $value;\n }",
"public function addAttribute(AttributeInterface $attribute) {\n if(isset($this->attributes[$attribute->getName()]))\n trigger_error(\"Attribute \" . $attribute->getName() . \" already exists\", E_USER_NOTICE);\n\n $this->attributes[ $attribute->getName() ] = $attribute;\n }",
"public function removeAttributeValue($attribute, $user) {\n\t\tif($aid = $this->getAttributeID($attribute)) {\n\n\t\t\tif(!$this->disableEvents) {\n\t\t\t\t$e = new AttributeEvent();\n\t\t\t\t$e->setAttribute($attribute);\n\t\t\t\tSkylineServiceManager::getEventManager()->trigger(SKY_EVENT_USER_ATTRIBUTE_REMOVE, $e, $attribute, $user);\n\t\t\t}\n\n\t\t\tif($user instanceof PDOResourceInterface)\n\t\t\t\t$user = $user->getID();\n\n\t\t\tif(is_numeric($user)) {\n\t\t\t\tif($map = $this->boundFilesMap[ $aid ] ?? false) {\n\t\t\t\t\t$map = realpath(ServiceManager::generalServiceManager()->mapValue( $map ));\n\t\t\t\t\tif($map) {\n\t\t\t\t\t\tforeach($this->PDO->select(\"SELECT value FROM SKY_USER_ATTRIBUTE_Q WHERE user = $user AND attribute = $aid\") as $record) {\n\t\t\t\t\t\t\t$value = $record[\"value\"];\n\n\t\t\t\t\t\t\tif(file_exists($file = \"$map/$value\")) {\n\t\t\t\t\t\t\t\tunlink($file);\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\n\t\t\t\t$this->PDO->exec(\"DELETE FROM SKY_USER_ATTRIBUTE_Q WHERE user = $user AND attribute = $aid\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function addAttribute($name, $value);",
"protected function registerAttributes()\n {\n $this->app->singleton('attributes', function ($app) {\n return new AttributeCollection();\n });\n }",
"public function remove_attribute($name)\n {\n }",
"public function setAttr($attribute, $value) {\n $this->attributes[$attribute] = $value;\n }",
"public function addAdditionalAttribute(ExtensibleTypeAttribute $attribute)\n {\n $this->additionalAttributes[$attribute->getAttributeId()] = $attribute;\n }",
"function storeObjectAttribute ( \n $attribute )\n {\n if ( isset( $GLOBALS['eZCreditcardCache'] ) )\n unset( $GLOBALS['eZCreditcardCache'] );\n }",
"public function addToWhiteList($attr)\n\t{\n\t\tif (! is_string($attr) || ! ($attr = trim($attr))) {\n\t\t\t$err = 'white listed attribute must be a non empty string';\n\t\t\tthrow new InvalidArgumentException($err);\n\t\t}\n\n\t\tif (! in_array($attr, self::$global) && \n\t\t\t! in_array($attr, $this->valid)) {\n\t\t\t$this->valid[] = $attr;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function process(\\Magento\\Catalog\\Api\\Data\\ProductAttributeInterface $attribute);",
"public function aAddTo($attribute, PersistentObject $value)\n {\n Logger::getInstance()->po_log(\"PO:aAddTo $attribute []=\".$value->getClass());\n \n // CHEK: attribute es un atributo hasMany\n \n // Si el rol tiene el nombre de la assoc declarado, necesito ver cual es el nombre\n // completo de la key en hasOne o hasMany porque usa attribute__assocName.\n $attribute = $this->getRoleWithAssocName( $attribute );\n\n\n // TODO: Se podria poner la restriccion de que no se puede hacer set('id', xxx); \n // o sea el id no se puede modificar por el usuario.\n // (asi puedo asumir que si no tiene id es xq no esta guardado... y me ahorro consultar si existe en la base)\n\n // Aqui se hace todo lo del codigo comentado abajo\n $this->lazyLoadHasMany($attribute);\n\n\n // Chekeo de tipos con el tipo definido en hasMany para este atributo.\n \n // Si es colection, se agrega normalmente, \n // si es set se verifica que no hay otro con el mismo id, \n // si es list al salvar y cargar se respeta el orden en el que se agregaron los elementos.\n \n $add = false;\n \n switch ( $this->hasManyType[$attribute] )\n {\n case self::HASMANY_COLLECTION:\n case self::HASMANY_LIST: // Por ahora hace lo mismo que COLECTION, en PM se verificaria el orden.\n \n $add = true;\n \n break;\n case self::HASMANY_SET: // Buscar repetidos por id, si ya esta no agrego de nuevo.\n \n $found = false;\n reset( $this->attributeValues[$attribute] );\n $elem = current( $this->attributeValues[$attribute] );\n while ( $elem )\n {\n if ($elem->getId() === $value->getId() )\n {\n $found = true;\n break; // while\n }\n $elem = next( $this->attributeValues[$attribute] );\n }\n\n $add = !$found; // Agrega solo si no esta.\n\n break;\n }\n\n if ($add)\n {\n $this->attributeValues[$attribute][] = $value; // TODO: Verificar que args0 es un PersistentObject y es simple!\n // FIXME: bool is_subclass_of ( mixed $object, string $class_name )\n $this->dirtyMany = true; // Marca como editado el hasMany\n }\n }",
"function addAttribute($element, $name, $attrDefinition) {\n $config = &$this->htmlPurifier()->config;\n $def =& $config->getHTMLDefinition(TRUE);\n $def->addAttribute($element, $name, $attrDefinition);\n }",
"public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}",
"public function AddAttribute($key, $value){\r\r\n\t\t$this->attributes[$key] = $value;\r\r\n\t}",
"function _wp_add_global_attributes($value)\n {\n }",
"function create_product_attribute( $label_name ) {\n global $wpdb;\n\n $slug = sanitize_title( $label_name );\n\n if ( strlen( $slug ) >= 28 ) {\n return new WP_Error( 'invalid_product_attribute_slug_too_long', sprintf( __( 'Name \"%s\" is too long (28 characters max). Shorten it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( wc_check_if_attribute_name_is_reserved( $slug ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_reserved_name', sprintf( __( 'Name \"%s\" is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( taxonomy_exists( wc_attribute_taxonomy_name( $label_name ) ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_already_exists', sprintf( __( 'Name \"%s\" is already in use. Change it, please.', 'woocommerce' ), $label_name ), array( 'status' => 400 ) );\n }\n\n $data = array(\n 'attribute_label' => $label_name,\n 'attribute_name' => $slug,\n 'attribute_type' => 'select',\n 'attribute_orderby' => 'menu_order',\n 'attribute_public' => 0, // Enable archives ==> true (or 1)\n );\n\n $results = $wpdb->insert( \"{$wpdb->prefix}woocommerce_attribute_taxonomies\", $data );\n\n if ( is_wp_error( $results ) ) {\n return new WP_Error( 'cannot_create_attribute', $results->get_error_message(), array( 'status' => 400 ) );\n } else {\n\t\twisync_admin_notice__success( 'Created ' . $label_name . ' as Product Attribute.' );\n\t}\n\n $id = $wpdb->insert_id;\n\n do_action('woocommerce_attribute_added', $id, $data);\n\n wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );\n\n delete_transient('wc_attribute_taxonomies');\n}",
"public function add(ConfigurationAttribute $attribute)\n {\n $this->attributes->push($attribute);\n }",
"public function attributes()\n {\n return $this->morphToMany(Attribute::class, 'attribute_able');\n }",
"public function add_attribute($post_id, $key, $value) \n\t { \n\t global $wpdb;\n\t global $woocommerce;\n\t\t\t \n\t // get attribute name, label\n\t if ( isset($this->amz_settings['attr_title_normalize']) && $this->amz_settings['attr_title_normalize'] == 'yes' )\n\t \t$attribute_label = $this->attrclean_splitTitle( $key );\n\t\t\telse\n\t\t\t\t$attribute_label = $key;\n\t $attribute_name = $this->the_plugin->cleanTaxonomyName($key, false);\n\n\t // set attribute type\n\t $attribute_type = 'select';\n\t \n\t // check for duplicates\n\t $attribute_taxonomies = $wpdb->get_var(\"SELECT * FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name = '\".esc_sql($attribute_name).\"'\");\n\t \n\t if ($attribute_taxonomies) {\n\t // update existing attribute\n\t $wpdb->update(\n $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t\t 'attribute_label' => $attribute_label,\n\t\t 'attribute_name' => $attribute_name,\n\t\t 'attribute_type' => $attribute_type,\n\t\t 'attribute_orderby' => 'name'\n ), array('attribute_name' => $attribute_name)\n\t );\n\t } else {\n\t // add new attribute\n\t $wpdb->insert(\n\t $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t \t'attribute_label' => $attribute_label,\n\t \t'attribute_name' => $attribute_name,\n\t \t'attribute_type' => $attribute_type,\n\t \t'attribute_orderby' => 'name'\n\t )\n\t );\n\t }\n\n\t // avoid object to be inserted in terms\n\t if (is_object($value))\n\t return;\n\t\n\t // add attribute values if not exist\n\t $taxonomy = $this->the_plugin->cleanTaxonomyName($attribute_name);\n\t\t\t\n\t if( is_array( $value ) )\n\t {\n\t $values = $value;\n\t }\n\t else\n\t {\n\t $values = array($value);\n\t }\n \n\t // check taxonomy\n\t if( !taxonomy_exists( $taxonomy ) ) \n\t {\n\t // add attribute value\n\t foreach ($values as $attribute_value) {\n\t \t$attribute_value = (string) $attribute_value;\n\n\t if (is_string($attribute_value)) {\n\t // add term\n\t //$name = stripslashes($attribute_value);\n\t\t\t\t\t\t$name = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t $slug = sanitize_title($name);\n\t\t\t\t\t\t\n\t if( !term_exists($name) ) {\n\t if( trim($slug) != '' && trim($name) != '' ) {\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->terms,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'name' => $name,\n\t\t \t'slug' => $slug\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%s', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->terms, array(\n\t\t 'name' => $name,\n\t\t 'slug' => $slug\n )\n\t );*/\n\t\n\t // add term taxonomy\n\t $term_id = $wpdb->insert_id;\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->term_taxonomy,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'term_id' => $term_id,\n\t\t \t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t\t//var_dump('<pre>1: ',$__dbg,'</pre>');\n\t }\n\t } else {\n\t // add term taxonomy\n\t $term_id = $wpdb->get_var(\"SELECT term_id FROM {$wpdb->terms} WHERE name = '\".esc_sql($name).\"'\");\n\t $this->the_plugin->db_custom_insert(\n\t \t$wpdb->term_taxonomy,\n\t \tarray(\n\t \t\t'values' => array(\n\t\t \t\t'term_id' => $term_id,\n\t\t \t\t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t)\n\t \t),\n\t \ttrue\n\t );\n\t /*$wpdb->insert(\n \t\t$wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t//var_dump('<pre>1c: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t else \n\t {\n\t // get already existing attribute values\n\t $attribute_values = array();\n\t /*$terms = get_terms($taxonomy, array('hide_empty' => true));\n\t\t\t\tif( !is_wp_error( $terms ) ) {\n\t \tforeach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t \t}\n\t\t\t\t} else {\n\t\t\t\t\t$error_string = $terms->get_error_message();\n\t\t\t\t\tvar_dump('<pre>',$error_string,'</pre>'); \n\t\t\t\t}*/\n\t\t\t\t$terms = $this->the_plugin->load_terms($taxonomy);\n\t foreach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t }\n\t \n\t // Check if $attribute_value is not empty\n\t if( !empty( $attribute_values ) )\n\t {\n\t foreach( $values as $attribute_value ) \n\t {\n\t \t$attribute_value = (string) $attribute_value;\n\t\t\t\t\t\t$attribute_value = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t if( !in_array( $attribute_value, $attribute_values ) ) \n\t {\n\t // add new attribute value\n\t $__term_and_tax = wp_insert_term($attribute_value, $taxonomy);\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', '__term_and_tax');\n\t\t\t\t\t\t\t//var_dump('<pre>1b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t\n\t // Add terms\n\t if( is_array( $value ) )\n\t {\n\t foreach( $value as $dm_v )\n\t {\n\t \t$dm_v = (string) $dm_v;\n\t if( !is_array($dm_v) && is_string($dm_v)) {\n\t \t$dm_v = $this->the_plugin->cleanValue( $dm_v ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $dm_v, $taxonomy );\n\t\t\t\t\t\t$__dbg = compact('taxonomy', 'dm_v', '__term_and_tax');\n\t\t\t\t\t\t//var_dump('<pre>2: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t else\n\t {\n\t \t$value = (string) $value;\n\t if( !is_array($value) && is_string($value) ) {\n\t \t$value = $this->the_plugin->cleanValue( $value ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $value, $taxonomy );\n\t\t\t\t\t$__dbg = compact('taxonomy', 'value', '__term_and_tax');\n\t\t\t\t\t//var_dump('<pre>2b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t\t\t\n\t // link to woocommerce attribute values\n\t if( !empty( $values ) )\n\t {\n\t foreach( $values as $term )\n\t {\n\t \t\n\t if( !is_array($term) && !is_object( $term ) )\n\t { \n\t $term = sanitize_title($term);\n\t \n\t $term_taxonomy_id = $wpdb->get_var( \"SELECT tt.term_taxonomy_id FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} as tt ON tt.term_id = t.term_id WHERE t.slug = '\".esc_sql($term).\"' AND tt.taxonomy = '\".esc_sql($taxonomy).\"'\" );\n \n\t if( $term_taxonomy_id ) \n\t {\n\t $checkSql = \"SELECT * FROM {$wpdb->term_relationships} WHERE object_id = {$post_id} AND term_taxonomy_id = {$term_taxonomy_id}\";\n\t if( !$wpdb->get_var($checkSql) ) {\n\t $wpdb->insert(\n\t $wpdb->term_relationships, array(\n\t\t\t 'object_id' => $post_id,\n\t\t\t 'term_taxonomy_id' => $term_taxonomy_id\n\t )\n\t );\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }",
"public function setAttributes();",
"private function addAttributes(array $attributes) : void\n {\n $this->attributes = $attributes;\n }",
"public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }",
"private function addCustomAttributes(array $attributes, HTMLPurifier_HTMLDefinition $definition)\n {\n foreach ($attributes as $attribute) {\n // Get configuration of attribute\n $required = !empty($attribute[3]) ? true : false;\n $onElement = $attribute[0];\n $attrName = $required ? $attribute[1] . '*' : $attribute[1];\n $validValues = $attribute[2];\n\n if ($onElement === '*') {\n $def = $validValues;\n if (is_string($validValues)) {\n $def = new $validValues();\n }\n\n if ($def instanceof \\HTMLPurifier_AttrDef) {\n $definition->info_global_attr[$attrName] = $def;\n }\n\n continue;\n\t }\n\n\t if (class_exists($validValues)) {\n\t\t$validValues = new $validValues();\n\t }\n\n $definition->addAttribute($onElement, $attrName, $validValues);\n }\n\n return $definition;\n }",
"protected function _generateAttributeOnToken()\n\t{\n\t\tif (!isset($this->_tempToken[\"args\"][\"attributes\"])) {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"] = array();\n\t\t}\n\t\tif (isset($this->_tempToken[\"args\"][\"attributes\"][$this->_attribute])) {\n\t\t\t$this->_attribute = null;\n\t\t} else {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"][$this->_attribute] = array(\n\t\t\t\t\"value\" => \"\"\n\t\t\t);\n\t\t}\n\t}",
"public function addAttributes(\\obiba\\mica\\AttributeDto $value) {\n return $this->_add(15, $value);\n }",
"public function addAttributes(\\obiba\\mica\\AttributeDto $value) {\n return $this->_add(15, $value);\n }",
"public function attributes() {\n return $this->hasMany('App\\Models\\ProductAttribute');\n }",
"public function replaceHashableAttributes($attributes)\n {\n $hash_id = $this->generateHashId($attributes);\n if($hash_id) {\n $attributes['hash_id'] = $hash_id;\n foreach ($this->hashableAttributes as $value) {\n unset($attributes[$value]);\n }\n }\n return $attributes;\n }",
"private function addAtrributesToCRUD() {\r\n if (!empty($this->__attributes)) {\r\n $this->myCRUD()->setAtributes($this->__attributes);\r\n }\r\n }",
"public function purgeXSS($attribute)\n {\n $this->$attribute = Html::encode($this->$attribute);\n }",
"public function addAttributes($arrAttributes) {\n foreach ($arrAttributes as $key => $val) {\n $this->attributes[$key] = $val;\n }\n }",
"public function addAttributes(string $property, array $attributes)\n {\n $this->attributes[$property] = $attributes;\n }",
"public function addAttributes(\\obiba\\mica\\AttributeDto $value) {\n return $this->_add(3, $value);\n }",
"public function setAttribute($attribute, $value) {\n\t\tif (!$this->attributes) {\n\t\t\t$this->attributes = tx_newspaper::selectOneRow(\n\t\t\t\t\t'*', tx_newspaper::getTable($this), $this->condition\n\t\t\t);\n\t\t}\n\t\t\n\t\t$this->attributes[$attribute] = $value;\n\t}",
"function storeObjectAttribute( $attribute )\n {}",
"public function addAttributes(\\obiba\\mica\\AttributeDto $value) {\n return $this->_add(24, $value);\n }",
"public function addAttributes(\\obiba\\mica\\AttributeDto $value) {\n return $this->_add(2, $value);\n }",
"private function addAttribute($group_name, $attribute_name) {\n\n\t\t// Fix special charrs\n\t\t//-------------------------------------------------------------------------\n\t\t$group_name = htmlspecialchars($group_name);\n\t\t$attribute_name = htmlspecialchars($attribute_name);\n\n\t\t$query = $this->db->query('SELECT attribute_group_id FROM `' . DB_PREFIX . 'attribute_group_description` WHERE LOWER(name) = LOWER(\\'' . $this->db->escape($group_name) . '\\') AND language_id = \\'' . (int)$this->LanguageID . '\\' LIMIT 1');\n\n\t\tif (isset($query->row['attribute_group_id'])) {\n\t\t\t$attribute_group_id = $query->row['attribute_group_id'];\n\t\t} else {\n\t\t\t$this->db->query('INSERT INTO `' . DB_PREFIX . 'attribute_group` SET sort_order = 1');\n\t\t\t$attribute_group_id = $this->db->getLastId();\n\t\t\t$this->db->query('INSERT INTO `' . DB_PREFIX . 'attribute_group_description` \n\t\t\t\tSET attribute_group_id = ' . (int)$attribute_group_id . ',\n\t\t\t\tlanguage_id = \\'' . (int)$this->LanguageID . '\\',\n\t\t\t\tname = \\'' . $this->db->escape($group_name) . '\\'\n\t\t\t');\n\t\t}\n\n\t\t$query = $this->db->query('SELECT ad.attribute_id FROM `' . DB_PREFIX . 'attribute_description` ad \n\t\t\tLEFT JOIN `' . DB_PREFIX . 'attribute` a ON (ad.attribute_id = a.attribute_id)\n\t\t\tWHERE LOWER(ad.name) = LOWER(\\'' . $this->db->escape($attribute_name) . '\\') AND ad.language_id = \\'' . (int)$this->LanguageID . '\\' AND a.attribute_group_id = \\'' . (int)$attribute_group_id . '\\' LIMIT 1\n\t\t\t');\n\n\t\tif (isset($query->row['attribute_id'])) {\n\t\t\t$attribute_id = $query->row['attribute_id'];\n\t\t} else {\n\t\t\t$this->db->query('INSERT INTO `' . DB_PREFIX . 'attribute` SET sort_order = 1, attribute_group_id = ' . (int)$attribute_group_id);\n\t\t\t$attribute_id = $this->db->getLastId();\n\t\t\t$this->db->query('INSERT INTO `' . DB_PREFIX . 'attribute_description`\n\t\t\t\tSET attribute_id = ' . (int)$attribute_id . ',\n\t\t\t\tlanguage_id = \\'' . (int)$this->LanguageID . '\\',\n\t\t\t\tname = \\'' . $this->db->escape($attribute_name) . '\\'\n\t\t\t');\n\t\t}\n\n\t\treturn $attribute_id;\n\t}",
"public function getAttribute($attribute)\n {\n }",
"public function addAttributes(\\obiba\\mica\\AttributeDto $value) {\n return $this->_add(7, $value);\n }",
"public function __set($attribute, $value)\n {\n array_set($this->attributes, $attribute, $value);\n }",
"public function setAttributes($attributes);",
"private function appendOldAttributes(array $attributes)\n {\n // Get a current collection\n $collection = $this->sessionBag->get(self::PARAM_STORAGE_KEY);\n\n // Merge new attributes with collection\n $collection = array_merge($collection, $attributes);\n\n // Override old collection with a new one\n $this->sessionBag->set(self::PARAM_STORAGE_KEY, $collection);\n }",
"public function addAttributes(\\obiba\\mica\\AttributeDto $value) {\n return $this->_add(9, $value);\n }",
"public function setAttributeList(array $attribute_list): void;",
"protected function clean_up_after_attribute_removal( $element, $attribute ) {\n\t\tstatic $attributes_tied_to_href = [ 'target', 'download', 'rel', 'rev', 'hreflang', 'type' ];\n\n\t\tif ( 'href' === $attribute->nodeName ) {\n\t\t\t/*\n\t\t\t * \"The target, download, rel, rev, hreflang, and type attributes must be omitted\n\t\t\t * if the href attribute is not present.\"\n\t\t\t * See: https://www.w3.org/TR/2016/REC-html51-20161101/textlevel-semantics.html#the-a-element\n\t\t\t */\n\t\t\tforeach ( $attributes_tied_to_href as $attribute_to_remove ) {\n\t\t\t\tif ( $element->hasAttribute( $attribute_to_remove ) ) {\n\t\t\t\t\t$element->removeAttribute( $attribute_to_remove );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function addAttr($key, $value): void\n {\n $this->attrs[$key] = $value;\n }",
"public function offsetSet($attribute, $value)\n {\n $this->attributeList[$attribute] = $value;\n }",
"public function addAttributes($post_id)\n\t{\n\t\t$attr = 'custom';\n\t\t\n\t\twp_set_object_terms($post_id, '0', $attr);\n\n $thedata[sanitize_title($attr)] = array(\n \t'name' => wc_clean($attr),\n 'value' => '0',\n 'postion' => '0',\n 'is_visible' => '0',\n 'is_variation' => '1',\n 'is_taxonomy' => '1'\n );\n \n\t\tupdate_post_meta($post_id, '_product_attributes', $thedata);\n\t\t\t\t\t\t\n\t}",
"public function loadAttributes()\n {\n if (! $this->_attributesLoaded) {\n // send the backend a list of attributes we already have, so the backend can possibly\n // skip re-loading them.\n $presentAttributeNames = array_keys($this->_attributes);\n $newAttributes = $this->_cache->getBackend()->getMissingAttributes($this, $presentAttributeNames);\n $this->_attributes = array_merge($this->_attributes, $newAttributes);\n $this->_attributesLoaded = true;\n }\n return $this;\n }",
"function userAttrAdd (\n $email,\n $attr,\n $value\n ) {\n global $db;\n\n $response = $db->client->updateItem(array(\n \"TableName\" => $db->prefixTable . 'Users', \n \"Key\" => array(\n \"email\" => array( Type::STRING => $email ) // Primary Key\n ),\n \"AttributeUpdates\" => array(\n $attr => array(\n \"Action\" => AttributeAction::ADD,\n \"Value\" => array( Type::NUMBER => $value )\n )\n )\n ));\n\n #return $response;\n }",
"public function addAttribute(StoreGoodRequest $request)\n {\n \t$data = [];\n\n foreach ($request->attribute as $key => $attribute) {\n \n if(Attribute::find($attribute['id'])) {\n \n array_push($data, ['good_id'=>$this->id,'attribute_id'=>$attribute['id'],'value'=>$attribute['value']]);\n }\n }\n AttributeGood::insert($data);\n return response()->json(['status' => 'success'], 200);\n }",
"function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($this->k($k), $v, $ns);}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"public function getAdditionalAttributes() {}",
"function insert_attr($key, $value) {\n $this->other_attr[$key] = $value;\n }",
"public function addAttribute($name, $value)\n {\n if (is_scalar($value)) {\n $value = explode(' ', (string) $value);\n }\n $name = htmlspecialchars($name, ENT_QUOTES);\n if (false==$this->hasAttribute($name)) {\n $this->attributes[$name] = array();\n }\n foreach ($value as $v) {\n if (!in_array($v, $this->attributes[$name])) {\n $this->attributes[$name][] = $v;\n }\n }\n }",
"public function setAttributes($attributes){ }",
"protected function applyAttribute($attribute)\n {\n $value = $this->product->{$attribute};\n if ($value === '' || $value === null) {\n return $this;\n }\n\n return $this->setAttribute($attribute, $value);\n }",
"function nav_menu_link_attributes( $attr ) {\n\n\t$attr['class'] = 'menu__link';\n\n\treturn $attr;\n}",
"public function setAttribute($attribute, $value)\n {\n }",
"function add_attribute($dom, $element, $name, $value) {\n\t$attr = $element->appendChild($dom->createAttribute($name));\n\t$attr->appendChild($dom->createTextNode($value));\n\treturn $attr;\n}",
"public function getAttribute($attribute)\r\n\t{\r\n\t\t\r\n\t}",
"public function removeAttribute($key)\n {\n $key = strtolower($key);\n unset($this->attr[$key]);\n }",
"public function __unset($attribute) {\n return $this->deleteAttribute($attribute);\n }",
"public function getAttributes() {\n\t\tif(NULL === $this->cachedAttributes) {\n\t\t\t$this->cachedAttributes = [];\n\t\t\tforeach($this->PDO->select(\"SELECT\n SKY_USER_ATTRIBUTE.id,\n valueType,\n SKY_USER_ATTRIBUTE.name,\n SKY_USER_ATTRIBUTE.description,\n icon,\n multiple,\n enabled,\n SKY_USER_ATTRIBUTE_GROUP.name as groupName,\n SKY_USER_ATTRIBUTE_GROUP.description as groupDescription,\n SKY_USER_ATTRIBUTE_GROUP.id as gid\nFROM SKY_USER_ATTRIBUTE\nLEFT JOIN SKY_USER_ATTRIBUTE_GROUP on attr_group = SKY_USER_ATTRIBUTE_GROUP.id\nORDER BY indexing, name\") as $record) {\n\t\t\t\t$attr = AbstractAttribute::create($record);\n\t\t\t\tif ($attr) {\n\t\t\t\t\t$this->cachedAttributes[$record[\"id\"] * 1] = $attr;\n\t\t\t\t\t$this->attributeName2ID[strtolower($record[\"name\"])] = $record[\"id\"] * 1;\n\n\t\t\t\t\tif($gid = $record[\"gid\"]) {\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"name\"] = $name = $record[\"groupName\"];\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"description\"] = $record[\"groupDescription\"];\n\t\t\t\t\t\t$this->cachedAttributeGroupNames2ID[strtolower($name)] = $gid*1;\n\t\t\t\t\t\t$this->attribute2Group[$attr->getId()] = $gid*1;\n\t\t\t\t\t\t$this->group2Attribute[$gid*1][] = $attr->getId();\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\ttrigger_error(\"Can not create user attribute {$record[\"name\"]}\", E_USER_NOTICE);\n\t\t\t}\n\t\t}\n\t\treturn $this->cachedAttributes;\n\t}",
"public function attributes($attr){\n $this->httpRequest->attributes($attr);\n }",
"public function exist($attribute)\n {\n $this->exist[] = $attribute;\n\n return $this;\n }",
"public function setAttribute(string $attribute, string $value);",
"public function addToBody($attribute)\n\t{\n\t\t$this->body .= (' ' . $attribute);\n\t}",
"public function addAttribute(string $name, $value): self;",
"private function prepareExistCondition($attribute)\n {\n $this->filter->addMust(new Exists($attribute));\n }",
"function action_unique_attribute_list() {\n $this->layout = null;\n\n $this->model = DB::model('Model')->fetch($_REQUEST['model_id']);\n if ($this->model->value['id']) {\n $this->model->bindMany('Attribute');\n }\n }",
"public function removeAttribute(string $attributeName) {\n if(isset($this->attributes[$attributeName]))\n unset($this->attributes[$attributeName]);\n }",
"abstract protected function mustApplyRuleOnAttribute(): bool;",
"public function enableFlag()\n {\n $this->state->setItem(self::SAFE_ATTRIBUTE_FLAG, true);\n }",
"public static function removeAttribute(ProductAttribute $attribute): bool\n {\n global $user;\n //====================================================================//\n // Ensure Service Init\n self::init();\n //====================================================================//\n // Ensure Attribute has No Child Values or Product\n if (($attribute->countChildValues() > 0) || ($attribute->countChildProducts() > 0)) {\n return Splash::log()->errTrace(\n \"Unable to Delete Product Attribute (\".$attribute->ref.\"): Has Child Values or Product\"\n );\n }\n //====================================================================//\n // Delete Attribute\n if ($attribute->delete($user) < 0) {\n return Splash::log()->errTrace(\n \" Unable to Delete Product Attribute (\".$attribute->ref.\").\"\n );\n }\n //====================================================================//\n // Reload Load Attributes Cache\n self::$attributesCache = $attribute->fetchAll();\n\n return true;\n }",
"public function collectAttributes($attribute, $index = null)\n\t{\n\t\t$memoKey = 'collected-' . $attribute . $index;\n\t\tif (!isset($this->memoize[$memoKey])) {\n\t\t\t$this->memoize[$memoKey] = array();\n\t\t\tforeach($this as $model)\n\t\t\t{\n\t\t\t\tif ($index) {\n\t\t\t\t\t$this->memoize[$memoKey][$model->$attribute->$index] = $model->$attribute;\n\t\t\t\t} else {\n\t\t\t\t\t$this->memoize[$memoKey][] = $model->$attribute;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->memoize[$memoKey];\n\t}",
"function getAdditionalAttributes() ;",
"public function removeAttribute($name)\n {\n unset($this->attributes[$name]);\n }"
] | [
"0.6281261",
"0.61672014",
"0.60503364",
"0.5977922",
"0.5954943",
"0.590952",
"0.58700424",
"0.58115685",
"0.5754149",
"0.56519103",
"0.5650959",
"0.56203955",
"0.5573173",
"0.557189",
"0.551486",
"0.5494973",
"0.5462906",
"0.54597425",
"0.53793925",
"0.53790087",
"0.53710884",
"0.5365502",
"0.5359701",
"0.53572345",
"0.5355839",
"0.53552854",
"0.53408897",
"0.53207254",
"0.5313303",
"0.53131175",
"0.53088313",
"0.527064",
"0.52628636",
"0.526053",
"0.5259599",
"0.5247234",
"0.5247093",
"0.52438456",
"0.5239277",
"0.5239277",
"0.5238943",
"0.523875",
"0.52169603",
"0.5215622",
"0.5207849",
"0.5199882",
"0.51945734",
"0.5188933",
"0.5185759",
"0.5178148",
"0.51604545",
"0.5151645",
"0.5146256",
"0.5141853",
"0.5137964",
"0.5125868",
"0.51201075",
"0.5115309",
"0.5110083",
"0.51040244",
"0.51030755",
"0.5102096",
"0.50989026",
"0.5097179",
"0.509005",
"0.50875556",
"0.506452",
"0.5064087",
"0.5064087",
"0.5063805",
"0.50632674",
"0.50622296",
"0.50622296",
"0.50622296",
"0.50622296",
"0.5053523",
"0.5050955",
"0.50509155",
"0.5045117",
"0.50342023",
"0.50286436",
"0.5021186",
"0.50197065",
"0.50125265",
"0.501201",
"0.50100535",
"0.500683",
"0.5005715",
"0.50030345",
"0.49936616",
"0.49919602",
"0.4987597",
"0.49862623",
"0.498084",
"0.4975323",
"0.4970323",
"0.49525583",
"0.49427223",
"0.4942425",
"0.49421892"
] | 0.6148048 | 2 |
The settings is attribute contains everything that should be saved to the settings area. | public function getSettingsAttribute()
{
$defaults = [
'fileName',
'components',
'content',
'markup',
'mtime',
'code'
];
$dynPropNames = array_keys(array_diff_key($this->getDynamicProperties(), ['purgeable' => 0]));
return array_diff_key(
$this->attributes,
array_flip(array_merge($defaults, $this->purgeable, $dynPropNames))
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save_settings($settings)\n {\n }",
"public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }",
"public function getSettings()\n\t{\n\t\treturn $this->settings;\n\t}",
"public function getSettings() {\n return $this->settings;\n }",
"function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}",
"function get_settings() {\n\t\treturn $this->settings;\n\t}",
"public function getSettings() {\n\t\treturn $this -> settings;\n\t}",
"public function getSettings()\n {\n return $this->settings;\n }",
"public function getSettings()\n {\n return $this->settings;\n }",
"public function getSettings()\n {\n return $this->settings;\n }",
"public function getSettings()\n {\n return $this->settings;\n }",
"public function getSettings()\n {\n return $this->_settings;\n }",
"public function saveSettings()\n {\n $this->store->save($this->data);\n }",
"public function getSettings()\n {\n return self::$settings;\n }",
"public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}",
"private function settings()\n\t{\n\t\tif($_POST)\n\t\t{\n\t\t\t// Available Vews\n config::set('s7n.views', $this->input->post('views'));\n\n\t\t\t// Default Sidebar Title\n config::set('s7n.default_sidebar_title', $this->input->post('default_sidebar_title'));\n\n\t\t\t// Default Sidebar Content\n config::set('s7n.default_sidebar_content', $this->input->post('default_sidebar_content'));\n\n\t\t\tmessage::info(__('Page Settings edited successfully'), 'admin/page/settings');\n\t\t}\n\n\t\t$this->head->title->append(__('Settings'));\n\n\t\t$this->template->title .= __('Settings');\n\t\t$this->template->content = View::factory('page/settings', array(\n\t\t\t'views' => config::get('s7n.page_views'),\n\t\t\t'default_sidebar_title' => config::get('s7n.default_sidebar_title'),\n\t\t\t'default_sidebar_content' => config::get('s7n.default_sidebar_content')\n\t\t));\n\t}",
"public function get_settings() {\n return self::$settings;\n }",
"public function settings()\n {\n }",
"public function getSettings() {\n return $this->settings->attributes;\n }",
"function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}",
"function set_settings( $settings ) {\n\t\t$this->settings = $settings;\n\t}",
"function settingsObject()\n\t{\n\t\tglobal $tpl, $ilCtrl, $lng;\n\t\t\n\t\t$editor = $this->object->_getRichTextEditor();\n\t\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this));\n\t\t$this->form->setTitle($lng->txt(\"adve_activation\"));\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_tiny_mce\"), \"use_tiny\");\n\t\tif ($editor == \"tinymce\")\n\t\t{\n\t\t\t$cb->setChecked(true);\n\t\t}\n\t\t$this->form->addItem($cb);\n\t\t$this->form->addCommandButton(\"saveSettings\", $lng->txt(\"save\"));\n\t\t\n\t\t$tpl->setContent($this->form->getHTML());\n\t}",
"public function settings()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['save']) && $_POST['save'] == 'Save Settings')\n\t\t\t{\n\t\t\t\tPlugin::setAllSettings($_POST['setting'], 'mbblog');\n\t\t\t\tFlash::setNow('success', __('Settings have been saved!'));\t\t \t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$this->display('mbblog/views/admin/settings', array('settings' => Plugin::getAllSettings('mbblog')));\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}",
"public static function getSettings()\n\t\t{\n\t\t\treturn self::$ettings;\n\t\t}",
"function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}",
"function saveSettings() {\n\t\t//# convert class variables into an array and save using\n\t\t//# Wordpress functions, \"update_option\" or \"add_option\"\n\t\t//#convert class into array...\n\t\t$settings_array = array();\n\t\t$obj = $this;\n\t\tforeach (array_keys(get_class_vars(get_class($obj))) as $k){\n\t\t\tif (is_array($obj->$k)) {\n\t\t\t\t//serialize any arrays within $obj\n\t\t\t\tif (count($obj->$k)>0) {\n\t\t\t\t\t$settings_array[$k] = esc_attr(serialize($obj->$k));\n\t\t\t\t} else {\n\t\t\t\t\t$settings_array[$k] = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$settings_array[$k] = \"{$obj->$k}\";\n\t\t\t}\n\t\t}\n\t\t//#save array to options table...\n\t\t$options_check = get_option('wassup_settings');\n\t\tif (!empty($options_check)) {\n\t\t\tupdate_option('wassup_settings', $settings_array);\n\t\t} else {\n\t\t\tadd_option('wassup_settings', $settings_array, 'Options for WassUp');\n\t\t}\n\t\treturn true;\n\t}",
"public function saveSettings() {\n\t\t\tif ( isset( $_POST['muut_settings_save'] )\n\t\t\t\t&& $_POST['muut_settings_save'] == 'true'\n\t\t\t\t&& check_admin_referer( 'muut_settings_save', 'muut_settings_nonce' )\n\t\t\t) {\n\t\t\t\t$this->submittedSettings = $_POST['setting'];\n\n\t\t\t\t$settings = $this->settingsValidate( $this->getSubmittedSettings() );\n\n\t\t\t\t// Save all the options by passing an array into setOption.\n\t\t\t\tif ( muut()->setOption( $settings ) ) {\n\t\t\t\t\tif ( !empty( $this->errorQueue ) ) {\n\t\t\t\t\t\t// Display partial success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved, other than the errors listed.', 'muut' ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Display success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved.', 'muut' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Display error if the settings failed to save.\n\t\t\t\t\tmuut()->queueAdminNotice( 'error', __( 'Failed to save settings.', 'muut' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function save_settings( $settings ) {\n\t\t$settings['_multiwidget'] = 1;\n\t\tupdate_option( $this->option_name, $settings );\n\t}",
"public function getSettings(){\r\n\t\treturn $this->initSettings;\r\n\t}",
"public function get_settings() {\n $this->create_object_settings();\n return array($this->settings);\n }",
"public function get_settings() {\n $data = array(\n 'settings' => $this->js_settings\n );\n \n return $data;\n }",
"public function site_settings()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$data['form_submit_message'] = '';\n\t\t\t$this->load->model('settings_model', 'sm');\n\t\t\t\n\t\t\tif(count($_POST) > 0)\n\t\t\t{\n\t\t\t\tforeach($_POST as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$settings_data['value'] = $value;\n\t\t\t\t\t$this->sm->update($key, $settings_data);\n\t\t\t\t}\n\t\t\t\t$data['form_submit_message'] = '<div style=\"font-weight:bold;color:#0000FF;\">'.lang('msg_settings_saved') .'</div>';\n\t\t\t}\n\t\t\t\n\t\t\t$settings_raw_data = $this->sm->get_all();\n\t\t\t$settings_data = array();\n\t\t\tforeach($settings_raw_data as $raw_settings)\n\t\t\t\t$settings_data[$raw_settings->name] = $raw_settings->value;\n\t\t\t$data['settings'] = $settings_data;\n\t\t\t$this->load->view('settings-admin', $data);\n\t\t}",
"public function getSettings() : array\n {\n return $this->settings;\n }",
"public function setSettings($settings)\r\n\t{\r\n $id = $this->_constructId();\r\n\t\t$this->_arr_settings[$id] = $this->owner->json_settings = json_encode(self::castArray($settings));\r\n\t}",
"public function getSettings() {\n return $this->settings == null ? array() : json_decode($this->settings, true);\n }",
"public function getAllSettings()\n {\n return $this->settings;\n }",
"protected function assignSettings()\n {\n $this->view->assign('settings', $this->settings);\n }",
"public function settings()\n\t\t{\n\t\t\t$section = 'reading';\n\t\t\tadd_settings_section(\n\t\t\t\t$this->tag . '_settings_section',\n\t\t\t\t$this->name . ' Settings',\n\t\t\t\tfunction () {\n\t\t\t\t\techo '<p>Configuration options for the ' . esc_html( $this->name ) .' plugin.</p>';\n\t\t\t\t},\n\t\t\t\t$section\n\t\t\t);\n\t\t\tforeach ( $this->settings AS $id => $options ) {\n\t\t\t\t$options['id'] = $id;\n\t\t\t\tadd_settings_field(\n\t\t\t\t\t$this->tag . '_' . $id . '_settings',\n\t\t\t\t\t$id,\n\t\t\t\t\tarray( &$this, 'settings_field' ),\n\t\t\t\t\t$section,\n\t\t\t\t\t$this->tag . '_settings_section',\n\t\t\t\t\t$options\n\t\t\t\t);\n\t\t\t}\n\t\t\tregister_setting(\n\t\t\t\t$section,\n\t\t\t\t$this->tag,\n\t\t\t\tarray( &$this, 'settings_validate' )\n\t\t\t);\n\t\t}",
"public function save_settings( $settings = array() ) {\n\t\tglobal $socialflow;\n\t\t$socialflow_params = filter_input_array( INPUT_POST );\n\t\t$settings = empty( $settings ) ? array() : $settings;\n\n\t\t// Merge current settings (we need to store account information which is not stored in the fields).\n\t\t$settings = $socialflow->array_merge_recursive( $socialflow->options->options, $settings );\n\n\t\t// Allow plugins/modules to add/modify settings when having post request.\n\t\t$settings = isset( $socialflow_params['socialflow'] ) ? apply_filters( 'sf_save_settings', $settings ) : $settings;\n\n\t\treturn $settings;\n\t}",
"public function setSettingsAttribute( $settings ){\n\n \t$base = self::$base_settings;\n $result = array();\n\n \tforeach ($base as $key => $value) { //for each key in the base\n $result[$key] = $settings; //$base[$key]['value'];\n \t\tif ( isset($settings[$key]) ){\n \t\t\t$result[$key] = $settings[$key];\n \t\t}\n \t}\n\n \t\t$this->attributes['settings'] = json_encode($result);\n }",
"public function setSettings() {\n $args = array(\n array(\n 'option_group' => 'pm_plugin_settings',\n 'option_name' => 'pm_plugin',\n 'callback' => array($this->callbacks_mgr, 'checkboxSanitize'),\n )\n );\n $this->settings->setSettings($args);\n }",
"function saveGeneralPageSettingsObject()\n\t{\n\t\tglobal $ilCtrl, $lng, $tpl;\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$aset = new ilSetting(\"adve\");\n\t\t\t$aset->set(\"use_physical\", $_POST[\"use_physical\"]);\n\t\t\tif ($_POST[\"block_mode_act\"])\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", (int) $_POST[\"block_mode_minutes\"]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", 0);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"showGeneralPageEditorSettings\");\n\t\t}\n\t\t\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function getSettings(){\n $allSettings = GeneralSetting::all();\n \n $settingsArray = array();\n foreach ($allSettings as $settings) {\n $refl3 = new ReflectionObject($settings);\n $prop3 = $refl3->getProperty('attributes');\n $prop3->setAccessible(true);\n $setting = $prop3->getValue($settings);\n array_push($settingsArray, $setting);\n \n }\n $this->layout->content = View::make('admin.settings')->with('settings',$settingsArray);\n }",
"public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }",
"function get_settings()\n\t{\n\t\t$this->settings = array();\n\t\t\n\t\treturn true;\n\t}",
"public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }",
"public function saveExportSetting($settings)\r\n {\r\n\r\n }",
"function settings()\n\t{\n\t\t$settings = array();\n\t\t$settings['script_folder_path'] = \"\";\n\t\treturn $settings;\n\t}",
"public function get_settings()\n {\n }",
"function save_settings(array $settings)\n {\n //if user is not active do not log changes\n if ($user = user()){\n $logs = [];\n foreach ($settings as $key => $value){\n //changed\n if (!settings($key) || settings($key) != $value){\n $old_val = settings($key);\n $logs[] = \"$user changed setting: '{$key}' from '{$old_val}' to '{$value}'\";\n }\n }\n }\n\n //sync settings and save\n \\Setting::set($settings);\n \\Setting::save();\n\n //log any changes\n if (!empty($logs))\n event(new \\App\\Events\\SettingsChanged($logs, $user));\n\n return $settings;\n }",
"public function settings_data() {\t\t\t\t## getting settings data function starts\n\t\t\treturn $this->get_settingsdata();\n\t\t}",
"public static function storeSettings($settings)\n\t{\n\t\t$registry = Registry::singleton();\n\t\t\n\t\tforeach ($settings as $key => $value) {\n\t\t\t$registry->_settings [ $key ] = $value;\n\t\t}\n\t}",
"public function getSettings()\n {\n return Initiatives::getInstance()->getSettings();\n }",
"public function saveSettings()\n {\n return $this->config->saveFile();\n }",
"public function defineSettings(){\n return array();\n }",
"public function getValues(){\n\t\treturn $this->_settings;\n\t}",
"public function saveSettings(){\n\n $vars = $this->getAllSubmittedVariablesByName();\n\n $vars['email'] = $this->email;\n $vars['firstname'] = $this->firstname;\n $vars['lastname'] = $this->lastname;\n $vars['real_name'] = $this->firstname .' ' .$this->lastname;\n $vars['phone'] = $this->phone;\n\n $vars['name'] = $this->firstname;\n $vars['surname'] = $this->lastname;\n $vars['screen_name'] = $this->firstname;\n\n\n $vars['about_my_artwork'] = $this->getSubmittedVariableByName('about_my_artwork');\n $vars['what_i_like_to_do'] = $this->getSubmittedVariableByName('what_i_like_to_do');\n $vars['experience'] = $this->getSubmittedVariableByName('experience');\n $vars['instructions'] = $this->getSubmittedVariableByName('instructions');\n $vars['aftercare'] = $this->getSubmittedVariableByName('aftercare');\n $vars['apprenticeship'] = $this->getSubmittedVariableByName('apprenticeship');\n\n $this->saveNamedVariables($vars);\n }",
"public static function save_settings($settings = array())\n\t{\n\t\t//be sure to save all settings possible\n\t\t$_tmp_settings = array_merge(self::_get_default_settings(), $settings);\n\t\t//No way to do INSERT IF NOT EXISTS so...\n\t\tforeach ($_tmp_settings as $setting_name => $setting_value)\n\t\t{\n\t\t\t$query = ee()->db->get_where(self::$_settings_table_name, array('setting_name'=>$setting_name), 1, 0);\n\t\t\tif ($query->num_rows() == 0) {\n\t\t\t // A record does not exist, insert one.\n\t\t\t $query = ee()->db->insert(self::$_settings_table_name, array('setting_name' => $setting_name, 'setting_value' => $setting_value));\n\t\t\t} else {\n\t\t\t // A record does exist, update it.\n\t\t\t $query = ee()->db->update(self::$_settings_table_name, array('setting_value' => $setting_value), array('setting_name'=>$setting_name));\n\t\t\t}\n\t\t}\n\t\tself::$_settings = $_tmp_settings;\n\t}",
"public static function Settings() {\r\n $settings = apply_filters( 'slp_widget_settings' , array() );\r\n return $settings[0];\r\n }",
"public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}",
"function settings()\n{\n return Yii::app()->settings;\n}",
"function settings()\n\t{\n\t\tif($this->session->userdata('admin_login') != 1)redirect(base_url() , 'refresh');\n\t\t\n\t\tif($_POST)\n\t\t{\n\t\t\t$data['institute_name']\t\t=\t$this->input->post('institute_name');\n\t\t\t$data['address']\t\t\t=\t$this->input->post('address');\n\t\t\t$data['phone_number']\t\t=\t$this->input->post('phone_number');\n\t\t\t$data['page_title']\t\t\t=\t$this->input->post('page_title');\n\t\t\t$data['page_meta_tag']\t\t=\t$this->input->post('page_meta_tag');\n\t\t\t\n\t\t\t$this->db->update('settings' , $data);\n\t\t\tmove_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads/logo.png');\n\t\t\t$this->session->set_flashdata('settings_message', 'Settings Updated');\n\t\t\tredirect(base_url().'index.php/admin/settings/' , 'refresh');\t\t\t\n\t\t}\n\t\t$page_data['page_info']\t=\t'System settings';\n\t\t$page_data['page_name']\t=\t'admin/settings';\n\t\t$page_data['page_title']=\t'Manage system settings';\n\t\t$this->load->view('index' , $page_data);\n\t}",
"private function settings()\n {\n if (!$this->settings) {\n $this->settings = userSettings::findOrMake($this->tid);\n }\n return $this->settings;\n }",
"function create_object_settings() {\n if (!isset($this->settings)) {\n require_once($this->addon->dir . 'include/class.widget.settings.php');\n $this->settings = new SLPWidget_Legacy_Settings( array( 'addon' => $this->addon ) );\n }\n }",
"public function settings(){\n\t\t$this->verify();\n\t\t$data['title']=\"Settings\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('settings', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}",
"function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }",
"public function register_settings()\n {\n }",
"public function register_settings()\n {\n }",
"function settings_section() {\n\t\t}",
"public function setSettings($settings) {\n\t\t$this->settings = $settings;\n\t\t$this->settings['base'] = $settings['tag'];\n\t\t$this->settings['element_class'] = isset($this->settings['element_class']) ? $this->settings['element_class'] :'';\n\t\t$this->settings[\"header_title\"] = isset($this->settings[\"header_title\"]) ? $this->settings[\"header_title\"] : TRUE;\n\t\t$this->settings[\"bottom_controls\"] = isset($this->settings[\"bottom_controls\"]) ? $this->settings[\"bottom_controls\"] : TRUE;\n\t\t$this->settings[\"is_sortable\"] = isset($this->settings[\"is_sortable\"]) ? $this->settings[\"is_sortable\"] : TRUE;\n\t\t$this->settings[\"child_sortable\"] = isset($this->settings[\"child_sortable\"]) ? $this->settings[\"child_sortable\"] : TRUE;\n\t}",
"public function saveSettings()\n\t{\n\t\t$this->ensureAuthed();\n\t\t$input = Input::getInstance();\n\t\t$settings = $input->getInput('settings');\n\t\t$settingsManager = Settings::getInstance();\n\t\t$settingsManager->setSettings($this->username, $settings);\n\t\treturn true;\n\t}",
"public function getSettings();",
"public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}",
"public function add_settings() {\n if (self::$settings !== null) {\n $this->print_settings(self::$settings);\n }\n }",
"public function settings()\n {\n\n $this->data['page'] = 'settings';\n $this->data['user'] = $this->user;\n\n // get privacy settings\n\n $my_privacy = explode(',',$this->user['privacy_settings']);\n\n $this->data['settings'] = $my_privacy;\n\n $this->load->view('/dash/header',$this->data);\n $this->load->view('/dash/settings',$this->data);\n $this->load->view('/dash/footer',$this->data);\n\n }",
"protected function getSettings() {\n\t\treturn $this->configuration->getSettings();\n\t}",
"public static function save_settings(array $settings)\n {\n $whitelisted_settings = array();\n foreach ($settings as $key => $value) {\n if (array_key_exists($key, self::$defaults)) {\n $whitelisted_settings[$key] = array();\n foreach ($value as $k => $v) {\n if (array_key_exists($k, self::$defaults[$key])) {\n $whitelisted_settings[$key][$k] = $v;\n }\n }\n }\n }\n update_option(self::$option_key, $whitelisted_settings);\n self::write_color_css();\n }",
"function _savesettings()\r\n {\r\n\t\t$settings = JRequest::getVar('settings');\r\n\r\n\t\tjimport('joomla.registry.registry');\r\n\t\t$reg = new JRegistry();\r\n\t\t$reg->loadArray($settings);\r\n\t\t\t\t\r\n\t\tif(JFusionConnect::isJoomlaVersion('1.6')) {\r\n\t\t\t$component =& JTable::getInstance('extension');\r\n\t\t\t$componentid = $component->find(array('type' => 'component','element' => 'com_jfusionconnect'));\r\n\t\t\t$component->load($componentid);\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('extension');\r\n\t\t\t$pluginid = $plugin->find(array('type' => 'plugin','element' => 'jfusionconnect'));\r\n\t\t\t$plugin->load($pluginid);\r\n\t\t\t$key='enabled';\r\n\t\t} else {\r\n\t\t\t$component =& JTable::getInstance('component');\r\n\t\t\t$component->loadByOption('com_jfusionconnect');\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('plugin');\r\n\t\t\t$plugin->_tbl_key = 'element';\r\n\t\t\t$plugin->load('jfusionconnect');\r\n\t\t\t$key='published';\r\n\t\t}\r\n\t\t$component->params = $reg->toString();\r\n\t\t$component->store();\r\n \tif ($settings['enabled']) {\r\n\t\t\t$plugin->$key = 1;\r\n\t\t} else {\r\n\t\t\t$plugin->$key = 0;\r\n\t\t}\r\n\t\t$plugin->store();\r\n }",
"public function action_article_settings()\n\t{\n\t\tglobal $context, $scripturl, $txt;\n\n\t\t// These are very likely to come in handy! (i.e. without them we're doomed!)\n\t\trequire_once(ADMINDIR . '/ManagePermissions.controller.php');\n\t\trequire_once(ADMINDIR . '/ManageServer.controller.php');\n\t\trequire_once(SUBSDIR . '/SettingsForm.class.php');\n\n\t\t// Initialize the form\n\t\t$this->_initArticleSettingsForm();\n\n\t\t// Save away\n\t\tif (isset($_GET['save']))\n\t\t{\n\t\t\tcheckSession();\n\n\t\t\t$this->_articleSettingsForm->setConfigValues($_POST);\n\t\t\t$this->_articleSettingsForm->save();\n\t\t\tredirectexit('action=admin;area=portalconfig;sa=articlesettings');\n\t\t}\n\n\t\t// Show the form\n\t\t$context['post_url'] = $scripturl . '?action=admin;area=portalconfig;sa=articlesettings;save';\n\t\t$context['settings_title'] = $txt['sp-adminArticleSettingsName'];\n\t\t$context['page_title'] = $txt['sp-adminArticleSettingsName'];\n\t\t$context['sub_template'] = 'show_settings';\n\n\t\t$this->_articleSettingsForm->prepare();\n\t}",
"public function settings()\n {\n $this->settings = ['max_token_length' => ['integer', 255] ];\n }",
"public static function get_settings()\n\t{\n\t\tif (! isset(self::$_settings) || self::$_settings == null)\n\t\t{\n\t\t\t$settings = array();\n\t\t\t//Get the actual saved settings\n\t\t\t$query = ee()->db->get(self::$_settings_table_name);\n\t\t\tforeach ($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$settings[$row[\"setting_name\"]] = $row[\"setting_value\"];\n\t\t\t}\n\t\t\tself::$_settings = array_merge(self::_get_default_settings(), $settings);\n\t\t}\n\t\treturn self::$_settings;\n\t}",
"public static function filter_stashbox_register_settings( $settings ) {\n $settings['sb_domain_reminders'] = 'boolval';\n $settings['sb_domain_reminder_distance'] = 'stashbox_sanitize_array';\n $settings['sb_domain_reminder_count'] = 'intval';\n $settings['sb_domain_reminder_recipient'] = 'sanitize_email';\n return $settings;\n }",
"private function getSettings(){\n $settings = Auth::user()->settings;\n if(!$settings){\n $settings = new \\App\\Setting;\n $settings->user_id = Auth::id();\n foreach(Cons::$default_settings as $key => $value){\n $settings->{$key} = $value;\n }\n $settings->save();\n return Cons::$default_settings;\n }\n return $settings; // return created settings\n }",
"function settings() {\n\t\tglobal $core, $db, $lang;\n\t\t$result = NULL;\n\n\t\tif(isset($_POST['save'])) {\n\t\t\t$error = 0;\n\t\t\tforeach($_POST as $key => $value) {\n\t\t\t\tif($key != 'save') {\n\t\t\t\t\t$query = $db->select('shoutbox_settings', array('field'=>$key));\n\t\t\t\t\t$record = $query[0];\n\t\t\t\t\tif(!$db->update('shoutbox_settings', array('field'=>$key), array($record['id'],$key,stripslashes($value)))) $error++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($error) $core->notify($lang['shoutbox']['update fail'],2);\n\t\t\telse $core->notify($lang['shoutbox']['update success'],1);\n\t\t}\n\n\t\t//Get settings from DB\n\t\tif($query = $db->select('shoutbox_settings')) {\n\t\t\tforeach((array)$query as $record) $settings[$record['field']] = $record['value'];\n\t\t\t//Define all inputs\n\t\t\t$form['top'] = '<form name=\"settings\" method=\"post\" action=\"'.$_SERVER['REQUEST_URI'].'\">';\n\t\t\t\n\t\t\t$form['nick_min_chars'] = '<label>'.$lang['shoutbox']['nick min chars'].'\n\t\t\t\t</label>\n\t\t\t\t<input type=\"text\" name=\"nick_min_chars\" value=\"'.$settings['nick_min_chars'].'\" />';\n\t\t\t\t\n\t\t\t$form['nick_max_chars'] = '<label>'.$lang['shoutbox']['nick max chars'].'\n\t\t\t\t</label>\n\t\t\t\t<input type=\"text\" name=\"nick_max_chars\" value=\"'.$settings['nick_max_chars'].'\" />';\n\t\t\t\t\n\t\t\t$form['post_max_chars'] = '<label>'.$lang['shoutbox']['post max chars'].'\n\t\t\t\t</label>\n\t\t\t\t<input type=\"text\" name=\"post_max_chars\" value=\"'.$settings['post_max_chars'].'\" />';\n\t\t\t\t\n\t\t\t$form['posts_refresh_time'] = '<label>'.$lang['shoutbox']['posts reflash time'].'\n\t\t\t\t</label>\n\t\t\t\t<input type=\"text\" name=\"posts_refresh_time\" value=\"'.$settings['posts_refresh_time'].'\" />';\n\t\t\t\t\n\t\t\t$form['posts_limit'] = '<label>'.$lang['shoutbox']['posts limit'].'\n\t\t\t\t</label>\n\t\t\t\t<input type=\"text\" name=\"posts_limit\" value=\"'.$settings['posts_limit'].'\" />';\n\n\t\t\t$form['time_anti_flood'] = '<label>'.$lang['shoutbox']['time_anti_flood'].'\n\t\t\t\t</label>\n\t\t\t\t<input type=\"text\" name=\"time_anti_flood\" value=\"'.$settings['time_anti_flood'].'\" />';\n\t\t\t\n\t\t\t$form['save'] = '<button type=\"submit\" name=\"save\" value=\"save\">'.$lang['shoutbox']['save'].'</button>';\n\t\t\t\n\t\t\t$form['bottom'] = '</form>';\n\t\t\t\n\t\t\t//Return form\n\t\t\tforeach($form as $input) $result .= $input.\"\\n\";\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function save_settings($data) {\n\n\t\treturn array(\n\t\t\t'config_settings' => $this->EE->input->post('config_settings'),\n\t\t\t'eeck_image_upload' => $this->EE->input->post('eeck_image_upload'),\n\t\t\t'eeck_file_upload' => $this->EE->input->post('eeck_file_upload'),\n\t\t\t'eeck_flash_upload' => $this->EE->input->post('eeck_flash_upload'),\n\t\t\t'field_fmt' => 'none',\n\t\t\t'field_show_fmt' => 'n'\n\t\t\t\t);\n\t}",
"public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ogone_directlink';\n\n\t\treturn $settings;\n\t}",
"public function settings( $settings ) {\n\t\t$settings['dev_fund_user'] = array(\n\t\t\t'id' => 'dev_fund_user',\n\t\t\t'type' => 'text',\n\t\t\t'size' => 'small',\n\t\t\t'name' => 'Development Fund User ID',\n\t\t\t'desc' => 'Enter the User ID of the development fund account'\n\t\t);\n\t\treturn $settings;\n\t}",
"public function settings() {\n \n // Verify if is a team's member\n if ( $this->session->userdata( 'member' ) ) {\n redirect('user/app/dashboard');\n }\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n // Load Team Model\n $this->load->model('team');\n \n if ( file_exists( APPPATH . 'language/' . $this->config->item('language') . '/default_settings_lang.php') ) {\n $this->lang->load( 'default_settings', $this->config->item('language') );\n }\n \n // Get User Information\n $getdata = $this->user->get_user_info($this->user_id);\n\n // Get User's options\n $options = $this->user_meta->get_all_user_options($this->user_id);\n\n // display user data in settings page\n $this->content = array(\n 'udata' => $getdata,\n 'options' => $options\n );\n\n // Load view/user/settings.php file\n $this->body = 'user/settings';\n\n $this->user_layout();\n \n }",
"public function getSettings()\n {\n $data = $this->_plugin->getSettings();\n\n return Frenet_SettingsModel::populateModel($data);\n }",
"public function grid_save_settings($settings)\n {\n $settings = $settings['rte'];\n\n return $settings;\n }",
"public static function getSettings()\n {\n return Settings::getSettings();\n }",
"static public function save_setup_settings() {\n\n $data = WPP_F::parse_str( $_REQUEST[ 'data' ] );\n\n $_setup = array(\n 'api' => WPP_API_URL_STANDARDS,\n 'data' => $data,\n 'schema' => self::get_settings_schema()\n );\n\n $_current_settings = get_option('wpp_settings');\n\n $_modified_settings = WPP_F::extend( $_current_settings, $_setup['schema'] );\n\n //die( '<pre>' . print_r( $_modified_settings['field_alias'], true ) . '</pre>' );\n\n if( is_array( $_modified_settings['property_stats_groups'] ) ) {\n // $_modified_settings['property_stats_groups'] = array_unique( $_modified_settings['property_stats_groups'] );\n }\n\n // @note This kills c.rabbit.ci response via Varnish, perhaps some sort of log output somewhere.\n if( is_array( $_modified_settings['searchable_attributes'] ) ) {\n // $_modified_settings[ 'searchable_attributes' ] = array_unique( $_modified_settings[ 'searchable_attributes' ] );\n }\n\n // preserve field aliases\n $_modified_settings['field_alias'] = $_current_settings['field_alias'];\n\n $_modified_settings['_updated'] = time();\n\n update_option( 'wpp_settings', $_modified_settings );\n\n $posts_array = get_posts( array(\n 'posts_per_page' => 1,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'post_type' => 'property',\n 'post_status' => 'publish',\n 'suppress_filters' => true\n ) );\n\n $return[ 'props_single' ] = get_permalink( $posts_array[ 0 ]->ID );\n\n $return[ '_settings' ] = $data[ 'wpp_settings' ];\n\n self::flush_cache();\n\n wp_send_json( $return );\n\n }",
"function page_builder_settings() {\n\n\t\t$settings = parent::page_builder_settings();\n\n\t\treturn array_merge( $settings, array(\n\t\t\t'name' => __( 'News Ticker', 'publisher' ),\n\t\t\t\"id\" => $this->id,\n\t\t\t\"weight\" => 10,\n\t\t\t\"wrapper_height\" => 'full',\n\t\t\t'icon_url' => PUBLISHER_THEME_URI . 'images/better-newsticker.png',\n\n\t\t\t\"category\" => publisher_white_label_get_option( 'publisher' ),\n\t\t) );\n\t}",
"function page_builder_settings() {\n\n\t\t$settings = parent::page_builder_settings();\n\n\t\treturn array_merge( $settings, array(\n\t\t\t'name' => __( 'Dribbble Shots', 'publisher' ),\n\t\t\t\"id\" => $this->id,\n\t\t\t\"weight\" => 10,\n\t\t\t\"wrapper_height\" => 'full',\n\t\t\t\"category\" => publisher_white_label_get_option( 'publisher' ),\n\t\t\t'icon_url' => PUBLISHER_THEME_URI . 'images/shortcodes/bs-dribbble.png',\n\t\t) );\n\t}",
"public function saveSettings($namespace, Settings $settings);",
"function retrieveSettings()\n\t\t{\t\n\t\t\t$this->settings = array();\n\t\t\t// first retrieve the \"external\" settings\n\t\t\t$this->retrieveExternalSettings();\n\t\t\t// read the settings property\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS);\n\t\t\tif ($stream == false) {\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\t$stat = mapi_stream_stat($stream);\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\t$settings_string = '';\n\t\t\tfor($i=0;$i<$stat['cb'];$i+=1024){\n\t\t\t\t$settings_string .= mapi_stream_read($stream, 1024);\n\t\t\t}\n\t\t\t\n\t\t\t// suppress php notice in case unserializing fails\n\t\t\t$settings = @unserialize($settings_string);\n\n\t\t\tif (!$settings){ // backwards compatible with old saving method using XML\n\t\t\t\t$xml = new XMLParser();\n\t\t\t\t$settings = $xml->getData($settings_string);\n\t\t\t}\n\n\t\t\tif (is_array($settings) && isset($settings['settings']) && is_array($settings['settings'])){\n\t\t\t\t$this->settings = array_merge_recursive_overwrite($settings['settings'],$this->settings);\n\t\t\t}\n\t\t}",
"public function save_settings() {\n\n\t\twoocommerce_update_options( $this->get_settings() );\n\t}",
"public function settingsData() {\n\n $arraySettings = array (\n 'Generic Param' => $this->_genericParam\n );\n\n return $arraySettings;\n\n }",
"public function savePageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl, $ilSetting;\n\t\n\t\t$this->initPageEditorForm();\n\t\tif ($this->form->checkInput())\n\t\t{\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageContentGUI.php\");\n\t\t\t$buttons = ilPageContentGUI::_getCommonBBButtons();\n\t\t\tforeach ($buttons as $b => $t)\n\t\t\t{\n\t\t\t\tilPageEditorSettings::writeSetting($_GET[\"grp\"], \"active_\".$b,\n\t\t\t\t\t$this->form->getInput(\"active_\".$b));\n\t\t\t}\n\t\t\t\n\t\t\tif ($_GET[\"grp\"] == \"test\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_tst_page_edit\", (int) $_POST[\"tst_page_edit\"]);\n\t\t\t}\n\t\t\telseif ($_GET[\"grp\"] == \"rep\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_cat_page_edit\", (int) $_POST[\"cat_page_edit\"]);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendInfo($lng->txt(\"msg_obj_modified\"), true);\n\t\t}\n\t\t\n\t\t$ilCtrl->setParameter($this, \"grp\", $_GET[\"grp\"]);\n\t\t$ilCtrl->redirect($this, \"showPageEditorSettings\");\n\t}",
"public function settings_view()\n {\n $this->register_handler('plugin.settingsform', array($this, 'settings_form'));\n $this->register_handler('plugin.settingslist', array($this, 'settings_list'));\n $this->register_handler('plugin.factoradder', array($this, 'settings_factoradder'));\n $this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));\n\n $this->include_script('kolab2fa.js');\n $this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');\n\n if ($this->check_secure_mode()) {\n $this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);\n }\n\n $this->api->output->add_label('save','cancel');\n $this->api->output->set_pagetitle($this->gettext('settingstitle'));\n $this->api->output->send('kolab_2fa.config');\n }",
"public function settings()\n\t{\n\t\t$settings = array(\n\t\t\t'user_id' \t=> '',\n\t\t\t'private_key' \t=> '',\n\t\t\t'debug'\t=> array('r',\n\t\t\t\tarray(\n\t\t\t\t\t'y' => lang('yes'),\n\t\t\t\t\t'n' => lang('no')\n\t\t\t\t),\n\t\t\t\t'n'\n\t\t\t)\n\t\t);\n\n\t\treturn $settings;\n\t}"
] | [
"0.7427756",
"0.739885",
"0.7351334",
"0.73493344",
"0.7334695",
"0.732518",
"0.728044",
"0.72446024",
"0.72446024",
"0.72446024",
"0.72446024",
"0.72123367",
"0.7179148",
"0.7152195",
"0.710572",
"0.7090442",
"0.70717824",
"0.7045257",
"0.7038667",
"0.70242596",
"0.70217115",
"0.70046264",
"0.6989063",
"0.69467014",
"0.69341534",
"0.6912939",
"0.6907248",
"0.6902707",
"0.686713",
"0.68634653",
"0.68456286",
"0.68399507",
"0.68215346",
"0.6798469",
"0.674581",
"0.67395365",
"0.6737908",
"0.6723662",
"0.6708655",
"0.66929376",
"0.66928345",
"0.66779155",
"0.66717786",
"0.6667173",
"0.6665562",
"0.66623276",
"0.66408974",
"0.6630522",
"0.6622718",
"0.6596546",
"0.6585655",
"0.65432036",
"0.6535337",
"0.653461",
"0.6527014",
"0.6522746",
"0.65094876",
"0.6501062",
"0.64915806",
"0.6489657",
"0.6484652",
"0.64814955",
"0.64666575",
"0.64611226",
"0.6454281",
"0.6446565",
"0.6444147",
"0.6443494",
"0.64406985",
"0.64380926",
"0.6435801",
"0.6430977",
"0.6426424",
"0.6422449",
"0.64168483",
"0.6412803",
"0.640256",
"0.64005303",
"0.640006",
"0.6399811",
"0.6398932",
"0.6398121",
"0.6386921",
"0.6378048",
"0.6370919",
"0.6369298",
"0.63423145",
"0.6336521",
"0.63347334",
"0.63307786",
"0.63245213",
"0.632392",
"0.6305785",
"0.63046986",
"0.63046324",
"0.63017404",
"0.6301458",
"0.63011706",
"0.6292063",
"0.62888396",
"0.6285588"
] | 0.0 | -1 |
Filling the settings should merge it with attributes. | public function setSettingsAttribute($value)
{
if (is_array($value)) {
$this->attributes = array_merge($this->attributes, $value);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init_settings()\n {\n /** @noinspection PhpUndefinedClassInspection */\n parent::init_settings();\n\n $sharedOptions = get_option(SharedPersistor::OPTION_NAME, []) ?: [];\n $this->settings = array_merge($this->settings, $sharedOptions);\n }",
"public function initialize_settings() {\n\n\t\t$default_settings = array();\n\n\t\tforeach ($this->settings as $id => $setting) {\n\t\t\tif ($setting['type'] != 'heading')\n\t\t\t\t$default_settings['$id'] = $setting['std'];\n\t\t}\n\n\t\tupdate_option('eaboot_options', $default_settings);\n\t}",
"private function syncronize() {\n\t\t$existingsOptions = get_option( $this->getGatewayKey() );\n\n\t\t// Get the saved options in the object\n\t\t$options = $this->getSettings();\n\n\t\t// If options exists we need to merge them with the default ones\n\t\tif ( $existingsOptions ) {\n\t\t\tforeach ( $existingsOptions as $option ) {\n\t\t\t\tif ( isset( $options[ $option->getName() ] ) )\n\t\t\t\t\t$options[ $option->getName() ]->setValue( $option->getValue() );\n\t\t\t}\n\t\t}\n\n\t\t//$this->addSettings( $options );\n\t}",
"function initialize() {\r\n add_filter(\"slp_widget_default_options\", array($this, \"options\"));\r\n add_filter(\"slp_widget_get_settings\" , array($this, \"getSettings\"));\r\n\r\n $this->settings_array = apply_filters(\"slp_widget_default_options\", array());\r\n foreach ($this->settings_array as $setting => $setto) {\r\n $this->$setting = $setto;\r\n }\r\n }",
"protected function load_settings() {\n\t\t$this->settings = WP_United_Settings::Create();\n\t\t$this->init_style_keys();\n\t}",
"public function setSettingsAttribute( $settings ){\n\n \t$base = self::$base_settings;\n $result = array();\n\n \tforeach ($base as $key => $value) { //for each key in the base\n $result[$key] = $settings; //$base[$key]['value'];\n \t\tif ( isset($settings[$key]) ){\n \t\t\t$result[$key] = $settings[$key];\n \t\t}\n \t}\n\n \t\t$this->attributes['settings'] = json_encode($result);\n }",
"protected function adjustOptionsValues()\n {\n $this->init();\n $this->create();\n }",
"protected function loadSettings() {}",
"protected function loadSettings() {}",
"protected function loadSettings() {}",
"public function applyOptions(): void\n {\n if ($this->hasEndpoint()) {\n $this->withOptions(['endpoint' => $this->endpoint]);\n }\n\n $this->setProp('value', $this->attribute);\n $this->setProp('entities', $this->options(), false);\n }",
"protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }",
"protected function initConfiguration(){\n $settings = array(\n 'user' => 'bitshok',\n 'widget_id' => '355763562850942976',\n 'tweets_limit' => 3,\n 'follow_btn' => 'on'\n );\n Configuration::updateValue($this->name.'_settings', serialize($settings));\n }",
"public function initSettingsData()\n {\n $this->maximum_users_per_group = 5;\n $this->maximum_user_group_memberships = 3;\n $this->maximum_groups_own_per_user = 3;\n $this->maximum_points_group = 200;\n //$this->mail_group_invite_template = 'dma.friends::mail.invite'; \n $this->reset_groups_every_day = $this->days;\n $this->reset_groups_time = '00:00';\n }",
"public function init_settings()\n\t{\n\t\tregister_setting('jststm_testimonials_group', 'jststm_testimonials', function($input)\n\t\t{\n\t\t\tforeach($input as $i => $data)\n\t\t\t{\n\t\t\t\t$input[$i]['message'] = sanitize_text_field($data['message']);\n\t\t\t\t$input[$i]['author'] = sanitize_text_field($data['author']);\n\t\t\t}\n\n\t\t\treturn $input;\n\t\t});\n\t}",
"private function buildSettings()\n {\n $settings = [];\n foreach($this->settings as $key=>$setting)\n {\n $split = explode(': ', $setting);\n $option = $split[0];\n unset($split[0]);\n $value = implode($split);\n $settings[$option] = $value;\n }\n $this->settings = $settings;\n }",
"private function _getSettings()\n {\n $properties = $this->_class->getProperties();\n foreach ($properties as $property) {\n $prop = new Property($property);\n $prop->fillSettings($this->_reflect);\n }\n if (empty($this->_reflect->listField)) {\n $keys = array_keys($this->_reflect->fields);\n $this->_reflect->listField = array_shift($keys);\n }\n $this->_reflect->fieldNames = array_keys($this->_reflect->fields);\n }",
"protected function define_settings() {\n\n // All the settings related to this activity will include this prefix\n $settingprefix = $this->info->modulename . '_' . $this->info->moduleid . '_';\n\n // All these are common settings to be shared by all activities\n\n // Define activity_include (to decide if the whole task must be really executed)\n // Dependent of:\n // - activities root setting\n // - section_included setting (if exists)\n $settingname = $settingprefix . 'included';\n $activity_included = new restore_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);\n $activity_included->get_ui()->set_icon(new image_icon('icon', get_string('pluginname', $this->modulename),\n $this->modulename, array('class' => 'iconlarge icon-post')));\n $this->add_setting($activity_included);\n // Look for \"activities\" root setting\n $activities = $this->plan->get_setting('activities');\n $activities->add_dependency($activity_included);\n // Look for \"section_included\" section setting (if exists)\n $settingname = 'section_' . $this->info->sectionid . '_included';\n if ($this->plan->setting_exists($settingname)) {\n $section_included = $this->plan->get_setting($settingname);\n $section_included->add_dependency($activity_included);\n }\n\n // Define activity_userinfo. Dependent of:\n // - users root setting\n // - section_userinfo setting (if exists)\n // - activity_included setting.\n $settingname = $settingprefix . 'userinfo';\n $defaultvalue = false;\n if (isset($this->info->settings[$settingname]) && $this->info->settings[$settingname]) { // Only enabled when available\n $defaultvalue = true;\n }\n\n $activity_userinfo = new restore_activity_userinfo_setting($settingname, base_setting::IS_BOOLEAN, $defaultvalue);\n if (!$defaultvalue) {\n // This is a bit hacky, but if there is no user data to restore, then\n // we replace the standard check-box with a select menu with the\n // single choice 'No', and the select menu is clever enough that if\n // there is only one choice, it just displays a static string.\n //\n // It would probably be better design to have a special UI class\n // setting_ui_checkbox_or_no, rather than this hack, but I am not\n // going to do that today.\n $activity_userinfo->set_ui(new backup_setting_ui_select($activity_userinfo, '-',\n array(0 => get_string('no'))));\n } else {\n $activity_userinfo->get_ui()->set_label('-');\n }\n\n $this->add_setting($activity_userinfo);\n\n // Look for \"users\" root setting\n $users = $this->plan->get_setting('users');\n $users->add_dependency($activity_userinfo);\n\n // Look for \"section_userinfo\" section setting (if exists)\n $settingname = 'section_' . $this->info->sectionid . '_userinfo';\n if ($this->plan->setting_exists($settingname)) {\n $section_userinfo = $this->plan->get_setting($settingname);\n $section_userinfo->add_dependency($activity_userinfo);\n }\n\n // Look for \"activity_included\" setting.\n $activity_included->add_dependency($activity_userinfo);\n\n // End of common activity settings, let's add the particular ones.\n $this->define_my_settings();\n }",
"function wassupoptions() {\n\t\t//# initialize class variables with current options \n\t\t//# or with defaults if none\n\t\t$this->loadSettings();\n\t}",
"private function updateVars(){\n // get configuration\n global $configuration;\n // if configuration file exists && class-settings\n if($configuration && array_key_exists('WPimgAttr', $configuration)):\n // class configuration\n $myConfig = $configuration['WPimgAttr'];\n // update vars\n $this->WPimgAttr_Alt_content = array_key_exists('Alt_content', $myConfig) ? $myConfig['Alt_content'] : $this->WPimgAttr_Alt_content;\n $this->WPimgAttr_Alt_attachment = array_key_exists('Alt_attachment', $myConfig) ? $myConfig['Alt_attachment'] : $this->WPimgAttr_Alt_attachment;\n $this->WPimgAttr_Alt_shortcode = array_key_exists('Alt_shortcode', $myConfig) ? $myConfig['Alt_shortcode'] : $this->WPimgAttr_Alt_shortcode;\n SELF::$WPimgAttr_Alt_languages = array_key_exists('Alt_languages', $myConfig) ? $myConfig['Alt_languages'] : SELF::$WPimgAttr_Alt_languages;\n endif;\n }",
"public function load_settings_values() {\n\t\t\tparent::load_settings_values();\n\n\t\t\tif ( false === $this->setting_option_values ) {\n\t\t\t\t$this->setting_option_values = array();\n\n\t\t\t\t// On the initial if we don't have saved values we grab them from the Custom Labels.\n\t\t\t\t$custom_label_settings = get_option( 'learndash_custom_label_settings', array() );\n\n\t\t\t\tif ( ( isset( $custom_label_settings['courses'] ) ) && ( ! empty( $custom_label_settings['courses'] ) ) ) {\n\t\t\t\t\t$this->setting_option_values['courses'] = learndash_get_custom_label_slug( 'courses' );\n\t\t\t\t}\n\n\t\t\t\tif ( ( isset( $custom_label_settings['lessons'] ) ) && ( ! empty( $custom_label_settings['lessons'] ) ) ) {\n\t\t\t\t\t$this->setting_option_values['lessons'] = learndash_get_custom_label_slug( 'lessons' );\n\t\t\t\t}\n\n\t\t\t\tif ( ( isset( $custom_label_settings['topic'] ) ) && ( ! empty( $custom_label_settings['topic'] ) ) ) {\n\t\t\t\t\t$this->setting_option_values['topics'] = learndash_get_custom_label_slug( 'topic' );\n\t\t\t\t}\n\n\t\t\t\tif ( ( isset( $custom_label_settings['quizzes'] ) ) && ( ! empty( $custom_label_settings['quizzes'] ) ) ) {\n\t\t\t\t\t$this->setting_option_values['quizzes'] = learndash_get_custom_label_slug( 'quizzes' );\n\t\t\t\t}\n\n\t\t\t\t// As we don't have existing values we want to save here and force the flush rewrite.\n\t\t\t\tupdate_option( $this->settings_section_key, $this->setting_option_values );\n\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t}\n\n\t\t\t$this->setting_option_values = wp_parse_args(\n\t\t\t\t$this->setting_option_values,\n\t\t\t\tarray(\n\t\t\t\t\t'courses' => 'courses',\n\t\t\t\t\t'lessons' => 'lessons',\n\t\t\t\t\t'topics' => 'topic',\n\t\t\t\t\t'quizzes' => 'quizzes',\n\t\t\t\t)\n\t\t\t);\n\t\t}",
"protected function updateSettings()\n {\n $this->settings = array();\n $raw_settings = $this->db->fetchAll('SELECT name, value FROM settings');\n\n foreach ($raw_settings as $raw_setting) {\n $this->settings[$raw_setting['name']] = $raw_setting['value'];\n }\n }",
"private function syncronize() {\n\t\t$existingsOptions = get_option( $this->getMaillistKey() );\n\t\t\n\t\t// Get the saved options in the object\n\t\t$options = $this->getSettings();\n\t\t\n\t\t// If options exists we need to merge them with the default ones\n\t\tif ( $existingsOptions ){\n\t\t\tforeach ( $existingsOptions as $option ){\n\t\t\t\t$options[ $option->getName() ]->setValue( $option->getValue() );\n\t\t\t}\n\t\t}\n\t\t\t\n\t}",
"public function setup_settings() {\n\t\t$this->init_sections();\n\t\t$this->init_fields();\n\t\t$this->settings_fields();\n\t}",
"private function load_settings() {\n\t\t\n\t}",
"private function reduceSettings() {\r\n foreach ($this->settings_array as $setting => $setto) {\r\n $this->settings_array[$setting] = $this->$setting;\r\n }\r\n }",
"public function initSettings()\n {\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_key');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_secret');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_path');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_expires');\n }",
"private function setDefaults()\n {\n $defaults = config('sevDeskApi.defaults.'.lcfirst($this->objectName));\n\n foreach($defaults as $attribute => $defaultValue)\n {\n if (!isset($this->$attribute))\n $this->$attribute = $defaultValue;\n }\n }",
"protected function applyCustomSettings()\n {\n $this->disable(array('read_counter', 'edit_counter', 'deleted_at', 'version', 'creator_user_id', 'created_at'));\n \n $this['updated_at']->setMetaWidgetClassName('ullMetaWidgetDate');\n \n //configure subject\n $this['subject']\n ->setLabel('Subject')\n ->setWidgetAttribute('size', 50)\n ->setMetaWidgetClassName('ullMetaWidgetLink');\n \n //configure body\n $this['body']\n ->setMetaWidgetClassName('ullMetaWidgetFCKEditor')\n ->setLabel('Text');\n \n // configure access level\n $this['ull_wiki_access_level_id']->setLabel(__('Access level', null, 'ullWikiMessages'));\n \n $this['is_outdated']->setLabel(__('Is outdated', null, 'ullWikiMessages'));\n \n // configure tags\n $this['duplicate_tags_for_search']\n ->setLabel('Tags')\n ->setMetaWidgetClassName('ullMetaWidgetTaggable');\n \n if ($this->isCreateOrEditAction())\n {\n $this->disable(array('id', 'updator_user_id', 'updated_at'));\n } \n\n if ($this->isListAction())\n {\n $this->disableAllExcept(array('id', 'subject'));\n $this->enable(array('updator_user_id', 'updated_at'));\n } \n }",
"public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}",
"public function loadSettings()\n {\n $this->loadJSON($this->settings);\n }",
"private function setFormAttributesByConfig() {\n if ($this->config instanceof \\Fewlines\\Core\\Xml\\Tree\\Element) {\n foreach ($this->config->getAttributes() as $name => $content) {\n switch (strtolower($name)) {\n case 'name':\n $this->setName($content);\n break;\n\n case 'method':\n $this->setMethod($content);\n break;\n\n case 'target':\n $this->setTarget($content);\n break;\n\n case 'accept-charset':\n $this->setAcceptCharset($content);\n break;\n\n case 'novalidate':\n $this->setNoValidate($content);\n break;\n\n case 'autocomplete':\n $this->setAutoComplete($content);\n break;\n\n case 'action':\n $this->setAction($content);\n break;\n\n case 'enctype':\n $this->setEncType($content);\n break;\n\n default:\n $this->addAttribute($name, $content);\n break;\n }\n }\n }\n }",
"function build_settings_and_styles() {\n\t\t\tif ($this->settings === null) {\n\t\t\t\t////////////////////////\n\t\t\t\t// Build Controls\n\t\t\t\t////////////////////////\n\t\t\t\t$this->settings = apply_filters('themify_customizer_settings', array());\n\n\t\t\t\t////////////////////////\n\t\t\t\t// Rest/Import/Export Buttons\n\t\t\t\t////////////////////////\n\t\t\t\t$this->settings['tools'] = array(\n\t\t\t\t\t'control' => array(\n\t\t\t\t\t\t'type' => 'Themify_Tools_Control',\n\t\t\t\t\t\t'label' => __('Tools', 'themify'),\n\t\t\t\t\t),\n\t\t\t\t\t'selector' => 'tools',\n\t\t\t\t\t'prop' => 'tools',\n\t\t\t\t);\n\n\t\t\t\t////////////////////////\n\t\t\t\t// Build CSS Styling\n\t\t\t\t////////////////////////\n\t\t\t\tforeach ($this->settings as $key => $setting) {\n\t\t\t\t\tif (isset($setting['selector'])) {\n\t\t\t\t\t\t$this->styles[$setting['selector']][] = array(\n\t\t\t\t\t\t\t'prop' => isset($setting['prop']) ? $setting['prop'] : '',\n\t\t\t\t\t\t\t'key' => isset($key) ? $key : '',\n\t\t\t\t\t\t\t'prefix' => isset($setting['prefix']) ? $setting['prefix'] : '',\n\t\t\t\t\t\t\t'global' => isset( $setting['global'] ) ? $setting['global'] : false,\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}",
"protected function assignExtensionSettings() {}",
"protected function assignSettings()\n {\n $this->view->assign('settings', $this->settings);\n }",
"private function load_site_settings() {\n\t\t\n\t\t$this->helper->load_editor_settings();\n\t\t$this->settings = array_merge($this->settings,$this->EE->session->cache['eeck']['eeck_settings']);\n\t}",
"public function __construct() {\n $CI = & get_instance();\n $results = $CI->db->get('Settings')->result();\n\n foreach ($results as $setting) {\n\n $CI->config->set_item($setting->SettingName, $setting->SettingValue);\n }\n\n $results = $CI->db->get('Schools')->result();\n $schoolIdsValue = array();\n $schoolsInfo = array();\n\n $masterSchoolId = 1;\n\n foreach ($results as $school) {\n array_push($schoolIdsValue, $school->SchoolId);\n\n if ($school->IsMaster == 1) {\n $masterSchoolId = $school->SchoolId;\n }\n \n $schoolsInfo[$school->SchoolId] = $school;\n }\n\n $CI->config->set_item(\"school_ids\", $schoolIdsValue);\n $CI->config->set_item(\"school_metas\", $schoolsInfo);\n $CI->config->set_item(\"master_school_id\", $masterSchoolId);\n }",
"public function init_settings() {\n // Load form_field settings\n $this->settings = get_option($this->plugin_id . $this->id . '_settings', null);\n\n if (!$this->settings || !is_array($this->settings)) {\n\n $this->settings = array();\n\n // If there are no settings defined, load defaults\n if ($form_fields = $this->get_form_fields())\n foreach ($form_fields as $k => $v)\n $this->settings[$k] = isset($v['default']) ? $v['default'] : '';\n }\n\n if ($this->settings && is_array($this->settings)) {\n $this->settings = array_map(array($this, 'format_settings'), $this->settings);\n $this->enabled = isset($this->settings['enabled']) && $this->settings['enabled'] == 'yes' ? 'yes' : 'no';\n }\n }",
"static public function save_setup_settings() {\n\n $data = WPP_F::parse_str( $_REQUEST[ 'data' ] );\n\n $_setup = array(\n 'api' => WPP_API_URL_STANDARDS,\n 'data' => $data,\n 'schema' => self::get_settings_schema()\n );\n\n $_current_settings = get_option('wpp_settings');\n\n $_modified_settings = WPP_F::extend( $_current_settings, $_setup['schema'] );\n\n //die( '<pre>' . print_r( $_modified_settings['field_alias'], true ) . '</pre>' );\n\n if( is_array( $_modified_settings['property_stats_groups'] ) ) {\n // $_modified_settings['property_stats_groups'] = array_unique( $_modified_settings['property_stats_groups'] );\n }\n\n // @note This kills c.rabbit.ci response via Varnish, perhaps some sort of log output somewhere.\n if( is_array( $_modified_settings['searchable_attributes'] ) ) {\n // $_modified_settings[ 'searchable_attributes' ] = array_unique( $_modified_settings[ 'searchable_attributes' ] );\n }\n\n // preserve field aliases\n $_modified_settings['field_alias'] = $_current_settings['field_alias'];\n\n $_modified_settings['_updated'] = time();\n\n update_option( 'wpp_settings', $_modified_settings );\n\n $posts_array = get_posts( array(\n 'posts_per_page' => 1,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'post_type' => 'property',\n 'post_status' => 'publish',\n 'suppress_filters' => true\n ) );\n\n $return[ 'props_single' ] = get_permalink( $posts_array[ 0 ]->ID );\n\n $return[ '_settings' ] = $data[ 'wpp_settings' ];\n\n self::flush_cache();\n\n wp_send_json( $return );\n\n }",
"public function loadConfigs()\n {\n self::$country_configs = self::getCountryConfigs();\n $configs = new parent();\n self::$categories = $configs->getCategories();\n self::$site_data = self::get_site_data();\n self::$payments_name = self::setPaymentGateway();\n }",
"public function load_settings_values() {\n\t\t\tparent::load_settings_values();\n\n\t\t\t// If the settings set as a whole is empty then we set a default.\n\t\t\tif ( empty( $this->setting_option_values ) ) {\n\t\t\t\t// If the settings set as a whole is empty then we set a default.\n\t\t\t\tif ( false === $this->setting_option_values ) {\n\t\t\t\t\t$this->transition_deprecated_settings();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! isset( $this->setting_option_values['admin_mail_from_name'] ) ) {\n\t\t\t\t$this->setting_option_values['admin_mail_from_name'] = '';\n\t\t\t}\n\n\t\t\tif ( ! isset( $this->setting_option_values['admin_mail_from_email'] ) ) {\n\t\t\t\t$this->setting_option_values['admin_mail_from_email'] = '';\n\t\t\t}\n\n\t\t\tif ( ! isset( $this->setting_option_values['admin_mail_to'] ) ) {\n\t\t\t\t$this->setting_option_values['admin_mail_to'] = '';\n\t\t\t}\n\n\t\t\tif ( ! isset( $this->setting_option_values['admin_mail_subject'] ) ) {\n\t\t\t\t$this->setting_option_values['admin_mail_subject'] = '';\n\t\t\t}\n\n\t\t\tif ( ! isset( $this->setting_option_values['admin_mail_message'] ) ) {\n\t\t\t\t$this->setting_option_values['admin_mail_message'] = '';\n\t\t\t}\n\n\t\t\tif ( ! isset( $this->setting_option_values['admin_mail_html'] ) ) {\n\t\t\t\t$this->setting_option_values['admin_mail_html'] = '';\n\t\t\t}\n\t\t}",
"public static function setAttributes()\n {\n\n self::$urls = config('user.client.urls');\n\n self::$search = config('user.client.search');\n\n self::$orderBy = config('user.client.order');\n\n self::$groups = config('user.client.groups');\n\n self::$list = config('user.client.list');\n\n self::$fields = config('user.client.form');\n\n return new static();\n }",
"abstract protected function loadSettings();",
"protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = 'procuralog';\n\t}",
"public function applyDefaultData()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $config = $objectManager->get('\\Magento\\Framework\\App\\Config\\ScopeConfigInterface');\n\n $this->setsup_is_active(1);\n $this->setsup_locale($config->getValue('general/locale/code'));\n $this->setsup_currency($config->getValue('currency/options/base'));\n $this->setsup_country($config->getValue('general/country/default'));\n\n return $this;\n }",
"public function load_with_defaults ()\n {\n parent::load_with_defaults ();\n $this->set_value ('publication_state', History_item_silent);\n $this->set_value ('email_visibility', User_email_scrambled);\n\n $this->set_required ('password1', true);\n $this->set_required ('password2', true);\n\n $icon_url = read_var ('icon_url');\n if ($icon_url)\n {\n $this->set_value ('icon_url', $icon_url);\n }\n }",
"public function configure_merchant_settings() {\n\t\t$this->title = $this->get_option( 'title' );\n\t\t$this->enabled = $this->get_option( 'enabled' );\n\t\t$this->payment_action = $this->get_option( 'payment_action' );\n\t\t$this->txn_descriptor = $this->get_option( 'txn_descriptor' );\n\t\t$this->allow_card_saving = $this->get_option( 'allow_card_saving' ) === 'yes';\n\n\t\tforeach ( $this->get_gateway_form_fields() as $key => $options ) {\n\t\t\tif ( ! property_exists( $this, $key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$value = $this->get_option( $key );\n\n\t\t\tif ( 'checkbox' === $options['type'] ) {\n\t\t\t\t$value = 'yes' === $value;\n\t\t\t}\n\n\t\t\t$this->{$key} = $value;\n\t\t}\n\t}",
"public function __construct($settings) {\n $this->settings = array_merge($this->settings, $settings);\n }",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"public function prepareBaseAssignation()\n {\n /** @var KernelInterface $kernel */\n $kernel = $this->get('kernel');\n $this->assignation = [\n 'head' => [\n 'ajax' => $this->getRequest()->isXmlHttpRequest(),\n 'devMode' => $kernel->isDebug(),\n 'maintenanceMode' => (bool) $this->getSettingsBag()->get('maintenance_mode'),\n 'universalAnalyticsId' => $this->getSettingsBag()->get('universal_analytics_id'),\n 'googleTagManagerId' => $this->getSettingsBag()->get('google_tag_manager_id'),\n 'baseUrl' => $this->getRequest()->getSchemeAndHttpHost() . $this->getRequest()->getBasePath(),\n ]\n ];\n\n return $this;\n }",
"public function load() {\n\t\t$statement = $this -> db -> query(\"SELECT * FROM \" . FORUM_DB . \".forum_settings\");\n\t\twhile($settingData = $statement -> fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$this -> settings[$settingData['key']] = new ForumSetting($settingData['key'], $settingData['value']);\n\t\t}\n\t}",
"public function setConfiguration(){\n\t\t/* Check the attributes type supported by system */\n\t\t/* debugVar(unserialize(LEAD_ATTRIBUTE_INPUT_ELEMENT), true); */\n\t\t\n\t\t/* Check the attributes validation type supported by system */\n\t\t/* debugVar(unserialize(LEAD_ATTRIBUTE_INPUT_VALIDATION), true); */\n\t\t\n\t\t/* Creating form object */\n\t\t$objForm\t= new Form();\n\t\t\t\t\t\n\t\t/* variable initialization */\n\t\t$strConfigArr[\"exiting_attr\"]\t= array(\"policy\" => array('attri_value_list'=>$objForm->getDropDown(getArrByKeyvaluePairs($this->_setPolicyList(),\"id\",\"name\"),'',false,false)));\n\t\t\n\t\t/* if parent schema is passed then do needful */\n\t\tif(isset($this->_strDataSet[\"table\"]) && ($this->_strDataSet[\"table\"] != \"\")){\n\t\t\t/* Custom Query */\n\t\t\t$strConfigArr[\"customQuery\"]\t= array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"table\"=>$this->_strDataSet[\"table\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"column\"=>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"where\"=>array(),\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\t/* removed used variables */\n\t\tunset($objForm);\n\t\t\n\t\t/* return configuration set */\n\t\treturn $strConfigArr;\n\t\t\n\t}",
"protected function mergeflexFormValuesIntoConf() {}",
"public function settings()\n {\n }",
"public function init() {\n register_setting( $this->key, $this->key );\n }",
"public function setupOptions() {\n $this->data = array('' => '') + $this->data;\n\n if (!isset($this->htmlOptions['class'])) {\n $this->htmlOptions['class'] = '';\n }\n\n // Include the base css if required\n if ($this->includeBaseCss) {\n\n if (stripos($this->htmlOptions['class'], 'yii-selectize') === false) {\n $this->htmlOptions['class'] .= ' yii-selectize';\n }\n\n // Add the full width class if fullWidth option is set to true\n if ($this->fullWidth && stripos($this->htmlOptions['class'], 'full-width') === false) {\n $this->htmlOptions['class'] .= ' full-width';\n }\n } else if ($this->fullWidth) { // if full with is required but the base css is not included\n if (!isset($this->htmlOptions['style'])) {\n $this->htmlOptions['style'] = '';\n }\n\n // we add the style attribute\n if (stripos($this->htmlOptions['style'], 'width:') === false) {\n $this->htmlOptions['style'] .= ' width: 100%;';\n }\n }\n\n // If the placeholder property is set we'll overwrite the htmlOptions attribute\n if (!empty($this->placeholder)) {\n $this->htmlOptions['placeholder'] = $this->placeholder;\n }\n\n // If the multiple property is set we'll overwrite the htmlOptions attribute\n if (!empty($this->multiple)) {\n $this->htmlOptions['multiple'] = $this->multiple;\n }\n\n // Set the selected attributed to the given options\n if (!empty($this->selectedValues)) {\n foreach ($this->selectedValues as $valueId) {\n $this->htmlOptions['options'][$valueId]['selected'] = true;\n }\n }\n\n }",
"private function setSettings() {\n $this ->setAccessToken( $this ->token );\n $this ->setAccountId( self::ACCOUNT_ID );\n }",
"function achilles_settings_init() {\n\t\n\t//create one option to store all of our values. \n register_setting( 'achilles-settings-group', 'achilles-settings' );\n add_settings_section( 'achilles-general-settings', 'General Settings', 'achilles_general_settings_callback', 'achilles' );\n add_settings_field('resident-portal', 'Resident Portal URL', 'resident_portal_url_callback', 'achilles', 'achilles-general-settings');\n add_settings_field('facebook-url', 'Facebook URL', 'facebook_url_callback', 'achilles', 'achilles-general-settings' );\n add_settings_field('google-analytics-id', 'Google Analytics ID', 'google_analytics_id_callback', 'achilles', 'achilles-general-settings');\n\t\n}",
"public function setAttributes();",
"private function getSettings()\n\t\t{\n\t\t\tforeach($this->settings as $key => $val) {\n\t\t\t\t$this->settings[$key] = !empty(get_option($this->tag.$key)) ? get_option($this->tag.$key) : '';\n\t\t\t}\n\t\t}",
"abstract protected function define_my_settings();",
"protected function mergeTranslationsWithAttributes()\n\t{\n\t\t$this->attributes = array_merge($this->attributes, $this->translatedAttributes);\n\t}",
"public function init() {\r\n\t\tregister_setting( $this->key, $this->key );\r\n\t}",
"protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"assignments\";\n\t}",
"public function settings_fields() {\n\t\t$this->create_sections();\n\t\t$this->create_fields();\n\t\tregister_setting( $this->token, $this->token, array( $this, 'validate_fields' ) );\n\t}",
"private function mergeDefaultSettings(){\n\t\t//Get a copy of the default configuration.\n\t\t$defaultConfig = $this->getDefaultConfig();\n\t\t//Check for a 'general' section\n\t\tif(array_key_exists('general', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing values\n\t\t\t$missingGeneral = array_diff_key($defaultConfig['general'], $this->configuration['general']);\n\t\t\t//Iterate through the missing values and attach them to the running configuration.\n\t\t\tif(count($missingGeneral) > 0){\n\t\t\t\tforeach($missingGeneral as $key=>$parameter){\n\t\t\t\t\t$this->configuration['general'][$key] = $parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//Section doesn't exist, so we need to set it to the defaults.\n\t\t\t$this->configuration['general'] = $defaultConfig['general'];\n\t\t}\n\t\t//Check for a 'options' section\n\t\tif(array_key_exists('options', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing values\n\t\t\t$missingOptions = array_diff_key($defaultConfig['options'], $this->configuration['options']);\n\t\t\t//Iterate through the missing values and attach them to the running configuration.\n\t\t\tif(count($missionOptions) > 0){\n\t\t\t\tforeach($missingOptions as $key=>$parameter){\n\t\t\t\t\t$this->configuration['options'][$key] = $parameter;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//Section doesn't exist, so we need to set it to the defaults.\n\t\t\t$this->configuration['options'] = $defaultConfig['options'];\n\t\t}\n\t}",
"private function initialize() {\n $CI = get_instance();\n $CI->config->load('dwootemplate', TRUE);\n $config = $CI->config->item('dwootemplate');\n foreach ($config as $key => $val) {\n $this->$key = $val;\n }\n }",
"private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }",
"public function loadSettings()\n {\n // old Alfred v4 settings\n $settings = \\Alfred\\getVariables(self::$settingsArgs);\n\n\n if (\\Alfred\\getAlfredVersion() >= 5) {\n $new_settings = \\Alfred\\getVariables(self::$settingsArgsV5);\n\n if (!empty($settings['language']) && $settings['language'] !== 'en_EN' && $new_settings['language'] !== 'en_EN') {\n $settings['language'] = $new_settings['language'];\n }\n if (empty($settings['language'])) {\n $settings['language'] = $new_settings['language'];\n }\n if (!empty($new_settings['timezone']) && $new_settings['timezone'] !== 'none') {\n $settings['time_zone'] = $new_settings['timezone'];\n }\n if (!empty($new_settings['base_currencies'])) {\n $settings['base_currency'] = str_replace(' ', '', $new_settings['base_currencies']);\n $settings['base_currency'] = explode(',', $settings['base_currency']);\n }\n if (!empty($new_settings['apikey_fixer'])) {\n $settings['fixer_apikey'] = $new_settings['apikey_fixer'];\n }\n if (!empty($new_settings['apikey_coinmarket'])) {\n $settings['coinmarket_apikey'] = $new_settings['apikey_coinmarket'];\n }\n if (!empty($new_settings['crypto_decimals'])) {\n $settings['crypto_decimals'] = $new_settings['crypto_decimals'];\n }\n if (!empty($new_settings['vat_value'])) {\n $settings['vat_percentage'] = $new_settings['vat_value'];\n }\n if (!empty($new_settings['pixels_base'])) {\n $settings['base_pixels'] = $new_settings['pixels_base'];\n }\n if (\n !empty($new_settings['date_format']) && $new_settings['date_format'] !== 'j F, Y, g:i:s a' ||\n empty($settings['time_format'])\n ) {\n $settings['time_format'] = $new_settings['date_format'];\n if (is_string($settings['time_format'])) {\n $settings['time_format'] = explode('|', $new_settings['date_format']);\n }\n }\n if (!empty($new_settings['number_output_format'])) {\n $settings['number_output_format'] = $new_settings['number_output_format'];\n }\n if (!empty($new_settings['currency_decimals'])) {\n $settings['currency_decimals'] = $new_settings['currency_decimals'];\n }\n }\n\n return $settings;\n }",
"public function init()\n {\n register_setting($this->key, $this->key);\n }",
"public function init_settings() {\n\t\tparent::init_settings();\n\t\t$this->enabled = ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'] ? 'yes' : 'no';\n\t}",
"protected function collect_attributes() {\n\t\tforeach ( $this->properties as $key => $val ) {\n\t\t\tif ( in_array($key, self::$global_attributes) || in_array($key, static::$element_attributes) ) {\n\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// also check for compound attributes, such as data-src, aria-required, etc.\n\t\t\tforeach ( self::$global_attribute_pattern_prefixes as $prefix ) {\n\t\t\t\tif ( preg_match( '/'. $prefix .'[-]\\w+/', $key ) ) {\n\t\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function load()\n {\n if ($this->_is_setting_loaded) {\n return $this;\n }\n $this->_settings = (array) get_option('woocommerce_wc-waafipay_settings', array());\n $this->_is_setting_loaded = true;\n return $this;\n }",
"function setCommonInfo()\n\t{\n\t\t$this->configobj = new configclass();\t\t\n\t\t\n\t}",
"public function init_form_fields() {\n\t\t$this->form_fields = include( 'data/data-settings.php' );\n\t}",
"public function settings()\n {\n // Process any module settings you asked for.\n $apiKey = $this->getSanitizer()->getString('apiKey');\n $owmApiKey = $this->getSanitizer()->getString('owmApiKey');\n $owmIsPaidPlan = $this->getSanitizer()->getCheckbox('owmIsPaidPlan');\n $cachePeriod = $this->getSanitizer()->getInt('cachePeriod', 1440);\n\n if ($this->module->enabled != 0) {\n if ($apiKey == '' && $owmApiKey == '')\n throw new InvalidArgumentException(__('Missing API Key'), 'apiKey');\n\n if ($cachePeriod <= 0)\n throw new InvalidArgumentException(__('Cache period must be a positive number'), 'cachePeriod');\n }\n\n $this->module->settings['apiKey'] = $apiKey;\n $this->module->settings['owmApiKey'] = $owmApiKey;\n $this->module->settings['owmIsPaidPlan'] = $owmIsPaidPlan;\n $this->module->settings['cachePeriod'] = $cachePeriod;\n }",
"public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}",
"public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}",
"public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}",
"protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }",
"public function _fill($attributes)\n \t{\n \t\tforeach($attributes as $key => $value) {\n \t\t\t$this->$key = $value;\n \t\t}\n\n \t\treturn $this;\n \t}",
"protected function setAttributes()\n {\n if (in_array('attributes', $this->with)) {\n $this->result[$this->attribute]['attributes'] = Arr::get($this->field, 'attributes');\n }\n\n\n return $this;\n }",
"public function run()\n {\n\n Model::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('settings')->truncate();\n\n\n\n $setting = $this->findSetting('site.title');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.title'),\n 'value' => __('voyager::seeders.settings.site.title'),\n 'details' => '',\n 'type' => 'text',\n 'order' => 1,\n 'group' => 'Site',\n ])->save();\n }\n\n $setting = $this->findSetting('site.description');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.description'),\n 'value' => __('voyager::seeders.settings.site.description'),\n 'details' => '',\n 'type' => 'text',\n 'order' => 2,\n 'group' => 'Site',\n ])->save();\n }\n\n $setting = $this->findSetting('site.logo');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.logo'),\n 'value' => '',\n 'details' => '',\n 'type' => 'image',\n 'order' => 3,\n 'group' => 'Site',\n ])->save();\n }\n\n $setting = $this->findSetting('site.google_analytics_tracking_id');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.site.google_analytics_tracking_id'),\n 'value' => '',\n 'details' => '',\n 'type' => 'text',\n 'order' => 4,\n 'group' => 'Site',\n ])->save();\n }\n\n\n\n\n\n\n $setting = $this->findSetting('admin.bg_image');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.background_image'),\n 'value' => 'settings\\admin\\bg.png',\n 'details' => '',\n 'type' => 'image',\n 'order' => 5,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.title');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.title'),\n 'value' => 'Тестовое задание',\n 'details' => '',\n 'type' => 'text',\n 'order' => 1,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.description');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.description'),\n 'value' => \"Тестовое задание доступ к панели управления\",\n 'details' => '',\n 'type' => 'text',\n 'order' => 2,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.loader');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.loader'),\n 'value' => 'settings\\admin\\loader.png',\n 'details' => '',\n 'type' => 'image',\n 'order' => 3,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.icon_image');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.icon_image'),\n 'value' => 'settings\\admin\\logo.png',\n 'details' => '',\n 'type' => 'image',\n 'order' => 4,\n 'group' => 'Admin',\n ])->save();\n }\n\n $setting = $this->findSetting('admin.google_analytics_client_id');\n if (!$setting->exists) {\n $setting->fill([\n 'display_name' => __('voyager::seeders.settings.admin.google_analytics_client_id'),\n 'value' => '',\n 'details' => '',\n 'type' => 'text',\n 'order' => 1,\n 'group' => 'Admin',\n ])->save();\n }\n }",
"public function __construct()\n {\n parent::__construct();\n $this->initSettings();\n }",
"public function setSettings() {\n $args = array(\n array(\n 'option_group' => 'pm_plugin_settings',\n 'option_name' => 'pm_plugin',\n 'callback' => array($this->callbacks_mgr, 'checkboxSanitize'),\n )\n );\n $this->settings->setSettings($args);\n }",
"function wpec_gd_settings_init(){\n\n register_setting( 'social_settings', 'social_settings', 'wpec_validate_options' );\n add_settings_section( 'facebook_section', 'Social Media Configuration', 'social_media_section_text', 'wpec_gd_options' );\n add_settings_field( 'facebook_api_key', 'Facebook Application API ID:', 'facebook_api_id', 'wpec_gd_options', 'facebook_section' );\n add_settings_field( 'facebook_app_secret', 'Faceook Application Secret:', 'facebook_app_secret', 'wpec_gd_options', 'facebook_section' );\n\n\t\n //Register Settings for each email. Arrays of Subject and Body\n register_setting( 'wpec_gd_main_options', 'wpec_gd_options_array', 'wpec_validate_options' );\n register_setting( 'wpec_gd_emails', 'site_owner_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'site_owner_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'site_owner_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_new_deal', 'wpec_validate_emails' );\n\n add_settings_section( 'main_section', __( 'Main Settings', 'wpec-group-deals' ), 'wpec_options_intro_text', 'wpec_gd_options' );\n add_settings_section( 'email_templates', __( 'Email Templates', 'wpec-group-deals' ), 'wpec_options_email_intro_text', 'wpec_gd_options' );\n \n add_settings_field( 'gd_api_id', __( 'Group Deals API ID', 'wpec-group-deals' ), 'gd_api_id', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_referral_credit', __( 'Referral Credit', 'wpec-group-deals' ), 'gd_referral_credit', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_logo_upload', __( 'Logo Upload', 'wpec-group-deals' ), 'gd_logo_upload', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_width', __( 'Group Deal Image Width', 'wpec-group-deals' ), 'wpec_options_img_width', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_height', __( 'Group Deal Image Height', 'wpec-group-deals' ), 'wpec_options_img_height', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_crop', __( 'Crop Images?', 'wpec-group-deals' ), 'wpec_options_crop_img', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_paypal_email', __( 'Paypal Email:', 'wpec-group-deals' ), 'wpec_paypal_email', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_default_location', __( 'Default Location:', 'wpec-group-deals' ), 'wpec_default_location', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_default_page', __( 'What page should be used for the Group Deals landing page? NOTE: If you do not have multiple locations to choose from, the popup will not show. Going to the home page will show the featured deal you have created. :', 'wpec-group-deals' ), 'wpec_default_page', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_location_threshold', __( 'When determining a user\\'s location, how wide of a radius should the GeoIP system allow for nearby locations?', 'wpec-group-deals' ), 'wpec_location_threshold', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_mobile_theme', __( 'Mobile Theme?', 'wpec-group-deals' ), 'gd_mobile_theme', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_site_owner_tipped_subject', __( 'Site Owner - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_tipped_body', __( 'Site Owner - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_site_owner_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_untipped_subject', __( 'Site Owner - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_untipped_body', __( 'Site Owner - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_site_owner_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_expired_subject', __( 'Site Owner - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_expired_body', __( 'Site Owner - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_site_owner_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_tipped_subject', __( 'Business Owner - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_tipped_body', __( 'Business Owner - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_business_owner_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_untipped_subject', __( 'Business Owner - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_untipped_body', __( 'Business Owner - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_business_owner_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_expired_subject', __( 'Business Owner - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_expired_body', __( 'Business Owner - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_business_owner_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_tipped_subject', __( 'Deal Purchaser - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_tipped_body', __( 'Deal Purchaser - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_untipped_subject', __( 'Deal Purchaser - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_untipped_body', __( 'Deal Purchaser - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_expired_subject', __( 'Deal Purchaser - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_expired_body', __( 'Deal Purchaser - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_new_deal_subject', __( 'Deal Purchaser - New Deal {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_new_deal_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_new_deal_body', __( 'Deal Purchaser - New Deal {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_new_deal_body', 'wpec_gd_options', 'email_templates' );\n \n }",
"public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}",
"function create_object_settings() {\n if (!isset($this->settings)) {\n require_once($this->addon->dir . 'include/class.widget.settings.php');\n $this->settings = new SLPWidget_Legacy_Settings( array( 'addon' => $this->addon ) );\n }\n }",
"function get_settings() {\n\n $defaults = [\n 'general' => [\n 'label' => __( 'General', 'fwp' ),\n 'fields' => [\n 'license_key' => [\n 'label' => __( 'License Key', 'fwp' ),\n 'html' => $this->get_field_html( 'license_key' )\n ],\n 'gmaps_api_key' => [\n 'label' => __( 'Google Maps API Key', 'fwp' ),\n 'html' => $this->get_field_html( 'gmaps_api_key' )\n ],\n 'separators' => [\n 'label' => __( 'Separators', 'fwp' ),\n 'html' => $this->get_field_html( 'separators' )\n ],\n 'loading_animation' => [\n 'label' => __( 'Loading Animation', 'fwp' ),\n 'html' => $this->get_field_html( 'loading_animation', 'dropdown', [\n 'choices' => [ 'fade' => __( 'Fade', 'fwp' ), '' => __( 'Spin', 'fwp' ), 'none' => __( 'None', 'fwp' ) ]\n ] )\n ],\n 'prefix' => [\n 'label' => __( 'URL Prefix', 'fwp' ),\n 'html' => $this->get_field_html( 'prefix', 'dropdown', [\n 'choices' => [ 'fwp_' => 'fwp_', '_' => '_' ]\n ] )\n ],\n 'debug_mode' => [\n 'label' => __( 'Debug Mode', 'fwp' ),\n 'html' => $this->get_field_html( 'debug_mode', 'toggle', [\n 'true_value' => 'on',\n 'false_value' => 'off'\n ] )\n ]\n ]\n ],\n 'woocommerce' => [\n 'label' => __( 'WooCommerce', 'fwp' ),\n 'fields' => [\n 'wc_enable_variations' => [\n 'label' => __( 'Support product variations?', 'fwp' ),\n 'notes' => __( 'Enable if your store uses variable products.', 'fwp' ),\n 'html' => $this->get_field_html( 'wc_enable_variations', 'toggle' )\n ],\n 'wc_index_all' => [\n 'label' => __( 'Include all products?', 'fwp' ),\n 'notes' => __( 'Show facet choices for out-of-stock products?', 'fwp' ),\n 'html' => $this->get_field_html( 'wc_index_all', 'toggle' )\n ]\n ]\n ],\n 'backup' => [\n 'label' => __( 'Backup', 'fwp' ),\n 'fields' => [\n 'export' => [\n 'label' => __( 'Export', 'fwp' ),\n 'html' => $this->get_field_html( 'export' )\n ],\n 'import' => [\n 'label' => __( 'Import', 'fwp' ),\n 'html' => $this->get_field_html( 'import' )\n ]\n ]\n ]\n ];\n\n if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {\n unset( $defaults['woocommerce'] );\n }\n\n return apply_filters( 'facetwp_settings_admin', $defaults, $this );\n }",
"public function set_behaviors_default_data() {\n\n\t\t$this->is_google_personalize_enabled = 'checked';\n\t\t$this->google_confirmation_title = 'Personalized advertisements';\n\t\t$this->google_confirmation_message = 'Turning this off will opt you out of personalized advertisements delivered from Google on this website.';\n\t\t$this->confirmbutton = 'Confirm';\n\t\t$this->is_email_enabled = 'checked';\n\t\t$this->email_address = '';\n\t\t$this->popup_main_title = 'Do Not Sell My Personal Information';\n\t\t$this->link_text = 'Privacy Policy';\n\t\t$this->link_url = '';\n\t\t$this->privacy_policy_message = 'Exercise your consumer rights by contacting us below';\n\t\t$this->is_phone_enabled = 'checked';\n\t\t$this->phone_number = '';\n\t\t$this->form_link_text = 'Exercise Your Rights';\n\t\t$this->form_link_url = '';\n\t\t$this->form_enable = 'checked';\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\t\t$this->selectuseroption\t\t\t\t = 'All';\n\t\t$this->isIABEnabled \t\t\t\t = 'checked';\n\t\t$this->isLSPAenable \t\t\t\t = '';\n\t}",
"public function load_settings()\n {\n // Basic Settings\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_basic',\n\t\t\t'title'\t\t\t => 'Grundeinstellungen',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_basic = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_send_cache_control_header',\n\t\t\t'title'\t\t\t\t => 'Cache-Control Headers',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_send_cache_control_header = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_etag',\n\t\t\t'title'\t\t\t\t => 'ETag',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_etag = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_generate_weak_etag',\n\t\t\t'title'\t\t\t\t => 'Weak ETag',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_generate_weak_etag = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_last_modified',\n\t\t\t'title'\t\t\t\t => 'Modified Header',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_last_modified = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_expires',\n\t\t\t'title'\t\t\t\t => 'Expries Header',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_expires = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_backwards_cache_control',\n\t\t\t'title'\t\t\t\t => 'Legacy Cache Control',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_backwards_cache_control = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_mobile_detect',\n\t\t\t'title'\t\t\t\t => 'Mobile Geräteerkennung',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_mobile_detect = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_expires_max_age',\n\t\t\t'title'\t\t\t\t => 'Expires Max-Age',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => 'Sekunden',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_expires_max_age = new Field( $args );\n\n // Compression\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_compression',\n\t\t\t'title'\t\t\t => 'Kompression',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_compression = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_gzip',\n\t\t\t'title'\t\t\t\t => 'GZip',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_gzip = new Field( $args );\n\n\t $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_br',\n\t\t\t'title'\t\t\t\t => 'Brotli',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_br = new Field( $args );\n\n\t $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_deflate',\n\t\t\t'title'\t\t\t\t => 'Deflate (Zlib)',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_deflate = new Field( $args );\n\n // Monitoring\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_health',\n\t\t\t'title'\t\t\t => 'Monitoring',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_health = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_health',\n\t\t\t'title'\t\t\t\t => 'Health Check',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_health',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_health_enable = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_health_url',\n\t\t\t'title'\t\t\t\t => 'Health Url',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_health',\n\t\t\t'description' => 'Z.B. /healthz',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_healt_url= new Field( $args );\n\n // CDN\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_cdn',\n\t\t\t'title'\t\t\t => 'CDN',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_cdn = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_cdn',\n\t\t\t'title'\t\t\t\t => 'CDN',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_cdn',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'dropdown', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n 'options' => array( CDN::None => 'Keins', CDN::Akamai => 'Akamai', CDN::Cloudfront => 'Cloudfront' )\n\t\t);\n\t\t$asse_http_cdn = new Field( $args );\n\n // Advanced\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_experimental',\n\t\t\t'title'\t\t\t => 'Experimental',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_experimental = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_origin',\n\t\t\t'title'\t\t\t\t => 'Origin',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht! Kann nicht gesetzt werden, wenn HTTP_ORIGIN gesetzt ist',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n 'disabled' => true,\n 'disabled_default' => ORIGIN_HOST, // todo\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_origin = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_replace_urls',\n\t\t\t'title'\t\t\t\t => 'Urls ersetzen',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => true,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_etag_salt = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_etag_salt',\n\t\t\t'title'\t\t\t\t => 'ETag Salt',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_etag_salt = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_try_rewrite_categories',\n\t\t\t'title'\t\t\t\t => 'Rewrite Kategorien',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_try_rewrite_categories = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_try_catch_404',\n\t\t\t'title'\t\t\t\t => 'Try Catch 404',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_expires_max_age = new Field( $args );\n }",
"public function setSettings($settings) {\n\t\t$this->settings = $settings;\n\t\t$this->settings['base'] = $settings['tag'];\n\t\t$this->settings['element_class'] = isset($this->settings['element_class']) ? $this->settings['element_class'] :'';\n\t\t$this->settings[\"header_title\"] = isset($this->settings[\"header_title\"]) ? $this->settings[\"header_title\"] : TRUE;\n\t\t$this->settings[\"bottom_controls\"] = isset($this->settings[\"bottom_controls\"]) ? $this->settings[\"bottom_controls\"] : TRUE;\n\t\t$this->settings[\"is_sortable\"] = isset($this->settings[\"is_sortable\"]) ? $this->settings[\"is_sortable\"] : TRUE;\n\t\t$this->settings[\"child_sortable\"] = isset($this->settings[\"child_sortable\"]) ? $this->settings[\"child_sortable\"] : TRUE;\n\t}",
"private function setOptions()\n\t{\n\t\t$this->site = ( isset($_POST['site']) ) ? sanitize_text_field($_POST['site']) : null;\n\t\t$this->feed_type = ( isset($_POST['type']) && $_POST['type'] !== 'search' ) ? sanitize_text_field($_POST['type']) : 'search';\n\t\t$this->post_id = ( isset($_POST['id']) ) ? sanitize_text_field($_POST['id']) : null;\n\t\t$this->feed_format = ( isset($_POST['format']) && $_POST['format'] !== 'unformatted' ) ? sanitize_text_field($_POST['format']) : 'unformatted';\n\t}",
"public function register_main_setting() {\n register_setting( 'lp_rating_settings', 'lp_rating_types');\n register_setting( 'lp_rating_settings', 'lp_rating_text');\n register_setting( 'lp_rating_settings', 'lp_rating_text_font_size');\n register_setting( 'lp_rating_settings', 'lp_rating_image_size');\n register_setting( 'lp_rating_settings', 'lp_rating_change_image');\n }",
"public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}",
"private static function initialize_defaults() {\r\n\t\t\tself::$default_settings['credentials'] = array();\r\n\r\n\t\t\tself::$default_settings['has_first_question'] = 'no';\r\n\r\n\t\t\t// We want the Urtaks to appear by default, so let's append them\r\n\t\t\tself::$default_settings['placement'] = 'append';\r\n\r\n\t\t\t// We want to default post types to 'post' and 'page'\r\n\t\t\tself::$default_settings['post-types'] = array('page', 'post');\r\n\r\n\t\t\t// We want users to be able to start Urtaks by default\r\n\t\t\tself::$default_settings['user-start'] = 'yes';\r\n\r\n\t\t\t// We want Urtaks to support community moderation by default so that we get more questions and responses\r\n\t\t\tself::$default_settings['moderation'] = 'community';\r\n\r\n\t\t\t// Auto height and width\r\n\t\t\tself::$default_settings['height'] = '';\r\n\t\t\tself::$default_settings['width'] = '';\r\n\r\n\t\t\t// Counter settings\r\n\t\t\tself::$default_settings['counter-icon'] = 'yes';\r\n\t\t\tself::$default_settings['counter-responses'] = 'yes';\r\n\r\n\t\t\t// Profanity\r\n\t\t\tself::$default_settings['blacklisting'] = 'no';\r\n\t\t\tself::$default_settings['blacklist_override'] = 'no';\r\n\t\t\tself::$default_settings['blacklist_words'] = '';\r\n\t\t}",
"private function prepare(){\r\n \r\n $autoload = &$this->settings->autoload; \r\n \r\n if(isset($autoload)){\r\n \r\n foreach($autoload AS $key => $class){\r\n \r\n $settings = &$this->settings->{$key};\r\n \r\n if(isset($settings)){\r\n\r\n $this->{$key} = new $class($settings);\r\n }\r\n }\r\n }\r\n }",
"protected function define_my_settings() {\n // No particular settings for this activity.\n }",
"private function create_settings( $field_atts ){\n $field['type'] = $field_atts['type'];\n $field['name'] = $field_atts['name'];\n if( !empty( $field_atts['validator'] ) ) {\n $field_atts['validator'] = explode( ',', $field_atts['validator'] );\n $field['validator'] = $field_atts['validator'];\n }\n if( !empty($field_atts['callback'] ) ) {\n $field_atts['callback'] = explode( ',', $field_atts['callback'] );\n $field_atts['callback'] = $field_atts['callback'];\n }\n if( !empty($field_atts['container'] ) ) {\n $field_atts['before'] = '<div class=\"' . $field_atts['container'] . '\">';\n $field_atts['after'] = '</div>';\n unset( $field_atts['container'] );\n }\n if( !empty($field_atts['options'] ) ) {\n $options = explode( ',', $field_atts['options'] );\n foreach( $options as $option ) {\n $option = explode( '|', $option );\n $opt[$option[0]] = $option[1];\n }\n $field_atts['options'] = $opt;\n }\n foreach( $field_atts as $key => $att ) {\n if( !in_array( $key, array( 'type', 'name', 'validator' ) ) && !empty( $att ) ) {\n $field['params'][$key] = $att;\n }\n }\n return $field;\n }",
"protected function setOptions()\n {\n $options = \\XLite::getInstance()->getOptions('skin_details');\n \n if (isset($options['skin']) && $options['skin'] === 'default') {\n $options['skin'] = 'customer';\n }\n\n foreach (array('skin', 'locale') as $name) {\n if (!isset($this->$name)) {\n $this->$name = $options[$name];\n }\n }\n\n $this->setPath();\n }",
"public function load_settings()\r\n\t{\r\n\t\tif (!$this->_use_cache || !($this->_settings = $this->cache->get('settings')))\r\n\t\t{\r\n\t\t\t// Get settings from database\r\n\t\t\t$this->db->select('setting,value');\r\n\t\t\t$query = $this->db->get('settings');\r\n\r\n\t\t\tforeach ($query->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$this->_settings[$row->setting] = $row->value;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if we want to cache the results\r\n\t\t\tif ($this->_use_cache)\r\n\t\t\t{\r\n\t\t\t\t$this->cache->save('settings', $this->_settings, $this->_cache_ttl);\r\n\t\t\t\t$this->_repopulated_cache = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}"
] | [
"0.64047515",
"0.6357996",
"0.6268254",
"0.6249794",
"0.62192845",
"0.6207818",
"0.61911374",
"0.61730784",
"0.6172418",
"0.6172418",
"0.616733",
"0.61395514",
"0.6135785",
"0.6133022",
"0.61217064",
"0.61113703",
"0.6096595",
"0.60568434",
"0.6048388",
"0.6032008",
"0.6021757",
"0.599546",
"0.5992834",
"0.59904325",
"0.5984868",
"0.5969258",
"0.5921021",
"0.59174216",
"0.5906049",
"0.5886835",
"0.58705795",
"0.5858826",
"0.5820831",
"0.5776854",
"0.57745284",
"0.5769064",
"0.57649547",
"0.57632196",
"0.5754593",
"0.5747296",
"0.5734785",
"0.57321393",
"0.5719697",
"0.5696609",
"0.5692876",
"0.56836313",
"0.56776243",
"0.56700474",
"0.5669057",
"0.5665592",
"0.56545794",
"0.56454843",
"0.56280065",
"0.5627203",
"0.56257343",
"0.5618848",
"0.560933",
"0.5609309",
"0.56009567",
"0.56007725",
"0.559705",
"0.5594267",
"0.55922014",
"0.5588041",
"0.5586614",
"0.5583859",
"0.55734706",
"0.5563381",
"0.55612606",
"0.5544542",
"0.5540715",
"0.55401844",
"0.5538542",
"0.5535865",
"0.5533724",
"0.55320674",
"0.5530696",
"0.5530696",
"0.5530696",
"0.55303526",
"0.55272084",
"0.5525067",
"0.55183846",
"0.55146563",
"0.5502174",
"0.55016565",
"0.5500809",
"0.54996765",
"0.54995775",
"0.54783744",
"0.5474724",
"0.54596967",
"0.54530096",
"0.5445223",
"0.54421216",
"0.54349816",
"0.5433721",
"0.54154825",
"0.5410728",
"0.5406478",
"0.540381"
] | 0.0 | -1 |
File name should always contain an extension. | public function setFileNameAttribute($value)
{
$fileName = trim($value);
if (strlen($fileName) && !strlen(pathinfo($value, PATHINFO_EXTENSION))) {
$fileName .= '.'.$this->defaultExtension;
}
$this->attributes['fileName'] = $fileName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function file_ext($filename) {\n\t if( !preg_match('/./', $filename) ) return '';\n\t return preg_replace('/^.*./', '', $filename);\n\t}",
"public function getFileExtension();",
"function file_extension($filename)\n\t\t{\n\t\t\t$fileparts = explode(\".\", $filename);\n\t\t\t$more_check = strpos(strtolower(end($fileparts)), '?');\n\t\t\tif ($more_check != false) {\n\t\t\t\t\n\t\t\t\treturn substr(strtolower(end($fileparts)),0, $more_check );\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\treturn strtolower(end($fileparts));\n\t\t}\n\t\t}",
"abstract protected function getFileExtension();",
"public static function extensionize($filename, $extension){\n if (!preg_match(\"/\\.${extension}$/\", $filename)){\n $filename = \"${filename}.${extension}\";\n }\n \n return $filename;\n }",
"function fileExtension($nameFile) {\n\t$format = substr($nameFile, -4);\n\treturn ($format == \".pat\");\n}",
"function getFileExtension($fileName)\n{\n\t$pos = strrpos($fileName, \".\");\n\tif( $pos === FALSE ) \n\t\treturn \"\";\n\t\t\n\treturn substr($fileName, $pos + 1);\n}",
"function getFileNameExtension($imagename){\n\t// Return last position of the period in the file name\n\t$periodpos = strrpos($imagename, \".\");\n\treturn substr($imagename, $periodpos, strlen($imagename));\n}",
"function cleanFileName($str) {\n $str = strtolower($str);\n $ext_point = strrpos($str,\".\");\n if ($ext_point===false) return false;\n $ext = substr($str,$ext_point,strlen($str));\n $str = substr($str,0,$ext_point);\n\n return preg_replace(\"/[^a-z0-9-]/\",\"_\",$str).$ext;\n}",
"function file_get_filename($filename)\r\n\t{\r\n\t\treturn substr($filename, 0, strrpos($filename, \".\"));\r\n\t}",
"private function _getFileExtension($filename)\n {\n if (empty($filename)) {\n return '';\n }\n\n $split = explode('.', $filename);\n return $split[1];\n }",
"private function _getFileSuffix()\n {\n if (strrpos($this->_originalName, '.'))\n {\n return substr($this->_originalName, strrpos($this->_originalName, '.') +1);\n }\n else \n {\n return '';\n }\n }",
"function get_file_extension($file_name) {\n if(empty($file_name) OR !is_string($file_name)) {\n return false;\n }\n return strtolower(substr(strrchr($file_name,'.'), 1));\n}",
"function file_ext_strip($filename){\n\t return preg_replace('/.[^.]*$/', '', $filename);\n\t}",
"public function extension( $fileName ) {\n\t\treturn strtolower( substr( strrchr( $fileName, '.' ), 1 ) );\n\t}",
"function testFileName(): void\n {\n $this->assertTrue(FileValidator::isName(\"docu.doc\"));\n $this->assertTrue(FileValidator::isName(\"docu\"));\n $this->assertFalse(FileValidator::isName(\"doc?u\"));\n }",
"function getExt($filename){\n return strtolower(substr(strrchr($fileName, '.'), 1));\n}",
"private function stripExtFromFile( $filename ) : string\n {\n $class = explode(\n \".\",\n $filename\n\n );\n return $class[0];\n }",
"public static function isFileName($name)\n {\n return preg_match('/^[a-zA-Z0-9_.-]+$/', $name);\n }",
"function cmk_sanitize_filename_on_upload($filename) {\n $ext = end(explode('.',$filename));\n // Reemplazar todos los caracteres extranos.\n $sanitized = preg_replace('/[^a-zA-Z0-9-_.]/','', substr($filename, 0, -(strlen($ext)+1)));\n // Replace dots inside filename\n $sanitized = str_replace('.','-', $sanitized);\n return strtolower($sanitized.'.'.$ext);\n}",
"public function isValidFilename()\n {\n $fileName = $this->fileName;\n if(substr($fileName, 0,1) == '-') {\n return false;\n }\n return true;\n }",
"public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }",
"function get_file_extension($file_name) \n{\n return substr(strrchr($file_name,'.'),1);\n}",
"function no_ext($filename) {\n\t$filebroken = explode('.', $filename);\n\tarray_pop($filebroken);\n\n\treturn implode('.', $filebroken);\n\n}",
"function file_ext($file) {\n return strtolower(pathinfo($file, PATHINFO_EXTENSION));\n }",
"function getFileNameWithExtension()\n {\n return $this->fileNameWithExt;\n }",
"function getExtension($name) {\r\n $explode_file = explode('.', $name);\r\n return strtolower(end($explode_file));\r\n }",
"function removeExtension($filename) {\n $file = substr($filename, 0,strrpos($filename,'.')); \n return $file;\n }",
"public static function getFileExtension(string $filename): string\n {\n $filename = basename($filename);\n\n // remove possible query string\n $pos = strpos($filename, '?');\n if ($pos !== false) {\n $filename = substr($filename, 0, $pos);\n }\n\n // retrieve the extension\n $pos = strrpos($filename, '.');\n if ($pos !== false) {\n return strtolower(substr($filename, $pos + 1));\n }\n\n return '';\n }",
"function filename($filedata) {\r\n\t\treturn substr($filedata['name'], 0, strrpos($filedata['name'], '.'));\r\n\t}",
"public function getExtensionFromName()\n {\n $vars = explode('.', $this->getClientFilename());\n return strtolower(array_pop($vars));\n }",
"public function getFileExtension() {\n\t\t$pathInfo = pathinfo($this->filename);\n\t\tif (!isset($pathInfo['extension'])) {\n\t\t\treturn '???';\n\t\t} else {\n\t\t\treturn $pathInfo['extension'];\n\t\t}\n\t}",
"function file_get_extension($filename)\r\n\t{\r\n\t\treturn substr($filename, strrpos($filename, \".\") + 1, strlen($filename));\r\n\t}",
"public static function filename_valid($name) {\n return strlen($name) < 100 && preg_match(\"/^[a-z0-9 \\.-]+$/i\", $name) != 0;\n }",
"private function addExtension($extension = \".txt\")\n\t{\n\t\t$fileName = $this->fileName;\n\t\tif(substr($fileName, -4) !== $extension) {\n\t\t\t$fileName .= $extension;\n\t\t\t$this->fileName = $fileName;\n\t\t}\n\t\treturn $fileName;\n\t}",
"function getExtension($filename) {\n\treturn substr(strrchr($filename,'.'),1);\n}",
"function get_file_extension($file_name) {\n return substr(strrchr($file_name,'.'),1);\n}",
"function get_file_extension($file_name) {\n\treturn substr(strrchr($file_name,'.'),1);\n }",
"private function getExt(string $filepath): string\n {\n $explodeUrl = explode('.', $filepath);\n return strtolower($explodeUrl[count($explodeUrl) - 1]);\n }",
"function ext_get( $filename ) {\n\n return strtolower( str_replace( '.', '', strrchr( $filename, '.' ) ) );\n\n }",
"function ext($filedata) {\r\n return strtolower(trim(strrchr($filedata['name'], '.'), '.'));\r\n }",
"function clean_filename($filename)\n\t{\n//replaces all characters that are not alphanumeric with the exception of the . for filename usage\n\t\t$realname = preg_replace(\"/[^a-zA-Z0-9\\.]/\", \"\", strtolower($filename));\n\t\treturn $realname;\n\t}",
"public function filename($name)\n {\n if (substr($name, -5) !== '.'.static::$file_type) {\n $name = $this->path.'/'.File::sanitize(md5($name).'.'.static::$file_type);\n }\n\n return $name;\n }",
"function getFileName(string $filename) : string {\n $names = explode(\".\",$filename);\n array_pop($names);\n return implode(\"\",$names); \n}",
"function GetExt($file){\n return substr($file, strrpos($file,'.') + 1);\n}",
"function sanitize_filename_on_upload($filename) {\n $exp = explode('.', $filename);\n $ext = end($exp);\n // Replace all weird characters\n $sanitized = preg_replace('/[^a-zA-Z0-9-_.]/', '', substr($filename, 0, -(strlen($ext) + 1)));\n // Replace dots inside filename\n $sanitized = str_replace('.', '-', $sanitized);\n return strtolower($sanitized . '.' . $ext);\n}",
"function get_file_extension($file){\n\t$tmp = explode('.',$file);\n\treturn strtolower(end($tmp)) ;\n}",
"function sanitize_file_name( $filename ) {\n\treturn preg_replace(\"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\].]|[\\.]{2,})\", '_', $filename);\n}",
"public static function stripExtFromFile( $filename ) : string\n {\n $class = explode(\n \".\",\n $filename\n\n );\n return $class[0];\n }",
"protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }",
"protected function getFileName($name)\n {\n $extension = (string) $this->extension;\n if (substr($name, 0 - strlen($extension)) !== $extension) {\n $name .= $extension;\n }\n\n return $name;\n }",
"public static function cleanFilename($dirty_filename) {\n $split = explode('.', $dirty_filename);\n $ext = array_pop($split);\n return \\Str::slug(urldecode( implode('.', $split) )).'.'.$ext;\n }",
"function getExt($file) \n\t{\n\t\t$dot = strrpos($file, '.') + 1;\n\t\treturn substr($file, $dot);\n\t}",
"public function extension($filePath);",
"function ext_change($filename, $ext) {\n return preg_replace('/\\.\\w+$/', \".$ext\", $filename, 1);\n}",
"public function getExtension() {\n\t\t\n\t\t$filename = $this->file['name'];\n\t\t\n\t\t$parts = explode('.', $filename);\n\t\t$extension = end($parts);\n\t\t\n\t\treturn strtolower($extension);\n\t\t\n\t}",
"private function detectExtension()\n {\n $arr = explode('.', $this->file['name']);\n $this->file['extension'] = end($arr);\n }",
"public static function GetFileNameWOExtension($filename)\n\t{\n\t\t$name = '';\n\t\t\n\t\t$arr = explode('.', basename($filename));\n\t\t\n\t\tif (is_array($arr) && count($arr) >= 2)\n\t\t{\n\t\t\tunset($arr[ count($arr)-1 ]);\n\t\t}\n\t\t$name = implode('.', $arr);\n\t\t\n\t\treturn $name;\n\t}",
"static public function getExtension($filename) {\r\n\t\t// 1. The \"explode/end\" approach\r\n\t\t//$ext = end(explode('.', $filename));\r\n\t\t// 2. The \"strrchr\" approach\r\n\t\t//$ext = substr(strrchr($filename, '.'), 1);\r\n\t\t// 3. The \"strrpos\" approach\r\n\t\t//$ext = substr($filename, strrpos($filename, '.') + 1);\r\n\t\t// 4. The \"preg_replace\" approach\r\n\t\t//$ext = preg_replace('/^.*\\.([^.]+)$/D', '$1', $filename);\r\n\t\t// 5. The \"pathinfo\" approach\r\n\t\t$ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n\t\t\r\n\t\t/*\r\n\t\t// OLD STYLE\r\n\t\t$i = strrpos($filename, \".\");\r\n\t\tif (!$i) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$l = strlen($filename) - $i;\r\n\t\t$ext = substr($filename, $i + 1, $l);\r\n\t\t*/\r\n\t\t\r\n\t\treturn strtolower($ext);\r\n\t}",
"public function generateProcessedFileNameWithoutExtension() {}",
"public function getFileName()\n {\n return basename($this->file, '.' . $this->getExtension());\n }",
"function isCorrectFilename ($name) {\r\n if (!empty($name)) {\r\n if (preg_match('/[a-zA-Z0-9_]/', $name)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}",
"protected function fileName() {}",
"public function fileName() {\n $name = time() . $this->file->getClientOriginalName();\n $extension = $this->file->getClientOriginalExtension();\n return \"{$name}.{$extension}\";\n }",
"protected function _extractExtension( $filename )\n {\n $ret = '';\n $dotPosition = strrpos( $filename, '.' );\n if ( false === $dotPosition ) {\n return $ret;\n }\n \n $ret = substr( $filename, ++$dotPosition );\n return $ret;\n }",
"function getFileExtension($file, $withdot=false)\n{\n if($withdot)\n return strtolower(substr($file, strrpos($file,\".\")));\n else\n return strtolower(substr($file, strrpos($file,\".\")+1));\n}",
"private function get_ext( $filename='' )\n\t{\n\t\treturn substr( $filename, strrpos( $filename, '.' ) + 1);\t\n\t}",
"public function getExtFromFileName( $filename=null ){\n if ( !$filename )\n $filename = $this->filename;\n \n $ext = explode('.', $filename);\n $ext = strtolower( $ext[ (count($ext) -1) ] );\n return $ext;\n }",
"public function getFileName(): string\n {\n if (strpos($this->savefileName, '.php') === false) {\n return $this->savefileName . $this->extension;\n }\n return $this->savefileName;\n }",
"function getext($in_file)\n{\n\tif (end(explode('.',$in_file)) != $in_file)\n\t{\n\t\treturn(strtolower(end(explode('.',$in_file))));\n\t}\n\treturn \"\";\n\t\n}",
"public function fileName()\n {\n return $this->getCleanString(self::$_file_name_clean);\n }",
"public function getFilename();",
"public function getFilename();",
"function sanitize_filename($filename) {\n\t// Remove any trailing dots, as those aren't ever valid file names.\n\t$filename = rtrim($filename, '.');\n\n\t$regex = array('#(\\.){2,}#', '#[^A-Za-z0-9\\.\\_\\- ]#', '#^\\.#');\n\t$filename = trim(preg_replace($regex, '', $filename));\n\t$filename = str_replace(' ', '-', $filename);\n\n\treturn $filename;\n}",
"function GetFileExtension($fileName) {\n return end(explode(\".\", $fileName));\n }",
"function getFileExtension($str) {\n\n $i = strrpos($str,\".\");\n if (!$i) { return \"\"; }\n\n $l = strlen($str) - $i;\n $ext = substr($str,$i+1,$l);\n\n return $ext;\n\n }",
"public function throwExtOfFile( $sName ){\n\t\t$aExp = explode( '.', $sName );\n if( isset( $aExp[0] ) && isset( $aExp[1] ) ){\n return strtolower( $aExp[count( $aExp )-1] ); \n }\n else\n return null;\n\t}",
"function sanitizeFileName($fileName)\n{\n\t//sanitize, remove double dot .. and remove get parameters if any\n\t$fileName = __DIR__ . '/' . preg_replace('@\\?.*$@' , '', preg_replace('@\\.{2,}@' , '', preg_replace('@[^\\/\\\\a-zA-Z0-9\\-\\._]@', '', $fileName)));\n\treturn $fileName;\n}",
"protected function _makeFileName($ext) {\n if (true == $this->_encryptFileName) {\n return (uniqid() .$ext);\n }\n\n if (null != $this->_newName) {\n $name = Folder::cleanFileName($this->_newName);\n $name = str_replace($ext, '', $name);\n } else {\n $name = Folder::cleanFileName($this->_data['file_origin_name']);\n $name = str_replace($ext, '', $name);\n }\n\n if (false !== $this->_ansiName) {\n $name = preg_replace('/[^A-Za-z0-9_\\-]/', '', $name);\n }\n\n if (false !== $this->_removeSpaceName) {\n $name = preg_replace('/\\s+/', '-', $name);\n }\n\n if (true !== $this->_overwrite\n && (file_exists($this->_dir .$name .$ext))) {\n $i = 1;\n do {\n $_t = $name .'(' .$i .')';\n ++$i;\n } while (file_exists($this->_dir .$_t .$ext));\n $name = $_t;\n }\n\n return $name .$ext;\n }",
"private function getFullFileName(string $fileName): string\n {\n return Normalizer::snakeString($fileName).'.'.self::FILE_EXTENSION;\n }",
"public function basename();",
"public function getFileExtension($filename){\n\n if (!$filename)\n return false;\n\n $arr = explode('.', $filename);\n\n if ($arr[count($arr)-1])\n return $arr[count($arr)-1];\n else\n return false;\n }",
"function getTargetFileExtension() ;",
"function getfileextension($filename){\n return pathinfo($filename, PATHINFO_EXTENSION);\n }",
"function filter_filename($name) {\n $name = str_replace(array_merge(\n array_map('chr', range(0, 31)),\n array('<', '>', ':', '\"', '/', '\\\\', '|', '?', '*','\\'')\n ), '', $name);\n // maximise filename length to 255 bytes http://serverfault.com/a/9548/44086\n $ext = pathinfo($name, PATHINFO_EXTENSION);\n $name= mb_strcut(pathinfo($name, PATHINFO_FILENAME), 0, 255 - ($ext ? strlen($ext) + 1 : 0), mb_detect_encoding($name)) . ($ext ? '.' . $ext : '');\n return $name;\n}",
"public static function file_extension($filename)\r\r\n\t{\r\r\n\t $path_info = pathinfo($filename);\r\r\n\t return $path_info['extension'];\r\r\n\t}",
"function stripExt($file) {\n return preg_replace('#\\.[^.]*$#', '', $file);\n }",
"public function getFileBaseName($extension = \".txt\")\n\t{\n\t\treturn basename($this->fileName,\".txt\");\n\t}",
"public function generateFilename()\n {\n $filename = str_replace(\" \", \"_\", strtolower($this->getOriginalName()));\n\n if(!file_exists(\"http://\".$_SERVER['HTTP_HOST'].\"/uploads/docs/\".$filename))\n {\n return $filename;\n }\n else\n {\n $extension = $this->getExtension($this->getOriginalExtension());\n $filename = str_replace($extension, '', $filename) . '_';\n\n $i = 2;\n\n while(true)\n {\n if(file_exists($this->getPath().$filename.$i.$extension))\n {\n $i++;\n continue;\n }\n break;\n }\n\n return $filename.$i.$extension;\n }\n }",
"private function formatFilename() {\n return $this->prefix . $this->name . \".\" . $this->extension;\n }",
"public function basename($ext = true) {\n\t\t$basename = parent::get('basename'); \n\t\tif(!$ext) $basename = basename($basename, \".\" . $this->ext());\n\t\treturn $basename;\n\t}",
"public function filename(): string\n {\n return Str::random(6) . '_' . $this->type . $this->fileExtension();\n }",
"public function get_file_name()\n {\n if( is_null( $this->file_name ) ) return NULL;\n $pos1 = strrpos( $this->file_name, '/' );\n $pos2 = strrpos( $this->file_name, '.' );\n return false === $pos2\n ? substr( $this->file_name, false === $pos1 ? 0 : $pos1 + 1 )\n : substr( $this->file_name, false === $pos1 ? 0 : $pos1 + 1, $pos2 - $pos1 - 1 );\n }",
"public function getFileExtension(): string\n {\n return $this->fileExtension;\n }",
"public function getFileName();",
"public function getFileName();",
"public function getFileName();",
"function get_file_extension($LoSFileName) {\n\t$LoSFileExtensions = substr($LoSFileName, strrpos($LoSFileName, '.') + 1);\n\treturn $LoSFileExtensions;\n}",
"public function getFilename() {\n\t\t\n\t\t$filename = $this->filename;\n\t\t\n\t\tif(file_exists($this->path . $filename) && $this->rename_if_exists === true) {\n\t\t\n\t\t\t//Explode the filename, pop off the extension and put it back together\n\t\t\t$parts = explode('.', $filename);\n\n\t\t\t$extension = array_pop($parts);\n\n\t\t\t$base_filename = implode('.', $parts);\n\t\t\t\n\t\t\t$count = 1;\n\t\t\t\n\t\t\tdo {\n\t\t\t\t$count++;\n\t\t\t} while(file_exists($this->path . $base_filename . '_' . $count . '.' . $extension));\n\t\t\t\n\t\t\t$filename = $base_filename . '_' . $count . '.' . $extension;\n\t\t\n\t\t}\n\t\t\n\t\treturn $filename;\n\t\t\n\t}",
"public function filename(): string;",
"function sanitize_file_name($filename)\n {\n }"
] | [
"0.7909113",
"0.7488397",
"0.7477418",
"0.745618",
"0.7391999",
"0.7383204",
"0.73103184",
"0.7308733",
"0.725133",
"0.72286564",
"0.7212832",
"0.7186276",
"0.7185842",
"0.7173767",
"0.71632063",
"0.7146784",
"0.713156",
"0.70996696",
"0.7089567",
"0.708731",
"0.70719486",
"0.7071182",
"0.70635045",
"0.7062375",
"0.7045496",
"0.7042422",
"0.70365983",
"0.7035252",
"0.7008308",
"0.69981855",
"0.69783473",
"0.69753474",
"0.6973297",
"0.69584817",
"0.69470525",
"0.69347316",
"0.6926446",
"0.69157606",
"0.68985564",
"0.6888114",
"0.68862164",
"0.688088",
"0.6864222",
"0.6862861",
"0.68534654",
"0.6847318",
"0.68386394",
"0.6836783",
"0.6835562",
"0.6820505",
"0.6818367",
"0.68151695",
"0.68071234",
"0.6806683",
"0.68004537",
"0.67893124",
"0.67892903",
"0.67863315",
"0.67854774",
"0.6784907",
"0.67741424",
"0.6767226",
"0.6766097",
"0.67657465",
"0.676011",
"0.6754214",
"0.6750401",
"0.6735937",
"0.6733956",
"0.6727372",
"0.672543",
"0.67243236",
"0.67243236",
"0.6721022",
"0.67206067",
"0.6716824",
"0.6715714",
"0.67129934",
"0.67088056",
"0.67084295",
"0.67036605",
"0.6697781",
"0.6691766",
"0.6688257",
"0.66858035",
"0.6682483",
"0.66760236",
"0.666239",
"0.66471136",
"0.66442084",
"0.6637251",
"0.66346604",
"0.6626774",
"0.6623877",
"0.6622292",
"0.6622292",
"0.6622292",
"0.66179806",
"0.66161937",
"0.6609801",
"0.6590033"
] | 0.0 | -1 |
Returns the directory name corresponding to the object type. For pages the directory name is "pages", for layouts "layouts", etc. | public function getObjectTypeDirName()
{
return $this->dirName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function dirName()\n {\n return str_plural(strtolower($this->itemClass()));\n }",
"private function _getTypeDirectory( $type )\n\t\t{\n\t\t\t$config = Config::getInstance();\n\t\t\t$directory = null;\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'installed':\n\t\t\t\tcase 'uninstalled':\n\t\t\t\t\t$directory = $config->notification->libPluginDirectory;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'recently_installed':\n\t\t\t\tcase 'run_out':\n\t\t\t\tcase 'expired':\n\t\t\t\tcase 'trial_run_out':\n\t\t\t\tcase 'trial_expired':\n\t\t\t\t\t$directory = $config->notification->indexDirectory;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'current_month_overdraft':\n\t\t\t\tcase 'expired_overdraft':\n\t\t\t\tcase 'unpaid_overdraft':\n\t\t\t\t\t$directory = $config->notification->optionsDirectory;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'forgot':\n\t\t\t\t\t$directory = $config->notification->authDirectory;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $directory;\n\t\t}",
"public function getDirname();",
"public function get_directory_by_type ( $type = 'bundled' ) {\n\t\t$path = '';\n\t\tswitch ( $type ) {\n\t\t\tcase 'standalone':\n\t\t\t\t$path = trailingslashit( WP_PLUGIN_DIR );\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'downloadable':\n\t\t\t\t$path = $this->downloads_path;\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'bundled':\n\t\t\tdefault:\n\t\t\t\t$path = $this->components_path;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $path;\n\t}",
"protected function _dir(): string\n {\n if ($container = $this->_container()) {\n assert($container->hasId());\n return \"{$container}/\" . static::DIR;\n }\n return static::DIR;\n }",
"protected function getJsonTypeFolder(): string\n {\n $path = self::getJsonFolder();\n return $path . DIRECTORY_SEPARATOR . $this->type;\n }",
"private function _get_asset_type_dir($type)\n\t{\n\t\t$asset_dir = '';\n\t\t\n\t\t$asset_dir .= $this->_ci->config->item('bucket_assets_path');\n\t\t$asset_dir .= $this->_ci->config->item('bucket_assets_' . $type . '_path');\n\t\t\n\t\treturn $asset_dir;\n\t}",
"protected function get_dir() {\r\n return dirname( ( new \\ReflectionClass( static::class ) )->getFileName());\r\n }",
"public function getDirname()\n {\n return static::dirname($this->path);\n }",
"protected function getDir()\n {\n $reflectionClass = new \\ReflectionClass(get_class($this));\n return dirname($reflectionClass->getFileName());\n }",
"public function getModuleDir($type, $moduleName)\n {\n $codePool = (string)$this->getModuleConfig($moduleName)->codePool;\n $codePoolParts = explode(\"_\",$codePool);\n if( is_array($codePoolParts) && sizeof($codePoolParts) > 1 ) {\n $codePool = $codePoolParts[0].DS.$codePoolParts[1];\n }\n\n $dir = $this->getOptions()->getCodeDir().DS.$codePool.DS.uc_words($moduleName, DS);\n\n switch ($type) {\n case 'etc':\n $dir .= DS.'etc';\n break;\n\n case 'controllers':\n $dir .= DS.'controllers';\n break;\n }//switch\n\n $dir = str_replace('/', DS, $dir);\n\n return $dir;\n }",
"protected function getObjectsDirectory()\n {\n return $this->cacheDirectory . self::DIR_OBJECTS . \"/\";\n }",
"public function getDirName(): string\n {\n return $this->dirName;\n }",
"public function getTypeString()\n {\n switch ( $this->fileStructure->type )\n {\n case self::IS_DIRECTORY:\n return \"d\";\n\n case self::IS_FILE:\n return \"-\";\n\n case self::IS_SYMBOLIC_LINK:\n return \"l\";\n\n case self::IS_LINK:\n return \"h\";\n\n default:\n return \"Z\";\n }\n }",
"public function getDirname()\n {\n return dirname($this->getPath());\n }",
"public function directoryName() \r\n {\r\n return $this->directory->fullName();\r\n }",
"public function getType() {\n\t\tif ($this->getIsDir()) {\n\t\t\treturn '<DIR>';\n\t\t} else {\n\t\t\treturn $this->getExtension().' file';\n\t\t}\n\t}",
"protected function getObjectType() {\n if ($this->objectType) return $this->objectType;\n $key = $this->getObjectTypePlural();\n if (substr($key, -3) == 'ies') return substr($key, 0, -3).'y';\n return substr($key, 0, -1);\n }",
"public function getDirName()\n {\n return $this->dirName;\n }",
"public function getObjectTypeName() \n\t{\n\t\treturn self::$object_type[$this->object_type];\n\t}",
"private static function detectClassTypeDir(string $className): string\n {\n foreach (self::$classTypes as $classTypeName => $classTypeDirectory) {\n if (preg_match('~.*' . $classTypeName . '$~', $className)) {\n return $classTypeDirectory;\n }\n }\n return self::DEFAULT_CLASS_DIR;\n }",
"public function getName()\n {\n return 'oo_folder';\n }",
"public function directoryName($object, PropertyMapping $mapping): string\n {\n return $object->getCreatedAt()->format('Y-m-d');\n }",
"public static function getFolderName() {\n // Remove '-test' if it is the last part of the folder name\n // return preg_replace('/-test$/', '', kebab_case(class_basename(__CLASS__)));\n return kebab_case(self::getBaseClassName());\n }",
"protected function getObjectTypePlural() {\n $tmp = explode('\\\\', get_class($this));\n return $tmp[count($tmp)-2]; \n }",
"private function instanceDirectory () : string {\n return dirname((new ReflectionClass(static::class))->getFileName());\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'documents';\n }",
"private function make_class_name( $name, $type ) {\n\n\t\tif ( 'field' == $type ) {\n\t\t\t$namespace = '\\\\' . __NAMESPACE__ . '\\Admin\\Fields\\\\';\n\t\t} elseif ( 'page' == $type ) {\n\t\t\t$namespace = '\\\\' . __NAMESPACE__ . '\\Admin\\Pages\\\\';\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\n\t\t$class_name = implode( '_', array_map( 'ucfirst', explode( '-', $name ) ) );\n\n\t\treturn $namespace . $class_name;\n\t}",
"protected static function classByType($type)\n {\n $type = preg_replace('/^icinga_/', '', $type);\n\n if (strpos($type, 'data') === false) {\n $prefix = 'Icinga';\n } else {\n $prefix = 'Director';\n }\n\n // TODO: Provide a more sophisticated solution\n if ($type === 'hostgroup') {\n $type = 'hostGroup';\n } elseif ($type === 'usergroup') {\n $type = 'userGroup';\n } elseif ($type === 'timeperiod') {\n $type = 'timePeriod';\n } elseif ($type === 'servicegroup') {\n $type = 'serviceGroup';\n } elseif ($type === 'apiuser') {\n $type = 'apiUser';\n }\n\n return 'Icinga\\\\Module\\\\Director\\\\Objects\\\\' . $prefix . ucfirst($type);\n }",
"public function get_type_name() { \n\n\t\tswitch ($this->type) { \n\t\t\tcase 'xml-rpc': \n\t\t\tcase 'rpc':\n\t\t\t\treturn _('API/RPC');\n\t\t\tbreak;\n\t\t\tcase 'network':\n\t\t\t\treturn _('Local Network Definition');\n\t\t\tbreak;\n\t\t\tcase 'interface':\n\t\t\t\treturn _('Web Interface');\n\t\t\tbreak;\n\t\t\tcase 'stream':\n\t\t\tdefault: \n\t\t\t\treturn _('Stream Access');\n\t\t\tbreak;\n\t\t} // end switch\n\n\t}",
"protected function getUploadDir()\r\n {\r\n // get rid of the __DIR__ so it doesn't screw when displaying uploaded doc/image in the view.\r\n return $this->getMediaType();\r\n }",
"public function getDirectory(): string\n {\n return $this->directory;\n }",
"public function getDirectory(): string\n {\n return $this->directory;\n }",
"function _templateFolder() {\n return Inflector::underscore(str_replace(\n 'Component', '', $this->toString()\n ));\n }",
"private function _getTypeName( $type )\n\t{\n\t\t$type_name = \"\";\n\t\tif ( $type == - 1 ) {\n\t\t\t$type_name = 'sight';\n\t\t} elseif ( $type == - 2 ) {\n\t\t\t$type_name = 'design';\n\t\t} elseif ( $type ) {\n\t\t\t$type_name = \"utilities{$type}\";\n\t\t}\n\n\t\treturn $type_name;\n\t}",
"public function getDir() {\n return Yii::getAlias('@static').'/'.$this->module.'/'. $this->parent_id .'/';\n }",
"public function getName()\n {\n $class = get_class($this);\n\n return str_replace($this->getObjectType(), '',\n str_replace(CADRE_appNameSpace.$this->getObjectTypePlural().'\\\\', '', $class));\n }",
"private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }",
"public function getObjectType()\n {\n return $this->systemProperties->getObjectType();\n }",
"function dir_name() {\n\t\treturn $this->_dir_name;\n\t}",
"protected function getUploadDir(): string\n {\n // when displaying uploaded doc/image in the view.\n return 'image_room_directory';\n }",
"public function getTypeName()\n\t{\n\t\tswitch($this->type)\n\t\t{\n\t\t\tcase User::TYPE_ADMIN:\n\t\t\t\treturn \"Admin\";\n\t\t\tcase User::TYPE_BOOKKEEPING:\n\t\t\t\treturn \"Bookkeeping\";\n\t\t\tcase User::TYPE_MAINTENANCE:\n\t\t\t\treturn \"Maintenance\";\n\t\t\tcase User::TYPE_REPRESENTATIVE:\n\t\t\t\treturn \"Representative\";\n\t\t\tcase User::TYPE_SALES:\n\t\t\t\treturn \"Sales\";\n\t\t\tdefault:\n\t\t\t\treturn \"UNKNOWN\";\n\t\t}\n\t}",
"public function getTypeAttribute()\n {\n $class = $this->component_type;\n $function = new \\ReflectionClass($class);\n $type = str_replace('Page', '', $function->getShortName());\n\n return strtolower($type);\n }",
"function getTemplateDir()\n {\n return $this->_objectPool[$this->_lastUsedObjectKey]->getOption('templateDir');\n }",
"protected static function get_dir( $root ){\n\t\tif( 'Ibinex_Forms_Fields')\n\t\tif( array_key_exists( $root, self::$roots ) ){\n\t\t\treturn trailingslashit( self::$roots[ $root ] );\n\t\t}\n\t}",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'images/page/'.$this->page->getId();\n }",
"public function getDirName() {\n\t\treturn dirname($this->getPath());\n\t}",
"public function getObjectType()\n {\n return $this->objectType;\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'archivos';\n }",
"protected function getModelName()\n {\n if (isset($this->options[\"type\"])) {\n $type = ucfirst($this->options[\"type\"]);\n $class = \"\\\\app\\\\models\\\\feeds\\\\\" . $type;\n if (class_exists($class)) {\n return $class;\n }\n }\n \n return \"\\\\app\\\\models\\\\\" . $this->objectName;\n }",
"protected function getThumbDirectoryName()\n {\n return Base::suffix($this->dirName);\n }",
"public function getTypeName()\n\t{\n\t\t$name = $this->handler_class;\n\t\t$name = str_replace('Application\\\\DeskPRO\\\\CustomFields\\\\Handler\\\\', '', $name);\n\t\t$name = str_replace('\\\\', '_', $name);\n\t\t$name = strtolower($name);\n\n\t\treturn $name;\n\t}",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'pictures';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'upload/documents';\n }",
"public function getType()\n {\n return $this->i18n_singular_name();\n }",
"public static function getDataFolder()\n {\n $class = get_called_class();\n $strip = explode('\\\\', $class);\n\n return RELEASE_NAME_DATA . '/' . strtolower(array_pop($strip)) . 's';\n }",
"public function getDirectoryName(): string {\n\n\t\treturn $this->directoryName;\n\t}",
"static public function filter_type_dir($value)\n\t{\n\t\treturn (substr($value, -1) != '/') ? $value.'/' : $value;\n\t}",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'results';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/models';\n }",
"private static function getChildClassDirectory()\n {\n $className = get_called_class();\n $reflector = new ReflectionClass($className);\n\n return dirname($reflector->getFileName());\n }",
"function get_class_basename($object_or_class): string\n {\n $class = is_object($object_or_class) ? get_class($object_or_class) : $object_or_class;\n\n return basename(str_replace('\\\\', '/', $class));\n }",
"protected function getTypeName(): string\n {\n if (isset($this->typeName)) {\n return $this->typeName;\n }\n\n return $this->getModelNameBasedOnClassName();\n }",
"public function getFileClassType()\n {\n return DirectoryConverter::ITEMCLASS;\n }",
"public function directoryName($projectImage, PropertyMapping $mapping)\n {\n $projectName = $projectImage->getProject()->getName();\n\n $directoryName = FxStringsTools::quickSlugify($projectName);\n\n return $directoryName;\n }",
"public function get_type() { return substr( strrchr( get_called_class(), '\\\\' ), 1 ); }",
"public function getSlug()\n\t{\n\t\t$posttype_class = get_called_class();\n\t\treturn ( string ) $posttype_class::$post_type;\n\t}",
"public function getDir(): string;",
"protected function getUploadDir()\n {\n return 'uploads/documents/' . $this->doctype;\n }",
"function entity_type_root_path($entity_type) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getToolboxHelper();\n\n return $helper->rootPath();\n}",
"public function get_base( $type ) : string {\n switch ( $type ) {\n case 'name':\n return $this->get_basename();\n case 'path':\n return $this->get_base_path();\n case 'url':\n return $this->get_base_url();\n default:\n return '';\n }\n }",
"public function getDirectory()\n {\n return $this->_path['dirname'];\n }",
"function email_get_root_folder_name($type) {\n\n\tif ($type == EMAIL_INBOX) {\n\t\t$name = get_string('inbox', 'block_email_list');\n\t} else if ($type == EMAIL_SENDBOX) {\n\t\t$name = get_string('sendbox', 'block_email_list');\n\t} else if ($type == EMAIL_TRASH) {\n\t\t$name = get_string('trash', 'block_email_list');\n\t} else if ($type == EMAIL_DRAFT) {\n\t\t$name = get_string('draft', 'block_email_list');\n\t} else {\n\t\t// Type is not defined\n\t\t$name = '';\n\t}\n\n\treturn $name;\n}",
"public function getObjectType();",
"public function getObjectType();",
"public function getDirName(): string\n {\n $dirname = dirname($this->currentFileName);\n\n if ($dirname == '.') {\n return '';\n }\n\n return $dirname;\n }",
"public function getTypePath() {\n $type = preg_replace(\"/\\[.*?\\]/\", \"\", $this->type);\n $pathRewrite = str_replace(\"\\\\\", \"/\", $type);\n return $pathRewrite != $type ? \"/\" . ltrim($pathRewrite, \"/\") : null;\n }",
"public function getObjectName($object){\n\t\t$parts = explode('\\\\', get_class($object));\n\t\treturn strtolower(array_pop($parts));\n\t}",
"protected function getTemplateDir(): string\n {\n $dirParts = [\n AutoloaderInterface::MODULES_PATHNAME,\n $this->getModuleContext(),\n 'tpl'\n ];\n\n return implode(DIRECTORY_SEPARATOR, $dirParts);\n }",
"public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }",
"protected function getIndexType($bean)\n {\n if (!empty($bean->module_dir)) {\n return $bean->module_dir;\n } else {\n return self::DEFAULT_INDEX_TYPE;\n }\n }",
"public function getTypeName($type = null)\n {\n $group = $this->getGroup();\n $type = $type === null ? $this->getType() : $type;\n $path = sprintf('wrappers.%s.%s.name', $group, $type);\n\n return Bootstrap::getConfigVar($path);\n }",
"function getClassName($objectType) {\n\t\t$type = strtolower($objectType);\n\t\tif ($this->plugin) {\n\t\t\t$path = Inflector::pluralize($type);\n\t\t\tif ($type === 'helper') {\n\t\t\t\t$path = 'views' . DS . $path;\n\t\t\t} elseif ($type === 'component') {\n\t\t\t\t$path = 'controllers' . DS . $path;\n\t\t\t} elseif ($type === 'behavior') {\n\t\t\t\t$path = 'models' . DS . $path;\n\t\t\t}\n\t\t\t$options = App::objects($type, App::pluginPath($this->plugin) . $path, false);\n\t\t} else {\n\t\t\t$options = App::objects($type);\n\t\t}\n\t\t$this->out(sprintf(__('Choose a %s class', true), $objectType));\n\t\t$keys = array();\n\t\tforeach ($options as $key => $option) {\n\t\t\t$this->out(++$key . '. ' . $option);\n\t\t\t$keys[] = $key;\n\t\t}\n\t\t$selection = $this->in(__('Choose an existing class, or enter the name of a class that does not exist', true));\n\t\tif (isset($options[$selection - 1])) {\n\t\t\treturn $options[$selection - 1];\n\t\t}\n\t\treturn $selection;\n\t}",
"public static function current_object_type() {\n\t\tglobal $pagenow;\n\t\t$type = 'post';\n\n\t\tif ( in_array( $pagenow, [ 'user-edit.php', 'profile.php', 'user-new.php' ], true ) ) {\n\t\t\t$type = 'user';\n\t\t}\n\n\t\tif ( in_array( $pagenow, [ 'edit-comments.php', 'comment.php' ], true ) ) {\n\t\t\t$type = 'comment';\n\t\t}\n\n\t\tif ( in_array( $pagenow, [ 'edit-tags.php', 'term.php' ], true ) ) {\n\t\t\t$type = 'term';\n\t\t}\n\n\t\tif ( Conditional::is_ajax() && 'add-tag' === Param::post( 'action' ) ) {\n\t\t\t$type = 'term';\n\t\t}\n\n\t\treturn $type;\n\t}",
"public function getName()\r\n\t{\r\n\t\treturn GeekPoint_AdminDAVi_Directory_Root::ADMIN_TEMPLATES;\r\n\t}",
"public static function getTypeName($type = ''): string\n {\n switch ($type) {\n case '':\n $type = 'app_id';\n break;\n case 'app':\n $type = 'appid';\n break;\n default:\n $type = $type.'_id';\n }\n\n return $type;\n }",
"public function getClassFolder($type)\n {\n return isset($this->namespaces[$type]) ? $this->namespaces[$type] : false;\n }",
"public function getDirectory(): string;",
"public function getObjectType() : string;",
"public function getTypeName()\n {\n return $this->type->getName();\n }",
"protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/w2share';\n }",
"private function getBaseModuleDir($type, $id)\n {\n $this->checkInit();\n $type = SanitizerTool::sanitizeFileName($type);\n $id = SanitizerTool::sanitizeFileName($id);\n return $this->rootDir . \"/$type/$id\";\n }"
] | [
"0.69865394",
"0.67635524",
"0.6652575",
"0.6649803",
"0.66300887",
"0.6527499",
"0.6215122",
"0.61566806",
"0.61389947",
"0.6063629",
"0.6054397",
"0.6043413",
"0.60420436",
"0.6017169",
"0.60124964",
"0.6008611",
"0.59829533",
"0.59541494",
"0.59476876",
"0.593549",
"0.59182316",
"0.59052956",
"0.58581793",
"0.58367056",
"0.58239055",
"0.58036304",
"0.5798856",
"0.5786422",
"0.5770124",
"0.5768877",
"0.5743983",
"0.5738773",
"0.5738773",
"0.57080746",
"0.5699247",
"0.5691474",
"0.5688082",
"0.5659581",
"0.56551534",
"0.56521654",
"0.5646281",
"0.56373477",
"0.5631322",
"0.5630782",
"0.56187284",
"0.5581599",
"0.5577885",
"0.5576923",
"0.55669314",
"0.5543883",
"0.5541825",
"0.553996",
"0.5523386",
"0.5521364",
"0.5520383",
"0.5518753",
"0.5512331",
"0.5511765",
"0.5490294",
"0.54886377",
"0.5487163",
"0.54841745",
"0.54668754",
"0.545153",
"0.5446827",
"0.54398465",
"0.5432056",
"0.54281765",
"0.5423984",
"0.5419419",
"0.5405085",
"0.5401106",
"0.5396392",
"0.53935575",
"0.53935575",
"0.53932124",
"0.5388992",
"0.5385113",
"0.53788394",
"0.5376966",
"0.53618723",
"0.53618723",
"0.53618723",
"0.53618723",
"0.53618723",
"0.53618723",
"0.53618723",
"0.53618723",
"0.53566456",
"0.5353799",
"0.53456515",
"0.53451735",
"0.53436506",
"0.5341307",
"0.5336521",
"0.5336144",
"0.53304124",
"0.5326865",
"0.5319449",
"0.53143805"
] | 0.8279505 | 0 |
Returns the allowable file extensions supported by this model. | public function getAllowedExtensions()
{
return $this->allowedExtensions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllowedExtensions()\n {\n return $this->allowedFiles;\n }",
"public function getAllowFileExtensions()\n\t{\n\t\treturn implode(',', array_merge($this->videoExtensions, $this->imageExtensions, $this->audioExtensions, $this->docExtensions ));\n\t\t//return Yii::app()->params['fileExtensions'];\n\t}",
"public function getSupportedFileExtensions() {}",
"protected function _getAllowedExtensions()\n {\n return ['jpg', 'jpeg', 'gif', 'png', 'svg'];\n }",
"public function getAllowedExtensions()\n {\n return $this->_allowedExtensions;\n }",
"public function getAllowedFileExtensions()\n {\n return ['jpg', 'jpeg', 'gif', 'png'];\n }",
"public function getAllowedExtensions(){\n return $this->allowedExtensions;\n }",
"public function getExtensionAllowed()\n {\n return array_merge($this->imageTypes, $this->videoTypes, $this->documentTypes);\n }",
"public function getSupportedFileExtensions()\n {\n return array_keys($GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['onlineMediaHelpers']);\n }",
"public static function getAllowedFileExtensions() {\n\t\tif (self::$allowedFileExtensions === null) {\n\t\t\tself::$allowedFileExtensions = array();\n\t\t\tself::$allowedFileExtensions = array_unique(explode(\"\\n\", StringUtil::unifyNewlines(WCF::getUser()->getPermission('user.profile.avatar.allowedFileExtensions'))));\n\t\t\tself::$allowedFileExtensions = array_diff(self::$allowedFileExtensions, self::$illegalFileExtensions);\n\t\t}\n\t\t\n\t\treturn self::$allowedFileExtensions;\n\t}",
"protected function getAcceptFileTypes()\n {\n $extensions = $this->getValidator()->getAllowedExtensions();\n if (!$extensions) {\n return [];\n }\n $extentionString = \"\";\n $i = 0;\n foreach ($extensions as $extension) {\n if ($i == 0) {\n $extentionString .= \".{$extension}\";\n } else {\n $extentionString .= \", .{$extension}\";\n }\n $i++;\n }\n return $extentionString;\n }",
"static public function getAllowedExtensions()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('extention')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->extention;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"private function getAllowedFileTypes()\n {\n return str_replace('.', '', config('media.allowed', ''));\n }",
"public final function getAcceptedExtensions() { \n return $this->acceptedExtensions; }",
"public function get_allowed_image_extensions()\r\n\t{\r\n\t\t$content_types = $this->upload_config['content_types'];\r\n\r\n\t\t$allowed_image_extensions = array();\r\n\t\tforeach($content_types as $extension => $content_type)\r\n\t\t{\r\n\t\t\tif(substr($content_type, 0, 5) == 'image')\r\n\t\t\t{\r\n\t\t\t\t$allowed_image_extensions[] = $extension;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $allowed_image_extensions;\r\n\t}",
"protected function getFileExtensions() {\n\t\treturn $this->fileExtensions;\n\t}",
"public static function getAllowedExtension()\n\t{\n\t\treturn ['xml' => 'XML'];\n\t}",
"public function getValidExtensions();",
"public function getFileTypeRestrictions(): array\n {\n return $this->supportedFileTypes;\n }",
"public function getFileTypeRestrictions() {}",
"public function get_supported_extensions() {\n return array();\n }",
"public function supported_filetypes() {\n return '*';\n }",
"public function getAllowedExtensions()\n {\n return array('md', 'markdown');\n }",
"public function getSupportedExtensions()\n {\n return array_keys($this->convertersByExtension);\n }",
"public function getAllowedFiles(){\n return self::$allowed_files;\n }",
"public function getAcceptExtensions();",
"function getFileTypeRestrictions() ;",
"public function fileExtensions($mimeType);",
"public function getFileExtension();",
"public function getExtensions()\n {\n return $this->extension;\n }",
"public function getSupportedImageExt() {\n return $this->__supportedImageExtension;\n }",
"public function getExtensionAttribute()\n {\n return pathinfo($this->file_path, PATHINFO_EXTENSION);\n }",
"public function isAllowedExtension()\n {\n if (!empty($this->allowed_upload_file_ext)) {\n if (!is_array($this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(FILE_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['ext'], $this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILE_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }",
"public function getSupportedMimeTypes()\n {\n return array_keys($this->convertersByMimeType);\n }",
"static public function getAllowedMimeTypes()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('content_type')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->content_type;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function getSupportedExtensions()\n\t{\n\t\treturn array('xml');\n\t}",
"protected function getAcceptedExtensions(): array\n {\n return array_keys($this->getConfigResolverAdapters());\n }",
"public function getAvailableExtensions() {}",
"public function getExtensions();",
"public function getSupportedFileTypes(){\n\t\t$_url = $this->constants['SERVICE_ENTRY_POINT'].$this->constants['SERVICE_VERSION'].'/'.$this->constants['MISC_PATH'].'/supported-file-types';\n\t\t$response = $this->getRequests($_url)['response'];\n\t\treturn $response;\n\t}",
"public function getDirectoryExtensionsEnabled()\n {\n if (array_key_exists(\"directoryExtensionsEnabled\", $this->_propDict)) {\n return $this->_propDict[\"directoryExtensionsEnabled\"];\n } else {\n return null;\n }\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getAvailableMimeTypes()\n {\n return $this->availableMimeTypes;\n }",
"public function getImageTypeAllowableValues()\r\n {\r\n return [\r\n self::IMAGE_TYPE_BACKUP,\r\n self::IMAGE_TYPE_REPLICATION,\r\n ];\r\n }",
"public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }",
"public static function getExtensions()\n {\n return self::$_extensions;\n }",
"public function getFileTypes() {\r\n return $this->fileTypes;\r\n }",
"public function provideFileAndExtension()\n {\n return [\n [__FILE__, 'php'],\n ['.htaccess', 'htaccess'],\n ['name', ''],\n ['a.combined.filename.with.multiple.ext.separator', 'separator']\n ];\n }",
"protected function getAcceptedFiles()\n {\n $accepted_files = str_replace(' ', '',\n str_replace('.', '', $this->config->get('media.accepted_files'))\n );\n\n return $accepted_files;\n }",
"public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }",
"public function extensions(): array;",
"public function getFileTypes()\n {\n return $this->fileTypes;\n }",
"public function file_extensions_for_case_studies(){\n\t\t$filetype_arr = array();\n\t\t$filetype_arr['ppt'] = \"PowerPoint\";\n\t\t$filetype_arr['pptx'] = \"PowerPoint\";\n\t\t$filetype_arr['pdf'] = \"PDF file\";\n\t\treturn $filetype_arr;\n\t}",
"public function getAllowedFileExtensions($post_id=null){\n if(empty($post_id) && !isset($_POST['comment_post_ID'])){\n global $post;\n if(isset($post) && is_object($post)){\n $post_id = $post->ID; \n }else{\n return;\n }\n }\n\n $return = array();\n $pluginFileTypes = $this->getMimeTypes();\n\n if(isset($_POST['comment_post_ID'])){\n $assignment_id = $_POST['comment_post_ID'];\n }\n \n if(empty($assignment_id)){\n $assignment_id = $post_id;\n }\n $attachment_type=get_post_meta($assignment_id,'vibe_attachment_type',true);\n if(is_array($attachment_type) && in_array('JPG',$attachment_type)){\n $attachment_type[]='JPEG';\n }\n if(empty($attachment_type)){\n $attachment_type=array('JPEG');\n }\n return $attachment_type;\n }",
"public function getExtensions() {}",
"public function getExtensions() {}",
"public static function supportedFormats()\n {\n return [\n 'avif' => 'image/avif',\n 'gif' => 'image/gif',\n 'jpg' => 'image/jpeg',\n 'pjpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'webp' => 'image/webp',\n 'tiff' => 'image/tiff',\n ];\n }",
"public function getExtensions(): array;",
"static function getImageExtensions()\n {\n return array('jpg', 'jpeg', 'gif', 'png', );\n }",
"public function getExtension()\n {\n return File::get_file_extension($this->getField('Name'));\n }",
"public function getFileExtension()\n {\n return $this->fileExtension;\n }",
"public function getFileExtension()\n {\n return $this->fileExtension;\n }",
"private function getMimeTypes()\n {\n return apply_filters('wplms_assignments_upload_mimes_array',array(\n 'JPG' => array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap'),\n 'GIF' => array(\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_'),\n 'PNG' => array(\n 'image/png',\n 'application/png',\n 'application/x-png'),\n 'DOCX'=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'RAR'=> 'application/x-rar',\n 'ZIP' => array(\n 'application/zip',\n 'application/x-zip',\n 'application/x-zip-compressed',\n 'application/x-compress',\n 'application/x-compressed',\n 'multipart/x-zip'),\n 'DOC' => array(\n 'application/msword',\n 'application/doc',\n 'application/text',\n 'application/vnd.msword',\n 'application/vnd.ms-word',\n 'application/winword',\n 'application/word',\n 'application/x-msw6',\n 'application/x-msword'),\n 'PDF' => array(\n 'application/pdf',\n 'application/x-pdf',\n 'application/acrobat',\n 'applications/vnd.pdf',\n 'text/pdf',\n 'text/x-pdf'),\n 'PPT' => array(\n 'application/vnd.ms-powerpoint',\n 'application/mspowerpoint',\n 'application/ms-powerpoint',\n 'application/mspowerpnt',\n 'application/vnd-mspowerpoint',\n 'application/powerpoint',\n 'application/x-powerpoint',\n 'application/x-m'),\n 'PPTX'=> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'PPS' => 'application/vnd.ms-powerpoint',\n 'PPSX'=> 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'PSD' => array('application/octet-stream',\n 'image/vnd.adobe.photoshop'\n ),\n 'ODT' => array(\n 'application/vnd.oasis.opendocument.text',\n 'application/x-vnd.oasis.opendocument.text'),\n 'XLS' => array(\n 'application/vnd.ms-excel',\n 'application/msexcel',\n 'application/x-msexcel',\n 'application/x-ms-excel',\n 'application/vnd.ms-excel',\n 'application/x-excel',\n 'application/x-dos_ms_excel',\n 'application/xls'),\n 'XLSX'=> array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'),\n 'MP3' => array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio'),\n 'M4A' => array(\n 'audio/mp4a-latm',\n 'audio/m4a',\n 'audio/mp4'),\n 'OGG' => array(\n 'audio/ogg',\n 'application/ogg'),\n 'WAV' => array(\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav'),\n 'WMA' => 'audio/x-ms-wma',\n 'MP4' => array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4'),\n 'M4V' => array(\n 'video/mp4',\n 'video/x-m4v'),\n 'MOV' => array(\n 'video/quicktime',\n 'video/x-quicktime',\n 'image/mov',\n 'audio/aiff',\n 'audio/x-midi',\n 'audio/x-wav',\n 'video/avi'),\n 'WMV' => 'video/x-ms-wmv',\n 'AVI' => array(\n 'video/avi',\n 'video/msvideo',\n 'video/x-msvideo',\n 'image/avi',\n 'video/xmpg2',\n 'application/x-troff-msvideo',\n 'audio/aiff',\n 'audio/avi'),\n 'MPG' => array(\n 'video/avi',\n 'video/mpeg',\n 'video/mpg',\n 'video/x-mpg',\n 'video/mpeg2',\n 'application/x-pn-mpg',\n 'video/x-mpeg',\n 'video/x-mpeg2a',\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'image/mpg'),\n 'OGV' => 'video/ogg',\n '3GP' => array(\n 'audio/3gpp',\n 'video/3gpp'),\n '3G2' => array(\n 'video/3gpp2',\n 'audio/3gpp2'),\n 'FLV' => 'video/x-flv',\n 'WEBM'=> 'video/webm',\n 'APK' => 'application/vnd.android.package-archive',\n ));\n }",
"public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach ($extensions as $extension) {\n $results[$extension] = extension_loaded($extension);\n }\n\n return $results;\n }",
"public function getFileExtension()\n {\n return $this->_fileExtension;\n }",
"public function provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}",
"public function getExtension();",
"public function getExtension();",
"public function getExtension();",
"public function getFileExtension(){\n\n if($this->isPhoto()){\n return \"jpg\";\n }\n\n if($this->isVideo()){\n return \"mp4\";\n }\n\n return \"bin\";\n\n }",
"public function getExtension()\n {\n return $this->fileExtension;\n }",
"public function getFileExtension(): string\n {\n return $this->fileExtension;\n }",
"public function getSupportedExtensions()\n {\n return array('json');\n }",
"public function getFileExtension()\n\t{\n\t\treturn $this->fileExtension;\n\t}",
"public function getMatchableExtensions();",
"public function getAllowedExtensions($type = null) {\r\n $extensions = $this->getConfigData('extensions');\r\n $extensions['video_allowed'] = array(\r\n 'mp4' => 1,\r\n 'mp3' => 1,\r\n 'webm' => 1,\r\n 'ogv' => 1,\r\n 'avi' => 1\r\n );\r\n if (is_string($type) && array_key_exists(\"{$type}_allowed\", $extensions)) {\r\n $allowed = $extensions[\"{$type}_allowed\"];\r\n } else {\r\n $allowed = $extensions['allowed'];\r\n }\r\n return array_keys(array_filter($allowed));\r\n }",
"abstract protected function getFileExtension();",
"protected function getExtensions()\n {\n if (file_exists(realpath(__DIR__.'/../../../../../config/twig.php'))) {\n $this->config = require realpath(__DIR__.'/../../../../../config/twig.php');\n } else {\n $this->config = require realpath(__DIR__.'/../../config/twig.php');\n }\n\n return isset($this->config['extensions']) ? $this->config['extensions'] : [];\n }",
"public function getSupportedFormat()\n {\n return array(\n 'm4v',\n 'ogv',\n 'flv',\n );\n }",
"public function getExtension()\n {\n return $this->file['extension'];\n }",
"public function extension($filePath);",
"public function get_file_extension () {\r\n\t\treturn $this->_file_extension;\r\n\t}",
"public function get_allowed_content_object_types()\n {\n return array(File::class);\n }",
"public function extension() : string {\n return $this->file->extension;\n }",
"public function getExt()\n {\n $filename = $this->getPath(); \n return pathinfo($filename, PATHINFO_EXTENSION);\n }",
"public function getMimeTypeToExtensionMap()\n {\n return $this->mimeTypeToExtension;\n }",
"abstract public function acceptedExtension(): string;",
"public function ext()\n {\n if (!$this->info) {\n $this->info();\n }\n if (isset($this->info['extension'])) {\n return $this->info['extension'];\n }\n\n return false;\n }",
"protected function getExtensions()\r\n {\r\n return array(new ValidatorExtension(Validation::createValidator()));\r\n }",
"function get_vid_extensions()\r\n{\r\n $exts = config('allowed_types');\r\n $exts = preg_replace(\"/ /\",\"\",$exts);\r\n $exts = explode(\",\",$exts);\r\n return $exts;\r\n}",
"public function getExtension() {}",
"protected function extensions() \n {\n return ['php'];\n }",
"public function getExtension() {}",
"function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}",
"public function getFileExtension()\n {\n return $this->originalAsset->getFileExtension();\n }",
"public function getMimeTypes() {\n return $this->mimeTypes;\n }"
] | [
"0.8461188",
"0.8457372",
"0.8232295",
"0.8076225",
"0.80326235",
"0.8010132",
"0.79803705",
"0.7969229",
"0.7890523",
"0.7772665",
"0.77056307",
"0.7682949",
"0.76175076",
"0.7610192",
"0.7596606",
"0.7584177",
"0.7546928",
"0.73727226",
"0.7274616",
"0.71379167",
"0.70806694",
"0.7061166",
"0.7010049",
"0.6992163",
"0.69521606",
"0.6903717",
"0.6863303",
"0.6777691",
"0.67506605",
"0.67036784",
"0.6630616",
"0.663041",
"0.6603435",
"0.6599626",
"0.65953887",
"0.65439194",
"0.6499902",
"0.6461289",
"0.64592534",
"0.64544857",
"0.64458376",
"0.64135796",
"0.64135796",
"0.64135796",
"0.64135796",
"0.64115995",
"0.6406719",
"0.63826555",
"0.6382578",
"0.63775384",
"0.63676465",
"0.635141",
"0.63507277",
"0.6336584",
"0.6336539",
"0.63346356",
"0.6334114",
"0.63137597",
"0.63137",
"0.6302194",
"0.6290803",
"0.62901086",
"0.62882894",
"0.6266494",
"0.6266494",
"0.624789",
"0.623635",
"0.6231703",
"0.6226875",
"0.6208629",
"0.6208629",
"0.6208629",
"0.62075573",
"0.6188551",
"0.61723673",
"0.61705905",
"0.6167422",
"0.6164501",
"0.61479366",
"0.613063",
"0.6125429",
"0.60997677",
"0.6092837",
"0.6073799",
"0.6071418",
"0.60557413",
"0.60305595",
"0.60302925",
"0.60263366",
"0.6025883",
"0.60230386",
"0.60188854",
"0.6018883",
"0.60144407",
"0.6014089",
"0.60126436",
"0.60060966",
"0.59996337",
"0.59976584"
] | 0.8153383 | 4 |
Returns true if this template supports code and settings sections. | public function isCompoundObject()
{
return $this->isCompoundObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function uses_sections() {\n return true;\n }",
"public function uses_sections() {\n return true;\n }",
"public function uses_sections() {\n\n return true;\n\n }",
"function audioman_is_featured_content_active( $control ) {\n\t\t$enable = $control->manager->get_setting( 'audioman_featured_content_option' )->value();\n\n\t\treturn ( audioman_check_section( $enable ) );\n\t}",
"public function can_process_shortcodes () {\n\t\treturn apply_filters(\n\t\t\t'upfront-shortcode-enable_in_layout',\n\t\t\t(defined('UPFRONT_DISABLE_LAYOUT_TEXT_SHORTCODES') && UPFRONT_DISABLE_LAYOUT_TEXT_SHORTCODES ? false : true)\n\t\t);\n\t}",
"public function has_shortcode ()\n {\n return $this->page_has_shortcode;\n }",
"public function isSection()\n {\n return false;\n }",
"function isCustomTemplate() {\n\t\treturn $this->isCustomTemplate;\n\t}",
"function isCustomTemplate() {\n\t\treturn $this->isCustomTemplate;\n\t}",
"protected function projectSpecificSectionsCondition()\n {\n return\n isset($this->get['urls']) ||\n //F\n isset($this->get['divisions-products']) ||\n isset($this->get['translations']) ||\n //A\n isset($this->get['products']) ||\n isset($this->get['pages']);\n }",
"final protected static function canRun() : bool\n\t{\n\t\t$bCanRun = false;\n\n\t\t/*<!-- build:debug -->*/\n\t\t$bCanRun = parent::canRun();\n\n\t\tif ($bCanRun) {\n\t\t\t// Only when debugmode is set\n\t\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\t\t\t$bCanRun = $aeSettings->getDebugMode();\n\t\t}\n\t\t/*<!-- endbuild -->*/\n\n\t\treturn $bCanRun;\n\t}",
"public function getIsSnippetEnabled()\n {\n return $this->helper->isSnippetEnabled();\n }",
"protected function isEnabled() {\n\t\treturn (\n\t\t\t$this->getPageService()->isEnabled() &&\n\t\t\t(bool) $this->getTypoScriptService()->resolve('settings.enable')\n\t\t);\n\t}",
"public function hasCpSection()\n {\n return false;\n }",
"public function hasCpSection()\n {\n return true;\n }",
"public function hasCpSection()\n {\n return true;\n }",
"function tc_is_customizing() {\r\n //checks if is customizing : two contexts, admin and front (preview frame)\r\n global $pagenow;\r\n $is_customizing = false;\r\n if ( is_admin() && isset( $pagenow ) && 'customize.php' == $pagenow ) {\r\n $is_customizing = true;\r\n } else if ( ! is_admin() && isset($_REQUEST['wp_customize']) ) {\r\n $is_customizing = true;\r\n }\r\n return $is_customizing;\r\n }",
"public function hasModuleSettings()\n {\n return true;\n }",
"public function canRun(): bool\n\t{\n\t\tif (!file_exists(JPATH_LIBRARIES . '/Jdideal'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif (class_exists('RSFormProHelper'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$helper = JPATH_ADMINISTRATOR\n\t\t\t. '/components/com_rsform/helpers/rsform.php';\n\n\t\tif (file_exists($helper))\n\t\t{\n\t\t\trequire_once $helper;\n\t\t\tRSFormProHelper::readConfig(true);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function isCustomTemplate() {\n\t\treturn false;\n\t}",
"function isSectionEditable($sectionId){\r\n\t\t//sections no longer used\r\n\t\tif (in_array($sectionId, array (4,5))) {\r\n\t\t\t//HTML or PHP module, invalid module since that can be done in smarty templates now\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t//disable featured levels 2-5 unless the addon is present\r\n\t\t$featuredLevels = array(13,14,15,16);\r\n\t\tif(in_array($sectionId, $featuredLevels) && !geoAddon::getInstance()->isEnabled('featured_levels')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function hasCpSection()\n\t{\n\t\treturn true;\n\t}",
"public function isEnabled() {\n\t\treturn $this->_runtime['enabled'];\n\t}",
"function get_classic_theme_supports_block_editor_settings()\n {\n }",
"public function canManageSnippets();",
"function canBeMadeConditional() {\n\tif ($this->getIsConditional()) {\n\t return false;\n\t}\n\t \n\t// DEBUG\n\treturn false;\n }",
"public static function isEnabled()\n {\n // Frontend editing needs to be enabled also by admins\n if (isset($GLOBALS['BE_USER']) && $GLOBALS['TSFE']->config['config']['tx_frontend_editing'] == 1) {\n return ($GLOBALS['BE_USER']->uc['tx_frontend_editing_enable'] == 1);\n }\n\n return false;\n }",
"protected function isPageTemplate(): bool {\n return (\n $this->layout === 'single' || \n $this->layout === 'archive'\n );\n }",
"function wp_is_development_mode($mode)\n {\n }",
"protected function is_active() {\n\t\treturn 'twentyfourteen' === get_template() || ( defined( 'JETPACK__VERSION' ) && get_theme_support( 'featured-content' ) );\n\t}",
"public function supports(){\n\t\t#Default support array\n\t\t$supports = array();\n\t\tif ($this->options('use_title')){\n\t\t\t$supports[] = 'title';\n\t\t}\n\t\tif ($this->options('use_order')){\n\t\t\t$supports[] = 'page-attributes';\n\t\t}\n\t\tif ($this->options('use_thumbnails')){\n\t\t\t$supports[] = 'thumbnail';\n\t\t}\n\t\tif ($this->options('use_editor')){\n\t\t\t$supports[] = 'editor';\n\t\t}\n\t\tif ($this->options('use_revisions')){\n\t\t\t$supports[] = 'revisions';\n\t\t}\n\t\treturn $supports;\n\t}",
"public function isEnabled()\n\t{\n\t\treturn Mage::helper('wordpress')->isPluginEnabled('wordpress-seo/wp-seo.php') \n\t\t\t|| Mage::helper('wordpress')->isPluginEnabled('wordpress-seo-premium/wp-seo-premium.php');\n\t}",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/traineedoc');\n }",
"public function isEnableModuleTemplatesLoader()\n {\n return $this->enableModuleTemplatesLoader;\n }",
"public function isTemplateHintsEnabled(): bool\n {\n if (!$this->config->getValue(self::CONFIG_PATH_TEMPLATE_HINTS)) {\n return false;\n }\n\n return true;\n }",
"public function usesCompiler()\n {\n // does not use compiler, template is PHP\n return false;\n }",
"private function is_editor() {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t// A global admin can edit content or change options anywhere.\n\t\t\tif ( is_super_admin() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$user = wp_get_current_user();\n\n\t\t\t// On the WSUWP Platform, a network admin can edit content or change options\n\t\t\t// anywhere on an individual network and may not have a role assigned.\n\t\t\tif ( function_exists( 'wsuwp_is_network_admin' ) ) {\n\t\t\t\tif ( wsuwp_is_network_admin( $user->user_login ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Authors and above have (at least) the ability to publish content or delete\n\t\t\t// published content at some level.\n\t\t\t$allowed_roles = array( 'editor', 'administrator', 'author' );\n\t\t\tif ( array_intersect( $allowed_roles, $user->roles ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isEnabled(): bool\n {\n return config('theme-system.enable', true) ?? true;\n }",
"public function isFrontendArea(): bool;",
"private function canRun()\n {\n $confEnabled = $this->config()->get('cdn_rewrite');\n $devEnabled = ((!Director::isDev()) || ($this->config()->get('enable_in_dev')));\n return ($confEnabled && $devEnabled);\n }",
"public function isPhpBlock()\n {\n return file_exists($this->getFolder() . '/view.php');\n }",
"private static function lp_check_is_block_editor() {\n\n // Check if Guteberg plugin available.\n if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) {\n return true;\n }\n\n $current_screen = get_current_screen();\n\n if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {\n return true;\n }\n\n return false;\n }",
"public function _isEnable(){\n return true;\n if(!array_key_exists('enable', $this->moduleConfig)) return false;\n return $this->moduleConfig['enable'];\n }",
"private function isEnabled()\n {\n if(is_file(JPATH_SITE.DS.'components'.DS.'com_magebridge'.DS.'models'.DS.'config.php')) {\n return true;\n }\n return false;\n }",
"public function isEditor(){\n\t\tif($_SESSION['waf_user']['editor']==1)return true;\n\t\telse return false;\n\t}",
"public function isCustomJsEnabled()\n {\n return $this->getGravityHelper()->getIsCustomJsEnabled();\n }",
"function is_settings() {\n\t\t\t\tglobal $pagenow;\n\t\t\t\treturn is_admin() && $pagenow == $this->settings_parent && $_GET['page'] == $this->slug;\n\t\t\t}",
"function wp_should_load_block_editor_scripts_and_styles()\n {\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/coursedoc');\n }",
"private function should_load() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$theme_support = get_theme_support( 'themeisle-demo-import' );\n\n\t\tif ( empty( $theme_support ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function isContentToBeParsed() {\n\t\t$result = FALSE;\n\t\t$currentPageUid = $GLOBALS['TSFE']->id;\n\t\t// get rootline of the current page\n\t\t$rootline = $GLOBALS['TSFE']->sys_page->getRootline($currentPageUid);\n\t\t// build an array of uids of pages the rootline\n\t\tfor ($i=count($rootline)-1; $i>=0; $i--) {\n\t\t\t$pageUidsInRootline[] = $rootline[\"$i\"]['uid'];\n\t\t}\n\t\t// check if the root page is in the rootline of the current page\n\t\tforeach (t3lib_div::trimExplode(',',$this->settings['includeRootPages'],1) as $includeRootPageUid) {\n\t\t\tif (t3lib_div::inArray((array)$pageUidsInRootline,$includeRootPageUid))\n\t\t\t\t$result = TRUE;\n\t\t}\n\t\tforeach (t3lib_div::trimExplode(',',$this->settings['excludeRootPages'],1) as $excludeRootPageUid) {\n\t\t\tif (t3lib_div::inArray((array)$pageUidsInRootline,$excludeRootPageUid))\n\t\t\t\t$result = FALSE;\n\t\t}\n\t\tif (t3lib_div::inList($this->settings['includePages'],$currentPageUid)) {\n\t\t\t$result = TRUE;\n\t\t}\n\t\tif (t3lib_div::inList($this->settings['excludePages'],$currentPageUid)) {\n\t\t\t$result = FALSE;\n\t\t}\n\t\tif ( $GLOBALS['TSFE']->page['f3_contentparser_dont_parse'] == 1) {\n\t\t\t$result = FALSE;\n\t\t}\n\t\t// if ( $this->cObj->getFieldVal('f3_contentparser_dont_parse') == 1) {\n\t\t// \t$result = FALSE;\n\t\t// }\n\n\t\treturn $result;\n\t}",
"public function canShowScript() {\n\t\t$pluginUpgrader = new Utils\\PluginUpgraderSilentAjax();\n\t\t$miLite = $pluginUpgrader->pluginSlugs['miLite'];\n\t\t$miPro = $pluginUpgrader->pluginSlugs['miPro'];\n\t\t$emLite = $pluginUpgrader->pluginSlugs['emLite'];\n\t\t$emPro = $pluginUpgrader->pluginSlugs['emPro'];\n\t\t$activePlugins = get_option( 'active_plugins' );\n\n\t\tif (\n\t\t\tin_array( $miLite, $activePlugins, true ) ||\n\t\t\tin_array( $miPro, $activePlugins, true ) ||\n\t\t\tin_array( $emLite, $activePlugins, true ) ||\n\t\t\tin_array( $emPro, $activePlugins, true )\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$googleAnalyticsId = aioseo()->options->deprecated->webmasterTools->googleAnalytics->id;\n\t\t$gtmContainerId = aioseo()->options->deprecated->webmasterTools->googleAnalytics->gtmContainerId;\n\n\t\tif (\n\t\t\tin_array( 'googleAnalytics', aioseo()->internalOptions->internal->deprecatedOptions, true ) &&\n\t\t\t! $googleAnalyticsId &&\n\t\t\t! $gtmContainerId\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ! $this->userIsExcluded();\n\t}",
"public static function hasContent(): bool\n {\n return true;\n }",
"protected function includeGeneralizations(): bool\n {\n return $this->getContentDimensionIdentifierToLimitTo() && $this->fusionValue('includeAllPresets');\n }",
"public function hasSections()\n {\n return null !== @$this->sections;\n }",
"function has_html() {\n\t\treturn $this->settings['popup'];\n\t}",
"function euphony_is_hero_content_active( $control ) {\n\t\t$enable = $control->manager->get_setting( 'euphony_hero_content_visibility' )->value();\n\n\t\treturn euphony_check_section( $enable );\n\t}",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) &&\n\t\t\t'wc-settings' == $_GET['page'] &&\n\t\t\tisset( $_GET['tab'] ) &&\n\t\t\t'tax' == $_GET['tab'] &&\n\t\t\tisset( $_GET['section'] ) &&\n\t\t\t'avatax' == $_GET['section'];\n\t}",
"public function canConfigure()\n {\n $options = $this->getOptions();\n return !empty($options) || $this->getTypeInstance(true)->canConfigure($this);\n }",
"public function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}",
"private function is_template_supported( $template ) {\n\t\t// If the --include argument is present in the WP-CLI command, this template conditional must be present in it.\n\t\tif ( ! empty( $this->include_conditionals ) ) {\n\t\t\treturn in_array( $template, $this->include_conditionals, true );\n\t\t}\n\t\tif ( $this->force_crawl_urls ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$supportable_templates = AMP_Theme_Support::get_supportable_templates();\n\n\t\t// Check whether this taxonomy's template is supported, including in the 'AMP Settings' > 'Supported Templates' UI.\n\t\treturn ! empty( $supportable_templates[ $template ]['supported'] );\n\t}",
"function has_configuration() {\n\t\treturn true;\n\t}",
"private static function _is_loadable()\n\t{\n\t\t$allowed_in_admin = apply_filters('bwp_minify_allowed_in_admin', false);\n\n\t\tif (is_admin() && !$allowed_in_admin)\n\t\t\treturn false;\n\n\t\tif (!did_action('template_redirect'))\n\t\t\treturn true;\n\n\t\t// ignore Geomashup\n\t\tif (!empty($_GET['geo_mashup_content'])\n\t\t\t&& 'render-map' == $_GET['geo_mashup_content'])\n\t\t\treturn false;\n\n\t\t// ignore AEC (Ajax Edit Comment)\n\t\tif (!empty($_GET['aec_page']))\n\t\t\treturn false;\n\n\t\t// ignore Simple:Press forum plugin\n\t\tif (defined('SPVERSION') && function_exists('sp_get_option'))\n\t\t{\n\t\t\t$sp_page = sp_get_option('sfpage');\n\t\t\tif (is_page($sp_page))\n\t\t\t\treturn false;\n\t\t}\n\n\t\t// @since 1.3.1 ignore Maintenance plugin\n\t\tif (bwp_is_maintenance_on())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function has_altis_config() : bool {\n\tif ( ! function_exists( 'Altis\\\\get_config' ) ) {\n\t\treturn false;\n\t}\n\n\tif ( ! isset( Altis\\get_config()['hm-juicer'] ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"static public function isHTML() {\n\t\treturn (self::$page_type === 0);\n\t}",
"function _is_development_mode() {\n\t\treturn IMFORZA_Utils::is_development_mode();\n\t}",
"protected function enabled() {\n\t\treturn class_exists( 'nProjects' );\n\t}",
"private function is_elementor_editor()\n {\n if ((isset($_REQUEST['action']) && 'elementor' == $_REQUEST['action']) ||\n isset($_REQUEST['elementor-preview'])\n ) {\n return true;\n }\n\n return false;\n }",
"function is_elementor_editor() {\n\t\treturn is_admin() && ( isset( $_GET['action'] ) && sanitize_text_field( $_GET['action'] ) === 'elementor' );\n\t}",
"public function isEnableThemeTemplatesLoader()\n {\n return $this->enableThemeTemplatesLoader;\n }",
"function has_config() {\n return true;\n }",
"function customised() {\n if($itm = Registry::get('article')) {\n\n return $itm->js or $itm->css;\n }\n\n return false;\n}",
"public function is_enabled() {\n $enabled = file_exists(ABSPATH . '!sak4wp.php');\n return $enabled;\n }",
"public function hasScriptType()\n {\n return $this->script_type !== null;\n }",
"public static function is_header_section_active() {\n\t\t\t$status = false;\n\t\t\tif ( Astra_Ext_Extension::is_active( 'header-sections' ) || Astra_Addon_Builder_Helper::$is_header_footer_builder_active ) {\n\t\t\t\t$status = true;\n\t\t\t}\n\t\t\treturn $status;\n\t\t}",
"private function isEditor() : bool\n {\n return $this->role('editor');\n }",
"public function isEnabled()\n {\n return $this->getState()->getMode() == View\\StateInterface::MODE_ENABLED;\n }",
"private static function _isTwigTweakEnabled() {\n $module = 'twig_tweak';\n $output = trim(shell_exec('drush pml --field=\"status\" --filter=\"' . $module . '\"'));\n if ($output == 'Enabled') {\n return TRUE;\n }\n return FALSE;\n }",
"protected function isFrontendMode()\n {\n return TYPO3_MODE == 'FE';\n }",
"function acf_is_block_editor()\n{\n}",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagicToolbox_MagicZoomPlus::magiczoomplus_settings_edit');\n }",
"public function isSupported()\n\t{\n\t\treturn $this->isSupported;\n\t}",
"public function is_plugin_settings() {\n\n\t\treturn isset( $_GET['page'], $_GET['tab'] ) && 'wc-settings' === $_GET['page'] && 'pip' === $_GET['tab'];\n\t}",
"public function canManageDevelopments();",
"public function allow_load() {\n\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! current_user_can( 'install_languages' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/template.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/file.php';\n\t\trequire_once ABSPATH . 'wp-admin/includes/translation-install.php';\n\n\t\treturn wp_can_install_language_pack();\n\t}",
"function is_primary() {\n\n\t\tif ( !empty( $this->get_post_types() ) ) {\n\n\t\t\tforeach ( TPL_FW()->registered_settings_pages as $key => $settings_page ) {\n\n\t\t\t\tif ( $settings_page->get_post_type() && $this->has_post_type( $settings_page->get_post_type() ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}",
"public function isOptions(): bool {}",
"public function isEnabled()\n {\n return $this->config->isEnabledSDK($this->_storeManager->getStore()->getId());\n }",
"public static function isSupported(): bool\n {\n // twig needs to be loaded via composer\n return class_exists('Twig_Environment', true);\n }",
"public function supportsLanguageSwitch(): bool;",
"private function canRun()\n {\n if (!$this->apiConfig->isAutoInvoiceEnabled()) {\n return false;\n }\n if (!$this->apiConfig->isEnabled()) {\n return false;\n }\n\n return true;\n }",
"public static function isSupported(): bool;",
"private function isPageBuilderUsed() : bool\n {\n $config = $this->getConfig();\n return $config->getData('activeEditorPath') === 'Magento_PageBuilder/pageBuilderAdapter'\n && $config->getData('is_pagebuilder_enabled') !== false;\n }",
"protected function enabled(): bool\n {\n return config('core-middleware.enabled', true);\n }",
"public function is_frontend_editor_page() {\n\t\tif ( is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tif (\n\t\t\t// Layouts frontend editor\n\t\t\tisset( $_GET['toolset_editor'] )\n\t\t\t// Beaver Builder frontend editor\n\t\t\t|| isset( $_GET['fl_builder'] )\n\t\t\t// CRED frontend editor pages, when discoverable\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function canManageBDXSnippets();",
"public function canManageOwnDevelopments();",
"function is_paper_wasp_editor( WP_Post $post = null ) {\n\n\t$is_paper_wasp_editor = false;\n\n\tif ( is_null( $post ) ) {\n\t\t$post = get_post();\n\t}\n\n\tif ( $post && current_user_can( 'edit_post', $post->ID ) ) {\n\t\tif ( is_admin() ) {\n\t\t\t$is_paper_wasp_editor = post_type_supports( $post->post_type, PaperWaspAdmin::FEATURE );\n\t\t} else if ( is_paper_wasp_enabled( $post ) && isset( $_GET['paper-wasp'] ) ) {\n\t\t\t$is_paper_wasp_editor = true;\n\t\t}\n\t}\n\n\treturn $is_paper_wasp_editor;\n\n}",
"public function should_load_block_editor_scripts_and_styles($is_block_editor_screen)\n {\n }",
"public function isSupported();",
"public function isSupported();"
] | [
"0.62456125",
"0.62456125",
"0.6217306",
"0.6164516",
"0.61567104",
"0.6141743",
"0.60814077",
"0.5994584",
"0.5994584",
"0.5968082",
"0.59273773",
"0.5896709",
"0.5836879",
"0.5798668",
"0.57735574",
"0.57735574",
"0.5771515",
"0.5762758",
"0.5761735",
"0.575217",
"0.5739659",
"0.57334614",
"0.57139045",
"0.56840724",
"0.5676617",
"0.56554335",
"0.56394786",
"0.5631071",
"0.56213087",
"0.5616539",
"0.56106657",
"0.5605766",
"0.56019866",
"0.557928",
"0.5568967",
"0.5552399",
"0.5545491",
"0.5541274",
"0.5536456",
"0.5532791",
"0.5528774",
"0.5517924",
"0.55088484",
"0.55046475",
"0.5495894",
"0.54887605",
"0.54846346",
"0.5482527",
"0.5477353",
"0.5476943",
"0.5473676",
"0.5466336",
"0.5448862",
"0.54461765",
"0.54460746",
"0.54381645",
"0.5433012",
"0.5428658",
"0.54200774",
"0.54118294",
"0.54007477",
"0.5398961",
"0.5375977",
"0.5360231",
"0.5354246",
"0.5350465",
"0.53499293",
"0.534858",
"0.53478307",
"0.53363353",
"0.53360516",
"0.53352004",
"0.5326898",
"0.53207225",
"0.5316269",
"0.53142834",
"0.5310193",
"0.5303204",
"0.5300952",
"0.52976006",
"0.5296083",
"0.5290963",
"0.5290467",
"0.5285544",
"0.5284996",
"0.52842516",
"0.52820414",
"0.5271023",
"0.5265768",
"0.52608037",
"0.5260392",
"0.5256634",
"0.5246526",
"0.5240778",
"0.5229627",
"0.52218163",
"0.52151984",
"0.5213936",
"0.5211161",
"0.52069575",
"0.52069575"
] | 0.0 | -1 |
Returns true if the code section will be wrapped in PHP tags. | public function getWrapCode()
{
return $this->wrapCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isHtmlBlock()\n {\n return (! $this->isPhpBlock());\n }",
"function compile($name, $code = false)\n {\n\t\tif (!$code)\n\t\t{\n\t\t\t$code = file_get_contents($this->template_dir.$name);\n\t\n\t\t\tif ($code === false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpreg_match_all('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code, $tag_blocks);\n\t\t$content_blocks = preg_split('/\\<!--[ ]*(.*?) (.*?)?[ ]*--\\>/', $code);\n\n\t\t$size = count($content_blocks);\n\n\t\t$parse_content = $compile = true;\n\t\t$tag_holding = array();\n\t\t$line = 1;\n\r\n\t\tfor ($loop = 0; $loop < $size; $loop++)\r\n\t\t{\n\t\t\t$line += substr_count($content_blocks[$loop], \"\\n\");\n\n\t\t\tif (!$compile)\n\t\t\t{\n\t\t\t\tif (strtoupper(trim($tag_blocks[1][$loop])) == 'ENDIGNORE')\n\t\t\t\t{\n\t\t\t\t\t$compile = true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($parse_content)\n\t\t\t{\n\t\t\t\t$content_blocks[$loop] = $this->_parse_content($content_blocks[$loop]);\n\t\t\t}\n\n\t\t\tif (empty($tag_blocks[1][$loop]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (strtoupper(trim($tag_blocks[1][$loop])))\r\n\t\t\t{\n\t\t\t\tcase 'IF':\n\t\t\t\t\t$this->_tag_holding_add('IF', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\r\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } else { ?>';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ELSEIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_view();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_if($tag_blocks[2][$loop], true);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'ENDIF':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'IF')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\r\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } ?>';\r\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'LOOP':\n\t\t\t\t\t$this->_tag_holding_add('LOOP', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_loop($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'LOOPELSE':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'LOOP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->_tag_holding_add('LOOPELSE', $line);\n\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php } } else { ?>';\n\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'ENDLOOP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != ('LOOP' || 'LOOPELSE'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_endloop($tag_blocks[2][$loop], $last_tag['name']);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'PHP':\n\t\t\t\t\t$this->_tag_holding_add('PHP', $line);\n\n\t\t\t\t\t$parse_content = false;\n\t\t\t\t\t$tag_blocks[0][$loop] = '<?php ';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'ENDPHP':\n\t\t\t\t\t$last_tag = $this->_tag_holding_get();\n\t\t\t\t\t\n\t\t\t\t\tif (!$last_tag || $last_tag['name'] != 'PHP')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Error here\n\t\t\t\t\t}\n\n\t\t\t\t\t$parse_content = true;\n\t\t\t\t\t$tag_blocks[0][$loop] = ' ?>';\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'INCLUDE':\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_include($tag_blocks[2][$loop]);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_HEADER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_header(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DISPLAY_FOOTER':\n\t\t\t\t\t$tag_blocks[0][$loop] = \"<?php echo \\$_CLASS['core_display']->display_footer(); ?>\";\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'IGNORE':\n\t\t\t\t\t$compile = false;\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'DEFINE':\r\n\t\t\t\t\t$tag_blocks[0][$loop] = $this->_compile_tag_define($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'AREA':\r\n\t\t\t\t\t//$tag_blocks[0][$loop] = $this->_compile_tag_area($tag_blocks[2][$loop]);\r\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t//$tag_blocks[0][$loop] = '<!-- '.$tag_blocks[1][$loop].' '.$tag_blocks[2][$loop].' -->';\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\n\n\t\t$this->_compiled_code = '';\n\t\t$size = count($content_blocks);\n\n\t\tfor ($loop = 0; $loop < $size; $loop++)\n\t\t{\r\n\t\t\t$this->_compiled_code .= $content_blocks[$loop] . (isset($tag_blocks[0][$loop]) ? $tag_blocks[0][$loop] : '');\r\n\t\t}\n\n\t\treturn true;\n }",
"public function isPhpBlock()\n {\n return file_exists($this->getFolder() . '/view.php');\n }",
"function _opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,&$len,&$comcode)\n{\n\tglobal $BLOCK_TAGS,$TEXTUAL_TAGS,$CODE_TAGS;\n\n\t$block_tag=isset($BLOCK_TAGS[$current_tag]);\n\n\tif (($block_tag) && ($pos<$len) && ($comcode[$pos]==chr(10)))\n\t{\n\t\t++$pos;\n\t\tglobal $NUM_LINES;\n\t\t++$NUM_LINES;\n\t}\n\n\t$tag_output=new ocp_tempcode();\n\t$textual_area=isset($TEXTUAL_TAGS[$current_tag]);\n\n\t$white_space_area=$textual_area;\n\tif (((($current_tag=='code') || ($current_tag=='codebox')) && (isset($attribute_map['param'])) && ((strtolower($attribute_map['param'])=='php') || (file_exists(get_file_base().'/sources/geshi/'.filter_naughty(strtolower($attribute_map['param'])).'.php')) || (file_exists(get_file_base().'/sources_custom/geshi/'.filter_naughty($attribute_map['param']).'.php')))) || ($current_tag=='php') || ($current_tag=='attachment') || ($current_tag=='attachment2') || ($current_tag=='attachment_safe') || ($current_tag=='menu'))\n\t{\n\t\t$in_separate_parse_section=true;\n\t} else\n\t{\n\t\t// Code tags are white space area, but not textual area\n\t\tif (isset($CODE_TAGS[$current_tag])) $white_space_area=true;\n\t}\n\n\t$in_code_tag=isset($CODE_TAGS[$current_tag]);\n\n\t$attribute_map=array();\n\n\t$formatting_allowed=(($textual_area?1:0) & ($block_tag?1:0))!=0;\n\n//\t\t\t\t\t\tif (in_array($current_tag,$BLOCK_TAGS)) $just_new_line=true;\n\n\tif ($current_tag=='html') $in_html=!$close;\n\telseif ($current_tag=='semihtml') $in_semihtml=!$close;\n\t$status=CCP_NO_MANS_LAND;\n\n\tif (($current_tag=='html') || ($current_tag=='semihtml')) // New state meaning we need to filter the contents\n\t{\n\t\tif (($in_html) || ($in_semihtml))\n\t\t{\n\t\t\tfilter_html($as_admin,$source_member,$pos,$len,$comcode,$in_html,$in_semihtml);\n\t\t}\n\t}\n\n\tif ($mindless_mode)\n\t{\n\t\t$white_space_area=true;\n\t\t$in_separate_parse_section=false;\n\t}\n\n\tif ($current_tag=='quote')\n\t{\n\t\t$comcode_dangerous=false;\n\t\t$comcode_dangerous_html=false;\n\t}\n\n\treturn array($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag);\n}",
"protected function openPhp()\n\t{\n\t\tif ($this->in_php) {\n\t\t\treturn '';\n\t\t}\n\t\t$this->in_php = true;\n\t\treturn '<?php ';\n\t}",
"function php_highlight(&$code)\n\n{\n\n if(preg_match('#^(\\s*)(\\<\\?(php|))#i', $code, $open_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, strlen($open_tag[0][0]));\n\n $open_tag = $open_tag[1][0].'<span class=\"php_tag\">'.htmlspecialchars($open_tag[2][0]).'</span>';\n\n }\n\n if(preg_match('#(\\?\\>)(\\s*)$#', $code, $end_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, 0, -strlen($end_tag[0][0]));\n\n $end_tag = '<span class=\"php_tag\">'.htmlspecialchars($end_tag[1][0]).'</span>'.$end_tag[2][0];\n\n }\n\n \n\n $blocks = array(\n\n array(\n\n 'pattern' => '#\\?\\>(.*?)(\\<\\?(php()|(\\s))|($()))#ise',\n\n 'replacement' => '\\'<span class=\"php_tag\">?></span>\\'.block_background(html_highlight(str_replace(\\'\\\\\\\\\\\\\\\\\"\\', \\'\"\\',\\'$1\\')), \\'php_html\\').\\'<span class=\"php_tag\">\\'.htmlspecialchars(\\'$2\\').\\'</span>\\'',\n\n 'keepsuffix' => 4\n\n ),\n\n array(\n\n 'pattern' => \"#'\".GENERAL_BACKSLASH_ESC_PREG.\"'#se\",\n\n 'replacement' => 'parse_php_string_simple(\\'$0\\')',\n\n //'prefix' => '<span class=\"php_string\">', \n\n //'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\"'.GENERAL_BACKSLASH_ESC_PREG.'\"#se',\n\n 'replacement' => '\\'<span class=\"php_string_d\">"\\'.parse_php_string(\\'$1\\').\\'"</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#\\<\\<\\<(.+?)([\\n\\r])(.*?)([\\n\\r]\\\\1)#se\",\n\n 'replacement' => '\\'<span class=\"php_string_h\"><<<$1$2\\'.parse_php_string(\\'$3\\').\\'$4</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#/\\\\*(.*?)\\\\*/#s\",\n\n 'prefix' => '<span class=\"php_blockcomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#//(.*?)[\\n\\r]#\",\n\n 'prefix' => '<span class=\"php_linecomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $secondaries = array(\n\n array(\n\n 'pattern' => '#(\\W|^)(\\.?[0-9][0-9a-zA-Z.]*)#',\n\n 'replacement' => '<span class=\"php_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '#([,\\[\\]\\{\\};=\\+\\-!%\\^&\\*\\(\\)<>|@.~])#',\n\n 'prefix' => '<span class=\"php_symbol\">',\n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\\$[a-zA-Z_][a-zA-Z0-9_]*#',\n\n 'prefix' => '<span class=\"php_var\">',\n\n 'suffix' => '</span>'\n\n )\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"php_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('and','or','xor','__file__','__line__','array','as','break','case','cfunction','class','const','continue','declare','default','die','do','echo','else','elseif','empty','enddeclare','endfor','endforeach','endif','endswitch','endwhile','eval','exit','extends','for','foreach','function','global','if','include','include_once','isset','list','new','old_function','print','require','require_once','return','static','switch','unset','use','var','while','__function__','__class__','php_version','php_os','default_include_path','pear_install_dir','pear_extension_dir','php_extension_dir','php_bindir','php_libdir','php_datadir','php_sysconfdir','php_localstatedir','php_config_file_path','php_output_handler_start','php_output_handler_cont','php_output_handler_end','e_error','e_warning','e_parse','e_notice','e_core_error','e_core_warning','e_compile_error','e_compile_warning','e_user_error','e_user_warning','e_user_notice','e_all','true','false','bool','boolean','int','integer','float','double','real','string','array','object','resource','null','class','extends','parent','stdclass','directory','__sleep','__wakeup','interface','implements','abstract','public','protected','private')\n\n )\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put back end/start tags if necessary\n\n if(isset($open_tag) && is_string($open_tag))\n\n $code = $open_tag.$code;\n\n if(isset($end_tag) && is_string($end_tag))\n\n $code .= $end_tag;\n\n \n\n return $code;\n\n}",
"private function hasHTMLTags()\n {\n return !(strcmp($this->content, strip_tags($this->content)) == 0);\n }",
"public function isClosingBrace() {\n return ($this->code === '}');\n }",
"function yy_r11()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '%>';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '%>';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if ($this->asp_tags) {\n $this->text_is_php = false;\n } else {\n $this->compiler->template_code->php(\"echo '%>';\\n\");\n }\n } elseif ($this->php_handling == Smarty::PHP_REMOVE) {\n if (! $this->asp_tags) {\n $this->compiler->template_code->php(\"echo '%>';\\n\");\n }\n }\n }",
"public function isMultiLine(): bool;",
"function formatHTML($code)\n\t{\n\t\t// formatting HTML is considerably more permissive. lines won't be broken or\n\t\t// reformatted, just indented correctly, and excessive whitespace may be removed.\n\t\t//\n\t\t// the indentation rule is simple: each line with an opening tag represents ONE\n\t\t// indentation level, even if 5 tags were opened. corresponding closing tags, however\n\t\t// will be put together on one line for the closing tag to match up with the opening.\n\t\t//\n\t\t$ret = '';\n\t\t$opentag = null; // current open tag\n\t\t$lws = true;\n\t\t$script = ''; // store javascript here and then format it separately\n\t\t$comment = false;\n\t\t$tags = array(array()); // stack of open tag-lines\n\t\t$closed = 0; // # of tags closed on this line\n\t\t$lastnewline = 0; // index in $ret\n\t\t$unindent = false;\n\t\t$forced = array();\n\t\t\n\t\t$newline = function () use (&$tags) {\n\t\t\treturn \"\\n\" . str_repeat(\"\\t\", count(array_filter($tags)));\n\t\t};\n\t\t\n\t\t$cur = &$ret;\n\t\t$tokens = token_get_all($code);\n\t\tforeach($tokens as $token)\n\t\t{\n\t\t\tlist($token, $val) = self::Tokenize($token);\n\t\t\t\n\t\t\tif ($token == T_INLINE_HTML || $token == T_CLOSE_TAG)\n\t\t\t{\n\t\t\t\tif ($token == T_CLOSE_TAG)\n\t\t\t\t{\n\t\t\t\t\t// eat the closing tag and process the newline as HTML.\n\t\t\t\t\t$cur .= '?>';\n\t\t\t\t\t$val = substr($val, 2);\n\t\t\t\t}\n\t\t\t\tfor($i = 0, $len = strlen($val); $i < $len; $i++)\n\t\t\t\t{\n\t\t\t\t\t$ch = $val[$i];\n\t\t\t\t\t\n\t\t\t\t\t// handle whitepsace\n\t\t\t\t\tif ($ch == \"\\n\")\n\t\t\t\t\t{\n\t\t\t\t\t\t// ignore newlines in tags\n\t\t\t\t\t\tif (is_null($opentag))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// everything following the newline is leading whitespace\n\t\t\t\t\t\t\t$lws = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// add a new tagline on the newline if we had tags before. if we\n\t\t\t\t\t\t\t// closed a tag but still have open tags, clear them now.\n\t\t\t\t\t\t\tif (count(end($tags)) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($closed > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach(end($tags) as $tag)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ret .= '</' . $tag . '>';\n\t\t\t\t\t\t\t\t\t\t$forced[] = $tag;\n\t\t\t\t\t\t\t\t\t\t$unindent = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// replace the whole tagline with a new empty one\n\t\t\t\t\t\t\t\t\t$tags[count($tags) - 1] = array();\n\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{\n\t\t\t\t\t\t\t\t\t// tack on a new layer\n\t\t\t\t\t\t\t\t\t$tags[count($tags)] = array();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($unindent)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// unindent the previous line (the line that's ending) by the\n\t\t\t\t\t\t\t\t// number of tags we closed.\n\t\t\t\t\t\t\t\t$ret = substr($ret, 0, $lastnewline + 1) . substr($ret,\n\t\t\t\t\t\t\t\t\t\t$lastnewline + 2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// and add a new line and mark it\n\t\t\t\t\t\t\t$lastnewline = strlen($ret);\n\t\t\t\t\t\t\tif (!empty($script))\n\t\t\t\t\t\t\t\t$script .= $newline();\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$ret .= $newline();\n\t\t\t\t\t\t\t$closed = 0;\n\t\t\t\t\t\t\t$unindent = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ($ch == ' ')\n\t\t\t\t\t{\n\t\t\t\t\t\t// allow all non-leading spaces\n\t\t\t\t\t\tif (!$lws)\n\t\t\t\t\t\t\t$cur .= ' ';\n\t\t\t\t\t}\n\t\t\t\t\telse if ($ch == \"\\t\")\n\t\t\t\t\t{\n\t\t\t\t\t\t// allow \"content\" tabs\n\t\t\t\t\t\tif (!$lws)\n\t\t\t\t\t\t\t$cur .= \"\\t\";\n\t\t\t\t\t}\n\t\t\t\t\telse if ($ch == \"\\r\")\n\t\t\t\t\t\t; // just strip carriage-returns flat out\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$lws = false;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// handle comments\n\t\t\t\t\t\tif ($ch == '!' && !is_null($opentag) && empty($opentag))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cur = &$ret;\n\t\t\t\t\t\t\t$cur .= '<!';\n\t\t\t\t\t\t\t$comment = 1;\n\t\t\t\t\t\t\t$opentag = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($ch == '<' && $comment)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$comment++;\n\t\t\t\t\t\t\t$cur .= $ch;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($ch == '>' && $comment)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$comment--;\n\t\t\t\t\t\t\t$cur .= $ch;\n\t\t\t\t\t\t\tif ($comment == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$comment = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// handle tags\n\t\t\t\t\t\telse if ($ch == '<')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$opentag = '';\n\t\t\t\t\t\t\t$cur = &$opentag;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($ch == '>' && !is_null($opentag))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fulltag = $opentag;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (substr((trim($fulltag)), - 1) == '/')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// we don't really have to do much of anything for\n\t\t\t\t\t\t\t\t// one-liners\n\t\t\t\t\t\t\t\t$cur = &$ret;\n\t\t\t\t\t\t\t\t$ret .= '<' . $fulltag . '>';\n\t\t\t\t\t\t\t\t$opentag = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tag = current(explode(' ', $fulltag));\n\t\t\t\t\t\t\t\t$opentag = null;\n\t\t\t\t\t\t\t\t$cur = &$ret;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// handle closing tags first\n\t\t\t\t\t\t\t\tif (strlen($tag) > 0 && $tag[0] == '/')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tag = substr($tag, 1);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// in an IDEAL world, all tags would have perfectly\n\t\t\t\t\t\t\t\t\t// matched closing tags; obviously this isn't always the\n\t\t\t\t\t\t\t\t\t// case. so we look through the current open tags, and if\n\t\t\t\t\t\t\t\t\t// we're the last opened tag, great! pop it off the stack,\n\t\t\t\t\t\t\t\t\t// close it, case closed.\n\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t// if the tag ISN'T the\n\t\t\t\t\t\t\t\t\t// last one, though, we need to close everything in between\n\t\t\t\t\t\t\t\t\t// right here, right now before closing the tag that's\n\t\t\t\t\t\t\t\t\t// actually being closed, and we have to mark it as having\n\t\t\t\t\t\t\t\t\t// been force-closed. when a force-closed tag is matched, it\n\t\t\t\t\t\t\t\t\t// should be popped off without closing.\n\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t// additionally, on\n\t\t\t\t\t\t\t\t\t// newlines the rest of the tagline will be closed and the\n\t\t\t\t\t\t\t\t\t// closing line will be unindented accordingly. more\n\t\t\t\t\t\t\t\t\t// information on that up at the \\n handler.\n\t\t\t\t\t\t\t\t\t$already = array_search($tag, $forced);\n\t\t\t\t\t\t\t\t\tif ($already !== false)\n\t\t\t\t\t\t\t\t\t\tunset($forced[$already]);\n\t\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\t// first of all, remove the blank one if it exists.\n\t\t\t\t\t\t\t\t\t\tif (!count(end($tags)))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tarray_pop($tags);\n\t\t\t\t\t\t\t\t\t\t\t$unindent = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// if we're the correct tag, we're good to go\n\t\t\t\t\t\t\t\t\t\t$last = end(end($tags));\n\t\t\t\t\t\t\t\t\t\tif ($last == $tag)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($tag == 'script' && !empty($script))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$js = $this->formatJavascript($script);\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= str_replace(\"\\n\", $newline(), $js) .\n\t\t\t\t\t\t\t\t\t\t\t\t\t$newline();\n\t\t\t\t\t\t\t\t\t\t\t\t$script = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t// because of the way we tack this on, we get\n\t\t\t\t\t\t\t\t\t\t\t\t// some oddities with unindenting. let's just\n\t\t\t\t\t\t\t\t\t\t\t\t// handle that here for brevity.\n\t\t\t\t\t\t\t\t\t\t\t\t$unindent = false;\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr($ret, - 1) == \"\\t\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret = substr($ret, 0, - 1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret .= '<' . $fulltag . '>';\n\t\t\t\t\t\t\t\t\t\t\tarray_pop($tags[count($tags) - 1]);\n\t\t\t\t\t\t\t\t\t\t\t$closed++;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// otherwise, go through and close them all\n\t\t\t\t\t\t\t\t\t\t\t$strip = $missing = array();\n\t\t\t\t\t\t\t\t\t\t\t$gotit = false;\n\t\t\t\t\t\t\t\t\t\t\tfor($tli = count($tags) - 1; !$gotit &&\n\t\t\t\t\t\t\t\t\t\t\t\t $tli >= 0; $tli--)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tfor($ti = count($tags[$tli]) - 1; !$gotit &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t $ti >= 0; $ti--)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($tags[$tli][$ti] == $tag)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$gotit = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$missing[] = $tags[$tli][$ti];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$strip[] = array($tli, $ti);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif ($gotit)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach($strip as $taginfo)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tunset($tags[$taginfo[0]][$taginfo[1]]);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (empty($tags[$taginfo[0]]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tunset($tags[$taginfo[0]]);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= '</' . implode('></', $missing) . '>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// do nothing: just strip the closing tag\n\t\t\t\t\t\t\t\t\t\t\t\t// that closes a mismatched tag\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\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\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$ret .= '<' . $fulltag . '>';\n\t\t\t\t\t\t\t\t\tif ($tag == 'script')\n\t\t\t\t\t\t\t\t\t\t$cur = &$script;\n\t\t\t\t\t\t\t\t\t$tags[count($tags) - 1][] = $tag;\n\t\t\t\t\t\t\t\t\t$closed--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// pass-through to current active buffer\n\t\t\t\t\t\t\t$cur .= $ch;\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\telse\n\t\t\t{\n\t\t\t\t// tack on all non-inline HTML tokens as-is to whichever buffer is currently\n\t\t\t\t// active (either the return val or the current open tag)\n\t\t\t\t$cur .= $val;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}",
"public function isMultiline() {}",
"public function can_process_shortcodes () {\n\t\treturn apply_filters(\n\t\t\t'upfront-shortcode-enable_in_layout',\n\t\t\t(defined('UPFRONT_DISABLE_LAYOUT_TEXT_SHORTCODES') && UPFRONT_DISABLE_LAYOUT_TEXT_SHORTCODES ? false : true)\n\t\t);\n\t}",
"function yy_r8()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '<?php';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if (! ($this->compiler->context->smarty instanceof Smarty_Smarty2BC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n }\n }",
"function highlight_php_code($text)\r\n{\r\n\r\n \r\n while (strpos($text,'<phpcode>')!== false)\r\n {\r\n $tag_start = strpos($text,'<phpcode>');\r\n $tag_end = strpos($text,'</phpcode>'); \r\n\r\n if ($tag_end === false)\r\n {\r\n $tag_end=(strlen($text)); \r\n }\r\n \r\n $phpcode = substr($text,$tag_start+9,$tag_end-$tag_start-9);\r\n \r\n $text_before = substr($text,0,$tag_start);\r\n $text_after = substr($text,$tag_end+10);\r\n \r\n if (strpos($phpcode,'<?php')===false)\r\n {\r\n \r\n $phpcode = str_replace('<?php','',highlight_string('<?php' . $phpcode,true)); \r\n }\r\n else\r\n {\r\n $phpcode = highlight_string($phpcode,true);\r\n }\r\n \r\n $text = $text_before . $phpcode . $text_after;\r\n \r\n }\r\n\r\n \r\n\r\n\r\n return $text;\r\n}",
"protected function _parse(\n string $tagDefinition, string $afterTagClose = '', string $newLineAfter = '', ?string $package = null ) : bool\n {\n\n if ( \\in_array( $tagDefinition, [ '/if', '/for', '/foreach', '/end' ] ) )\n {\n $this->_compiled = ( new PlateTagCompiled() )\n ->setPhpCode( '<' . '?php } ?>' )\n ->setNewLineAfter( \" \\n\" )\n ->setAfterTagClose( $afterTagClose );\n return true;\n }\n\n $this->_compiled = ( new PlateTagCompiled() )\n ->setPhpCode( $this->config->getOpenChars() . $tagDefinition . $this->config->getCloseChars() )\n ->setAfterTagClose( $afterTagClose );\n return true;\n\n }",
"public function isClosingParenthesis() {\n return ($this->code === ')');\n }",
"public function insertPhpCode($code)\n {\n $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code));\n }",
"function phpblock($text) {\n $this->php($text, 'pre');\n }",
"function is_include_operator($code) {\n return $code === \"include\";\n }",
"public function usesCompiler()\n {\n // does not use compiler, template is PHP\n return false;\n }",
"function is_doctype_operator($code) {\n return $code === \"doctype\";\n }",
"function testBugInternal1() \n {\n $sText = <<<SCRIPT\n<?php\n\\$a = <<<HEREDOC\nsdsdsds\nHEREDOC;\n?>\nSCRIPT;\n $this->setText($sText);\n $sActual = $this->oBeaut->get();\n $this->assertTrue(preg_match(\"/HEREDOC;\\n\\s*?\\?>/ms\", $sActual));\n }",
"public function isBeforeBodyClose()\r\n\t{\r\n\t\treturn false;\r\n\t}",
"public function isHtml(): bool;",
"function has_shortcode($content, $tag)\n {\n }",
"public static function hasPhpTokens($str, $enclosure = '\"'): bool\n\t{\n\t\t$result = false;\n\t\tif (!empty($str) && is_string($str))\n\t\t{\n\t\t\tif ($enclosure == '<<<')\n\t\t\t{\n\t\t\t\t$validTokens = [\\T_CONSTANT_ENCAPSED_STRING, \\T_START_HEREDOC, \\T_ENCAPSED_AND_WHITESPACE, \\T_END_HEREDOC];\n\t\t\t\t$validChars = [];\n\t\t\t\t$tokens = \\token_get_all('<'. \"?php \\$MESS = <<<'HTML'\\n\". $str. \"\\nHTML;\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$validTokens = [\\T_CONSTANT_ENCAPSED_STRING];\n\t\t\t\t$validChars = [$enclosure];\n\t\t\t\t$tokens = \\token_get_all('<'. '?php $MESS = '. $enclosure. $str. $enclosure . ';');\n\t\t\t}\n\t\t\t$cnt = count($tokens);\n\t\t\tif ($cnt <= 5 || $cnt > 10)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tfor ($inx = 5, $cnt--; $inx < $cnt ; $inx++)\n\t\t\t{\n\t\t\t\t$token = $tokens[$inx];\n\t\t\t\tif (is_array($token))\n\t\t\t\t{\n\t\t\t\t\t$token[] = \\token_name($token[0]);\n\t\t\t\t\tif (!in_array($token[0], $validTokens))\n\t\t\t\t\t{\n\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif (is_string($token))\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($token, $validChars))\n\t\t\t\t\t{\n\t\t\t\t\t\t$result = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"function isHTMLContent($c)\t{\n\t\t$c = trim($c);\n\t\t$first = strtolower(substr($c,0,6));\n\t\t$last = strtolower(substr($c,-7));\n\t\tif ($first.$last=='<html></html>')\treturn 1;\n\t}",
"function escapePhp() {\n\t\t$rv = $this->getContents();\n\t\t$changes = array(\n\t\t\t'<?' => '<?',\n\t\t\t'?>' => '?>',\n\t\t);\n\t\treturn str_replace( array_keys( $changes ), $changes, $rv );\n\t}",
"function is_form_tag($code) {\n return $code === \"form\";\n }",
"private function isSafeCode($code)\n {\n // http://sourceware.org/binutils/docs-2.23.1/as/Pseudo-Ops.html#Pseudo-Ops\n // Notes:\n // - .fill et al. are deemed unsafe because of potential DoS (huge output).\n // - \". \" allows for relative jumps, e.g. jmp . + 5\n $safe_directives = array(\n \".ascii\", \".asciz\", \".align\", \".balign\",\n \".byte\", \".int\", \".double\", \".quad\", \".octa\", \".word\", \". \"\n );\n\n foreach ($safe_directives as $directive)\n $code = str_replace($directive, \"\", $code);\n\n // These comments have special meaning to as. They don't seem dangerous but\n // reject anyway to be safe.\n if (strpos($code,\"#NO_APP\",0) !== false || strpos($code,\"#APP\",0) !== false)\n return false;\n\n // If the source contains any other directives, reject.\n // Yes, this will make it fail if there's a non-directive period in a string\n // constant, but if we want to check for that safely we need to go beyond\n // strpos and even regular expressions.\n return strpos($code, \".\", 0) === false; \n }",
"function tpl_add_content()\n\t{\n\t\treturn true;\n\t}",
"function replaceTagsPHP(&$src_str, $src_enabled = 1, $src_security_pass = 1, $article = '')\n\t{\n\t\tif (!is_string($src_str) || $src_str == '')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ((strpos($src_str, '<?') === false) && (strpos($src_str, '[[?') === false))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $src_vars;\n\n\t\t// Match ( read {} as <> ):\n\t\t// {?php ... ?}\n\t\t// {? ... ?}\n\t\t$src_string_array = $this->stringToSplitArray($src_str, '-start-' . '\\?(?:php)?[\\s<](.*?)\\?' . '-end-', 1);\n\t\t$src_string_array_count = count($src_string_array);\n\n\t\tif ($src_string_array_count < 1)\n\t\t{\n\t\t\t$src_str = implode('', $src_string_array);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$src_enabled)\n\t\t{\n\t\t\t// replace source block content with HTML comment\n\t\t\t$src_string_array = array();\n\t\t\t$src_string_array['0'] = '<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::sprintf('SRC_CODE_REMOVED_NOT_ALLOWED', JText::_('SRC_PHP'), JText::_('SRC_PHP')) . ' -->';\n\n\t\t\t$src_str = implode('', $src_string_array);\n\n\t\t\treturn;\n\t\t}\n\t\tif (!$src_security_pass)\n\t\t{\n\t\t\t// replace source block content with HTML comment\n\t\t\t$src_string_array = array();\n\t\t\t$src_string_array['0'] = '<!-- ' . JText::_('SRC_COMMENT') . ': ' . JText::sprintf('SRC_CODE_REMOVED_SECURITY', JText::_('SRC_PHP')) . ' -->';\n\n\t\t\t$src_str = implode('', $src_string_array);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// if source block content has more than 1 php block, combine them\n\t\tif ($src_string_array_count > 3)\n\t\t{\n\t\t\tfor ($i = 2; $i < $src_string_array_count - 1; $i++)\n\t\t\t{\n\t\t\t\tif (fmod($i, 2) == 0)\n\t\t\t\t{\n\t\t\t\t\t$src_string_array['1'] .= \"<!-- SRC_SEMICOLON --> ?>\" . $src_string_array[$i] . \"<?php \";\n\t\t\t\t\tunset($src_string_array[$i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$src_string_array['1'] .= $src_string_array[$i];\n\t\t\t\tunset($src_string_array[$i]);\n\t\t\t}\n\t\t}\n\n\t\t// fixes problem with _REQUEST being stripped if there is an error in the code\n\t\t$src_backup_REQUEST = $_REQUEST;\n\t\t$src_backup_vars = array_keys(get_defined_vars());\n\n\t\t$src_script = trim($src_string_array['1']) . '<!-- SRC_SEMICOLON -->';\n\t\t$src_script = preg_replace('#(;\\s*)?<\\!-- SRC_SEMICOLON -->#s', ';', $src_script);\n\n\t\t$a = $this->src_params->areas['default'];\n\t\t$src_forbidden_php_array = explode(',', $a['forbidden_php']);\n\t\t$this->cleanArray($src_forbidden_php_array);\n\t\t$src_forbidden_php_regex = '#[^a-z_](' . implode('|', $src_forbidden_php_array) . ')(\\s*\\(|\\s+[\\'\"])#si';\n\n\t\tpreg_match_all($src_forbidden_php_regex, ' ' . $src_script, $src_functions, PREG_SET_ORDER);\n\n\t\tif (!empty($src_functions))\n\t\t{\n\t\t\t$src_functionsArray = array();\n\t\t\tforeach ($src_functions as $src_function)\n\t\t\t{\n\t\t\t\t$src_functionsArray[] = $src_function['1'] . ')';\n\t\t\t}\n\n\t\t\t$src_comment = JText::_('SRC_PHP_CODE_REMOVED_FORBIDDEN') . ': ( ' . implode(', ', $src_functionsArray) . ' )';\n\n\t\t\t$src_string_array['1'] = JFactory::getDocument()->getType() == 'html'\n\t\t\t\t? '<!-- ' . JText::_('SRC_COMMENT') . ': ' . $src_comment . ' -->'\n\t\t\t\t: $src_string_array['1'] = '';\n\n\t\t\t$src_str = implode('', $src_string_array);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isset($Itemid))\n\t\t{\n\t\t\t$Itemid = JFactory::getApplication()->input->getInt('Itemid');\n\t\t}\n\t\tif (!isset($mainframe) || !isset($app))\n\t\t{\n\t\t\t$mainframe = $app = JFactory::getApplication();\n\t\t}\n\t\tif (!isset($document) || !isset($doc))\n\t\t{\n\t\t\t$document = $doc = JFactory::getDocument();\n\t\t}\n\t\tif (!isset($database) || !isset($db))\n\t\t{\n\t\t\t$database = $db = JFactory::getDbo();\n\t\t}\n\t\tif (!isset($user))\n\t\t{\n\t\t\t$user = JFactory::getUser();\n\t\t}\n\n\t\t$src_script = '\n\t\t\tif (is_array($src_vars)) {\n\t\t\t\tforeach ($src_vars as $src_key => $src_value) {\n\t\t\t\t\t${$src_key} = $src_value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t' . $src_script . ';\n\t\t\treturn get_defined_vars();\n\t\t\t';\n\n\t\t$temp_PHP_func = create_function('&$src_vars, &$article, &$Itemid, &$mainframe, &$app, &$document, &$doc, &$database, &$db, &$user', $src_script);\n\n\t\t// evaluate the script\n\t\t// but without using the the evil eval\n\t\tob_start();\n\t\t$src_new_vars = $temp_PHP_func($src_vars, $article, $Itemid, $mainframe, $app, $document, $doc, $database, $db, $user);\n\t\tunset($temp_PHP_func);\n\t\t$src_string_array['1'] = ob_get_contents();\n\t\tob_end_clean();\n\n\t\t$src_diff_vars = array_diff(array_keys($src_new_vars), $src_backup_vars);\n\t\tforeach ($src_diff_vars as $src_diff_key)\n\t\t{\n\t\t\tif (!in_array($src_diff_key, array('src_vars', 'article', 'Itemid', 'mainframe', 'app', 'document', 'doc', 'database', 'db', 'user'))\n\t\t\t\t&& substr($src_diff_key, 0, 4) != 'src_'\n\t\t\t)\n\t\t\t{\n\t\t\t\t$src_vars[$src_diff_key] = $src_new_vars[$src_diff_key];\n\t\t\t}\n\t\t}\n\n\t\t$src_str = implode('', $src_string_array);\n\t}",
"function pre_tidy_ASP () {\r\n\t\t// document object could properly be created then somehow revert the ASP to its preprocessed state.\r\n\t\t// also: there could be includes with includes in them so we must process until no chances are made\r\n\t\t// but since we need to remove these afterwards; we need some way to mark the level of the include so as to\r\n\t\t// be able to match its closing and ending tags without using the DOM (since we cannot save the DOM after \r\n\t\t// unincluding some code since it may be necessary for the DOM.\r\n\t\t$ASP_include_statements = array(array(-1),-1);\r\n\t\t$count_of_level_of_include = 1;\r\n\t\tpreg_match_all('/<!--#include virtual=\"([^\"]*)\" -->/is', $this->code, $ASP_include_statements);\r\n\t\tforeach($ASP_include_statements[0] as $index => $ASP_include_statement) {\r\n\t\t\t$this->code = str_replace($ASP_include_statements[0][$index], '<!--ASPInclude' . $count_of_level_of_include . 'Begin-->\r\n' . html_entity_decode(file_get_contents(substr($ASP_include_statements[1][$index], 1))) . '<!--ASPInclude' . $count_of_level_of_include . 'End-->\r\n', $this->code);\r\n\t\t}\r\n\t\t$this->code = str_replace('<%', '<!--9o9ASPopen9o9', $this->code);\r\n\t\t$this->code = str_replace('%>', '9o9ASPclose9o9-->', $this->code);\r\n\t\t$count_of_level_of_include++;\r\n\t\treturn true;\t\t\r\n\t}",
"public function is_next_a_mergeable_comment() {\n\t\tif (! $this->oBeaut->isNextTokenConstant(T_COMMENT)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// The beautifer doesn't let me pull the next token with a method\n\t\t$idx = 1;\n\t\t$nextToken = $this->oBeaut->getToken($this->oBeaut->iCount + $idx);\n\t\t\n\t\twhile (is_array($nextToken) && $nextToken[0] == T_WHITESPACE) {\n\t\t\t$idx ++;\n\t\t\t$nextToken = $this->oBeaut->getToken($this->oBeaut->iCount + $idx);\n\t\t}\n\t\t\n\t\tif (! is_array($nextToken)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($nextToken[0] == 370) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (substr($nextToken[1], 0, 2) == '/*') {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$prevToken = $this->oBeaut->getToken($this->oBeaut->iCount - 1);\n\t\t\n\t\tif (! is_array($prevToken) || strpos($prevToken[1], \"\\n\") === false) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function isOpeningBrace() {\n return ($this->code === '{' || $this->name === 'T_CURLY_OPEN' || $this->name === 'T_DOLLAR_OPEN_CURLY_BRACES');\n }",
"function acf_is_block_editor()\n{\n}",
"function templateCode_older() {\r\n\t\tif ($this->template !== \"none\") {\r\n\t\t\tprint('do not use this function 43096809683069836');exit(0);\r\n\t\t\t$bodycode = ReTidy::getBodyCode();\r\n\t\t\tif(strpos($bodycode, '<div class=\"center\">') !== false) {\r\n\t\t\t\tvar_dump(OM::getTagString('abvb<div class=\"center\">adsfds</div>sdsgdsgds', '<div class=\"center\">'));exit(0);\r\n\t\t\t\t$bodycode = substr(OM::getTagString($bodycode, '<div class=\"center\">'), strlen('<div class=\"center\">'), strlen($bodycode)-strlen('<div class=\"center\">')-4);\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace(\"{content}\", $bodycode, file_get_contents($this->template));\r\n\t\t}\r\n\t}",
"public function isHTML(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_HTML );\n\t}",
"function yy_r10()\n {\n if ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n if ($this->asp_tags) {\n if (! ($this->compiler->template instanceof SmartyBC)) {\n $this->compiler->error(self::Err3);\n }\n $this->text_is_php = true;\n } else {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n } elseif ($this->php_handling == Smarty::PHP_REMOVE) {\n if (! $this->asp_tags) {\n $this->compiler->template_code->php(\"echo '<%';\\n\");\n }\n }\n }",
"public function openTag()\n {\n $this->writer->write('<?php' . PHP_EOL);\n return $this;\n }",
"function single_inline_codeblock($content) {\n $content = preg_replace(\"/(`[^`]*`)/\", \"<span class='code-inline'>$0</span>\", $content);\n $content = str_replace('`', '', $content);\n return $content;\n}",
"public function isHtml() {}",
"public function isSingleLine(): bool;",
"function parseTemplate() {\n $this->initParsing();\n $this->beginMainBlock();\n if (!$this->parseTemplateCommands()) return false;\n $this->endMainBlock();\n if (!$this->checkBlockDefinitionsComplete()) return false;\n if (!$this->parseTemplateVariables()) return false;\n $this->associateVariablesWithBlocks();\n return true; }",
"private function _isTraitUse( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {\n\n $tokens = $phpcsFile->getTokens();\n $next = $phpcsFile->findNext( T_WHITESPACE, ( $stackPtr + 1 ), null, true );\n\n if ( $tokens[ $next ]['code'] === T_OPEN_PARENTHESIS ) {\n return false;\n }\n\n return $phpcsFile->hasCondition( $stackPtr, [ T_CLASS, T_TRAIT ] );\n\n }",
"public function isPhp() {}",
"public function isShortTernary(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n if (isset($tokens[$stackPtr]) === false\n || $tokens[$stackPtr]['code'] !== \\T_INLINE_THEN\n ) {\n return false;\n }\n\n $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n if ($nextNonEmpty === false) {\n // Live coding or parse error.\n return false;\n }\n\n if ($tokens[$nextNonEmpty]['code'] === \\T_INLINE_ELSE) {\n return true;\n }\n\n return false;\n }",
"function yy_r9()\n {\n if ($this->is_xml) {\n $this->is_xml = false;\n $this->compiler->template_code->php(\"echo '?>';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_PASSTHRU) {\n $this->compiler->template_code->php(\"echo '?>';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_QUOTE) {\n $this->compiler->template_code->php(\"echo '?>';\\n\");\n } elseif ($this->php_handling == Smarty::PHP_ALLOW) {\n $this->text_is_php = false;\n }\n }",
"public function isWrapped()\n {\n return ($this->getWrapperInfo() !== false);\n }",
"private function htmltidy_php() {\r\n\t\t$this->logMsg(\"=== htmltidy_php ===\");\r\n\t\tif(!is_callable('tidy_parse_string')) {\r\n\t\t\t$this->logMsg('tidy_parse_string() is not callable! Maybe the tidy extension is not installed.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// added (2011-06-29)\r\n\t\tif($this->WET === \"WET\" || $this->config['WET'] === \"WET\") {\r\n\t\t\t$this->config['htmltidy']['anchor-as-name'] = 0;\r\n\t\t}\r\n\t\tReTidy::set_HTML5();\r\n\t\t//ReTidy::tidy_comments();\r\n\t\tReTidy::encode_character_entities_in_comments();\r\n\t\t$tidy = tidy_parse_string($this->code, $this->config['htmltidy'], $this->config['htmltidy']['input-encoding']);\r\n\t\t//var_dump($tidy); // tidy error reporting\r\n\t\tif(!$tidy) {\r\n\t\t\t$this->logMsg('tidy_parse_string() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!$tidy->cleanRepair()) {\r\n\t\t\t$this->logMsg('$tidy->cleanRepair() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->logMsg('Status: '. $tidy->getStatus() . \"\\nErrors: \" . tidy_error_count($tidy) . \"\\nWarnings: \" . tidy_warning_count($tidy));\r\n\t\tif($this->config['show_tidy_errors']) {\r\n\t\t\t$this->logMsg(\"--- Error buffer --- \\n\" . $tidy->errorBuffer . \"\\n --- Error buffer end ---\");\r\n\t\t}\r\n\t\t$this->code = tidy_get_output($tidy);\r\n\t\tif(!$this->code) {\r\n\t\t\t$this->logMsg('Warning! HTML Tidy output is empty.');\r\n\t\t}\r\n\t\t// perhaps we should just say if not utf8?\r\n\t\tif(($this->config['encoding'] === \"iso-8859-1\" ||\r\n\t\t$this->config['encoding'] === \"us-ascii\" ||\r\n\t\t$this->config['encoding'] === \"windows-1252\") && $this->config['do_not_encode_character_entities'] !== true) {\r\n\t\t\tReTidy::encode_character_entities();\r\n\t\t}\r\n\t\t// HTML5 specific fix (tidy and basically everything else do not support HTML5)\r\n\t\t//var_dump($this->config['HTML5']);\r\n\t\t//var_dump($this->config);\r\n\t\t//var_dump(ReTidy::get_HTML5());\r\n\t\tif(ReTidy::get_HTML5()) {\r\n\t\t\t//print(\"here--4300--2\");\r\n\t\t\t$this->code = ReTidy::str_replace_first('<meta />', '<meta charset=\"' . $this->config['encoding'] . '\" />', $this->code);\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function has_shortcode ()\n {\n return $this->page_has_shortcode;\n }",
"public function hasCodeType(){\n return $this->_has(4);\n }",
"public function hasCodeType(){\n return $this->_has(4);\n }",
"protected function closePhp()\n\t{\n\t\tif (!$this->in_php) {\n\t\t\treturn '';\n\t\t}\n\t\t$this->in_php = false;\n\t\treturn ' ?>';\n\t}",
"function remove_php_tags(&$code) {\r\n\r\n\t\t\t\t// This matches the information gathered from the internal PHP lexer\r\n\t\t\t\t$match = array(\r\n\t\t\t\t\t'#<([\\?%])=?.*?\\1>#s',\r\n\t\t\t\t\t'#<script\\s+language\\s*=\\s*([\"\\']?)php\\1\\s*>.*?</script\\s*>#s',\r\n\t\t\t\t\t'#<\\?php(?:\\r\\n?|[ \\n\\t]).*?\\?>#s'\r\n\t\t\t\t);\r\n\r\n\t\t\t$code = preg_replace($match, '', $code);\r\n\t}",
"protected static function handle_php_tags($content) {\n\t\treturn preg_replace('/\\<\\?(php|=)(.*?)\\?\\>/s', '', $content);\n\t}",
"public function getTagName ()\n\t{\n\t\treturn 'code';\n\t}",
"public function uses_sections() {\n return true;\n }",
"public function uses_sections() {\n return true;\n }",
"public function wrapJavaScriptInTags($javaScriptCode) {\n\t\treturn '<script type=\"text/javascript\">/* <![CDATA[ */ ' . $javaScriptCode . ' /* ]]> */</script>';\n\t}",
"public function isOpeningParenthesis() {\n return ($this->code === '(');\n }",
"private function is_code_file( $file ) {\n\t\tif ( stristr( $file, '.php' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.js' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.css' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.json' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( stristr( $file, '.md' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function uses_sections() {\n\n return true;\n\n }",
"public function isHtml()\n\t{\n\t\treturn stripos($this->getContentType(), 'html') !== false;\n\t}",
"static public function isHTML() {\n\t\treturn (self::$page_type === 0);\n\t}",
"public static function hasContent(): bool\n {\n return true;\n }",
"public function overwriteCode(): bool\n {\n return $this->overwriteCode;\n }",
"function php($php, $return = FALSE) {\n if (!$return) {\n echo '<?php ' . $php . ' ?>';\n } else {\n return '<?php ' . $php . ' ?>';\n }\n }",
"function yy_r172()\n {\n if (empty($this->db_quote_code_buffer)) {\n $this->db_quote_code_buffer = \"ob_start();\\n\";\n }\n $this->db_quote_code_buffer .= $this->yystack[$this->yyidx + - 1]->minor->buffer;\n if ($this->block_nesting_level == count($this->compiler->_tag_stack)) {\n $this->prefix_number ++;\n $code = new Smarty_Compiler_Code();\n $code->iniTagCode($this->compiler);\n $code->formatPHP($this->db_quote_code_buffer . ' $_tmp' . $this->prefix_number . '=ob_get_clean();')->newline();\n $this->compiler->prefix_code[] = $code;\n $this->db_quote_code_buffer = '';\n $this->_retvalue = '$_tmp' . $this->prefix_number;\n } else {\n $this->_retvalue = false;\n }\n\n }",
"private function isMarkup($markup)\n {\n return strpos($markup, '{{') !== false;\n }",
"function eval_inline_php($myContent,$onlyEval=false)\n// *************************************************\n{\n\t$rVal = \"\";\n\n\t// PHP INCLUDES\n\t$pos1 = strpos($myContent,\"<?php\");\n\n\tif (!($pos1===false))\n\t{\n\t\t$pos2 = strpos($myContent,\"?>\",$pos1);\n\n\t\t$rVal .= substr($myContent,0,$pos1);\n\n\t\t// BLOCK AUSWERTEN\n\t\t$evalTxt = substr($myContent,$pos1+5,($pos2)-($pos1+5));\n\t\teval($evalTxt);\n\n\t\t// RUECKGABE BLOCK DAVOR UND DANACH\n\t\tif (!$onlyEval) return $rVal.substr($myContent,$pos2+2);\n\t}\n\telse\n\t\treturn $myContent;\n\n\treturn \"\";\n}",
"public function is_php( $file ) {\n\t\t$check = substr( $file, - 4 );\n\t\tif ( '.php' === $check ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function has_PLAIN_not_HTML()\n\t{\n\t\treturn $this->PLAIN != '' && $this->HTML == '';\n\t}",
"function ninja_has_shortcode($shortcode = '', $content) {\r\n\t\t$found = false;\r\n\t\tif ( stripos($content, '[' . $shortcode) !== false ) {\r\n\t\t\t$found = true;\r\n\t\t}\r\n\t\treturn $found;\r\n\t}",
"function sourcecode_allow_pre_tag( $tags ) {\r\n\t$tags['pre'] = array('lang' => array(), 'lineno' => array());\r\n\treturn $tags;\r\n}",
"public function has_self_closing_flag()\n {\n }",
"public function hasCodeType(){\n return $this->_has(3);\n }",
"function insert_code_block( & $params )\n\t{\n\t\t$content = & $params['data'];\n\t\t$item = & $params['Item'];\n\n\t\t//TODO: allow per post-type inclusion\n\n\t\t$title = \"'\" . $item->dget( 'title', 'htmlattr' ) . \"'\";\n\t\t$url = \"'\" . $item->get_permanent_url() . \"'\";\n\n\t\t$content .= \"\\n\".'<div class=\"sharethis\">\n\t\t\t\t\t\t\t<script type=\"text/javascript\" language=\"javascript\">\n\t\t\t\t\t\t\t\tSHARETHIS.addEntry( {\n\t\t\t\t\t\t\t\t\ttitle : '. $title .',\n\t\t\t\t\t\t\t\t\turl : '. $url .'}, \n\t\t\t\t\t\t\t\t\t{ button: true }\n\t\t\t\t\t\t\t\t) ;\n\t\t\t\t\t\t\t</script></div>' . \"\\n\";\n\t\treturn true;\n\t}",
"private static function lp_check_is_block_editor() {\n\n // Check if Guteberg plugin available.\n if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) {\n return true;\n }\n\n $current_screen = get_current_screen();\n\n if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {\n return true;\n }\n\n return false;\n }",
"function _closeRemainingBlocks () {\r\n // everything closed\r\n if (count ($this->_stack) == 1) {\r\n return true;\r\n }\r\n // not everything close\r\n if ($this->strict) {\r\n return false;\r\n }\r\n while (count ($this->_stack) > 1) {\r\n if ($this->_topNode ('getFlag', 'closetag', 'integer', BBCODE_CLOSETAG_IMPLICIT) == BBCODE_CLOSETAG_MUSTEXIST) {\r\n return false; // sorry\r\n }\r\n $res = $this->_popNode ();\r\n if (!$res) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public function isSection()\n {\n return false;\n }",
"function restore_pre_code_tags( $p_string, $p_multiline = true ) {\n\t\t\t$t_string = $p_string;\n\t\t\t$tags = '';\n\t\t\t$t_html_pre_code_tags = \"br, pre, code\";\n\n\t\t\tif( is_blank( $t_html_pre_code_tags ) ) {\n\t\t\t\treturn $t_string;\n\t\t\t}\n\n\t\t\t$tags = explode( ',', $t_html_pre_code_tags );\n\t\t\tforeach( $tags as $key => $value ) {\n\t\t\t\tif( !is_blank( $value ) ) {\n\t\t\t\t\t$tags[$key] = trim( $value );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tags = implode( '|', $tags );\n\t\t\n\t\t\t$t_string = preg_replace_callback('/<(' . $tags . ')(.*?)>/ui',\n\t\t\tcreate_function('$m', '\n\t\t\t\treturn \"<\" . $m[1] . str_replace(\""\", \"\\\"\", $m[2]) . \">\";\n\t\t\t')\n\t\t\t, $t_string);\n\t\t\t\n\t\t\t$t_string = preg_replace( '/<\\/(' . $tags . ')\\s*>/ui', '</\\\\1>', $t_string );\t\t\t\n\t\t\t$t_string = preg_replace( '/<a\\shref="(\\S+)">.+<\\/a>\\s\\[<a\\shref="(\\S+)"\\starget="_blank">\\^<\\/a>\\]/ui', '<a href=\"\\\\1\">\\\\1</a> [<a href=\"\\\\1\" target=\"_blank\">^</a>]', $t_string );\n\n\t\t\treturn $t_string;\n\t\t}",
"private function htmlFix() {\n // First, check if html is allowed\n if (!$this->allow_html) {\n $html = false;\n } elseif ($this->standard_html) {\n $html = true;\n } else {\n $html = false;\n }\n\n $newParseArray = array();\n while ($tag = array_shift($this->parseArray)) {\n switch ($tag) {\n case self::TAG_NOHTML_OPEN:\n case self::TAG_HTML_CLOSE:\n $html = false;\n break;\n case self::TAG_HTML_OPEN:\n case self::TAG_NOHTML_CLOSE:\n if ($this->allow_html) {\n $html = true;\n }\n break;\n\n default:\n if ($html) {\n if ($tag == self::BR_TAG) {\n $tag = \"\\n\";\n } // Really, no BR's in html code is wanted.\n $newParseArray[] = $tag;\n } else {\n $newParseArray[] = htmlspecialchars($tag);\n }\n }\n }\n $this->parseArray = $newParseArray;\n return true;\n }",
"protected function set_HTML5() {\r\n\t\t$this->HTML5 = false;\r\n\t\t//var_dump($this->code);\r\n\t\t//if(strpos($this->code, '<!DOCTYPE html>') !== false) { // assuming good practices this is sufficient but we can't make this assumption\r\n\t\t//\t$this->HTML5 = true;\r\n\t\t//}\r\n\t\t$array_tags_identifying_HTML5 = array(\r\n\t\t'section',\r\n\t\t'header',\r\n\t\t'footer',\r\n\t\t'figure',\r\n\t\t);\r\n\t\tforeach($array_tags_identifying_HTML5 as $index => $tag_name) {\r\n\t\t\tif(strpos($this->code, '<' . tag_name) !== false) {\r\n\t\t\t\t$this->HTML5 = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function t_open_tag($sTag) {\n\t\t$this->oBeaut->add('<?php');\n\t\t$token = $this->oBeaut->getToken($this->oBeaut->iCount);\n\t\t$ws = '';\n\t\t\n\t\tif (is_array($token)) {\n\t\t\t$ws .= $token[1];\n\t\t}\n\t\t\n\t\t$token = $this->oBeaut->getToken($this->oBeaut->iCount + 1);\n\t\t\n\t\tif (is_array($token) && $token[0] == T_WHITESPACE) {\n\t\t\t$ws .= $token[1];\n\t\t}\n\t\t\n\t\tif (strpos($ws, \"\\n\") !== false) {\n\t\t\t$this->pad(2);\n\t\t} else {\n\t\t\t$this->oBeaut->add(' ');\n\t\t}\n\t}",
"function has_shortcode( $content ) {\n\n\t\t\tif ( false !== strpos( $content, '[' ) ) {\n\n\t\t\t\tpreg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );\n\n\t\t\t\tif ( !empty( $matches ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"private function tag_close($tag)\r\n\t{\r\n\t\tif(!$this->current_tag instanceof SBBCodeParser_Document\r\n\t\t\t&& $tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t$closing_tags = $this->bbcodes[$this->current_tag->tag()]->closing_tags();\r\n\r\n\t\t\tif(in_array($tag, $closing_tags) || in_array('/' . $tag, $closing_tags))\r\n\t\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t}\r\n\t\t\r\n\t\tif($this->current_tag instanceof SBBCodeParser_Document)\r\n\t\t\treturn false;\r\n\t\telse if($tag !== $this->current_tag->tag())\r\n\t\t{\r\n\t\t\t// check if this is a tag inside another tag like\r\n\t\t\t// [tag1] [tag2] [/tag1] [/tag2]\r\n\t\t\t$node = $this->current_tag->find_parent_by_tag($tag);\r\n\t\t\t\r\n\t\t\tif($node !== null)\r\n\t\t\t{\r\n\t\t\t\t$this->current_tag = $node->parent();\r\n\r\n\t\t\t\twhile(($node = $node->last_tag_node()) !== null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$new_node = new SBBCodeParser_TagNode($node->tag(), $node->attributes());\r\n\t\t\t\t\t$this->current_tag->add_child($new_node);\r\n\t\t\t\t\t$this->current_tag = $new_node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->current_tag = $this->current_tag->parent();\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function testRenderIgnorePhpShortTags() {\n\t\t$this->View->set(['aVariable' => 123]);\n\t\t$result = $this->View->render('simple_php_short_tags');\n\t\t$expected = \"The value of aVariable is: 123. Not <?= \\$aVariable ?>.\\n\";\n\n\t\t$this->assertSame($expected, $result, 'variables in php tags should be treated as strings');\n\t}",
"private function has_conditional_tag( $html ) {\r\n\t\treturn ( false !== strpos( $html, self::WP_ROCKET_CONDITIONAL ) );\r\n\t}",
"function elytra_javascript_detection() {\n\techo \"<script>(function(html){html.className = html.className.replace(/\\bno-js\\b/,'js')})(document.documentElement);</script>\\n\";\n}",
"public function hasCode(){\n return $this->_has(3);\n }",
"public function inSassScriptDirective()\n\t{\n\t\treturn $this->parent instanceof EachNode\n\t\t\t|| $this->parent->parent instanceof EachNode\n\t\t\t|| $this->parent instanceof ForNode\n\t\t\t|| $this->parent->parent instanceof ForNode\n\t\t\t|| $this->parent instanceof IfNode\n\t\t\t|| $this->parent->parent instanceof IfNode\n\t\t\t|| $this->parent instanceof WhileNode\n\t\t\t|| $this->parent->parent instanceof WhileNode;\n\t}",
"function isHTML($a_text)\n\t{\n\t\tif (preg_match(\"/<[^>]*?>/\", $a_text))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE; \n\t\t}\n\t}",
"public function isTokenized()\n\t{\n\t\treturn true;\n\t}",
"public function hasCpSection()\n {\n return false;\n }",
"function js_detection() {\n\n\techo \"<script>(function(html){html.className = html.className.replace(/\\bno-js\\b/,'js')})(document.documentElement);</script>\\n\";\n}",
"function parse_code($markup)\n\t{\n\t\tglobal $p_items;\n\t\tlist(, $spaces, $class, $content, $end) = $markup;\n\t\t$content = htmlentities($content);\n\n\t\tif($spaces == \"\\n\") {\n\t\t\t$begin = \"<pre\".$class.\"><code>\";\n\t\t\t$content = trim($content, \"\\r\\n\");\n\t\t\t$end .= \"</pre>\";\n\t\t}\n\t\telse $begin = \"<code\".$class.\">\";\n\n\t\t$p_items[] = $spaces.$begin.$content.$end;\n\t\treturn \"<THIISpreserve\".(count($p_items)-1).\"/>\";\n\t}",
"public static function isMarkup($input) : bool\n {\n return is_string($input) && strpos(trim($input), '<') === 0;\n }",
"public function isSelfClosingTag($tag)\n {\n return $tag === 'br' || $tag === 'img';\n }",
"function replacePhpShortCodes(&$string)\n\t{\n\t\t$string = preg_replace('#<\\?(\\s.*?)\\?>#', '<?php\\1?>', $string);\n\t\t// Replace <?= with <?php echo\n\t\t$string = preg_replace('#<\\?=\\s*(.*?)\\?>#', '<?php echo \\1?>', $string);\n\t}"
] | [
"0.6342579",
"0.6015344",
"0.5999089",
"0.5777366",
"0.5766227",
"0.571766",
"0.5703856",
"0.5689268",
"0.5634954",
"0.5601844",
"0.5583934",
"0.5579047",
"0.55535275",
"0.553919",
"0.5524793",
"0.5501309",
"0.54886746",
"0.5473864",
"0.5430884",
"0.53993154",
"0.5393771",
"0.5391075",
"0.53719157",
"0.53686625",
"0.53624547",
"0.536006",
"0.53358406",
"0.5334386",
"0.5308653",
"0.53055596",
"0.5299222",
"0.5271119",
"0.5253649",
"0.52528304",
"0.52526385",
"0.5250818",
"0.5247695",
"0.524615",
"0.5231105",
"0.52022034",
"0.51992124",
"0.5197874",
"0.5186734",
"0.51858026",
"0.51616305",
"0.5156959",
"0.515389",
"0.5146442",
"0.5137971",
"0.5121653",
"0.51164615",
"0.51130354",
"0.51004905",
"0.51004905",
"0.5098745",
"0.5093396",
"0.5078183",
"0.5074192",
"0.506288",
"0.506288",
"0.5056058",
"0.5035299",
"0.502905",
"0.50238097",
"0.50128245",
"0.5010016",
"0.5005884",
"0.49868822",
"0.4985969",
"0.49794105",
"0.4975515",
"0.4972366",
"0.49718913",
"0.49699062",
"0.49678716",
"0.49677655",
"0.4967254",
"0.49557966",
"0.49525136",
"0.49453413",
"0.49350542",
"0.49342096",
"0.4928097",
"0.492776",
"0.49275512",
"0.49272358",
"0.49268645",
"0.49160326",
"0.4883505",
"0.48555437",
"0.4842433",
"0.48385334",
"0.4837182",
"0.48191145",
"0.4817083",
"0.48111793",
"0.4798561",
"0.47971255",
"0.4796421",
"0.47952545",
"0.47938868"
] | 0.0 | -1 |
Returns the maximum directory nesting allowed by this template. | public function getMaxNesting()
{
return $this->maxNesting;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function maxDepth()\n {\n if ($this->maxDepth === null) {\n return static::DEFAULT_MAX_DEPTH;\n }\n\n return $this->maxDepth;\n }",
"public static function getMaximumPathLength() {}",
"public function getDepth(): int\n {\n return count(explode('/', $this->currentFileName)) - 1;\n }",
"public function getMaxRecursionDepth() {\n\t\treturn $this->_maxRecursionDepth;\n\t}",
"public function getMaxComponentDepth() {}",
"public static function getMaxGraphicStateNestingLevel() {}",
"public function getMaximumDepth()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT MAX(depth) depth FROM '.$this->table_tree;\n\t\t$res = $ilDB->query($query);\t\t\n\t\t\n\t\t$row = $ilDB->fetchAssoc($res);\n\t\treturn $row['depth'];\n\t}",
"public function getMaxDepth(): ?int;",
"public function getMaxDepth(): ?int;",
"function max_parent( $dirpath, $prefix )\n{\n $dirpath = rtrim ( $dirpath, \"/\" ); // Trim any trailing slash\n $position = strrpos( $dirpath, \"/\" );\n $dirpath = substr ( $dirpath, 0, $position );\n\n $lines = http_get_file( $dirpath );\n\n $regex_match = \"#${prefix}[\\d\\.]+/#\";\n $regex_replace = \"#^.*(${prefix}[\\d\\.]+)/.*$#\";\n $max = find_max( $lines, $regex_match, $regex_replace );\n\n return \"$dirpath/$max\";\n}",
"public function getLevel()\n {\n return sizeof($this->getParentsID());\n }",
"public function ancestorsGetDepth()\r\n {\r\n if (!isset($this->depth))\r\n {\r\n $this->depth = substr_count($this->path, \"/\");\r\n }\r\n \r\n return (int) $this->depth;\r\n }",
"public function depth() {\n return $this->depth;\n }",
"public function getDepthMaximum(): PositiveInteger;",
"public function getNestingLevel()\n {\n $nested = $this->getNested();\n\n // another collection ... increase the level by 1\n if ($nested instanceof CollectionMapper) {\n return 1 + $nested->getNestingLevel();\n }\n\n // not another collection ... level is 1\n return 1;\n }",
"protected function checkXdebugMaxNestingLevel() {}",
"function calculate_folder_level($file)\n{\n$dir = \"\"; $count = 0;\nwhile(!file_exists($dir.$file)) {\n$dir .= \"../\"; $count++;\nif($count > 5) {\nreturn false;\n}\n}\ndefine(\"DIR_LEVEL\", $dir, true);\n}",
"public function getDepth() {\n\t\tif ($this->depth === NULL) {\n\t\t\t$this->depth = NodePaths::getPathDepth($this->path);\n\t\t}\n\t\treturn $this->depth;\n\t}",
"public function getNestingLevel();",
"public function getNestingLevel()\n {\n return $this->nestingLevel;\n }",
"protected function maxFiles()\n {\n if ($this->app->bound('config')) {\n return $this->app->make('config')->get('app.log_max_files', 5);\n }\n\n return 0;\n }",
"public function setMaxComponentDepth($value) {}",
"public function getDepth()\n {\n return ($this->isEmpty()) ? 0 : $this->root->getDepth() - 1;\n }",
"public function getMaxNbChilds()\n {\n return $this->getOption('max', 0);\n }",
"public function getAllowedMaxFileNumber() {\n return $this->allowedMaxFileNumber;\n }",
"public static function maxLevel()\n\t{\n\t\tif (!auth()->check()) return 0;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\t\tif ($member->isAdmin()){\n\t\t\treturn 3;\n\t\t}elseif($member->isAgent()){\n\t\t\treturn 2;\n\t\t}else\n\t\t\treturn 1;\n\t}",
"public function getDepth() {\n\t\treturn $this->depth;\n\t}",
"public function getDepth()\n {\n return $this->depth;\n }",
"public function getDepth()\n {\n return $this->depth;\n }",
"public function getDepth()\n {\n return $this->depth;\n }",
"public function getDirCount(){\n\t\treturn $this->intDirCount;\n\t}",
"function ep_post_depth() {\n\tglobal $post;\n\t$depth = 0;\n\t$parents = get_post_ancestors($post);\n\tif ($parents) {\n\t\tforeach ($parents as $one_parent_id) {\n\t\t\t$parent_post = get_post($parent_post);\n\t\t\tif ($parent_post->post_parent) {\n\t\t\t\t$depth++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $depth;\n}",
"public function getDepth():int;",
"function getTemplateDir()\n {\n return $this->_objectPool[$this->_lastUsedObjectKey]->getOption('templateDir');\n }",
"public function getRootLevelFolder() {}",
"public function nesting()\r\n\t{\r\n\t\treturn $this->context->current_nesting();\r\n\t}",
"public function depth() {\n\t\treturn Hash::depth($this->_value);\n\t}",
"function get_max_depth($cat_id)\n{\n\tglobal $db;\n\tif ($cat_id < 0) $cat_id = 0;\n\t$local_depth = 0;\n\t$sql = \"select * from \" . CATEGORIES_TABLE . \" where cat_main = $cat_id\";\n\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categorie parm', '', __LINE__, __FILE__, $sql);\n\twhile ( $row = $db->sql_fetchrow($result) )\n\t{\n\t\t$branch_depth = get_max_depth( $row['cat_id'] );\n\t\tif ( $cat_id > 0 ) $branch_depth++;\n\t\tif ( $branch_depth > $local_depth ) $local_depth = $branch_depth;\n\t}\n\treturn $local_depth;\n}",
"public function getDepth() {}",
"public function getDepth() {}",
"public function getAllowedMaxFileNumber()\n {\n $uploadField = $this->getUploadField();\n\n return $uploadField->getAllowedMaxFileNumber();\n }",
"public function getMaxChildrenPerFamily()\n {\n return $this->maxChildrenPerFamily;\n }",
"public function getDepth();",
"public function getDepth() {\n\t\treturn $this->d;\n\t}",
"public function getMaxFileUploads()\n {\n return $this->max_file_uploads;\n }",
"public function getMaxFileSize()\r\n\t{\r\n\t\treturn $this->max_file_size;\r\n\t}",
"public function getDefaultLevelRoot()\n {\n return 0;\n }",
"public function getAllowedMaxFileSize()\n {\n $size = $this->getValidator()->getAllowedMaxFileSize();\n if($size) {\n $sizeMB = $size / 1024 / 1024;\n return $sizeMB;\n }\n }",
"public function getMaxSize() : int {\n\t\treturn $this->generator->getMaxSize();\n\t}",
"public function getTemplateRoot()\n {\n return TEMPLATE_ROOT;\n }",
"public function getMaxUploadFileSize()\n\t{\n\t\t$objResult = \\Database::getInstance()->prepare(\"SELECT MAX(maxlength) AS maxlength FROM tl_form_field WHERE pid=? AND invisible='' AND type='upload' AND maxlength>0\")\n\t\t\t\t\t\t\t\t\t\t\t ->execute($this->id);\n\n\t\tif ($objResult->numRows > 0 && $objResult->maxlength > 0)\n\t\t{\n\t\t\treturn $objResult->maxlength;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \\Config::get('maxFileSize');\n\t\t}\n\t}",
"public function getStructureDepth() {}",
"public function max() {\n return count($this->flats);\n }",
"function getRootLevelFolder() ;",
"public function getDepthAttribute()\n {\n $count = 0;\n $parent = $this->parent;\n while ($parent)\n {\n $count += 1;\n $parent = $parent->parent;\n }\n return $count;\n }",
"public function getPostMaximumDepth($a_thr_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$res = $ilDB->queryf('\n\t\t\tSELECT MAX(depth) FROM frm_posts_tree\n\t\t\tWHERE thr_fk = %s',\n\t\t\tarray('integer'),array($a_thr_id));\n\t\t\t\n\t\t$row = $res->fetchRow();\n\t\t\n\t\treturn $row[0];\n\t}",
"public function getMaxIssuerPathLengthValue()\n {\n return $this->readWrapperValue(\"max_issuer_path_length\");\n }",
"public function getMaxSize()\r\n {\r\n return $this->max_size;\r\n }",
"public function getTemplateRootAbs()\n {\n return TEMPLATE_ROOT_ABS;\n }",
"public static function getMaxUploadFileNumber() {\n\t\treturn min_not_null(array(self::MAX_NUMBER_FILES, ini_get(\"suhosin.upload.max_uploads\"), ini_get(\"max_file_uploads\")));\n\t}",
"private function get_max_files(){\r\n\t\t$md_setttings = get_option('iemop_market_downloads_settings', array());\r\n\t\t$max_files = isset($md_setttings['mr_max_files']) ? $md_setttings['mr_max_files'] : 50;\r\n\t\t\r\n\t\treturn $max_files;\r\n\t}",
"public function getMaxFileSize()\n {\n return $this->maxBytes;\n }",
"protected function _getMax()\n {\n $max = 0;\n if (!empty($this->_tagsArray)) {\n $p_size = 0;\n foreach ($this->_tagsArray as $cKey => $cVal) {\n $c_size = $cVal['size'];\n if ($c_size > $p_size) {\n $max = $c_size;\n $p_size = $c_size;\n }\n }\n }\n return $max;\n }",
"function get_dirsize($directory, $max_execution_time = \\null)\n {\n }",
"public function getMaxSize(){\n return $this->maxSize;\n }",
"public function getMaxSize() : int{\n return $this->maxSize;\n }",
"public function getOmittedMaximumDepthOfXReachedMessage(): string;",
"public function getMaxNodeCount()\n {\n return $this->max_node_count;\n }",
"public function getTemplateDir()\n {\n return $this->templateDir;\n }",
"public static function getDepth() : int\n {\n return count(static::$stack);\n \n }",
"public function getTemplateDirectory() : string {\n\t\t\treturn $this->templateDirectory;\n\t\t}",
"protected function get_max_length(): int\n\t{\n\t\treturn $this->end < $this->total ? $this->length : -1;\n\t}",
"function recurse_dirsize($directory, $exclude = \\null, $max_execution_time = \\null, &$directory_cache = \\null)\n {\n }",
"public function get_template_root()\n {\n }",
"public function getMaxNumSteps()\n {\n return $this->max_num_steps;\n }",
"function array_depth($array) \n{\n\t// init maximal depth (deepest child)\n\t$max_depth = 1;\n\t// print array as string\n\t$array_str = print_r($array, true);\n\t// explode string by line breaks\n\t$lines = explode(\"\\n\", $array_str);\n\t// loop through lines and check for depth\n\tforeach ($lines as $line) \n\t{\n\t\t// get depth for current loop\n\t\t$depth = ( strlen($line) - strlen( ltrim($line) ) ) / 4;\n\t\t// if depth is deeper\n\t\tif ($depth > $max_depth) \n\t\t{\n\t\t\t// set max depth to depth\n\t\t\t$max_depth = $depth;\n \t\t}\n\t}\n\t// return depth\n return ceil( ($max_depth - 1) / 2) + 1;\n}",
"protected function determineMaximumGalleryWidth() {}",
"public function getSizeLimit() {\n return $this->sizeLimit;\n }",
"public function getDepth($index) {\n if (!isset($this->view->result[$index])) {\n return FALSE;\n }\n $row = $this->view->result[$index];\n // If parent is available, set parent's depth +1.\n return (!empty($row->draggableviews_structure_parent)) ? $this->getDepth($this->getIndex('nid', $row->draggableviews_structure_parent)) + 1 : 0;\n }",
"public function getMaxStackElements() {}",
"function getMaxFileSize()\n {\n $val = trim(ini_get('post_max_size'));\n $last = strtolower($val[strlen($val)-1]);\n $val = intval($val);\n switch($last) {\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n $postMaxSize = $val;\n\n return($postMaxSize);\n }",
"private function getActualLevel(): int\n {\n return (int)array_key_last($this->levels);\n }",
"public function GetMaxSize ();",
"public function numChildFolders()\n {\n return $this->ChildFolders()->count();\n }",
"public static function getLastDirectory() {\n\t\tif (is_null(static::$currentDirectory)) {\n\t\t\treturn Application::paths()->routes();\n\t\t}\n\n\t\treturn static::$currentDirectory;\n\t}",
"public function getMaxDit() {\n\t\treturn $this->maxDit;\n\t}",
"public function getTermLevel(): int\n {\n $level = 0;\n $term = $this;\n\n while ($term->ParentID) {\n $level++;\n $term = $term->Parent();\n }\n\n return $level;\n }",
"public function getTemplateDir()\n {\n return WP::applyFilters('wpmvc_template_dir', $this->templateDir);\n }",
"public function getMaxSize(): int\n {\n return $this->maxSize;\n }",
"public function getTemplateDir()\n\t{\n\t\treturn $this->_tplDir;\n\t}",
"private function return_lastdir($file_path){\n \n if (is_dir($file_path)){\n //$dir_handle = opendir($file_path);\n $object = scandir($file_path);\n \n $object = $this->except_special_dir($object);\n \n if(is_array($object) && count($object)){\n rsort($object);\n $latest_dir = $object[0]; // number of directory\n return $latest_dir;\n }else{\n $this->mkpath($file_path.DS.\"0\");\n if(is_dir($file_path.DS.\"0\")){\n return \"0\";\n }else{\n return false;\n }\n }\n }else{\n return false;\n } \n }",
"public function getMaxLength() {\n return $this->maxLength;\n }",
"public function getTemplateDir()\n\t{\n\t\treturn DIR_TEMPLATE;\n\t}",
"public function getMaxSize() {\n\t\t\treturn $this->maxSize >= 0 ? $this->maxSize : $this->getTotalMaxSize();\n\t\t}",
"public function get_logger_limit() {\n\t\treturn $this->get_option('ring_logger_limit', 20);\n\t}",
"public function getMaxSize(): int;",
"public function getMaxLimit()\n {\n return $this->max_limit;\n }",
"function getUploadMaxValue(){\n return str_replace('M', '', getUploadMax()) * 1024;\n }",
"static public function getMaxUploadFileSize()\n\t{\n $upload_max_filesize = self::getBytesOfLiteralSizeFormat(ini_get('upload_max_filesize'));\n $post_max_size = self::getBytesOfLiteralSizeFormat(ini_get('post_max_size'));\n\n\t\tif ($upload_max_filesize < $post_max_size) {\n\t\t\t$maxUploadFilesize = $upload_max_filesize;\n\t\t} else {\n\t\t\t$maxUploadFilesize = $post_max_size;\n\t\t}\n\t\treturn $maxUploadFilesize;\n\t}",
"public function getMaxIssuerPathLength()\n {\n return $this->max_issuer_path_length;\n }"
] | [
"0.6367185",
"0.6237618",
"0.6235076",
"0.6183445",
"0.6144252",
"0.612431",
"0.60825133",
"0.59626013",
"0.59626013",
"0.5907675",
"0.5822726",
"0.5790901",
"0.57689506",
"0.57647324",
"0.5746729",
"0.572063",
"0.56975687",
"0.56738526",
"0.56526834",
"0.5572018",
"0.55324924",
"0.55259126",
"0.5500723",
"0.54615283",
"0.5452428",
"0.54447114",
"0.5412892",
"0.5410862",
"0.5410862",
"0.5410862",
"0.53931427",
"0.53896093",
"0.53723943",
"0.5368467",
"0.5365359",
"0.53544444",
"0.5343879",
"0.53097177",
"0.53035516",
"0.5303196",
"0.5297648",
"0.5268809",
"0.52172124",
"0.52130604",
"0.51785976",
"0.5174846",
"0.5173688",
"0.51709855",
"0.5165227",
"0.51542693",
"0.51367825",
"0.5118118",
"0.50928766",
"0.5090599",
"0.50798357",
"0.50773066",
"0.50710833",
"0.5064465",
"0.5050057",
"0.50459534",
"0.5036495",
"0.50343466",
"0.50294685",
"0.5027374",
"0.5014576",
"0.50123435",
"0.49934",
"0.49786106",
"0.49783546",
"0.49750328",
"0.49733078",
"0.4967772",
"0.49635693",
"0.49498764",
"0.49463165",
"0.49442238",
"0.49435115",
"0.49365807",
"0.49363914",
"0.49267763",
"0.49263254",
"0.49242368",
"0.49159282",
"0.49138322",
"0.49135327",
"0.49082726",
"0.49054056",
"0.49015847",
"0.48870638",
"0.4884704",
"0.48836493",
"0.4880774",
"0.48767665",
"0.48753968",
"0.48716822",
"0.48702133",
"0.48623264",
"0.4861192",
"0.4858735",
"0.48507273"
] | 0.7226511 | 0 |
Returns true if the object was loaded from the cache. | public function isLoadedFromCache()
{
return $this->loadedFromCache;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function loadCacheData()\n\t{\n\t\t//is it enabled?\n\t\tif ($this->useObjectCaching)\n\t\t{\n\t\t\t//get our cache data... is it there?\n\t\t\t$data = $this->getCache();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t//load it, and we're good.\n\t\t\t\t$this->hydrate($data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isCached(): bool;",
"public function isCached() {}",
"public function isCached()\n {\n if ($this->cache->has($this->cacheKey)) {\n return true;\n }\n\n return false;\n }",
"function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }",
"public function is_cached()\n\t\t{\n\t\t\treturn $this->cached;\n\t\t}",
"protected function _loadCache()\n {\n return false;\n }",
"public function hasCache(): bool\n {\n return isset($this->contents);\n }",
"private function isCached()\n {\n return Cache::has($this->cacheKey());\n }",
"public function isLoaded() {\n return is_object($this->result);\n }",
"function isCached() {\r\n if ($this->_cachingEnabled) {\r\n $isCached = $this->_templateObject->isCached($this->_viewId);\r\n }\r\n else $isCached = false;\r\n return $isCached;\r\n }",
"public static function hasCache() {\n\t\treturn false;\n\t}",
"public function is_objectcache_add_in() {\n\t\tif ( !$this->objectcache_installed() )\n\t\t\treturn false;\n\n\t\treturn ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_OBJECT_CACHE ) )\n\t\t\t&& strstr( $script_data, '//ObjectCache Version: 1.4' ) !== false );\n\t}",
"public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}",
"public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }",
"public function can_cache() {\n return $this->valid;\n }",
"function exists() {\n \n return !empty($this->cache);\n \n }",
"protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }",
"public function objectcache_installed() {\n\t\treturn file_exists( W3TC_ADDIN_FILE_OBJECT_CACHE );\n\t}",
"private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }",
"public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }",
"public static function loadFromCache() {\n\t\tif (Server::isDebugModeEnabled()) {\n\t\t\t// in debug mode the server never uses caching\n\t\t\treturn false;\n\t\t}\n\n\t\t// If we are trying to load routing from cache, we must save cache after compilation for the next time\n\t\tself::$saveCache = true;\n\n\t\tif (self::isInitialized()) {\n\t\t\t// prevent calling this method a second time\n\t\t\treturn true;\n\t\t}\n\n\t\t$fileName = Server::getCacheDir() . DIRECTORY_SEPARATOR . self::CACHE_FILE_NAME;\n\n\t\tif (!is_file($fileName) || !is_readable($fileName)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (time() > (filemtime($fileName) + self::CACHE_LIFETIME)) {\n\t\t\t// cache file is expired, delete it and re-render routing table\n\t\t\tunlink($fileName);\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$content = file_get_contents($fileName);\n\n\t\tif ($content) {\n\t\t\t$map = @unserialize($content);\n\n\t\t\tif (!empty($map) && is_array($map)) {\n\t\t\t\tself::$cachedMap = $map;\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// cache file contains wrong data\n\t\tunlink($fileName);\n\n\t\treturn false;\n\t}",
"function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }",
"public function hasCacheStore(): bool;",
"public function wasCached();",
"private function hasCache()\n {\n if (!$this->isActive()) {\n return false;\n }\n\n return !empty($this->getCache(false));\n }",
"public function isLazyLoadableObject()\n {\n return $this->lazyLoadable;\n }",
"public function getCacheable() : bool {\n return $this->cacheable;\n }",
"public function isCacheEnabled() {\n\t\treturn $this->cache;\n\t}",
"private function _isLoaded() {\n return (bool) $this->id;\n }",
"public function is_objectcache_old_add_in() {\n\t\tif ( !$this->objectcache_installed() )\n\t\t\treturn false;\n\n\t\treturn ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_OBJECT_CACHE ) )\n\t\t\t&& ( ( strstr( $script_data, 'W3 Total Cache Object Cache' ) !== false ) ||\n\t\t\t\tstrstr( $script_data, 'w3_instance' ) !== false ) );\n\t}",
"protected function isCached(): bool\n {\n $cacheTime = self::CACHE_TIME * 60;\n\n if (!is_file($this->pathCache)) {\n return false;\n }\n\n $cachedTime = filemtime($this->pathCache);\n $cacheAge = $this->time - $cachedTime;\n\n return $cacheAge < $cacheTime;\n }",
"public function isUseCache()\n {\n return $this->use_cache;\n }",
"public function isCacheUsed()\n\t{\n\t\treturn $this->__isMainTree() and $this->use_cache;\n\t}",
"private function isLoaded()\r\n {\r\n return $this->loaded;\r\n }",
"public function isCacheEnabled()\n {\n return $this->cache;\n }",
"public function hasCache()\n {\n return (null !== $this->getCacheAdapter());\n }",
"public function cacheExists()\n {\n $cacheFile = $this->getCacheFile();\n if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {\n return(true);\n } else {\n return(false);\n }\n }",
"public function isLoaded ( )\n {\n return $this->_loaded;\n }",
"public function isLoaded();",
"final public function isHit(): bool\n\t{\n\t\tif ($stm = $this->_prepare('SELECT COUNT(*) AS `found` FROM `Cache` WHERE `key` = :key LIMIT 1;')) {\n\t\t\t$stm->execute(['key' => $this->getkey()]);\n\t\t\t$result = $stm->fetchObject();\n\t\t\tvar_dump($result);\n\t\t\treturn $result->found === '1';\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function MustUseCache()\n {\n if ($this->cacheLifetime == 0)\n {\n return false;\n }\n if (!File::Exists($this->file))\n {\n return false;\n }\n $now = Date::Now();\n $lastMod = File::GetLastModified($this->file);\n if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)\n {\n return true;\n }\n return false;\n }",
"public function isLoaded()\n {\n return $this->_is_loaded;\n }",
"private function check_cache() {\n if (!file_exists($this->cache_file)) {\n return false;\n }\n if (filemtime($this->cache_file) >= strtotime(\"-\" . CACHE_EXPIRATION . \" seconds\")) {\n return true;\n } else {\n return false;\n }\n }",
"public function isLoaded()\n {\n return $this->loaded;\n }",
"public function isLoaded()\r\n\t{\r\n\t\treturn $this->loaded;\r\n\t}",
"static function is_cache()\n\t{\n\t\tif (file_exists(Cache::$path))\n\t\t{\n\t\t\tif(Cache::$time>0)\n\t\t\t{\n\t\t\t\t$info_file=stat(Cache::$path);\n\t\t\t\tif(time() > $info_file[9]+Cache::$time)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tCache::delete();\n\t\t\t\t\tCache::$time=0;\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function is_loaded()\n {\n return $this->loaded;\n }",
"public function has()\n\t{\n\t\t$name = $this->name();\n\n\t\tif(($has = Cache::has($name)) && $this->forget)\n\t\t{\n\t\t\tCache::forget($name);\n\n\t\t\t// We don't want to return the cached assets because we cleared\n\t\t\t// the cache and we want a new fresh copy of the assets returned.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $has;\n\t}",
"public function isLoaded()\n {\n return $this->isLoaded;\n }",
"public function hasLoadedCacheFile( $classname );",
"protected function useCache()\n {\n // Should we use a cached version?\n if ($this->cache && $this->cacheExists()) {\n $this->templateOutput = $this->getCache();\n if ($this->templateOutput !== false) {\n return true;\n }\n }\n return false;\n }",
"public static function isCached($key) {\n\t\t\t$klass = self::getInstance();\n\t\t\treturn isset($klass->cache[crc32($key)]);\n\t\t}",
"public function isCachedDataAvailable(){\n\t\treturn $this->_dataAvailable;\n\t}",
"public function hasCachedData(): bool\n {\n return !empty(static::$cachedData);\n }",
"public function has_lazy_load() {\n\t\treturn $this->get_meta_value( static::LAZY_LOAD_META_KEY ) === '1';\n\t}",
"function cacheObjectLocked ()\n {\n return is_file($this->cacheObjectId.'.lock');\n }",
"public function isCacheEnabled()\n {\n return $this->isCacheEnabled;\n }",
"public function hasLoadedCacheFile( $classname )\n\t{\n\t\tif ( isset( $this->loaded_classes[ $classname ] ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function isLoaded(): bool\n {\n return $this->options['load'] || in_array($this->getMethod(), [self::INLOAD, self::POSTLOAD], true);\n }",
"public function isCacheEnabled()\n {\n return $this->cacheEnabled;\n }",
"public static function hasDefaultCache();",
"public static function isCacheActive()\n {\n return (bool)static::$cacheActive;\n }",
"public static function isInitialized() {\n\t\treturn isset(self::$cachedMap);\n\t}",
"public static function is_set_cache(): bool\n {\n return self::getConfigDB(self::cache);\n }",
"public static function isLoaded();",
"function _can_cache() {\n\t\treturn true;\n\t}",
"public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isCacheable()\n {\n return $this->cacheable;\n }",
"function isAvailable()\r\n\t{\r\n return $this->oMemcache == null ? false : true;\r\n }",
"public function memCached() { return true; }",
"public function cacheIsSet()\n {\n return is_a($this->Cache, CacheInterface::class);\n }",
"public function is_property_cached($key) {\n\t\treturn array_key_exists($key, $this->_cached_properties);\n\t}",
"private function _isCached($key)\n {\n return Cache::has($key);\n }",
"public static function isLoaded(): bool\n {\n return !!static::$loaded;\n }",
"public function isCached(string $label) : bool\n {\n $filename = $this->path . \"/\" . md5($label);\n if (file_exists($filename) && (filemtime($filename) + $this->ttl >= time())) {\n return true;\n }\n return false;\n }",
"protected function isLoaded(){\n\t\treturn $this->lodaed;\n\t}",
"public function getIsCallForCache()\n {\n return $this->_blIsCallForCache;\n }",
"public static function has($key){\n return \\Illuminate\\Cache\\Repository::has($key);\n }",
"public static function isLoaded()\n {\n $qualifiedName = static::getSingletonClass();\n\n return isset(static::$instances[ $qualifiedName ])\n && is_object(static::$instances[ $qualifiedName ]);\n }",
"private function _checkCache()\r\n {\r\n // get a string representation of the object\r\n ob_start();\r\n var_dump(get_object_vars($this));\r\n $buffer = ob_get_clean();\r\n \r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // check if the cache file exists, if it does use it\r\n if (file_exists(\"{$this->_config['paths']['cache']}/{$hash}\")){\r\n die(file_get_contents(\"{$this->_config['paths']['cache']}/{$hash}\"));\r\n }\r\n }",
"public function isCached($key) {\n\t\tif($this->getCacheAge($key) == null) {\n\t\t\t$cacheFile = $this->getCacheFile($key);\n\t\t\tif(file_exists($cacheFile)) {\n\t\t\t\t$this->setCacheAge($key,filemtime($cacheFile));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"public function isCached($key)\n {\n if (!is_readable($this->path . '/' . $key)) {\n return false;\n }\n if(!is_null($this->duration)) {\n $now = time();\n $expires = $this->duration * 60 * 60;\n $fileTime = filemtime($this->path . '/' . $key);\n if (($now - $expires) < $fileTime) {\n return false;\n }\n }\n return true;\n }",
"public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }",
"public function is_cached($file_name){\n\t\t\n\t\t$file_name = $this->path . $file_name;\n\t\tif(file_exists($file_name) && (filemtime($file_name) + $this->cache_time >= time())) return true;\t\n\n\t\treturn false;\n\t}",
"protected function load() {\n $values = $this->getStorage()->fetch($this->getId());\n\n if ($values === false) {\n return false;\n }\n\n // metadata\n $metadata = $values[self::METADATA_NAMESPACE];\n $this->first_trace = $metadata['first_trace'];\n $this->last_trace = $metadata['last_trace'];\n $this->regeneration_trace = $metadata['regeneration_trace'];\n $this->requests_counter = $metadata['requests_count'];\n $this->fingerprint = $metadata['fingerprint'];\n\n // values\n $this->values = $values;\n\n return true;\n }",
"private function loadCache()\r\n {\r\n if (file_exists(WEMO_CACHE)) {\r\n $fp = fopen(WEMO_CACHE, 'r');\r\n $json = fread($fp, filesize(WEMO_CACHE));\r\n fclose($fp);\r\n return json_decode($json);\r\n } else {\r\n return false;\r\n }\r\n }",
"public function valid ()\n {\n return isset($this->offset) && isset($this->cache[ $this->offset ]);\n }",
"protected function canLoad()\n\t{\n\t\t$v = version_compare($this->getVersion(),$this->getConfigValue('plugin_current_version')); \n\t\t//first, check if this instance is the latest one, or not\n\t\tif($v < 0) return false;\n\t\t\t \n\t\t//save the latest version, for later reference\n\t\tif($v > 0 )\n\t\t\t$this->setConfigValue('plugin_current_version',$this->getVersion());\n\t\t\t\n\t\treturn true;\n\t}",
"function MustStoreToCache()\n {\n return $this->cacheLifetime > 0;\n }",
"public function isExistInCache($key);",
"public function getIsCachedResult()\n {\n return $this->is_cached_result;\n }",
"protected function useCache() {\n\t\tif (isset($_COOKIE['nc']) && $_COOKIE['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (isset($_GET['nc']) && $_GET['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function canBeCached(): bool\n {\n foreach ($this->getValidators() as $validator) {\n if (!$validator->canBeCached()) {\n return false;\n }\n }\n\n return true;\n }",
"protected function isLoaded($key) {\n return isset($this->loaded[$key]);\n }",
"public function checkIfCanLoad()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"function cache_classes_IsLoaded($classname)\n{\n $cache = core_cache_Get(CACHE_CLASSES_KEY);\n RETURN array_key_exists($classname, $cache);\n}"
] | [
"0.8096812",
"0.7640676",
"0.7482657",
"0.74748504",
"0.74692136",
"0.74615556",
"0.74591196",
"0.7450629",
"0.7428408",
"0.74026287",
"0.7331308",
"0.7271206",
"0.72503763",
"0.72425246",
"0.7219823",
"0.71931124",
"0.7180526",
"0.71777904",
"0.71598095",
"0.7149306",
"0.71400625",
"0.71140754",
"0.7101518",
"0.70972675",
"0.70933545",
"0.70446306",
"0.70134735",
"0.7007161",
"0.6992733",
"0.69880223",
"0.6987535",
"0.697489",
"0.69721425",
"0.69592863",
"0.6950693",
"0.69253415",
"0.6876407",
"0.6869775",
"0.6865924",
"0.6859505",
"0.68586415",
"0.6857047",
"0.68552715",
"0.6821829",
"0.6810786",
"0.6795307",
"0.6791445",
"0.67910105",
"0.6790977",
"0.6776591",
"0.6769572",
"0.67633504",
"0.67602116",
"0.6755536",
"0.67409885",
"0.67367256",
"0.67309827",
"0.6721475",
"0.6720505",
"0.67086905",
"0.67073613",
"0.67057824",
"0.6705037",
"0.6694938",
"0.66857177",
"0.6676894",
"0.6670929",
"0.66666996",
"0.6662239",
"0.6659997",
"0.66509867",
"0.6644798",
"0.66427",
"0.66330177",
"0.6632687",
"0.6619507",
"0.6618641",
"0.6614765",
"0.65997326",
"0.6598912",
"0.6582705",
"0.65689427",
"0.6561872",
"0.6553156",
"0.6551971",
"0.65410715",
"0.65360016",
"0.65348643",
"0.6532654",
"0.6532587",
"0.6528565",
"0.6518078",
"0.65160877",
"0.6514718",
"0.651357",
"0.651357",
"0.6512765",
"0.65118647",
"0.6511504",
"0.65087056"
] | 0.8554659 | 0 |
Returns true if the object was loaded from the cache. | public function setLoadedFromCache($value)
{
$this->loadedFromCache = (bool) $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isLoadedFromCache()\n {\n return $this->loadedFromCache;\n }",
"protected function loadCacheData()\n\t{\n\t\t//is it enabled?\n\t\tif ($this->useObjectCaching)\n\t\t{\n\t\t\t//get our cache data... is it there?\n\t\t\t$data = $this->getCache();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t//load it, and we're good.\n\t\t\t\t$this->hydrate($data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isCached(): bool;",
"public function isCached() {}",
"public function isCached()\n {\n if ($this->cache->has($this->cacheKey)) {\n return true;\n }\n\n return false;\n }",
"function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }",
"public function is_cached()\n\t\t{\n\t\t\treturn $this->cached;\n\t\t}",
"protected function _loadCache()\n {\n return false;\n }",
"public function hasCache(): bool\n {\n return isset($this->contents);\n }",
"private function isCached()\n {\n return Cache::has($this->cacheKey());\n }",
"public function isLoaded() {\n return is_object($this->result);\n }",
"function isCached() {\r\n if ($this->_cachingEnabled) {\r\n $isCached = $this->_templateObject->isCached($this->_viewId);\r\n }\r\n else $isCached = false;\r\n return $isCached;\r\n }",
"public static function hasCache() {\n\t\treturn false;\n\t}",
"public function is_objectcache_add_in() {\n\t\tif ( !$this->objectcache_installed() )\n\t\t\treturn false;\n\n\t\treturn ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_OBJECT_CACHE ) )\n\t\t\t&& strstr( $script_data, '//ObjectCache Version: 1.4' ) !== false );\n\t}",
"public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}",
"public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }",
"public function can_cache() {\n return $this->valid;\n }",
"function exists() {\n \n return !empty($this->cache);\n \n }",
"protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }",
"public function objectcache_installed() {\n\t\treturn file_exists( W3TC_ADDIN_FILE_OBJECT_CACHE );\n\t}",
"private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }",
"public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }",
"public static function loadFromCache() {\n\t\tif (Server::isDebugModeEnabled()) {\n\t\t\t// in debug mode the server never uses caching\n\t\t\treturn false;\n\t\t}\n\n\t\t// If we are trying to load routing from cache, we must save cache after compilation for the next time\n\t\tself::$saveCache = true;\n\n\t\tif (self::isInitialized()) {\n\t\t\t// prevent calling this method a second time\n\t\t\treturn true;\n\t\t}\n\n\t\t$fileName = Server::getCacheDir() . DIRECTORY_SEPARATOR . self::CACHE_FILE_NAME;\n\n\t\tif (!is_file($fileName) || !is_readable($fileName)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (time() > (filemtime($fileName) + self::CACHE_LIFETIME)) {\n\t\t\t// cache file is expired, delete it and re-render routing table\n\t\t\tunlink($fileName);\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$content = file_get_contents($fileName);\n\n\t\tif ($content) {\n\t\t\t$map = @unserialize($content);\n\n\t\t\tif (!empty($map) && is_array($map)) {\n\t\t\t\tself::$cachedMap = $map;\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// cache file contains wrong data\n\t\tunlink($fileName);\n\n\t\treturn false;\n\t}",
"function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }",
"public function hasCacheStore(): bool;",
"public function wasCached();",
"private function hasCache()\n {\n if (!$this->isActive()) {\n return false;\n }\n\n return !empty($this->getCache(false));\n }",
"public function isLazyLoadableObject()\n {\n return $this->lazyLoadable;\n }",
"public function getCacheable() : bool {\n return $this->cacheable;\n }",
"public function isCacheEnabled() {\n\t\treturn $this->cache;\n\t}",
"private function _isLoaded() {\n return (bool) $this->id;\n }",
"public function is_objectcache_old_add_in() {\n\t\tif ( !$this->objectcache_installed() )\n\t\t\treturn false;\n\n\t\treturn ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_OBJECT_CACHE ) )\n\t\t\t&& ( ( strstr( $script_data, 'W3 Total Cache Object Cache' ) !== false ) ||\n\t\t\t\tstrstr( $script_data, 'w3_instance' ) !== false ) );\n\t}",
"protected function isCached(): bool\n {\n $cacheTime = self::CACHE_TIME * 60;\n\n if (!is_file($this->pathCache)) {\n return false;\n }\n\n $cachedTime = filemtime($this->pathCache);\n $cacheAge = $this->time - $cachedTime;\n\n return $cacheAge < $cacheTime;\n }",
"public function isUseCache()\n {\n return $this->use_cache;\n }",
"public function isCacheUsed()\n\t{\n\t\treturn $this->__isMainTree() and $this->use_cache;\n\t}",
"private function isLoaded()\r\n {\r\n return $this->loaded;\r\n }",
"public function isCacheEnabled()\n {\n return $this->cache;\n }",
"public function hasCache()\n {\n return (null !== $this->getCacheAdapter());\n }",
"public function cacheExists()\n {\n $cacheFile = $this->getCacheFile();\n if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {\n return(true);\n } else {\n return(false);\n }\n }",
"public function isLoaded ( )\n {\n return $this->_loaded;\n }",
"public function isLoaded();",
"final public function isHit(): bool\n\t{\n\t\tif ($stm = $this->_prepare('SELECT COUNT(*) AS `found` FROM `Cache` WHERE `key` = :key LIMIT 1;')) {\n\t\t\t$stm->execute(['key' => $this->getkey()]);\n\t\t\t$result = $stm->fetchObject();\n\t\t\tvar_dump($result);\n\t\t\treturn $result->found === '1';\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function MustUseCache()\n {\n if ($this->cacheLifetime == 0)\n {\n return false;\n }\n if (!File::Exists($this->file))\n {\n return false;\n }\n $now = Date::Now();\n $lastMod = File::GetLastModified($this->file);\n if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)\n {\n return true;\n }\n return false;\n }",
"public function isLoaded()\n {\n return $this->_is_loaded;\n }",
"private function check_cache() {\n if (!file_exists($this->cache_file)) {\n return false;\n }\n if (filemtime($this->cache_file) >= strtotime(\"-\" . CACHE_EXPIRATION . \" seconds\")) {\n return true;\n } else {\n return false;\n }\n }",
"public function isLoaded()\n {\n return $this->loaded;\n }",
"public function isLoaded()\r\n\t{\r\n\t\treturn $this->loaded;\r\n\t}",
"static function is_cache()\n\t{\n\t\tif (file_exists(Cache::$path))\n\t\t{\n\t\t\tif(Cache::$time>0)\n\t\t\t{\n\t\t\t\t$info_file=stat(Cache::$path);\n\t\t\t\tif(time() > $info_file[9]+Cache::$time)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tCache::delete();\n\t\t\t\t\tCache::$time=0;\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function is_loaded()\n {\n return $this->loaded;\n }",
"public function has()\n\t{\n\t\t$name = $this->name();\n\n\t\tif(($has = Cache::has($name)) && $this->forget)\n\t\t{\n\t\t\tCache::forget($name);\n\n\t\t\t// We don't want to return the cached assets because we cleared\n\t\t\t// the cache and we want a new fresh copy of the assets returned.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $has;\n\t}",
"public function isLoaded()\n {\n return $this->isLoaded;\n }",
"public function hasLoadedCacheFile( $classname );",
"protected function useCache()\n {\n // Should we use a cached version?\n if ($this->cache && $this->cacheExists()) {\n $this->templateOutput = $this->getCache();\n if ($this->templateOutput !== false) {\n return true;\n }\n }\n return false;\n }",
"public static function isCached($key) {\n\t\t\t$klass = self::getInstance();\n\t\t\treturn isset($klass->cache[crc32($key)]);\n\t\t}",
"public function isCachedDataAvailable(){\n\t\treturn $this->_dataAvailable;\n\t}",
"public function hasCachedData(): bool\n {\n return !empty(static::$cachedData);\n }",
"public function has_lazy_load() {\n\t\treturn $this->get_meta_value( static::LAZY_LOAD_META_KEY ) === '1';\n\t}",
"function cacheObjectLocked ()\n {\n return is_file($this->cacheObjectId.'.lock');\n }",
"public function isCacheEnabled()\n {\n return $this->isCacheEnabled;\n }",
"public function hasLoadedCacheFile( $classname )\n\t{\n\t\tif ( isset( $this->loaded_classes[ $classname ] ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function isLoaded(): bool\n {\n return $this->options['load'] || in_array($this->getMethod(), [self::INLOAD, self::POSTLOAD], true);\n }",
"public function isCacheEnabled()\n {\n return $this->cacheEnabled;\n }",
"public static function hasDefaultCache();",
"public static function isCacheActive()\n {\n return (bool)static::$cacheActive;\n }",
"public static function isInitialized() {\n\t\treturn isset(self::$cachedMap);\n\t}",
"public static function is_set_cache(): bool\n {\n return self::getConfigDB(self::cache);\n }",
"public static function isLoaded();",
"function _can_cache() {\n\t\treturn true;\n\t}",
"public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isCacheable()\n {\n return $this->cacheable;\n }",
"function isAvailable()\r\n\t{\r\n return $this->oMemcache == null ? false : true;\r\n }",
"public function memCached() { return true; }",
"public function cacheIsSet()\n {\n return is_a($this->Cache, CacheInterface::class);\n }",
"public function is_property_cached($key) {\n\t\treturn array_key_exists($key, $this->_cached_properties);\n\t}",
"private function _isCached($key)\n {\n return Cache::has($key);\n }",
"public static function isLoaded(): bool\n {\n return !!static::$loaded;\n }",
"public function isCached(string $label) : bool\n {\n $filename = $this->path . \"/\" . md5($label);\n if (file_exists($filename) && (filemtime($filename) + $this->ttl >= time())) {\n return true;\n }\n return false;\n }",
"protected function isLoaded(){\n\t\treturn $this->lodaed;\n\t}",
"public function getIsCallForCache()\n {\n return $this->_blIsCallForCache;\n }",
"public static function has($key){\n return \\Illuminate\\Cache\\Repository::has($key);\n }",
"public static function isLoaded()\n {\n $qualifiedName = static::getSingletonClass();\n\n return isset(static::$instances[ $qualifiedName ])\n && is_object(static::$instances[ $qualifiedName ]);\n }",
"private function _checkCache()\r\n {\r\n // get a string representation of the object\r\n ob_start();\r\n var_dump(get_object_vars($this));\r\n $buffer = ob_get_clean();\r\n \r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // check if the cache file exists, if it does use it\r\n if (file_exists(\"{$this->_config['paths']['cache']}/{$hash}\")){\r\n die(file_get_contents(\"{$this->_config['paths']['cache']}/{$hash}\"));\r\n }\r\n }",
"public function isCached($key) {\n\t\tif($this->getCacheAge($key) == null) {\n\t\t\t$cacheFile = $this->getCacheFile($key);\n\t\t\tif(file_exists($cacheFile)) {\n\t\t\t\t$this->setCacheAge($key,filemtime($cacheFile));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"public function isCached($key)\n {\n if (!is_readable($this->path . '/' . $key)) {\n return false;\n }\n if(!is_null($this->duration)) {\n $now = time();\n $expires = $this->duration * 60 * 60;\n $fileTime = filemtime($this->path . '/' . $key);\n if (($now - $expires) < $fileTime) {\n return false;\n }\n }\n return true;\n }",
"public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }",
"public function is_cached($file_name){\n\t\t\n\t\t$file_name = $this->path . $file_name;\n\t\tif(file_exists($file_name) && (filemtime($file_name) + $this->cache_time >= time())) return true;\t\n\n\t\treturn false;\n\t}",
"protected function load() {\n $values = $this->getStorage()->fetch($this->getId());\n\n if ($values === false) {\n return false;\n }\n\n // metadata\n $metadata = $values[self::METADATA_NAMESPACE];\n $this->first_trace = $metadata['first_trace'];\n $this->last_trace = $metadata['last_trace'];\n $this->regeneration_trace = $metadata['regeneration_trace'];\n $this->requests_counter = $metadata['requests_count'];\n $this->fingerprint = $metadata['fingerprint'];\n\n // values\n $this->values = $values;\n\n return true;\n }",
"private function loadCache()\r\n {\r\n if (file_exists(WEMO_CACHE)) {\r\n $fp = fopen(WEMO_CACHE, 'r');\r\n $json = fread($fp, filesize(WEMO_CACHE));\r\n fclose($fp);\r\n return json_decode($json);\r\n } else {\r\n return false;\r\n }\r\n }",
"public function valid ()\n {\n return isset($this->offset) && isset($this->cache[ $this->offset ]);\n }",
"protected function canLoad()\n\t{\n\t\t$v = version_compare($this->getVersion(),$this->getConfigValue('plugin_current_version')); \n\t\t//first, check if this instance is the latest one, or not\n\t\tif($v < 0) return false;\n\t\t\t \n\t\t//save the latest version, for later reference\n\t\tif($v > 0 )\n\t\t\t$this->setConfigValue('plugin_current_version',$this->getVersion());\n\t\t\t\n\t\treturn true;\n\t}",
"function MustStoreToCache()\n {\n return $this->cacheLifetime > 0;\n }",
"public function isExistInCache($key);",
"public function getIsCachedResult()\n {\n return $this->is_cached_result;\n }",
"protected function useCache() {\n\t\tif (isset($_COOKIE['nc']) && $_COOKIE['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (isset($_GET['nc']) && $_GET['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function isCacheEnabled(){\n return(true);\n }",
"public function canBeCached(): bool\n {\n foreach ($this->getValidators() as $validator) {\n if (!$validator->canBeCached()) {\n return false;\n }\n }\n\n return true;\n }",
"protected function isLoaded($key) {\n return isset($this->loaded[$key]);\n }",
"public function checkIfCanLoad()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"function cache_classes_IsLoaded($classname)\n{\n $cache = core_cache_Get(CACHE_CLASSES_KEY);\n RETURN array_key_exists($classname, $cache);\n}"
] | [
"0.8554635",
"0.8096812",
"0.76406664",
"0.7482658",
"0.7474846",
"0.7469178",
"0.7461557",
"0.7459111",
"0.74506027",
"0.74284035",
"0.74025965",
"0.7331312",
"0.7271191",
"0.7250365",
"0.7242507",
"0.72198266",
"0.71930975",
"0.71804994",
"0.7177764",
"0.71597815",
"0.71493036",
"0.7140035",
"0.71140605",
"0.71015155",
"0.70972544",
"0.70933515",
"0.7044616",
"0.7013475",
"0.70071477",
"0.69927186",
"0.69879997",
"0.69875324",
"0.697487",
"0.6972145",
"0.6959292",
"0.6950665",
"0.6925328",
"0.6876393",
"0.6869741",
"0.6865893",
"0.68594855",
"0.68586195",
"0.68570256",
"0.6855244",
"0.6821803",
"0.68107504",
"0.6795271",
"0.6791424",
"0.67909807",
"0.6790951",
"0.6776562",
"0.6769545",
"0.67633355",
"0.6760207",
"0.6755528",
"0.67409706",
"0.67367387",
"0.6730965",
"0.6721463",
"0.6720485",
"0.6708669",
"0.67073464",
"0.670577",
"0.670505",
"0.6694938",
"0.6685711",
"0.6676876",
"0.6670922",
"0.6666677",
"0.6662235",
"0.6659982",
"0.66509753",
"0.6644799",
"0.6642683",
"0.6633005",
"0.6632663",
"0.6619481",
"0.661861",
"0.6614767",
"0.6599708",
"0.6598903",
"0.6582682",
"0.6568923",
"0.6561834",
"0.6553127",
"0.6551947",
"0.65410435",
"0.6535976",
"0.6534855",
"0.65326476",
"0.65325767",
"0.6528554",
"0.65180725",
"0.65160966",
"0.65147257",
"0.65135574",
"0.65135574",
"0.6512755",
"0.65118384",
"0.6511488",
"0.6508694"
] | 0.0 | -1 |
Fill the model with an array of attributes. | public function fill(array $attributes)
{
foreach ($this->fillableFromArray($attributes) as $key => $value) {
if ($this->isFillable($key)) {
$this->setAttribute($key, $value);
}
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fill(array $attributes);",
"public function fill(array $attributes = []);",
"public function fill(Identifiable $model, array $attributes);",
"public function fill(array $attributes = [])\n {\n // start_measure('fill-model', 'Création de l\\'objet '.static::class);\n foreach ($attributes as $key => $value) {\n if (is_array($value) && method_exists($this, $key)) {\n $this->setRelation($key,\n $this->$key()->getRelationsFromArray($value)\n );\n } else {\n $this->setAttribute($key, $value);\n }\n }\n // stop_measure('fill-model');\n\n return $this;\n }",
"public function fill(array $attributes)\n {\n $totallyGuarded = $this->totallyGuarded();\n\n // TODO: check if its fillable\n // TODO: set attribute\n // TODO: else throw exception\n\n // TODO: return $this for chaining\n }",
"public function fill(array $attributes)\n {\n $existingAttributes = get_object_vars($this);\n\n foreach ($existingAttributes as $attributeName => $oldAttributeValue) {\n array_key_exists($attributeName, $attributes) ? $this->$attributeName = $attributes[$attributeName] : NULL;\n }\n }",
"public function fill(array $attributes)\n\t{\n\t\t$this->fillCustomAttributes($attributes);\n\t\t\n\t\treturn parent::fill($attributes);\n\t}",
"public function forceFill(array $attributes);",
"public function fill(array $attributes = [])\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n }",
"public function forceFill(array $attributes)\n {\n $this->attributes = $attributes;\n }",
"public function forceFill(array $attributes)\n {\n $model = $this;\n\n return static::unguarded(function () use ($model, $attributes) {\n return $model->fill($attributes);\n });\n }",
"public function fill(array $attributes)\n {\n foreach ( $attributes as $key => $value) {\n\t\t\t$this->setAttribute($key, $value);\n }\n\n return $this;\n }",
"public function fill(array $attributes)\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n\n return $this;\n }",
"public function fill(array $attributes)\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n\n return $this;\n }",
"public function fill(array $attributes = [])\n {\n $this->attributes = array_merge($this->attributes, $attributes);\n foreach($this->attributes['items'] as $key => $item) {\n if(is_array($item)) {\n $className = '\\App\\Items\\\\'.ucfirst($item['slug']);\n if(class_exists($className)) {\n $this->attributes['items'][$key] = new $className($item);\n }\n } elseif($item instanceof Item) {\n $this->attributes['items'][$key] = $item;\n }\n }\n foreach($this->attributes['systems'] as $key => $system) {\n if(is_array($system)) {\n $className = '\\App\\Systems\\\\'.ucfirst($system['slug']);\n if(class_exists($className)) {\n $this->attributes['systems'][$key] = new $className($system);\n }\n } elseif($system instanceof Item) {\n $this->attributes['systems'][$key] = $system;\n }\n }\n }",
"public function fill(array $attributes)\n {\n foreach ($attributes as $key => $value) {\n if (property_exists($this, $key)) {\n $this->{$key} = $value;\n }\n }\n return $this;\n }",
"public function _fill($attributes)\n \t{\n \t\tforeach($attributes as $key => $value) {\n \t\t\t$this->$key = $value;\n \t\t}\n\n \t\treturn $this;\n \t}",
"public function __construct(){\n if(count($this->fillable) == 0){\n foreach($this->attributes as $key => $attr){\n array_push($this->fillable, $key);\n }\n }\n }",
"public function fill(array $attributes, $raw = false) {\n\t\tforeach ($attributes as $key => $value) {\n\t\t\t// If the \"raw\" flag is set, it means that we'll just load every value from\n\t\t\t// the array directly into the attributes, without any accessibility or\n\t\t\t// mutators being accounted for. What you pass in is what you get.\n\t\t\tif ($raw) {\n\t\t\t\t$this->set_attribute($key, $value);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the \"accessible\" property is an array, the developer is limiting the\n\t\t\t// attributes that may be mass assigned, and we need to verify that the\n\t\t\t// current attribute is included in that list of allowed attributes.\n\t\t\tif (is_array(static::$accessible)) {\n\t\t\t\tif (in_array($key, static::$accessible)) {\n\t\t\t\t\t$this->$key = $value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If the \"accessible\" property is not an array, no attributes have been\n\t\t\t\t// white-listed and we are free to set the value of the attribute to\n\t\t\t\t// the value that has been passed into the method without a check.\n\n\t\t\t\t$this->$key = $value;\n\t\t\t}\n\t\t}\n\n\t\t// If the original attribute values have not been set, we will set\n\t\t// them to the values passed to this method allowing us to easily\n\t\t// check if the model has changed since hydration.\n\t\tif (count($this->original) === 0) {\n\t\t\t$this->original = $this->attributes;\n\t\t}\n\n\t\treturn $this;\n\t}",
"protected abstract function initializeAttributes(): array;",
"public function setAttributes(array $attributes);",
"public function setAttributes(array $attributes);",
"public function setAttributes(array $attributes);",
"public function fillAttributes(array $attributes = []): void\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n }",
"public function fill(array $attributes)\n {\n $totallyGuarded = $this->totallyGuarded();\n\n foreach ($this->fillableFromArray($attributes) as $key => $value)\n {\n if ($this->isFillable($key))\n $this->setAttribute($key, $value);\n elseif ($totallyGuarded)\n throw new MassAssignmentException($key);\n }\n\n return $this;\n }",
"public function fill(array $attributes)\n {\n parent::fill($attributes);\n if ($this->exists != false) {\n $this->time_add = time();\n }\n\n return $this;\n }",
"public function __construct(array $attributes = [])\n {\n $this->fill($attributes);\n }",
"public function __construct(array $attributes = [])\n {\n $this->fill($attributes);\n }",
"public function __construct(array $attributes = [])\n {\n $this->fill($attributes);\n }",
"public function hydrate( array $attributes ) {\n\n\t\t// Set all the field from $data\n\t\tforeach ( $attributes as $fieldName => $fieldValue ) {\n\t\t\t$this->set( $fieldName, $fieldValue );\n\t\t}\n\n\t}",
"public function hydrate(array $attributes = []);",
"public function fill(array $attributes)\n {\n $this->saving = true;\n\n $totallyGuarded = $this->totallyGuarded();\n\n foreach ($attributes as $key => $values) {\n if ($this->isKeyALocale($key)) {\n foreach ($values as $translationAttribute => $translationValue) {\n if ($this->alwaysFillable() or $this->isFillable($translationAttribute)) {\n $this->getTranslationOrNew($key)->$translationAttribute = $translationValue;\n } elseif ($totallyGuarded) {\n throw new MassAssignmentException($key);\n }\n }\n unset($attributes[$key]);\n }\n }\n\n $result = parent::fill($attributes);\n\n $this->saving = false;\n\n return $result;\n }",
"public function make(array $attributes = []);",
"public function make(array $attributes = []);",
"public function fillModelAttributes($model, $request, $fields)\n {\n }",
"public function fill(array $attributes)\n {\n $this->container = array_merge($this->container, $attributes);\n\n return $this;\n }",
"public function fill_raw(array $attributes) {\n\t\treturn $this->fill($attributes, true);\n\t}",
"public function fill($attributes)\n {\n foreach ($attributes as $key => $attribute)\n {\n if ($attribute === null)\n {\n unset($attributes[$key]);\n }\n }\n parent::fill($attributes);\n return $this;\n }",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'nombre',\n 'estado',\n 'pais_idpais'\n ],\n 'date' => []\n ];\n }",
"public function __construct(array $attributes = []);",
"protected function fillAttributesToModel($model, array $attributes)\n {\n foreach ($this->form->getRegisteredFields() as $field) {\n if (! array_key_exists($field->id, $attributes)) {\n continue;\n }\n\n $fill = [$field->local_key];\n if ($field instanceof ModifiesMultipleAttributes) {\n $fill = $field->getModifiedAttributes();\n $attributes = $attributes[$field->id];\n }\n\n foreach ($fill as $attribute) {\n $field->fillModel($model, $attribute, $attributes[$attribute]);\n }\n }\n }",
"public function setAttributes($arr) {\n foreach($arr as $key => $val) {\n switch($key) {\n case \"id\":\n case \"user_id\":\n //casting null to int will return 0; don't want that\n if ($val !== null) {\n $this->id_ = (int) $val;\n }\n break; \n case \"username\":\n $this->username_ = $val;\n break; \n case \"email\":\n $this->email_ = $val;\n break; \n case \"displayName\":\n case \"display_name\":\n $this->displayName_ = $val;\n break; \n case \"firstName\":\n case \"first_name\":\n $this->firstName_ = $val;\n break; \n case \"lastName\":\n case \"last_name\":\n $this->lastName_ = $val;\n break; \n case \"postalCode\":\n case \"postal_code\":\n $this->postalCode_ = $val;\n break; \n case \"isVerified\":\n case \"is_verified\":\n $this->isVerified_ = (int) $val;\n break; \n case \"privileges\":\n //might be a string of comma-separated numbers, or an array\n if (is_array($val)) {\n $this->privileges_ = $val;\n } else if ($val !== null) {\n //clear array first\n unset($this->privileges_);\n $this->privileges_ = array();\n $tmp = explode(\",\", $val);\n foreach($tmp as $v){\n if (is_numeric($v)) {\n //$this->privileges_[(int) $v] = 1;\n $this->privileges_[] = (int) $v;\n }\n }\n \n }\n break;\n\n default:\n //ignore any others\n }\n }\n }",
"public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\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$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"abstract protected function getModelAttributes();",
"public function __construct(array $attributes)\n {\n foreach ($attributes as $attribute => $value){\n $this->$attributes = $value;\n }\n }",
"public function fill(array $attributes)\n {\n if ($this->getSection()) {\n $this->getEditableFields()->getFields()->each(function (FieldInterface $field) use (& $attributes) {\n $field->onDocumentFill($this, array_get($attributes, $field->getDBKey()));\n unset($attributes[$field->getDBKey()]);\n });\n }\n\n parent::fill($attributes);\n\n return $this;\n }",
"public function set()\n {\n $args = func_get_args();\n\n if ( count($args) == 2 )\n {\n $this->attributes[$args[0]] = $args[1];\n }\n elseif ( count($args) == 1 && is_array($args[0]) ) \n {\n $this->attributes = ( array_merge($this->attributes, $args[0]) );\n }\n\n return $this;\n }",
"public function setAttributes();",
"public function fillAll($attributes, $safeOnly = true, $scenario = null)\n {\n $this->ensureAllInstanceOf(BaseActiveRecord::class);\n if(!empty($attributes)){\n foreach($this->getModels() as $model) {\n if($scenario){\n $model->scenario = $scenario;\n }\n $model->setAttributes($attributes, $safeOnly);\n }\n }\n return $this;\n }",
"public function syncOriginalAttributes($attributes): Model\n {\n $attributes = is_array($attributes) ? $attributes : func_get_args();\n\n $modelAttributes = $this->getAttributes();\n\n foreach ($attributes as $attribute) {\n $this->original[$attribute] = $modelAttributes[$attribute];\n }\n\n return $this;\n }",
"public function setAttributes(Array $attributes): self\n {\n\t\tforeach($attributes as $k => $v) {\n\t\t\t$this->setAttribute($k, $v);\n\t\t}\n\t\treturn $this;\n\t}",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_documento',\n 'fk_funcionario',\n 'accion',\n 'fecha',\n 'descripcion',\n 'titulo'\n ],\n 'date' => ['fecha']\n ];\n }",
"public function attributes(array $attributes=array())\n {\n $this->_attributes = $attributes;\n return $this;\n }",
"private function prepareItems()\n {\n $attribute = $this->attribute;\n $items = $this->model->$attribute;\n if (!is_array($items)) {\n $items = [];\n }\n\n $this->_items = $items;\n }",
"public function attributes(array $attributes)\n\t{\n\t\t$this->attributes = $attributes;\n\n\t\treturn $this;\n\t}",
"public function setAttributes(array $attributes)\n {\n $this->attributes = $attributes;\n\n return $this;\n }",
"public function fill($attributes)\n {\n // Some context types have varying types\n if ($this->hasGetMutator('type')) {\n $this->type = $this->mutateAttribute('type', $this->getArrValue($attributes, 'type', $this->type));\n }\n\n // Set properties\n $properties = array_merge([\n '@context' => 'http://schema.org',\n '@type' => $this->type,\n 'sameAs' => null\n ], $this->structure, $this->extendStructure);\n\n // Set properties from attributes\n foreach ($properties as $key => $property) {\n $this->setProperty($key, $property, $this->getArrValue($attributes, $key, ''));\n }\n\n // After fill event\n $this->afterFill($attributes);\n }",
"function update_attributes($array = array())\n {\n foreach ($array as $key => $value) {\n $this->_stdObject->{$key} = $value;\n }\n }",
"public function addAttributes($arrAttributes) {\n foreach ($arrAttributes as $key => $val) {\n $this->attributes[$key] = $val;\n }\n }",
"public function setAttributes($attributes){ }",
"public function populateAttributes(array $attributes) {\n\t\tforeach ($attributes as $attributeName => $attributeValue) {\n\t\t\t$this->_attributes[$attributeName] = $attributeValue;\n\t\t}\n\t\treturn true;\n\t}",
"function action_unique_attribute_list() {\n $this->layout = null;\n\n $this->model = DB::model('Model')->fetch($_REQUEST['model_id']);\n if ($this->model->value['id']) {\n $this->model->bindMany('Attribute');\n }\n }",
"public function setAttributes ($attributes)\n {\n\n $this->attributes = array_merge($this->attributes, $attributes);\n\n }",
"public function setAttributes($attributes);",
"public static function create(array $attributes = []);",
"public static function create(array $attributes = []);",
"public function __construct(array $attributes = []) {\n $this->attributes = $attributes;\n }",
"public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}",
"public function __construct(array $attributes = [])\n {\n $config = config(\"erpnetMigrates.tables.$this->table.fields\");\n if(is_array($config))\n foreach ($config as $key => $field) {\n if (array_search($field, $this->fillable)===false){\n if(is_string($field) ) array_push($this->fillable, $field);\n if(is_array($field)) array_push($this->fillable, $key);\n }\n }\n parent::__construct($attributes);\n }",
"public function initAttribute();",
"public function fill($model, $setPrimaryKey = true) {\r\n if($setPrimaryKey)\r\n $this->primaryKey = $model->id;\r\n $this->attributes = [\r\n 'title' => $model->header1,\r\n 'content' => $model->text,\r\n ];\r\n }",
"public function __construct(array $attributes = [])\n {\n $this->bootIfNotBooted();\n\n $this->syncOriginal();\n\n $this->fill($attributes);\n }",
"public function fill()\n {\n $relationships = $this->relationships;\n $modelRelations = $this->loadRequiredRelationships();\n\n return collect($relationships)->transform(function($relations, $key) use($modelRelations) {\n $merge = array_get($modelRelations, $key);\n return $merge ? $this->mergeRelations($merge, $relations) : $relations;\n })->all();\n }",
"public static function model($attrs)\n {\n $model = new static;\n\n foreach ($attrs as $key => $value) {\n $model->$key = $value;\n }\n\n return $model;\n }",
"private function fillArray($array) {\n\t\t$result = array();\n\t\tforeach ($array as $attr => $val) {\n\t\t\t$setMethod = 'set' . ucfirst($attr);\n\t\t\t$returnType = $this->getReturnTypeOfSetMethod($setMethod);\n\t\t\tif ($returnType) {\n\t\t\t\t$result[$attr] = new $returnType(); \n\t\t\t} else {\n\t\t\t\t$result[$attr] = 'abc';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function create(array $attributes) : Model;",
"public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}",
"public function __construct(array $attributes = [])\n {\n foreach($attributes as $key=>$value)\n {\n $this->$key = $value;\n }\n\n return $this;\n }",
"public function __construct(array $attributes)\n {\n $this->attributes = $attributes;\n }",
"public function loadAttributes()\n {\n if (! $this->_attributesLoaded) {\n // send the backend a list of attributes we already have, so the backend can possibly\n // skip re-loading them.\n $presentAttributeNames = array_keys($this->_attributes);\n $newAttributes = $this->_cache->getBackend()->getMissingAttributes($this, $presentAttributeNames);\n $this->_attributes = array_merge($this->_attributes, $newAttributes);\n $this->_attributesLoaded = true;\n }\n return $this;\n }",
"public function with(array $items)\n {\n $this->attributes = $items;\n\n return $this;\n }",
"public static function populateModel($values)\n\t{\n\t\t// Strip out the element record attributes if this is getting called from a child class\n\t\t// based on an Active Record result eager-loaded with the ElementRecord\n\t\tif (isset($values['element']))\n\t\t{\n\t\t\t$elementAttributes = $values['element'];\n\t\t\tunset($values['element']);\n\t\t}\n\n\t\t$model = parent::populateModel($values);\n\n\t\t// Now set those ElementRecord attributes\n\t\tif (isset($elementAttributes))\n\t\t{\n\t\t\tif (isset($elementAttributes['i18n']))\n\t\t\t{\n\t\t\t\t$model->setAttributes($elementAttributes['i18n']);\n\t\t\t\tunset($elementAttributes['i18n']);\n\t\t\t}\n\n\t\t\t$model->setAttributes($elementAttributes);\n\t\t}\n\n\t\treturn $model;\n\t}",
"public function setNewAttributes(array $attributes)\n {\n $this->attributes = $attributes;\n return $this;\n }",
"public function __construct(array $attributes = array()) {\n $this->attributes = array(\n 'SourceName' => NULL,\n 'ExtReference' => NULL,\n 'PropertyCode' => NULL,\n 'FirstName' => NULL,\n 'LastName' => NULL,\n 'Email' => NULL\n );\n\n if (!empty($attributes)) {\n foreach ($attributes as $name => $value) {\n $this->$name = $value;\n }\n }\n }",
"public function setRequiredAttributes(array $attributes)\n {\n $this->requiredAttributes = $attributes;\n }",
"public function initialize()\n {\n $this->skipAttributes([\n \"question_id\",\n ]);\n\n $this->skipAttributesOnCreate([\n \"question_status\"\n ]);\n\n $this->skipAttributesOnUpdate([\n \"question_creation_time\"\n ]);\n\n $this->hasMany('question_id', 'QaApp\\Models\\Answer', 'question_id', array('alias' => 'Answers'));\n }",
"public function __construct(array $attributes = [])\n {\n }",
"public function __construct(array $data = [])\n {\n return $this->setAttributesArray($data);\n }",
"function update_attributes($attributes) {\n\t\t\tif(is_array($attributes)) {\n\t\t \t \t// Test each attribute to be updated\n\t\t \t \t// and process according to its type\n\t\t\t\tforeach($attributes as $field => $value) {\n\t\t\t\t\t# datetime / date parts check\n\t\t\t\t\tif(preg_match('/^\\w+\\(.*i\\)$/i', $field)) {\n\t\t\t\t\t\t// The name of this attribute ends in '(?i)'\n\t\t\t\t\t\t// indicating that it's part of a date or time\n\t\t\t\t\t\t$datetime_field = substr($field, 0, strpos($field, '('));\n\t\t\t\t\t\tif(!in_array($datetime_field, $datetime_fields)) {\n\t\t\t\t\t\t\t$datetime_fields[] = $datetime_field;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif(is_object($value) && get_parent_class($value) == __CLASS__ && $this->auto_save_associations) {\n\t\t\t\t\t\t# this elseif checks if first its an object if its parent is ActiveRecord\n\t\t\t\t\t\tif($association_type = $this->get_association_type($field)) {\n\t\t\t\t\t\t\t$this->save_associations[$association_type][] = $value;\n\t\t\t\t\t\t\tif($association_type == \"belongs_to\") {\n\t\t\t\t\t\t\t\t$foreign_key = Inflector::singularize($value->table_name).\"_id\";\n\t\t\t\t\t\t\t\t$this->$foreign_key = $value->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif(is_array($value) && $this->auto_save_associations) {\n\t\t\t\t\t\t# this elseif checks if its an array of objects and if its parent is ActiveRecord\n\t\t\t\t\t\tif($association_type = $this->get_association_type($field)) {\n\t\t\t\t\t\t\t$this->save_associations[$association_type][] = $value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->$field = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t \t \t \t\t// Just a simple attribute, copy it\n\t\t\t\t\t\t$this->$field = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If any date/time fields were found, assign the\n\t\t\t\t// accumulated values to corresponding attributes\n\t\t\t\tif(count($datetime_fields)) {\n\t\t\t\t\tforeach($datetime_fields as $datetime_field) {\n\t\t\t\t\t\t$datetime_format = '';\n\t\t\t\t\t\t$datetime_value = '';\n\n\t\t\t\t\t\tif($attributes[$datetime_field.'(1i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(2i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(3i)']) {\n\t\t\t\t\t\t\t$datetime_value = $attributes[$datetime_field.'(1i)']\n\t\t\t\t\t\t\t. '-' . $attributes[$datetime_field.'(2i)']\n\t\t\t\t\t\t\t. '-' . $attributes[$datetime_field.'(3i)'];\n\t\t\t\t\t\t\t$datetime_format = $this->date_format;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$datetime_value .= ' ';\n\n\t\t\t\t\t\tif($attributes[$datetime_field.'(4i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(5i)']) {\n\t\t\t\t\t\t\t$datetime_value .= $attributes[$datetime_field.'(4i)']\n\t\t\t\t\t\t\t. ':' . $attributes[$datetime_field.'(5i)'];\n\t\t\t\t\t\t\t$datetime_format .= ' '.$this->time_format;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($datetime_value = trim($datetime_value)) {\n\t\t\t\t\t\t\t$datetime_value = date($datetime_format, strtotime($datetime_value));\n\t\t\t\t\t\t\t//error_log('($field) $datetime_field = $datetime_value');\n\t\t\t\t\t\t\t$this->$datetime_field = $datetime_value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->set_habtm_attributes($attributes);\n\t\t\t}\n\t\t}",
"public static function newWithAttributes(array $attributes)\n\t{\n\t\t$relations = static::pullRelationsFromAttributes($attributes, [\n\t\t\t'purse' => 'App\\Purse\\Model\\PurseModel',\n\t\t\t'user' => 'App\\User\\Model\\UserModel',\n\t\t]);\n\n\t\treturn parent::newWithAttributes($attributes)->fill($relations);\n\t}",
"public function setAttrs($attrs);",
"public function __construct(array $attributes){\n parent::__construct($attributes);\n }",
"public function update($arr) {\n // update attribute\n foreach ($arr as $key => $value) {\n $this->{$key} = $value;\n }\n }",
"public function update($arr) {\n // update attribute\n foreach ($arr as $key => $value) {\n $this->{$key} = $value;\n }\n }",
"public function attributes(array $values): static\n {\n $new = clone $this;\n $new->attributes = $values;\n\n return $new;\n }",
"public function fillWithInput(array $input)\n {\n $scalars = $this->getFillableScalars($input);\n $relations = $this->getFillableRelations($input);\n $connections = $this->getFillableConnections($input);\n\n $this->fillScalars($scalars);\n $this->fillRelations($relations);\n $this->fillConnections($connections);\n\n return $this;\n }",
"public function __construct(array $attributes = [])\n {\n $this->attributes = $attributes;\n }",
"public function __construct(array $attributes = [])\n {\n $this->attributes = $attributes;\n }",
"public function fillAttributes($attr_arr) {\n // If $attr_arr is an associative array, convert it to numerically indexed\n // If it's a numerically indexed array, treat it the same\n $index_keys = array_keys($attr_arr);\n foreach ($index_keys as $num => $val) {\n $attr_to_add = $attr_arr[$val];\n /* echo \"index_keys is $val \\n\"; */\n foreach ($this->attr as $key => $value) {\n /* echo \"this->key is $key and index_keys is $val \\n\"; */\n if ($attr_to_add and $key === $val) {\n $this->attr[$key] = $attr_to_add;\n break 1;\n }\n } \n }\n }",
"protected function prepareForValidation()\n {\n $this->merge([\n self::ATTRIBUTE_REFERER => $this->prepareArray($this->input(self::ATTRIBUTE_REFERER)),\n self::ATTRIBUTE_IP => $this->prepareArray($this->input(self::ATTRIBUTE_IP)),\n ]);\n }"
] | [
"0.7654308",
"0.75207293",
"0.7401452",
"0.71766514",
"0.70241576",
"0.70226705",
"0.7011032",
"0.6890579",
"0.6855368",
"0.6816414",
"0.6745761",
"0.66773254",
"0.6670295",
"0.6670295",
"0.6660146",
"0.66436523",
"0.66341853",
"0.65938205",
"0.65899813",
"0.65620536",
"0.64302474",
"0.64302474",
"0.64302474",
"0.6417021",
"0.6405115",
"0.63575435",
"0.6354563",
"0.6354563",
"0.6354563",
"0.63348556",
"0.6334703",
"0.630537",
"0.6257669",
"0.6257669",
"0.62290144",
"0.62106884",
"0.6182056",
"0.6180971",
"0.6160626",
"0.6150445",
"0.61400634",
"0.6120103",
"0.6096813",
"0.6091256",
"0.60892045",
"0.60816365",
"0.6043812",
"0.5982237",
"0.59669626",
"0.5958677",
"0.59524065",
"0.59522635",
"0.5944954",
"0.59089416",
"0.590851",
"0.58708745",
"0.5866508",
"0.5864074",
"0.58564067",
"0.58510655",
"0.5817611",
"0.57900333",
"0.5771046",
"0.57590014",
"0.57363695",
"0.57363695",
"0.5723349",
"0.57229406",
"0.5713599",
"0.56993085",
"0.56974995",
"0.5685915",
"0.56753576",
"0.5670646",
"0.5670261",
"0.5669494",
"0.56682545",
"0.56667596",
"0.56665087",
"0.56605136",
"0.5656941",
"0.56156915",
"0.5614721",
"0.560974",
"0.5606083",
"0.55975574",
"0.55972505",
"0.55838555",
"0.5580405",
"0.55803645",
"0.5579368",
"0.55774665",
"0.5576146",
"0.5576146",
"0.5570189",
"0.55636656",
"0.5548214",
"0.5548214",
"0.5540915",
"0.5530739"
] | 0.6774815 | 10 |
Get the fillable attributes of a given array. | protected function fillableFromArray(array $attributes)
{
$defaults = ['fileName'];
if (count($this->fillable) > 0) {
return array_intersect_key(
$attributes,
array_flip(array_merge($defaults, $this->fillable))
);
}
return $attributes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function fillableFromArray(array $attributes)\n {\n if (count($this->fillable) > 0 && !static::$unguarded)\n return array_intersect_key($attributes, array_flip($this->fillable));\n\n return $attributes;\n }",
"protected function fillableFromArray(array $attributes)\n {\n if (count($this->getFillable()) > 0 && ! static::$unguarded) {\n return array_intersect_key($attributes, array_flip($this->getFillable()));\n }\n\n return $attributes;\n }",
"public function getFillable()\n\t{\n\t\t$fillableColumns = $this->resource->columns->filter(function($item)\n\t\t{\n\t\t\treturn $item->fillable && $item->name;\n\t\t});\n\n\t\t$fillable = $fillableColumns\n\t\t\t->fetch('name')\n\t\t\t->all();\n\n\t\treturn $this->compileArray($fillable);\n\t}",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"public function getModelFillable()\n {\n $fillable_arr = $this->getArrayKeyCreate();\n\n $string_result = \"['\".implode(\"', '\",$fillable_arr).\"']\"; // => ['a', 'b', 'c']\n\n return $string_result;\n }",
"protected function listifyAttr( $array ) {\n\t\tksort( $array );\n\t\t$list = array();\n\t\tforeach ( $array as $name => $obj ) {\n\t\t\tif ( $obj === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$list[] = \"$name = <i>\" . $this->getClass( $obj, 'AttrDef_' ) . '</i>';\n\t\t}\n\n\t\treturn $this->listify( $list );\n\t}",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"protected function getFillableScalars(array $attributes): array\n {\n return collect($attributes)->filter(function ($value, $key) {\n $fields = $this->getSchema()->getFillableFields()->keys();\n\n return $fields->contains($key);\n })->toArray();\n }",
"public function getFillable() {\n\n if(sizeof($this->fillable) > 1) {\n unset($this->fillable[0]);\n }\n return $this->fillable;\n\n }",
"protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$table_fields as $field) {\n\t if(property_exists( $this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n }",
"public function sanitizeToModelFillable(array $data) {\n\n $fillable = $this->getFillable();\n\n $fillables = ! empty($fillable) \n ? $fillable \n : array_diff(\n array_diff(\n Schema::getColumnListing($this->getTable()), \n $this->getGuarded()\n ), \n $this->getHidden()\n );\n\n return array_intersect_key($data, array_flip($fillables));\n }",
"public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }",
"public function getAttributesFields(): array\n {\n $fields = [];\n\n // Only fields without relations\n foreach ($this->fieldsArray(false) as $attribute) {\n $fields[$attribute] = [\n 'name' => $attribute,\n 'type' => $this->overrideMethod(\n 'set'.Str::studly($attribute).'Type',\n [$this, 'callGraphQLType'],\n $attribute\n ),\n 'privacy' => function (array $args) use ($attribute): bool {\n $method = 'get'.Str::studly($attribute).'Privacy';\n\n return $this->$method($args);\n },\n ];\n }\n\n return $fields;\n }",
"public function fillable();",
"public function getCustomAttributes(): array;",
"public function getAttributes(array $only = null): array\n {\n if ($only === null || empty($only)) {\n return $this->attributes;\n }\n\n $attributes = [];\n foreach ($only as $key) {\n $attributes[$key] = $this->attributes[$key] ?? null;\n }\n\n return $attributes;\n }",
"protected function attributes() {\n $attributes = array();\n foreach(static::$db_fields as $field) {\n if(property_exists($this, $field)) {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->getArrayableItems($this->attributes);\n }",
"protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach(self::$db_fields as $field) {\n\t\t\tif(property_exists($this, $field)){\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}",
"protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach (self::$db_fields as $field) {\n\t\t\tif (property_exists($this, $field)) {\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}",
"public function attributes()\n {\n return collect(array_keys($this->rules()))\n ->mapWithKeys(function ($key) {\n return [$key => str_replace(['.', '_'], ' ', $key)];\n })\n ->toArray();\n }",
"public function getFillables()\n {\n return $this->filterDatas(function ($data) {\n return isset($data->fillable) && $data->fillable;\n });\n }",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function attributes()\n {\n $attributes = array();\n foreach(self::$db_fields as $field)\n {\n if(property_exists($this,$field))\n {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }",
"protected function attributes() {\n\t $attributes = array();\n\t foreach(self::$db_fields as $field) {\n\t if(property_exists($this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n\t}",
"public function getAllowedAttributes();",
"public function getActiveFileAttributes()\n {\n $fileAttributes = [];\n foreach ($this->getActiveFileValidators() as $fileValidator) {\n if (is_array($fileValidator->attributes)) {\n foreach ($fileValidator->attributes as $attribute) {\n $fileAttributes[$attribute] = [\n 'file_type_name' => $fileValidator->file_type_name,\n 'target_field' => $fileValidator->target_field,\n 'relation_field' => $fileValidator->relation_field,\n 'thumb' => $fileValidator->thumb,\n 'multiple' => $fileValidator->multiple,\n 'resize' => $fileValidator->resize,\n ];\n }\n } else {\n $fileAttributes[$fileValidator->attributes] = [\n 'file_type_name' => $fileValidator->file_type_name,\n 'target_field' => $fileValidator->target_field,\n 'relation_field' => $fileValidator->relation_field,\n 'thumb' => $fileValidator->thumb,\n 'multiple' => $fileValidator->multiple,\n 'resize' => $fileValidator->resize,\n ];\n }\n }\n\n return $fileAttributes;\n }",
"public function getAll()\n {\n $valueArray = [];\n\n foreach(self::$validAttributes as $attribute) {\n $valueArray[$attribute] = $this->$attribute;\n }\n\n return $valueArray;\n }",
"private function build_attributes_object( $array ) {\n $attributes = [ ];\n\n foreach ( $array as $name => $value ) {\n $attributes[] = [\n 'name' => $name,\n 'value' => $value,\n ];\n }\n\n return $attributes;\n }",
"public function getFillable()\n\t{\n\t\treturn $this->fillable;\n\t}",
"public function getFillable()\n\t{\n\t\t\treturn $this->fillable;\n\t}",
"public function getFillable()\n\t{\n\t\t\treturn $this->fillable;\n\t}",
"public function attributes() : array;",
"public function getFillableProperties(): array;",
"protected function getAttr()\r\n\t{\r\n\t\treturn array( 'maxLength', 'width', 'searchMethod', 'searchRangeValues' );\r\n\t}",
"public function getAttributes() {}",
"public function getAttributes() {}",
"abstract function attributes(): array;",
"public function getAttributes()\n {\n return $this->where('isRelation', false)->pluck('attribute')->toArray();\n }",
"public function getAttributes() {\n return $this->attributes->getArray();\n }",
"public function getFlatAttributes() {\n $attrib = array();\n foreach($this->attributes as $a) {\n $attrib = $attrib + $a;\n }\n return $attrib;\n }",
"protected function getAttributes()\n {\n return [];\n }",
"public function attributes()\n {\n return $this->model->getFillable();\n }",
"public function getAttributes() {\n $attr = array();\n \n $attr[\"id\"] = $this->id_;\n $attr[\"taxonId\"] = $this->taxonId_;\n $attr[\"dbh\"] = $this->dbh_;\n $attr[\"lat\"] = $this->lat_;\n $attr[\"lng\"] = $this->lng_;\n $attr[\"layers\"] = $this->layers_;\n \n return $attr;\n }",
"public function __toArray(array $arrAttributes = array()) {\n if (empty($arrAttributes)) {\n return $this->data;\n }\n\n $arrRes = array();\n foreach ($arrAttributes as $attribute) {\n if (isset($this->valid($attribute))) {\n $arrRes[$attribute] = $this->data[$attribute];\n } else {\n $arrRes[$attribute] = null;\n }\n }\n return $arrRes;\n }",
"public static function Attributes(array $attr = null) {\n return Utils::Attributes($attr);\n }",
"public function getFillable()\n {\n return $this->fillable;\n }",
"public function getFillable()\n {\n return $this->fillable;\n }",
"public function getFillable()\n {\n return $this->fillable;\n }",
"public function findByAttributes(array $array) {\n $this->select();\n $this->where($array);\n return $this->execute();\n }",
"public function getValidFixedAttributes(): array\n {\n return [\n 'Empty string' => [\n 'attribute_fixed_0001.xsd', \n '', \n ], \n 'Only white spaces' => [\n 'attribute_fixed_0002.xsd', \n ' ', \n ], \n 'Alphanumeric' => [\n 'attribute_fixed_0003.xsd', \n 'foo3bar6baz9', \n ], \n 'Alphanumeric with white spaces' => [\n 'attribute_fixed_0004.xsd', \n ' foo2 bar9 baz8 qux1 ', \n ], \n ];\n }",
"protected function getUnsafeAttributes()\n\t{\n\t\treturn array_merge(parent::getUnsafeAttributes(), [\n\t\t\t'checked',\n\t\t]);\n\t}",
"public function getAttributes(): array\n {\n return [\n Attributes\\IdAttribute::make(),\n Attributes\\UuidAttribute::make(),\n Attributes\\TextAttribute::make('name')\n ->setUnique(true)\n ->setRequired(true),\n Attributes\\EmailAttribute::make('email')\n ->setRequired(true)\n ->setUnique(true),\n Attributes\\PasswordAttribute::make('password')\n ->setRequired(true),\n Attributes\\BooleanAttribute::make('enabled'),\n Attributes\\CreatedAtAttribute::make(),\n Attributes\\UpdatedAtAttribute::make(),\n Attributes\\DeletedAtAttribute::make(),\n ];\n }",
"function _get_data_attrs($array){\n\t\t\t\tif(!function_exists('EVO_get_data_attrs')){\n\t\t\t\t\t$output = '';\n\t\t\t\t\tforeach($array as $key=>$val){\n\t\t\t\t\t\t$output .= 'data-'.$key.'=\"'.$val .'\" ';\n\t\t\t\t\t}\n\t\t\t\t\treturn $output;\n\t\t\t\t}else{\n\t\t\t\t\treturn EVO_get_data_attrs($array);\n\t\t\t\t}\n\t\t\t}",
"public function getArrayableAttributes()\n {\n $attributes = parent::getArrayableAttributes();\n\n foreach ($attributes as $key => $attribute) {\n if ($this->encryptable($key)) {\n $attributes[$key] = $this->decryptAttribute($attribute);\n }\n }\n\n return $attributes;\n }",
"public function getFields()\n {\n return $this->fillable;\n }",
"public function getAttributes()\n {\n return collect(parent::getAttributes())\n ->except(array_keys($this->fieldAttributes()))\n ->toArray();\n }",
"public function attributes()\n {\n $rules_labels = User::$labels;\n return $rules_labels;\n }",
"public function getAttributes()\n\t{\n\t\treturn array(\n\t\t\t'usuario' => $this->usuario,\n\t\t\t'correo' => $this->correo,\n\t\t\t'cedula'=>$this->cedula,\n\t\t\t//'firstName' => $this->firstName,\n\t\t\t//'lastName' => $this->lastName,\n\t\t);\n\t}",
"public function getFillable(){\n return $this->fillable;\n }",
"public function attributes(): array\n {\n return ['firstname', 'lastname', 'email', 'password', 'isAdmin'];\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n\n return $attributes;\n }",
"public function getAttributes(): iterable;",
"private function requestedAttributes()\n {\n\n $default = [\n 'id',\n 'name',\n 'level',\n 'rarity',\n 'image',\n 'category.0',\n 'category.1',\n 'vendor_price',\n 'buy.quantity',\n 'buy.price',\n 'buy.last_change.time',\n 'buy.last_change.quantity',\n 'buy.last_change.price',\n 'sell.quantity',\n 'sell.price',\n 'sell.last_change.time',\n 'sell.last_change.quantity',\n 'sell.last_change.price',\n 'last_update'\n ];\n\n $requested = $this->getInput('attributes') ?: $default;\n\n if (!is_array($requested)) {\n $requested = explode(',', $requested);\n }\n\n return $requested;\n\n }",
"public function getFillable()\n {\n return static::$model::getFillableValues();\n }",
"public function safeAttributes()\n {\n return $this->attributes();\n }",
"public function getAttributes(): array\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return [\n Attributes\\IdAttribute::make(),\n \\Amethyst\\Core\\Attributes\\DataNameAttribute::make('model')\n ->setRequired(true)\n ->setMutable(false),\n Attributes\\TextAttribute::make('name')\n ->setRequired(true)\n ->setValidator(function (EntityContract $entity, $value) {\n return preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $value);\n }),\n Attributes\\LongTextAttribute::make('description'),\n Attributes\\EnumAttribute::make('schema', array_keys(Config::get('amethyst.attribute-schema.resolvers')))\n ->setRequired(true),\n Attributes\\BooleanAttribute::make('required')\n ->setDefault(function (EntityContract $entity) {\n return false;\n }),\n Attributes\\TextAttribute::make('regex')\n ->setRequired(false)\n ->setValidator(function (EntityContract $entity, $value) {\n try {\n return preg_match($value, null) !== false;\n } catch (\\Throwable $exception) {\n return false;\n }\n }),\n Attributes\\YamlAttribute::make('options')\n ->setValidator(function (EntityContract $entity, $value) {\n $options = (object) Yaml::parse((string) $attributeRaw->options);\n }),\n Attributes\\TextAttribute::make('require')\n ->setFillable(false)\n ->setMutable(false),\n Attributes\\CreatedAtAttribute::make(),\n Attributes\\UpdatedAtAttribute::make(),\n Attributes\\DeletedAtAttribute::make(),\n ];\n }",
"public function getAttributes() : array\n {\n\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return [\n Attributes\\IdAttribute::make(),\n Attributes\\TextAttribute::make('name')\n ->setRequired(true)\n ->setUnique(true),\n Attributes\\LongTextAttribute::make('description'),\n Attributes\\TextAttribute::make('filter'),\n Attributes\\EnumAttribute::make('class_name', config('amethyst.data-builder.data.data-builder.attributes.class_name.options')),\n Attributes\\YamlAttribute::make('class_arguments'),\n Attributes\\YamlAttribute::make('mock_data'),\n Attributes\\YamlAttribute::make('input'),\n Attributes\\TextAttribute::make('include'),\n Attributes\\CreatedAtAttribute::make(),\n Attributes\\UpdatedAtAttribute::make(),\n Attributes\\DeletedAtAttribute::make(),\n ];\n }",
"public function attributes(): array\n {\n return [\n //\n ];\n }",
"public function attributes(): array\n {\n return [\n //\n ];\n }",
"public static function supportedAttributes();",
"public function getAttributes(): array {\n return $this->attributes;\n }",
"public function attributes()\n\t{\n\t\treturn ['id', 'file'];\n\t}",
"protected function getAttributes(): array\n {\n return array_keys(get_class_vars(static::class));\n }",
"private function getDefaultAttributes()\n {\n return [\n 'name' => [\n 'type' => 'varchar',\n 'label' => 'Name',\n 'input' => 'text',\n 'sort_order' => 1,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'is_active' => [\n 'type' => 'int',\n 'label' => 'Is Active',\n 'input' => 'select',\n 'source' => Boolean::class,\n 'sort_order' => 2,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'url_key' => [\n 'type' => 'varchar',\n 'label' => 'URL Key',\n 'input' => 'text',\n 'required' => false,\n 'sort_order' => 3,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n 'description' => [\n 'type' => 'text',\n 'label' => 'Description',\n 'input' => 'textarea',\n 'required' => false,\n 'sort_order' => 4,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'wysiwyg_enabled' => true,\n 'is_html_allowed_on_front' => true,\n 'group' => 'General',\n ],\n 'image' => [\n 'type' => 'varchar',\n 'label' => 'Image',\n 'input' => 'image',\n 'backend' => Image::class,\n 'required' => false,\n 'sort_order' => 5,\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'group' => 'General',\n ],\n ];\n }",
"function mixedAttributeTypes () {\r\n return $this->_mixedAttributeTypes;\r\n }",
"public function attributes()\n {\n return [\n 'name' => 'nombre',\n 'last_name' => 'apellido',\n 'num_id' => 'cédula',\n 'email' => 'correo',\n 'birthdate' => 'fecha',\n 'sex' => 'sexo',\n 'place_birthdate' => 'lugar de nacimiento',\n 'blood_group' => 'grupo sanguineo',\n 'phone_person' => 'telefono personal',\n 'location_home' => 'lugar donde vive',\n 'phone_home' => 'telefono de casa',\n 'location_work' => 'lugar de trabajo ',\n 'phone_work' => 'telefono de trabajo',\n 'profession' => 'profesión',\n 'current_occupation' => 'ocupación',\n 'observation' => 'observación',\n ];\n }",
"public function getAttributes(): array\n {\n return $this->_attributes;\n }",
"public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }",
"public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n $mutatedAttributes = $this->getMutatedAttributes();\n\n foreach ($mutatedAttributes as $key)\n {\n if (!array_key_exists($key, $attributes))\n continue;\n\n $attributes[$key] = $this->mutateAttributeForArray(\n $key,\n $attributes[$key]\n );\n }\n\n foreach ($this->casts as $key => $value)\n {\n if (!array_key_exists($key, $attributes) ||\n in_array($key, $mutatedAttributes))\n {\n continue;\n }\n\n $attributes[$key] = $this->castAttribute(\n $key,\n $attributes[$key]\n );\n }\n\n foreach ($this->getArrayableAppends() as $key)\n $attributes[$key] = $this->mutateAttributeForArray($key, null);\n\n return $attributes;\n }",
"protected static function resolveFillable()\n\t{\n\t\tstatic::getAttributeDefinitions()->each->applyFillable($fillable = collect());\n\t\tstatic::$resolvedFillable[static::class] = $fillable->all();\n\t}",
"public function getAttributes(){ }"
] | [
"0.7485169",
"0.7431268",
"0.65387875",
"0.6369011",
"0.6369011",
"0.61958706",
"0.61957335",
"0.61303127",
"0.61303127",
"0.61303127",
"0.61303127",
"0.61298674",
"0.6035263",
"0.60131687",
"0.59887",
"0.5970922",
"0.5961864",
"0.59574443",
"0.59520197",
"0.59307975",
"0.5923269",
"0.59168077",
"0.58868074",
"0.58820426",
"0.5878693",
"0.58726907",
"0.58558804",
"0.58558804",
"0.58558804",
"0.58558804",
"0.58558804",
"0.58558804",
"0.58558804",
"0.58558804",
"0.58558804",
"0.58344436",
"0.5834272",
"0.58117604",
"0.58056146",
"0.5797695",
"0.5796978",
"0.57935953",
"0.57816786",
"0.57816786",
"0.577486",
"0.5726793",
"0.5721995",
"0.5714865",
"0.5714346",
"0.5710517",
"0.5707079",
"0.5704667",
"0.56739956",
"0.56685257",
"0.5661532",
"0.56597394",
"0.5656578",
"0.5645505",
"0.564401",
"0.564401",
"0.564401",
"0.5630858",
"0.5618124",
"0.56072295",
"0.56007457",
"0.55884606",
"0.55649436",
"0.55601555",
"0.55547225",
"0.55515677",
"0.55372",
"0.5524107",
"0.5515127",
"0.5514956",
"0.5514956",
"0.5514956",
"0.5514956",
"0.55124104",
"0.5506031",
"0.54820776",
"0.54781574",
"0.54775584",
"0.54711515",
"0.5466338",
"0.5465648",
"0.54653573",
"0.54459476",
"0.54459476",
"0.54391766",
"0.54220587",
"0.54174566",
"0.54136336",
"0.5411793",
"0.5406338",
"0.5400652",
"0.5398534",
"0.5396607",
"0.53949904",
"0.5394132",
"0.53930736"
] | 0.7535031 | 0 |
Create a new instance of the given model. | public function newInstance($attributes = [], $exists = false)
{
// This method just provides a convenient way for us to generate fresh model
// instances of this current model. It is particularly useful during the
// hydration of new objects via the Halcyon query builder instances.
$model = new static((array) $attributes);
$model->exists = $exists;
return $model;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create(Model $model);",
"public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }",
"public static function from(Model $model)\n {\n return new static($model);\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }",
"public function createModel(PayModel $model);",
"public function model($model) {\n // Require model file\n require_once \"../app/models/{$model}.php\";\n\n // Instantiate model\n return new $model();\n }",
"protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }",
"public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}",
"private static function newModel(string $model, array $attributes = [])\n {\n return new $model(...array_values($attributes));\n }",
"protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }",
"protected function getModelInstance()\n {\n return new $this->model();\n }",
"public function creating($model)\n\t{\n\t}",
"public function model($model)\n\t{\n\t\trequire_once INC_ROOT .'/app/models/'. $model .'.php';\n\t\treturn new $model();\n\t}",
"protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }",
"function create($model)\n {\n }",
"public function model($model) {\r\n require_once \"../app/models/$model.php\";\r\n return new $model; //return class\r\n }",
"public function make($modelClass);",
"public static function createFromModel(\\MemberModel $model)\n {\n return self::create($model->row());\n }",
"public static function factory($model, $id = NULL)\n\t{\t\n\t\t$class = Jelly_Meta::class_name($model);\n\t\t\n\t\treturn new $class($id);\n\t}",
"public function create(): Model;",
"public function model($model)\n\t{\n\t\trequire_once '../app/models/'.$model.'.php';\n\t\treturn new $model();\n\t}",
"protected function newModel(): Model\n {\n return (new $this->model)->fresh();\n }",
"public function create()\n {\n return $this->modelManager->instance($this->model);\n }",
"public function __construct($model)\n {\n if (is_string($model)) {\n $model = '\\\\App\\\\Models\\\\' . $model;\n $this->model = new $model();\n } elseif (is_object($model) && ($model instanceof Model) && !$model->exists) {\n $this->model = $model;\n } elseif (is_object($model) && ($model instanceof Model)) {\n $this->model = $model;\n $this->action = 'useru_id';\n }\n $this->builder = $this->model->newQuery();\n }",
"public function createModel()\n {\n }",
"abstract protected function newModel(): Model;",
"public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}",
"public function create(Model $model)\n\t{\n\t\tif ($this->beta) {\n\t\t\t$this->client->sendBetaRequest('POST', '/' . $this->uri, null, $model->getSchema());\n\t\t} else {\n\t\t\t$this->client->sendRequest('POST', '/' . $this->uri, null, $model->getSchema());\n\t\t}\n\t\treturn true;\n\t}",
"public function model($model){\n\n if(file_exists('../src/models/' . $model . '.php')){\n require_once '../src/models/' . $model . '.php';\n return new $model();\n } else {\n die('<strong>Fatal Error:</strong> Model <em>' . $model .'</em> does not exist');\n }\n }",
"public static function factory($model = FALSE, $id = FALSE)\n\t{\n\t\t$model = empty($model) ? __CLASS__ : ucfirst($model).'_Model';\n\t\treturn new $model($id);\n\t}",
"static public function getModel($model_name) {\n return new $model_name();\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->model = $model;\n }",
"public function __construct(Model $model)\n {\n $this->reflection = new ReflectionClass($model);\n }",
"protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}",
"protected function makeModel()\n {\n return factory(Employee::class)->create();\n }",
"function __construct($model)\n {\n $this->model = $model;\n }",
"private function makeModel()\n {\n\n $this->model = $this->app->make($this->model());\n\n if (!$this->model instanceof Model)\n throw new Exception(\"Class \".$this->model.\" must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n\n return $this->model;\n }",
"public function create($modelData);",
"public static function model()\n {\n return new self;\n }",
"public function __construct( Model $model ) {\n\t\t$this->model = $model;\n\t}",
"function __construct(Model $model)\n {\n $this->model=$model;\n }",
"public static function factory(App $app, $model_name)\n {\n if (!isset($app) || (isset($app) && !$app instanceof App))\n Throw new Error('App object not set', 1000);\n\n // Framework, SMF or App model? Create proper namespace.\n $model_class = ($app->isSecure() ? '\\\\Web\\\\Framework\\\\AppsSec' : '\\\\Web\\\\Apps') . \"\\\\\" . $app->getName() . '\\\\Model\\\\' . $model_name . 'Model';\n\n // Create and return modelobject\n $model = new $model_class($model_name);\n\n // Inject app object\n $model->injectApp($app);\n\n return $model;\n }",
"protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }",
"public static function getModel (string $model) {\n $class= \"\\\\Model\\\\$model\";\n return new $class;\n }",
"public static function dynamicInstanceModel(string $model)\n {\n $model = '\\\\App\\\\' . str_replace('_', '', ucwords(str_replace('_id', '', $model), '_'));\n return new $model;\n }",
"function getModel($model, $params = array()) {\n $model = \"app\\\\models\\\\\" . $model . \"Model\";\n return new $model($params);\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct($model)\n {\n //\n $this->model = $model;\n }",
"public static function factory( $modelClassName )\n\t{\n\t\t$factory = self::$factory;\n\t\treturn ( $factory ) ? $factory( $modelClassName ) : new $modelClassName();\n\t}",
"private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }",
"public function model()\n {\n $model = $this->_model;\n return new $model;\n\n }",
"private function __construct($model)\r\n {\r\n\r\n }",
"protected function _newModel($class)\n {\n // instantiate\n $model = new $class($this);\n \n // done!\n return $model;\n }",
"protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }",
"public static function newModel(...$params) : Model\n {\n $model = new Model();\n $count = $params ? count($params) : 0;\n\n if ($count === 1)\n {\n $model->loadModelFromText($params[0]);\n }\n\n if ($count === 2 && $params[0])\n {\n $model->loadModel($params[0]);\n }\n\n return $model;\n }",
"protected function newModel($data)\n{\n\t$className = Model::className($this->query['from']);\n\t$model = new $className($this->query['from']);\n\n\tif (!$this->cachedTemplate) {\n\t\t$this->cachedTemplate = $model->getTemplate();\n\t}\n\n\t$model->setTemplate($this->cachedTemplate);\n\n\tif ($data) {\n\t\t$model->setValues($data);\n\t\t$model->isInDb(true);\n\t}\n\n\treturn $model;\n}",
"protected function getNewModel()\n {\n $modelName = $this->getModelName();\n return new $modelName;\n }",
"public static function getNew($model, $ttl = self::DEFAULT_TTL){\n $class = null;\n\n $model = '\\\\' . __NAMESPACE__ . '\\\\' . $model;\n if(class_exists($model)){\n $class = new $model( null, null, null, $ttl );\n }else{\n throw new \\Exception(sprintf(self::ERROR_INVALID_MODEL_CLASS, $model));\n }\n\n return $class;\n }",
"public function creating(Model $model)\n {\n $model->uuid = Uuid::uuid4()->toString();\n }",
"public static function fromModel(AbstractModel $model): static\n {\n return new static($model->toArray());\n }",
"public function create($data)\n\t{\n\t\t$model = $this->model->create($data);\n\n\t\treturn $model;\n\t}",
"protected function model($model)\r\n {\r\n if (file_exists(ROOT_DIR . '/app/models/' . $model . '.php'))\r\n {\r\n require_once ROOT_DIR . '/app/models/' . $model . '.php';\r\n return new $model(self::$db);\r\n }\r\n return NULL;\r\n }",
"public function model($model)\n\t{\n\t\tif(file_exists(\"app/model/\".$model.\".php\"))\n\t\t{\n\t\t\trequire_once(\"app/model/\".$model.\".php\");\n\t\t\t$actual=explode(\"/\", $model);\n\t\t\t$main=end($actual);\n\t\t\treturn new $main;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(\"Model \".$model.\" not found\");\n\t\t}\n\t}",
"public function model(Model $model)\n {\n return new ModelBuilder($model, $this->pdo, $this->handler);\n }",
"public function create($data) : Model\n {\n return $this->getModel()->create($data);\n }",
"public function create(array $attributes) : Model;",
"public function create($model, $data = null)\n {\n $repo = $this->getRepository($model);\n\n return $repo->create($data);\n }",
"public function creating(Request $model)\n {\n # Set Current User as Creator\n $model->setAttribute('creator', $model->getAttribute('creator') ?: $this->getUserId() );\n # Set the Owner ID to current user\n $model->setAttribute('owner_id', $model->getAttribute('owner_id') ?: $this->getUserId() );\n # Set Tiering Needs\n $model->setAttribute('is_tiering_needed', $this->isTieringNeeded($model));\n # Set Tiering New\n $model->setAttribute('is_tiering_new', $this->isTieringNew($model));\n }",
"public function getModel()\n {\n return new $this->model;\n }",
"public function creating(Model $model)\n {\n $model->{$model->getKeyName()} = Uuid::uuid4()->toString();\n }",
"function __construct () {\n\t\t$this->_model = new Model();\n\t}",
"protected function createModelInstance($options = [])\n {\n if (isset($options['model']) && !is_bool($options['model'])) {\n if (is_object($options['model'])) {\n return $options['model'];\n }\n $class = $this->getModelClass($options['model']);\n } else {\n $class = $this->getModelClass();\n }\n\n return new $class();\n }",
"public function model(string $model)\n {\n $namespace = $this->container->get('DB_MDNS');\n\n if (! empty($namespace)) {\n $model = $namespace . '\\\\' . $model;\n }\n\n return new $model($this->container, $this);\n }",
"public function createModelObject($modelName){\n //$this->modelObject = new SignupModel;\n\n }",
"private function makeModel() {\n \n $model = $this->app->make( $this->model() );\n\n if ( !$model instanceof Model )\n throw new RepositoryException(\"Class {$this->model} must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n $this->model = $model;\n\n return $this;\n }",
"protected function makeModel()\n {\n $model = app($this->getModelClass());\n\n if (!$model instanceof Model) {\n throw new \\Exception(\"Invalid Eloquent model\");\n }\n\n $this->model = $model;\n }",
"public static function create($params = array())\n {\n $model = new static();\n static::getSchema();\n if (!empty($params)) {\n $model->setProperties($params);\n }\n\n return $model;\n }",
"public function model($model)\n\t{\n\t\trequire_once($model.\".php\");\n\t\t$this->obj->$model = new $model();\n\t}",
"public function __construct($model){\r\n\t\t$this->model = $model;\r\n\t}",
"public function __construct(Model $model)\n {\n // $this->$key = $model;\n $this->model = $model;\n }",
"public function create(array $attributes): Model\n {\n return $this->model->create($attributes);\n }"
] | [
"0.82489604",
"0.7996992",
"0.76176596",
"0.7520926",
"0.7520926",
"0.75158346",
"0.75001466",
"0.74945736",
"0.7492397",
"0.7473658",
"0.74309605",
"0.73189354",
"0.7238691",
"0.7224371",
"0.72191375",
"0.72133934",
"0.72106177",
"0.7170888",
"0.716543",
"0.71643466",
"0.71336544",
"0.71117955",
"0.7096843",
"0.7092944",
"0.70923525",
"0.7083599",
"0.707107",
"0.7066287",
"0.69944817",
"0.6969502",
"0.6959745",
"0.69574517",
"0.6951396",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.6906083",
"0.689719",
"0.687834",
"0.6874445",
"0.68628716",
"0.6856715",
"0.68553376",
"0.68501806",
"0.68484825",
"0.6845886",
"0.68102795",
"0.67973703",
"0.6787525",
"0.6776152",
"0.67598706",
"0.67526174",
"0.67526174",
"0.67526174",
"0.67526174",
"0.67526174",
"0.67526174",
"0.67526174",
"0.67526174",
"0.67526174",
"0.67506456",
"0.6726949",
"0.6714765",
"0.67117065",
"0.670783",
"0.67062324",
"0.6692761",
"0.66772026",
"0.6670801",
"0.66625273",
"0.6652693",
"0.6639705",
"0.66366214",
"0.66251516",
"0.6623911",
"0.6601564",
"0.66003585",
"0.65984064",
"0.6591405",
"0.65797013",
"0.65783924",
"0.6576738",
"0.656333",
"0.6558567",
"0.6557408",
"0.6539146",
"0.65347326",
"0.65337175",
"0.6532071",
"0.65307575",
"0.65296525",
"0.65242255",
"0.6518341",
"0.65109974"
] | 0.0 | -1 |
Create a new model instance that is existing. | public function newFromBuilder($attributes = [], $datasource = null)
{
$instance = $this->newInstance([], true);
if ($instance->fireModelEvent('fetching') === false) {
return $instance;
}
$instance->setRawAttributes((array) $attributes, true);
$instance->fireModelEvent('fetched', false);
$instance->setDatasource($datasource ?: $this->datasource);
return $instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->modelManager->instance($this->model);\n }",
"public function create(): Model;",
"public function create(Model $model);",
"public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }",
"protected function newModel(): Model\n {\n return (new $this->model)->fresh();\n }",
"public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}",
"public function createModel()\n {\n }",
"public function create(array $attributes) : Model;",
"public function create($data) : Model\n {\n return $this->getModel()->create($data);\n }",
"protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }",
"public function create($data)\n\t{\n\t\t$model = $this->model->create($data);\n\n\t\treturn $model;\n\t}",
"public function create($data=null) {\n\t\t\treturn $this->_create_model_instance(parent::create($data));\n\t}",
"protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }",
"protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }",
"public function create(array $attributes): Model\n {\n return $this->model->create($attributes);\n }",
"public function creating($model)\n\t{\n\t}",
"protected function getNewModel()\n {\n $modelName = $this->getModelName();\n return new $modelName;\n }",
"public function create($modelData);",
"public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}",
"protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }",
"abstract protected function newModel(): Model;",
"public function create(Request $request): Model;",
"public function createModel(PayModel $model);",
"public function getNewModel( array $attributes = array() ) {\n\t\treturn $this->model->newInstance( $attributes );\n\t}",
"public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}",
"function create($model)\n {\n }",
"public function createModel() {\n return null;\n }",
"public function create(array $attributes = [])\n {\n $class = $this->getModelNamespace();\n /** @var \\Illuminate\\Database\\Eloquent\\Model $model */\n $model = new $class($attributes);\n $res = $model->save();\n if ($res !== true) throw new \\Exception('Error creating model.');\n return $model;\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n // This method just provides a convenient way for us to generate fresh model\n // instances of this current model. It is particularly useful during the\n // hydration of new objects via the Halcyon query builder instances.\n $model = new static((array) $attributes);\n\n $model->exists = $exists;\n\n return $model;\n }",
"public static function create($attributes) {\n\t\t$model = new static($attributes);\n\n\t\t$success = $model->save();\n\n\t\treturn ($success) ? $model : false;\n\t}",
"public function create(){}",
"public function create(): object\n {\n if (!Bouncer::can('create', $this->model)) {\n abort(403);\n }\n $form = $this->form($this->form, [\n 'method' => 'POST',\n 'route' => [$this->routeWithModulePrefix . '.' . 'store']\n ]);\n\n $item = new $this->model;\n return $this->view($this->baseView . '.create', ['form' => $form, 'item' => $item]);\n }",
"protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }",
"public function create(array $request): Model;",
"protected function makeModel()\n {\n return factory(Employee::class)->create();\n }",
"public function newEntryModel();",
"protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n\n $model = parent::newInstance($attributes, $exists);\n $model->setTable($this->table);\n\n return $model;\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n $model = new static((array) $attributes);\n\n $model->exists = $exists;\n\n return $model;\n }",
"public function create()\n {\n return $this->objectManager->create($this->className);\n }",
"public function create() {}",
"public function getNewModel()\n { if (isset($this->oModel))\n {\n if (get_class($this->oModel) !== $this->modelClassName)\n {\n // yes we do\n $this->resetModel();\n\n }\n else\n {\n // no, we do not\n }\n }\n else\n {\n // we have no record instance - create one\n $this->resetModel();\n }\n\n return clone $this->oModel;\n }",
"public function create(Model $model)\n\t{\n\t\tif ($this->beta) {\n\t\t\t$this->client->sendBetaRequest('POST', '/' . $this->uri, null, $model->getSchema());\n\t\t} else {\n\t\t\t$this->client->sendRequest('POST', '/' . $this->uri, null, $model->getSchema());\n\t\t}\n\t\treturn true;\n\t}",
"public function createNew() {\n\t}",
"public function createAction()\n {\n $data = $this->getRequest()->getBody();\n $model = $this->getBinding()->create($data);\n $responseClass = $this->container->getParameter('response.class');\n $response = new $responseClass($model, 201);\n\n return $response;\n }",
"public function createNew();",
"public function actionCreate()\n\t{\n\t\tif (isset($_GET['newModel']) && isset(Yii::app()->session[$this->createBackup.'_Time']) && $_GET['newModel']>Yii::app()->session[$this->createBackup.'_Time']){\n\t\t\t\tunset(Yii::app()->session[$this->createBackup]);\n\t\t\t\tunset(Yii::app()->session[$this->createBackup.'_Time']);\n\t\t\t\tunset($_GET['newModel']);\n\t\t}\n\t\t$this->prepareCreateOrUpdate(null, 'create');\n\t}",
"public function create() {\n //\n }",
"public function create()\n {\n //TODO\n }",
"protected function getModelInstance()\n {\n return new $this->model();\n }",
"public static function create(array $attributes = [])\n {\n $model = new static($attributes);\n\n $model->save();\n\n return $model;\n }",
"public static function create(array $attributes = [])\n {\n $model = new static($attributes);\n\n $model->save();\n\n return $model;\n }",
"public function create()\n {}",
"function create($model, $overrides = [], $times = 1)\n{\n return new PendingModel('create', $model, $overrides, $times);\n}",
"public function newInstance($attributes = [], $exists = false)\n {\n // This method just provides a convenient way for us to generate fresh model\n // instances of this current model. It is particularly useful during the\n // hydration of new objects via the Eloquent query builder instances.\n $model = new static((array) $attributes);\n\n $model->exists = $exists;\n\n $model->setConnection(\n $this->getConnectionName()\n );\n\n return $model;\n }",
"public function create(array $data = [])\n {\n $model = $this->factory($data);\n\n $this->save($model);\n\n return $model;\n }",
"public function create($attributes)\n {\n return $this->model->create($attributes);\n }",
"public function create()\n {\n //\n }",
"public function create()\n {\n //\n }",
"public function create()\n {\n //\n }",
"public function create()\n {\n //\n }",
"public function create()\n {\n \n //\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n // This method just provides a convenient way for us to generate fresh model\n // instances of this current model. It is particularly useful during the\n // hydration of new objects via the Eloquent query builder instances.\n $type = Arr::get($attributes, $this->getTypeColumn());\n\n if ($this->getTypes()->has($type)) {\n $class = $this->getTypes()->get($type);\n $model = new $class((array) $attributes);\n } else {\n $model = new static((array) $attributes);\n }\n\n $model->exists = $exists;\n\n $model->setConnection(\n $this->getConnectionName()\n );\n\n return $model;\n }",
"public function create() {\n \n }",
"public function create() {\n \n }",
"public function create()\n {\n //\n }",
"public function create()\n {\n //\n }",
"public function create()\n {\n }",
"public function create()\n {\n }",
"public function create()\n\t\t{\n\t\t\t//\n\t\t}",
"public function create()\n\t\t{\n\t\t\t//\n\t\t}",
"private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create() {\n\t\t\t//\n\t\t}",
"public function create()\n {\n\n \n \n }",
"protected function newModel($data)\n{\n\t$className = Model::className($this->query['from']);\n\t$model = new $className($this->query['from']);\n\n\tif (!$this->cachedTemplate) {\n\t\t$this->cachedTemplate = $model->getTemplate();\n\t}\n\n\t$model->setTemplate($this->cachedTemplate);\n\n\tif ($data) {\n\t\t$model->setValues($data);\n\t\t$model->isInDb(true);\n\t}\n\n\treturn $model;\n}",
"public function create() {\r\n //\r\n }",
"public function creating(Model $model): void\n {\n $model->setAttribute($model->getKeyName(), Uuid::uuid4());\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }",
"public function create() {\n //\n }"
] | [
"0.73426616",
"0.7313782",
"0.7259265",
"0.7162958",
"0.7137214",
"0.70039785",
"0.6997961",
"0.69303906",
"0.6899517",
"0.68280137",
"0.67946273",
"0.67726487",
"0.6711098",
"0.6698336",
"0.66924787",
"0.66451305",
"0.66451156",
"0.6612408",
"0.6593344",
"0.65752167",
"0.65683806",
"0.6552875",
"0.65340596",
"0.6527186",
"0.65170187",
"0.6498422",
"0.649689",
"0.6492557",
"0.64658123",
"0.64658123",
"0.6452426",
"0.6448018",
"0.64387447",
"0.64090186",
"0.6405754",
"0.63834095",
"0.63818896",
"0.63689405",
"0.63578856",
"0.6343353",
"0.6331056",
"0.6329346",
"0.6320897",
"0.6313915",
"0.6306392",
"0.63014334",
"0.6300549",
"0.62973213",
"0.62971294",
"0.62960905",
"0.62938166",
"0.62926435",
"0.6285203",
"0.6285203",
"0.62781096",
"0.6271181",
"0.6269839",
"0.6265101",
"0.62593746",
"0.624676",
"0.624676",
"0.624676",
"0.624676",
"0.6241615",
"0.622933",
"0.62031615",
"0.62031615",
"0.6199416",
"0.6199416",
"0.6194772",
"0.6194772",
"0.6190707",
"0.6190707",
"0.61884755",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186537",
"0.6186368",
"0.6179848",
"0.61765623",
"0.6174624",
"0.6162448",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795",
"0.61611795"
] | 0.0 | -1 |
Create a collection of models from plain arrays. | public static function hydrate(array $items, $datasource = null)
{
$instance = (new static)->setDatasource($datasource);
$items = array_map(function ($item) use ($instance) {
return $instance->newFromBuilder($item);
}, $items);
return $instance->newCollection($items);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newCollection(array $models = []);",
"public function create(): array\n {\n return array_map(fn() => self::newModel($this->model, $this->definition()), range(1, $this->count));\n }",
"public static function createManyFromArray(array $posts): Collection\n {\n return collect($posts)->map(function ($post) {\n return new static($post);\n });\n }",
"public function fromArray(array $data);",
"public function fromArray(array $data);",
"public static function modelsFromRawResults($rawResult = [])\n\t{\n\t\t$objects = [];\n\t\tforeach($rawResult as $result) {\n\t\t\t$object = new static();\n\n\t\t\t$object->setRawAttributes((array)$result, true);\n\n\t\t\t$objects[] = $object;\n\t\t}\n\n\t\treturn new Collection($objects);\n\t}",
"public static function fromArray(array $data);",
"public function newCollection(array $models = []): Collection\n {\n return new Collection($models);\n }",
"private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }",
"public function fromArray(array $arrayData);",
"public function newCollection(array $models = [])\n {\n return new Collection($models);\n }",
"public function newCollection(array $models = [])\n {\n return new Collection($models);\n }",
"public function newCollection(array $models = [])\n {\n return new Collection($models);\n }",
"public function hydrate(): Collection\n\t{\n\t\t$className = get_class($this->model);\n\n\t\treturn $this->getRaw()->map(fn ($row) => (new $className())->forceFill($row));\n\t}",
"private function createModels($rows)\n {\n $models = [];\n $modelClass = $this->modelClass;\n $param = $modelClass::resultParam();\n if ($this->asArray) { \n return $rows->{$param};\n } else {\n /* @var $class ActiveRecord */\n $class = $this->modelClass;\n foreach ($rows->{$param} as $row) {\n $model = $class::instantiate($row);\n $modelClass = get_class($model);\n $modelClass::populateRecord($model, $row);\n $models[] = $model;\n }\n return $models;\n }\n }",
"public function newCollection(array $models = array())\n {\n return new Collection($models);\n }",
"function ars(array $array) {\n\t\trequire_once(Config()->CORE_PATH.'ActiveRecordSet.php');\n\t\treturn new ActiveRecordSet($array);\n\t}",
"public static function make(array $items): Collection\n {\n return new static($items);\n }",
"public static function hydrate(array $items)\n {\n $instance = new static;\n $items = array_map(function ($item) use ($instance) {\n return $instance->newInstance($item);\n }, $items);\n\n return $items;\n }",
"public function newCollection(array $models = array())\n\t{\n\t\treturn new MyCollection($models);\n\t}",
"public function newCollection(array $models = [])\n {\n return new ReferenceCollection($models);\n }",
"public function createMany(array $data): Model\n {\n return $this->model->createMany($data);\n }",
"public static function fromArray($rawArray, $charset = null) {\n $output = array();\n\n foreach ($rawArray as $rawEntry) {\n $output[] = new static($rawEntry, $charset);\n }\n\n return $output;\n }",
"public function transformArrayObject(array $items, string $type = 'simple'): array;",
"public function arrayToObject($array): static;",
"public function toArray()\n {\n $output = [];\n\n foreach ($this->models as $model) {\n $output[] = $model->toArray();\n }\n\n return $output;\n }",
"public function __construct(array $models)\n {\n $this->iterator = new \\ArrayIterator($models);\n $this->count = count($this->iterator);\n }",
"public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n if ( $this->$key instanceof PersistentCollection ) {\n \n $value = new ArrayCollection(\n array_unique(array_merge($this->$key->toArray(), $value->toArray()), \\SORT_REGULAR)\n );\n \n }\n \n $this->$key = $value; \n }\n \n //return $this;\n }",
"public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n if ( $this->$key instanceof PersistentCollection ) {\n \n $value = new ArrayCollection(\n array_unique(array_merge($this->$key->toArray(), $value->toArray()), \\SORT_REGULAR)\n );\n \n }\n \n $this->$key = $value; \n }\n \n //return $this;\n }",
"public static function arrayWithObjects()\n {\n return new RsoArray(func_get_args());\n }",
"public function convertItemArray() {}",
"public function toEntity($array);",
"public function toEntity($array);",
"private function dataConvert($array)\n {\n $result = false;\n if(count($array) && isset($array[0]) && is_array($array[0]))\n {\n $class = get_class($this);\n foreach($array as $arr)\n {\n $result[] = new $class((int) $arr[$this->primaryName]);\n }\n }\n else if(count($array))\n {\n $class = get_class($this);\n $result = new $class((int) $array[$this->primaryName]);\n }\n return $result;\n }",
"public function newCollection(array $models = []): ItemCollection\n {\n return (new ItemCollection($models));\n }",
"public function from(array $input);",
"public static function toObject(array $array);",
"public function normalizeModelProducts() : array\n {\n\n // Init empty array\n $return = [];\n\n // Loop on every Model's products\n foreach ($this->getProducts() as $product) {\n\n // Store ProductSubresource in new $return index\n $return[] = $product->normalizeProductCollection(true, false, false, false);\n }\n\n return $return;\n }",
"private function createArrayable()\n {\n $this->data = $this->data->toArray();\n\n $this->createArray();\n }",
"public function newCollection(array $models = [])\n {\n return new KusikusiCollection($models);\n }",
"public function createArray(array $data) {\n\t\treturn array_map(array($this, 'create'), $data);\n\t}",
"public function hydrate(array $data);",
"public static function createFromArray($tags)\n {\n return new self(\n null,\n Functional\\map(\n $tags,\n function ($tag) {\n return (object) $tag;\n }\n )\n );\n }",
"function treatModel(Array $arr)\n {\n }",
"public function createCollectionFromArray($data)\n {\n $data['hidden'] = (bool) ArrayUtils::get($data, 'hidden');\n $data['single'] = (bool) ArrayUtils::get($data, 'single');\n $data['managed'] = (bool) ArrayUtils::get($data, 'managed');\n\n return new Collection($data);\n }",
"public static function fromData(array $data);",
"public static function makeFromArray(array $data)\r\n {\r\n }",
"public static function makeFromArray(array $data)\r\n {\r\n }",
"public static function makeFromArray(array $data)\r\n {\r\n }",
"public static function makeFromArray(array $data)\r\n {\r\n }",
"public static function makeFromArray(array $data)\r\n {\r\n }",
"public function bulkStore(array $payload) {\n $collection = collect($payload);\n\n $products = $collection->map(function ($product) {\n $product = new Product([\n 'id' => Uuid::uuid4()->toString(),\n 'name' => $product['name'],\n 'price' => $product['price'],\n 'quantity' => $product['quantity'],\n ]);\n\n return $product;\n });\n\n $this->model->insert($products->toArray());\n\n return $products;\n }",
"static public function fromArray($anArray) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anArray);\n\t}",
"private function makeObjects($array) {\n\t\t$ret = array();\n\t\tforeach ($array as $k => $v) {\n\t\t\tif (is_array($v)) {\n\t\t\t\t$ret[$k] = $this->makeObjects($v);\n\t\t\t} else {\n\t\t\t\treturn new UploadedFile($array);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}",
"public function toArray()\n {\n $array = array_values($this->getModels());\n return $array;\n }",
"public static function factory(array $fields)\n\t{\n\t\t$collection = new self();\n\t\tforeach ($fields as $data) {\n\t\t\t$field = Field::factory($data);\n\t\t\t$collection->add($field);\n\t\t}\n\t\treturn $collection;\n\t}",
"public function intoArrays()\n {\n return self::arraysOf($this);\n }",
"function toArray($deep = false)\n{\n\t$rows = array();\n\tforeach ($this as $model) {\n\t\t$rows[] = $deep? $model->toArray() : $model;\n\t}\n\treturn $rows;\n}",
"public function newCollection(array $models = [])\n {\n return new ArticleCollection($models);\n }",
"private function buildCollection(array $items): Collection\n {\n $hits = array_pluck($items['hits']['hits'], '_source') ?: [];\n\n $sources = array_map(function ($source) {\n // metod hydrate akan mencoba men decode field tersebut, sedangkan ES sudah mempersiapkan arraynya\n $source['tags'] = json_encode($source['tags']);\n return $source;\n }, $hits);\n\n // Kita harus meng konfersi hasil array kedalam eloquent models\n return Article::hydrate($sources);\n }",
"protected function createCollection()\n {\n $model = $this->getModel();\n return $model->asCollection();\n }",
"public static function instance(Array $request)\n {\n return collect(new self($request))->toArray();\n }",
"public function newCollection(array $rows = [])\n {\n $collection = new Collection($this->_className);\n\n foreach ($rows as $row) {\n $collection->addByRow($row);\n }\n\n return $collection;\n }",
"public static function createFromArray($array) {\n\t\t$document = new static();\n\n\t\tforeach ($array as $fieldName => $fieldValue) {\n\t\t\t$document->$fieldName = $fieldValue;\n\t\t}\n\n\t\treturn $document;\n\t}",
"public static function createFrom(array $elements)\n {\n return new static($elements);\n }",
"public function createByArray($data) \n\t{\n\t\tif (empty($data)) {\n\t\t\treturn false;\n\t\t}\n\n\t include('./models/fichas_model.php');\n\t\t$model = new Fichas_Model;\n\t\t$model->create($data);\n\n\t\tunset($model);\n\t}",
"public static function fromDataContainer(array $data, Request $request = null)\n {\n $models = collect();\n foreach ($data as $model) {\n\n $models->push((new RequestModel($request))->data(['data' => $model]));\n }\n return (new static($request))->models($models);\n }",
"protected function convert_array($array_elements){\n return array_map(function($object){\n return $object;\n },$array_elements->toArray());\n \n\n }",
"public function testConstructorArray()\n {\n $data = ['foo' => 1, 'bar' => 2];\n $document = new Document($data);\n $this->assertSame($data, $document->toArray());\n }",
"public static function create(array $obj): Model{\n $r = new \\Models\\M_Carrello($obj[\"id\"]);\n $items = F_Item_Carrello::getCarrelloItems($obj[\"id\"]);\n foreach($items as $item)\n $r->addItem($item);\n return $r;\n }",
"public function transformArray(array $items, string $type = 'simple'): array;",
"public static function fromArray(array $array): static\n {\n return new self(Iterators::forArray($array));\n }",
"protected function makeData()\n {\n $Collection = new Collection();\n for($i = 0; $i < 35; $i++){\n $Collection->push([\n 'name' => $this->Faker->name,\n 'email' => $this->Faker->email,\n 'birthday' => $this->Faker->date,\n 'phone_number' => $this->Faker->phoneNumber,\n 'bio' => $this->Faker->text,\n ]);\n }\n\n return $Collection;\n }",
"private function manyToMany($array){\n\t\t$result = $this->parseRelation($array);\n\t\t$model = $result['model'];\n\t\t$table = $result['table'];\n\t\t$priKey = $result['priKey'];\n\t\t$forKey = $result['forKey'];\n\t\t$this->_db()->select($forKey)->from($table)->where($priKey,$this->id)->get();\n\t\t$results = $this->_db()->results();\n\t\t$entities = array();\n\t\tforeach ($results as $k => $v){\n\t\t\t$entities[] = new $model($v[$forKey]);\n\t\t}\n\t\treturn $entities;\n\t}",
"public function arrayCollection(array $elements = []): ArrayCollection\n {\n return new ArrayCollection($elements);\n }",
"public function fromArray(array $data) : DataContainerInterface;",
"public static function asObjectArray(array $data)\r\n {\r\n $converter = new ObjectArrayListConverter();\r\n $converter->setArraySource($data);\r\n return new static($converter);\r\n }",
"public static function factory(array $fields)\n\t{\n\t\t$collection = new self();\n\t\tforeach ($fields as $fieldData) {\n\t\t\t$field = new Field();\n\t\t\t$field->setProperties($fieldData);\n\t\t\t$collection->add($field);\n\t\t}\n\t\treturn $collection;\n\t}",
"public function create(array $input);",
"public function getModels($columns = array('*'))\n\t{\n\t\t// First we will simply get the raw reuslts from the query builder which we\n\t\t// can use to popular an array of Eloquent models. We will pass columns\n\t\t// that should be selected too, which are typically just everything.\n\t\t$results = parent::get($columns);\n\n\t\t$connection = $this->model->getConnectionName();\n\n\t\t$models = array();\n\n\t\t// Once we have the results we can spin through them and instantiate a new\n\t\t// model instance for each record we retrieved from the database. We'll\n\t\t// also set the proper connection names for the model after creating.\n\t\tforeach ($results as $result)\n\t\t{\n\t\t\t$models[] = $model = $this->model->newExisting();\n\n\t\t\t$model->setAttributes((array) $result);\n\n\t\t\t$model->setConnection($connection);\n\t\t}\n\n\t\t// Now that we have created the models we can just return them, as this\n\t\t// method is kept separate from eager loadings in case they need to\n\t\t// be used by a relationship individually when loading the model.\n\t\treturn $models;\n\t}",
"public function hydrate(array $items)\n {\n $collection = $this->di->make(Collection::class);\n\n foreach ($items as $item) {\n $item = (object)$item;\n\n // Check whether all required properties exists.\n if (!isset($item->type) || !isset($item->src)) {\n throw new HydratePropertyNotFoundException(\"The type or src key missing in repository definition.\");\n }\n\n $repository = $this->make($item->type, $item->src);\n $collection->add($repository);\n }\n\n return $collection;\n }",
"private function hasMany($array){\n\t\t$result = $this->parseRelation($array);\n\t\t$model = $result['model'];\n\t\t$forKey = $result['forKey'];\n\t\t$table = $result['table'];\n\t\t$priKey = $result['priKey'];\n\t\t$this->_db()->select($priKey)->from($table)->where($forKey,$this->id)->get();\n\t\t$results = $this->_db()->results();\n\t\t$entities = array();\n\t\tforeach($results as $k => $v){\n\t\t\t$entities[] = new $model($v[$priKey]);\t\n\t\t}\n\t\treturn $entities;\n\t}",
"public function transformCollection(array $items)\n {\n return array_map([$this, 'transform'], $items);\n }",
"public function __construct(array $array)\n {\n parent::hydrate($array);\n }",
"protected function buildData(array $attributes = []){\n if(!array_key_exists($this->class, $this->definitions)){\n throw new ImmuTableException(\"No definitions set for class '{$this->class}'\");\n }\n $collection = [];\n $primary_key = (new $this->class)->getKeyName();\n foreach(range(1, $this->size) as $item){\n $definitions = call_user_func($this->definitions[$this->class], $this->faker);\n foreach($attributes as $key => $value){\n $definitions[$key] = $value;\n }\n $definitions[$primary_key] = '';\n $collection[] = new $this->class($definitions);\n }\n \n if($this->size == 1){\n return $collection[0];\n }\n \n return new Collection($collection);\n }",
"public static function fromArray(array $array)\n {\n return new static($array);\n }",
"protected function entityCreate(Array $data){\n // TODO: deal with errors\n // insert new items\n $inserted = $this->resourceService()->create($data);\n if(isset($inserted['message'])){\n \\Log::error(\"Error \".$inserted['status_code'].\": \".$inserted['message']);\n }\n // return item\n return new LaravelCollection($inserted['data']);\n }",
"public abstract function toArray($model);",
"public static function createFromArrayOfIds($tags)\n {\n return new self(\n Functional\\pluck($tags, \"id\"),\n null\n );\n }",
"public static function make($items)\n {\n if (is_null($items)) {\n return new static;\n }\n\n if ($items instanceof Collection) {\n return $items;\n }\n\n return new static(is_array($items) ? $items : [$items]);\n }",
"public static function createCollection(array $users)\n {\n $userResources = array();\n foreach ($users as $user) {\n $userResources[] = self::create($user);\n }\n\n return $userResources;\n }",
"public function transformCollection(array $items){\n return array_map([$this,'transform'], $items->toArray());\n }",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"protected function newCollection(array $data)\n {\n return new Collection($data);\n }",
"public function newCollection(array $rows = array())\n {\n return $this->object_factory->newCollection($rows);\n }"
] | [
"0.6637981",
"0.62146586",
"0.61324024",
"0.6120789",
"0.6120789",
"0.6099168",
"0.60229367",
"0.5988837",
"0.5981549",
"0.59146214",
"0.59094524",
"0.59094524",
"0.59094524",
"0.59057826",
"0.5883332",
"0.5875364",
"0.58474034",
"0.5805666",
"0.57589793",
"0.5745693",
"0.5725947",
"0.5641141",
"0.56363165",
"0.5609453",
"0.5575785",
"0.5570051",
"0.5552842",
"0.55486876",
"0.55486876",
"0.5543969",
"0.554223",
"0.5524393",
"0.5524393",
"0.55215937",
"0.5521035",
"0.55098695",
"0.5504804",
"0.54791284",
"0.5477918",
"0.54723495",
"0.5471724",
"0.54709864",
"0.5439843",
"0.5427505",
"0.5415175",
"0.5395711",
"0.5373727",
"0.5373727",
"0.5373727",
"0.5373727",
"0.5373727",
"0.5373214",
"0.53598607",
"0.535846",
"0.5352643",
"0.5351977",
"0.53473145",
"0.53435427",
"0.53398585",
"0.5337202",
"0.5336005",
"0.5327897",
"0.5318609",
"0.5315132",
"0.530747",
"0.53043175",
"0.5292993",
"0.5286785",
"0.528556",
"0.5283552",
"0.5281804",
"0.5263545",
"0.52601534",
"0.523887",
"0.5225786",
"0.5221129",
"0.5216299",
"0.52031684",
"0.5201527",
"0.5197528",
"0.5191987",
"0.51872015",
"0.5183114",
"0.5179222",
"0.51765174",
"0.5176189",
"0.5173883",
"0.5171088",
"0.5153089",
"0.5152582",
"0.5150731",
"0.5149353",
"0.5135944",
"0.5135944",
"0.5135944",
"0.5135944",
"0.5135944",
"0.5135944",
"0.5135067",
"0.5116141"
] | 0.57339096 | 20 |
Save a new model and return the instance. | public static function create(array $attributes = [])
{
$model = new static($attributes);
$model->save();
return $model;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save() {\r\n if ($this->model->getId()) {\r\n return $this->model->update();\r\n }\r\n return $this->create();\r\n }",
"public function store()\n {\n Log::debug(\"STORE MODEL: $this->request\");\n return $this->saveModel();\n }",
"public function save()\n {\n // that is already in this database using the current IDs in this \"where\"\n // clause to only update this model. Otherwise, we'll just insert them.\n if ($this->exists) {\n $saved = $this->newBuilder()->where('_id', $this->convertToMongoId($this->attributes['_id']))->update($this->attributes);\n }\n // If the model is brand new, we'll insert it into our database and set the\n // ID attribute on the model to the value of the newly inserted row's ID\n // which is typically an auto-increment value managed by the database.\n else {\n $saved = $this->newBuilder()->insert($this->attributes);\n }\n\n // TODO: fill() attributes will new or updated values.\n\n return $saved;\n }",
"protected function newModel(): Model\n {\n return (new $this->model)->fresh();\n }",
"public function save($model);",
"public function persist($model): Model\n {\n return $this->persistenceService->persist($model);\n }",
"public function save($model) {\n return parent::save($model);\n }",
"public function save() {\n\n $this->get(\"id\") ? $this->_update() : $this->_create();\n return $this;\n\n }",
"public function create()\n {\n return $this->modelManager->instance($this->model);\n }",
"public function save() {\n\n return isset($this->id) ? $this->update() : $this->create();\n }",
"abstract public function save(Model $model);",
"public function save() {\n if ($this->loaded) {\n return $this->update();\n }else{\n return $this->create();\n }\n }",
"public function save()\n {\n // If the model already exists in the database we can just update our record\n // that is already in this database using the current IDs in this \"where\"\n // clause to only update this model. Otherwise, we'll just insert them.\n if ($this->exists) {\n $saved = $this->isDirty() ? $this->performUpdate() : true;\n }\n\n // If the model is brand new, we'll insert it into our database and set the\n // ID attribute on the model to the value of the newly inserted row's ID\n // which is typically an auto-increment value managed by the database.\n else {\n $saved = $this->performInsert();\n }\n\n // If the model is successfully saved, we need to do a few more things once\n // that is done. We will call the \"saved\" method here to run any actions\n // we need to happen after a model gets successfully saved right here.\n if ($saved) {\n $this->syncOriginal();\n }\n\n return $saved;\n }",
"public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }",
"public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}",
"private function saveModel() {\n $this->model->name = $this->request->name;\n $this->model->layout_header_in_first_column = $this->request->layout_header_in_first_column;\n $this->model->save();\n\n $toSync = [];\n foreach ($this->request->labels as $sequence => $label) {\n $toSync[$label['parameterId']] = ['label' => $label['label'], 'sequence' => $sequence];\n }\n\n $this->model->parameters()->sync($toSync);\n\n return response(['message' => trans('strings.modelExportSuccess'), 'synced' => $toSync]);\n }",
"public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}",
"public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}",
"public function save()\n\t{\n\t\tself::$db->model = $this;\n\t\t$boolean = $this->validate();\n\t\tif($boolean){\n\t\t\treturn self::$db->saveNow();\n\t\t}\n\t}",
"public function saveAttributes(Model $model, Request $request): Model\n {\n return $model;\n }",
"private function persist(): static\n {\n if ($this->model == null) {\n $this->model = new $this->modelClass();\n $this->model->setUrl($this->url);\n $this->model->setElementsForParse($this->elementsForParse);\n $this->model->setRootIteratorElement($this->rootIteratorElement);\n $this->save();\n }\n return $this;\n }",
"public static function saved($model)\n {\n return new static([\n 'success' => true,\n 'model' => $model->toArray(),\n 'redirect' => $model->editUrl(),\n 'messages' => [$model::singular(true).\" Saved.\"],\n 'errors' => []\n ]);\n }",
"public function save() {\n return isset($this->id) ? $this->update() : $this->create();\n }",
"public function getModel()\n {\n $model = new $this->versionable_type();\n $model->unguard();\n $model->fill(unserialize($this->model_data));\n $model->exists = true;\n $model->reguard();\n return $model;\n }",
"protected function getModelInstance()\n {\n return new $this->model();\n }",
"public function save()\n\t{\n\t\t$this->validate();\n\n\t\t$values = $this->_get_save_values();\n\n\t\t// Create\n\t\tif ( ! $this->loaded())\n\t\t{\n\t\t\t// Perform the data layer update.\n\t\t\t$id = DORM::create($this)\n\t\t\t\t->set($values)\n\t\t\t\t->execute();\n\n\t\t\t// @todo: _id is mongo-specific\n\t\t\t$this->set(array('_id' => $id));\n\t\t}\n\n\t\t// Update\n\t\telse\n\t\t{\n\t\t\tDORM::update($this)\n\t\t\t\t->where('_id', '=', $this->id())\n\t\t\t\t->set($values)\n\t\t\t\t->execute();\n\t\t}\n\n\t\t// Reset changed values since last save.\n\t\t$this->_changed = array();\n\t\t$this->_changes = array();\n\n\t\treturn $this;\n\t}",
"public function save()\n\t{\n\n\t\t// ....\n\n\t\treturn $this;\n\t}",
"public function save()\n {\n if ($this->_id === false) {\n return $this->create();\n }\n\n return $this->set();\n }",
"abstract public function save(Model $model): Model;",
"public function save(Authenticatable $model);",
"public function saving($model)\n {\n }",
"public function save()\n {\n return $this->edit($this->id, $this->data);\n }",
"public function save()\n {\n if (!$this->isValid()) {\n throw new Cms_Model_Exception(\"This model has errors\");\n }\n\n $this->_saveBefore();\n\n $result = ($this->_isVirgin) ? $this->_create() : $this->_update();\n\n $this->_saveAfter($result);\n\n return $result;\n }",
"public function save() {\n\t\tif ( ! $this->dirty()) return true;\n\n\t\tif (static::$timestamps) {\n\t\t\t$this->timestamp();\n\t\t}\n\n\t\t$this->fire_event('saving');\n\n\t\t// If the model exists, we only need to update it in the database, and the update\n\t\t// will be considered successful if there is one affected row returned from the\n\t\t// fluent query instance. We'll set the where condition automatically.\n\t\tif ($this->exists) {\n\t\t\t$query = $this->query()->where(static::$key, '=', $this->get_key());\n\n\t\t\t$result = $query->update($this->get_dirty()) === 1;\n\n\t\t\tif ($result) $this->fire_event('updated');\n\t\t}\n\n\t\t// If the model does not exist, we will insert the record and retrieve the last\n\t\t// insert ID that is associated with the model. If the ID returned is numeric\n\t\t// then we can consider the insert successful.\n\t\telse {\n\t\t\t$id = $this->query()->insert_get_id($this->attributes, $this->key());\n\n\t\t\t$this->set_key($id);\n\n\t\t\t$this->exists = $result = is_numeric($this->get_key());\n\n\t\t\tif ($result) $this->fire_event('created');\n\t\t}\n\n\t\t// After the model has been \"saved\", we will set the original attributes to\n\t\t// match the current attributes so the model will not be viewed as being\n\t\t// dirty and subsequent calls won't hit the database.\n\t\t$this->original = $this->attributes;\n\n\t\tif ($result) {\n\t\t\t$this->fire_event('saved');\n\t\t}\n\n\t\treturn $result;\n\t}",
"function save(&$model);",
"public function create(Model $model);",
"public function save(Model $model)\n {\n return $model->save();\n }",
"function save(){\n if( !$this->validate() ){\n return false;\n }\n \n if($this->id){\n return $this->update();\n } else {\n return $this->create();\n }\n }",
"public function save()\n {\n $params = array_filter(array_merge($this->ids(), [$this]));\n\n if ($this->exists) {\n return $this->hydrate(\n $this->builder()->request($this->path, 'update', ...$params)\n );\n }\n\n return $this->hydrate(\n $this->builder()->request($this->path, 'create', ...$params)\n );\n }",
"protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }",
"protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\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 save(Model $model): void;",
"public function save(){\n $data = file_get_contents('php://input');\n //saving data and getting inserted id or the existing one\n $this->id = $this->_so->save($data);\n //returning saved object for frontend sync\n return $this->byId();\n }",
"protected function bindAndSave(&$model) {\n\t\t$model = $this->bind($model);\n\t\t$model->saveOrUpdate();\n\t\treturn $model;\n\t}",
"public function save() {\n if ($this->id) {\n return $this->update();\n } else {\n return $this->insert();\n }\n }",
"public function save( Application_Model_Interface $model );",
"public function create(): Model;",
"public function makeModel()\n {\n return $this->model;\n }",
"public function cloneAndPersist($model) : Model\n {\n return $this->persist($this->clone($model));\n }",
"public function getModel()\n {\n return new $this->model;\n }",
"public function save() {\n $class = get_called_class();\n return $class::$objects->save($this);\n }",
"public function getNewModel()\n { if (isset($this->oModel))\n {\n if (get_class($this->oModel) !== $this->modelClassName)\n {\n // yes we do\n $this->resetModel();\n\n }\n else\n {\n // no, we do not\n }\n }\n else\n {\n // we have no record instance - create one\n $this->resetModel();\n }\n\n return clone $this->oModel;\n }",
"public function save(){\r\n\t\tif ($this->new){\r\n\t\t\treturn $this->insert();\r\n\t\t} else {\r\n\t\t\treturn $this->update();\r\n\t\t}\r\n\t}",
"public function saving($model)\n\t{\n\t}",
"public function store(CreateModelAPIRequest $request)\n {\n $input = $request->all();\n\n $model = $this->modelRepository->create($input);\n\n return $this->sendResponse($model->toArray(), 'Model saved successfully');\n }",
"public function save()\n {\n if ($this->_checkRecordInstance())\n {\n $this->_entity->save();\n }\n return $this;\n }",
"public function getModel()\n {\n return $this->model->newInstance();\n }",
"public function saved($model)\n {\n }",
"public function store()\n\t{\n\t\t$instance = new static;\n\n\t\t$data = \\Input::all();\n\t\t$model = call_user_func($instance->model . '::create', $data);\n\t\t$json_error = ['message' => 'An error occured. Data was not stored'];\n\t\t\n\t\tif($model->save())\n\t\t{\n\t\t\treturn static::responseSuccess($model);\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\treturn Response::json($json_error);\n\t\t}\n\t}",
"public function saveModel() : int\n {\n return $this->save($this);\n }",
"public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}",
"public function store()\n {\n $this->initStaticModel();\n $this->setFormFields($this->getCreateFormFields());\n\n $data = $this->validateFormData();\n $data = $this->storeFiles($data);\n $data = $this->filterCreateData($data);\n\n $res = $this->createModel($data);\n\n return $this->sendCreateResponse($res);\n }",
"public function save() {\n return $this->{static::$primaryKey} === null? $this->create() : $this->update();\n }",
"public function store()\n\t{\n\t\t//get this model instance\n\t\t$modelInstance = $this->decorator->getModel()->newInstance();\n\t\t//Get this model validation\n\t\t$validation = $modelInstance->getValidator();\n\t\t//Get a post\n\t\t$input = Input::all();\n\n\t\t//If validation passes\n\t\tif ($validation->passesStore($input)) {\n\t\t\t//Fill this model\n\t\t\t$modelInstance->fill($input);\n\t\t\t//Save this model\n\t\t\t$modelInstance->save();\n\t\t\t//Redirect to this model @index\n\t\t\t$response = Redirect::action(get_class($this) . '@index');\n\t\t} else {\n\t\t\t//Redirect back to previous page with validation errors and input\n\t\t\t$response = Redirect::back()->withErrors($validation->getErrors())->withInput();\n\t\t}\n\n\t\treturn $response;\n\t}",
"protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function makeModel()\n {\n $model = $this->app->make($this->model());\n\n if (!$model instanceof Model)\n throw new RepositoryException(\"Class {$this->model()} must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n return $this->model = $model;\n }",
"public function save(): void\n {\n $this->em->persist($this->model);\n $this->em->flush();\n }",
"public function save()\n {\n if ($conn = $this->_getConnection()) {\n $data = $this->getData();\n unset($data['user']);\n if ($this->id) {\n $fields = array();\n foreach ($data as $_field => $_value) {\n $fields[] = \"`{$_field}`='{$_value}'\";\n }\n $sql = \"UPDATE `{$this->_dbTable}` SET \" . implode(\",\", $fields) . \" WHERE `id`={$this->id};\";\n } else {\n $sql = \"INSERT INTO `{$this->_dbTable}` (`\" . implode('`,`', array_keys($data)) . \"`)\n VALUES('\" . implode(\"','\", $data) . \"');\";\n }\n $result = $conn->query($sql);\n app::log(array($sql, $result, $conn->errno, $conn->error)); //!!!!\n if ($conn->errno) {\n app::log('Error saving model \"' . $this->_modelName . '\" into DB with ID=' . $this->id, app::LOG_LEVEL_ERROR . \"\\n{$conn->errno} - {$conn->error}\");\n }\n if (!$this->id) {\n $this->id = $conn->insert_id;\n }\n }\n app::log($this->_data); //!!!!\n return $this;\n }",
"public function save(Identifiable $model);",
"private function makeModel()\n {\n\n $this->model = $this->app->make($this->model());\n\n if (!$this->model instanceof Model)\n throw new Exception(\"Class \".$this->model.\" must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n\n return $this->model;\n }",
"public function store()\n {\n try {\n $model = $this->getModel();\n\n if (Gate::denies('create', $model->fill(Request::all()))) {\n return ApiResponse::respondForbidden();\n }\n\n if (!$model->validate(Request::all())) {\n return ApiResponse::respondValidationError($model->getValidationErrors());\n }\n\n if ($models = $model::create(Request::all())) {\n return ApiResponse::respond($models, 201);\n } else {\n return ApiResponse::respondBadRequest();\n }\n } catch (\\Exception $e) {\n return ApiResponse::respondInternalError(null, [$e->getMessage()]);\n }\n }",
"protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }",
"public function getModel()\n {\n $modelData = is_resource($this->model_data)\n ? stream_get_contents($this->model_data,-1,0)\n : $this->model_data;\n\n $className = self::getActualClassNameForMorph($this->versionable_type);\n $model = new $className();\n $model->unguard();\n $model->fill(unserialize($modelData));\n $model->exists = true;\n $model->reguard();\n return $model;\n }",
"public function storeModel(Model &$model)\n {\n }",
"public function createModel(PayModel $model);",
"public function makeModel() {\r\n $model = $this->app->make($this->model());\r\n\r\n if (!$model instanceof Model) {\r\n throw new RepositoryException(\"Class {$this->model()} must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\r\n }\r\n return $this->model = $model;\r\n }",
"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(PassiveRecord &$Model) {\n if (null !== $Model->{$Model->getPkey()}) {\n return $this->update($Model);\n }\n\n return $this->insert($Model);\n }",
"public function store()\n {\n $class = $this->model;\n\n $this->validate(request(), $this->getValidationRules());\n\n // Create\n $model = new $class($this->input);\n return $model->save()\n ? [\n 'success' => ucfirst($this->readableResourceType()) . ' created successfully.',\n 'model' => $model->toArray(),\n ]\n : ['error' => 'There was a problem saving the ' . $this->readableResourceType() . '.'];\n }",
"protected function getModel()\n {\n if (! $this->model) {\n $this->model = $this->createModel();\n\n $this->prepareModel($this->model);\n }\n\n return $this->model;\n }",
"public function createModel() {\n return null;\n }"
] | [
"0.79149723",
"0.7302606",
"0.6976441",
"0.69518477",
"0.68823975",
"0.68041086",
"0.67284393",
"0.66490966",
"0.6643495",
"0.661478",
"0.66018224",
"0.6598074",
"0.6595255",
"0.6593825",
"0.6568989",
"0.65638083",
"0.6550679",
"0.6550679",
"0.6549599",
"0.6533402",
"0.65293676",
"0.6523422",
"0.64867294",
"0.64846146",
"0.64663607",
"0.64561814",
"0.6422167",
"0.6394464",
"0.6391738",
"0.6385891",
"0.63802046",
"0.6374228",
"0.6366232",
"0.6350505",
"0.6329864",
"0.6327396",
"0.63204265",
"0.6315728",
"0.6311816",
"0.630527",
"0.6289486",
"0.6289163",
"0.62887114",
"0.6268768",
"0.6261529",
"0.62362397",
"0.62340134",
"0.6230174",
"0.6228891",
"0.6227957",
"0.62239194",
"0.6217706",
"0.62047786",
"0.62023234",
"0.62020016",
"0.6195969",
"0.6192684",
"0.61683404",
"0.6168309",
"0.6153606",
"0.61383545",
"0.61244845",
"0.6123416",
"0.6120434",
"0.609275",
"0.6083665",
"0.60749555",
"0.60749555",
"0.6074312",
"0.60708153",
"0.60641503",
"0.6063816",
"0.60614187",
"0.60613245",
"0.6057742",
"0.6049772",
"0.6043844",
"0.6023476",
"0.60185",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.6009322",
"0.60091513",
"0.59952664",
"0.59943837",
"0.599218"
] | 0.0 | -1 |
Begin querying the model. | public static function query()
{
return (new static)->newQuery();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function query()\n {\n }",
"public function query()\n {\n }",
"public static function query()\n {\n }",
"public function Query() {\n \n }",
"function begin() {\n\t\t\tself::$db->begin();\n\t\t\t$this->begin_executed = true;\n\t\t}",
"public function query()\n\t{\n\t\t\n\t}",
"public function _query()\n {\n }",
"public function query();",
"public function query();",
"public function query();",
"abstract public function query();",
"public function query() {\n\n }",
"public function query() {\n if (!empty($this->value)) {\n parent::query();\n }\n }",
"public function query() {\n // Leave empty to avoid a query on this field.\n }",
"public function Query(){\n\t}",
"public function Query(){\n\t}",
"public function Query(){\n\t}",
"function query() {\n }",
"function Borrow_model()\n\t{\n\t\tparent::Query();\n\t}",
"public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\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 }",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"abstract protected function initQuery(): void;",
"function query() {}",
"private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }",
"function query() {\n $this->add_additional_fields();\n }",
"public function all()\n {\n $sql = $this->get();\n $this->query = $sql;\n }",
"public function query() {\n\t\treturn Documents::instance()->query();\n\t}",
"public function doQuery() {\n // Selects all of ads' title and writer's name\n $queryString = \"SELECT title, name FROM advertisements INNER JOIN users ON users.id = advertisements.userid ORDER BY advertisements.id DESC\";\n\n $getAds = $this->sql->query($queryString);\n\n // Store the result array in the $data variable, which can be available by getData() later\n while($rows = $getAds->fetch_array(MYSQLI_ASSOC)) {\n array_push($this->data, $rows);\n }\n }",
"public function query()\n\t{\n\t\treturn false;\n\t}",
"protected function begin()\n\t{\n\t\t$this->beginTransaction();\n\t}",
"public static function query();",
"public function begin () {\n $this->connection->begin();\n $this->update_current_user_activity();\n }",
"public function query(QueryObject $query);",
"public function run()\n {\n DB::disableQueryLog();\n parent::run();\n }",
"public function first()\n {\n $sql = $this->get() . ' LIMIT 1';\n $this->query = $sql;\n }",
"protected function _begin() {\n $this->dataSource = $this->getDataSource();\n }",
"private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}",
"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 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 }",
"public function flushQuery();",
"public function start()\n {\n $model = $this->getModel();\n $model->started_at = date('Y-m-d H:i:s');\n $model->save(false);}",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function newModelQuery();",
"public function SearchRecord()\n {\n $this->UpdateActiveRecord(null);\n $this->m_QueryONRender = false;\n $this->SetDisplayMode(MODE_Q);\n return $this->ReRender(true,false);\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 }",
"protected function queryMore()\n {\n $result = $this->client->queryMore($this->queryResult->getQueryLocator());\n $this->setQueryResult($result);\n $this->rewind();\n }",
"function query() {\n // Don't filter if we're exposed and the checkbox isn't selected.\n\n if ((!empty($this->options['exposed'])) && empty($this->value)) {\n return;\n }\n if (!$this->options['exposed']) {\n $value = $this->options['uid'];\n }\n else {\n $value = $this->validated_exposed_input[0];\n }\n\n\n $this->ensure_my_table();\n\n\n $table = 'scheduling_appointments';\n //$field1 = $this->query->add_field($table, 'nid');\n //$field2 = $this->query->add_field($table, 'title');\n\n\n //$field1 = $table . '.nid';\n //$field2 = $table . '.title';\n if ($value != '') {\n $this->query->add_where(\n $this->options['group'],\n db_and()\n ->condition($table . '.uid', $value, '=')\n );\n }\n }",
"function query()\n\t{\n\t\treturn $this->query;\n\t}",
"public function Query(){\r\n\t\treturn self::get_query();\r\n\t}",
"public function search() {\n\t\t$data = $this->model->getSearchData($this->table->getFilterNames());\n\t\t$this->table->setData($data);\n\t\t// Store the user/object ids in the session so the report() can reuse them\n\t\t$this->storeIdsInSession($data);\n\t\t$this->tpl->setContent($this->table->getHTML());\n\t}",
"public function query()\n {\n $query = Fieldagent::query()->select($this->getColumns());\n\n return $this->applyScopes($query);\n }",
"public function query(ActionDataTable $model)\n {\n //return $model->newQuery();\n $data = Action::select();\n return $this->applyScopes($data);\n }",
"public function query() {\n if ($this->get_option('geocluster_enabled')) {\n if ($algorithm = geocluster_init_algorithm($this->config)) {\n $algorithm->pre_execute();\n }\n }\n }",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function perform()\n {\n $services = $this->getServiceLocator();\n $api = $services->get('Omeka\\ApiManager');\n $em = $services->get('Omeka\\EntityManager');\n $fulltext = $services->get('Omeka\\FulltextSearch');\n $adapters = $services->get('Omeka\\ApiAdapterManager');\n foreach ($adapters->getRegisteredNames() as $adapterName) {\n $adapter = $adapters->get($adapterName);\n if ($adapter instanceof FulltextSearchableInterface) {\n $page = 1;\n do {\n if ($this->shouldStop()) {\n return;\n }\n $response = $api->search(\n $adapter->getResourceName(),\n ['page' => $page, 'per_page' => 100],\n ['responseContent' => 'resource']\n );\n foreach ($response->getContent() as $resource) {\n $fulltext->save($resource, $adapter);\n }\n $em->clear(); // avoid a memory leak\n $page++;\n } while ($response->getContent());\n }\n }\n }",
"public function createQuery() {}",
"public function readAction() {\n\t\tif(getParam('id')){\n\t\t\t$model = new $this->model(intval(getParam('id')));\n\t\t\t$records = array(\n\t\t\t\t$this->formatRow($model->get())\n\t\t\t);\n\t\t\t$this->setParam('records', $records);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get submitted params\n\t\t$sortBy = getParam('sort', false);\n\t\t$filter = json_decode(getParam('filter', '{}'), true);\n\t\t\n\t\t// Setup the filtering and query variables\n\t\t$start = intval(getParam('start', 0));\n\t\t$limit = intval(getParam('limit', 0));\n\t\t\n\t\t//Fields to select\n\t\t$fields = $this->getFields();\n\t\t\n\t\t//From to use\n\t\t$from = $this->getFrom();\n\t\t\n\t\t//Join tables\n\t\t$join = $this->getJoin();\n\t\t\n\t\t//Base where clause\n\t\t$where = $this->getWhere();\n\t\t\n\t\t//Sort\n\t\t$sort = $this->getSort();\n\t\t\n\t\tif ($sortBy) {\n\t\t\t$sortArray = json_decode($sortBy, true);\n\t\t\t$numSorters = count($sortArray);\n\t\t\t$sort = array();\n\t\t\tfor ($i = 0; $i < $numSorters; $i++) {\n\t\t\t\t$sort[] = $sortArray[$i]['property'] . ' ' . $sortArray[$i]['direction'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Filter\n\t\t$where = array_merge($where, $this->applyFilter($filter));\n\t\t\n\n\t\t\n\t\t// convert query data to sql\n\t\t$fieldsSql = implode(',', $fields);\n\t\t$fromSql = ' FROM ' . implode(',', $from);\n\t\t$joinSql = implode(' ', $join);\n\t\t$whereSql = 'WHERE ' . implode(' AND ', $where);\n\t\tif (!count($where)) {\n\t\t\t$whereSql = '';\n\t\t}\n\t\t$sortSql = implode(',', $sort);\n\n\t\t// get total count\n\t\t$total = 0;\n\t\t$totalQuery = \"SELECT COUNT(*) total $fromSql $joinSql $whereSql\";\n\t\t$row = LP_Db::fetchRow($totalQuery);\n\t\tif ($row) {\n\t\t\t$total = $row['total'];\n\t\t}\n\t\t$this->setParam('total', $total);\n\t\t\n\t\t// get records\n\t\t$query = \"SELECT $fieldsSql $fromSql $joinSql $whereSql\";\n\t\t$this->setParam('query', $query);\n\t\tif($limit){\n\t\t\t$query = LP_Util::buildQuery($query, $sortSql, $limit, $start);\n\t\t}\n\t\t$rows = LP_Db::fetchAll($query);\n\t\t$numRows = count($rows);\n\t\t$records = array();\n\t\t\n\t\t//Format rows\n\t\tforeach ($rows as $row){\n\t\t\t$records[] = $this->formatRow($row);\n\t\t}\n\t\t\n\t\t$this->setParam('records', $records);\n\t}",
"private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }",
"public function begin() {\n\t\t$this->mPDO->beginTransaction();\n\t}",
"function run() {\n $this->model->run();\n }",
"public function query()\n {\n return $this->model\n ->newQuery()\n ->with(['translations'])\n ->orderBy('order_column')\n ->nonDraft();\n }",
"public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }",
"public function execute() {\n $this->query->filter($this->filter);\n $data = $this->query->execute();\n $results = $data['results'];\n\n if (!$results) {\n return;\n }\n\n return entity_load($this->EntityType, array_keys($results));\n }",
"public function preRetrieve();",
"private function loadFromStore() {\r\n \r\n /*\r\n * Request start time\r\n */\r\n $this->requestStartTime = microtime(true);\r\n \r\n /*\r\n * Clean search filters\r\n */\r\n $originalFilters = $this->defaultModel->getFiltersFromQuery($this->context->query);\r\n \r\n /*\r\n * Number of returned results is never greater than MAXIMUM_LIMIT\r\n */\r\n $limit = isset($originalFilters['count']) && is_numeric($originalFilters['count']) ? min($originalFilters['count'], isset($this->defaultModel->searchFilters['count']->maximumInclusive) ? $this->defaultModel->searchFilters['count']->maximumInclusive : 500) : $this->context->dbDriver->resultsPerPage;\r\n\r\n /*\r\n * Compute offset based on startPage or startIndex\r\n */\r\n $offset = $this->getOffset($originalFilters, $limit);\r\n \r\n /*\r\n * Query Analyzer \r\n */\r\n $analysis = $this->analyze($originalFilters);\r\n \r\n /*\r\n * Completely not understood query - return an empty result without\r\n * launching a search on the database\r\n */\r\n if (isset($analysis['notUnderstood'])) {\r\n $this->restoFeatures = array();\r\n $this->paging = $this->getPaging(array(\r\n 'total' => 0,\r\n 'isExact' => true\r\n ), $limit, $offset);\r\n }\r\n /*\r\n * Read features from database\r\n */ \r\n else {\r\n $this->loadFeatures($analysis['appliedFilters'], $limit, $offset);\r\n }\r\n \r\n /*\r\n * Set description\r\n */\r\n $this->setDescription($analysis, $offset, $limit);\r\n \r\n }",
"public function start() {\n\t\t$this->writeTitle();\n\t\t\n\t\t$this->showAllTable();\n\t\t\n\t\t$this->addEntityForm();\n\t}"
] | [
"0.6952657",
"0.6952657",
"0.66653293",
"0.6415399",
"0.6407923",
"0.64002293",
"0.63524437",
"0.6252773",
"0.6252773",
"0.6252773",
"0.61948395",
"0.61473244",
"0.6098904",
"0.6090589",
"0.60617495",
"0.60617495",
"0.60617495",
"0.6025989",
"0.60223746",
"0.5996114",
"0.5929678",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.5898314",
"0.58862436",
"0.5876729",
"0.5839703",
"0.5838972",
"0.582962",
"0.57912993",
"0.57866865",
"0.5780778",
"0.5770038",
"0.576903",
"0.5762883",
"0.57564485",
"0.5755845",
"0.5720688",
"0.5716347",
"0.5706524",
"0.5674159",
"0.567273",
"0.56653774",
"0.5655136",
"0.56408536",
"0.56408536",
"0.56408536",
"0.56408536",
"0.56408536",
"0.56408536",
"0.56408536",
"0.56408536",
"0.56408536",
"0.56231034",
"0.5617542",
"0.5613527",
"0.55831015",
"0.5569347",
"0.5569225",
"0.5555701",
"0.55553347",
"0.55280626",
"0.5501189",
"0.5499383",
"0.54977864",
"0.54977864",
"0.54977864",
"0.5495105",
"0.5494859",
"0.5482616",
"0.54718983",
"0.54595774",
"0.54579437",
"0.5455422",
"0.5444005",
"0.54351133",
"0.54321146",
"0.54309636",
"0.5406947"
] | 0.0 | -1 |
Begin querying the model on a given datasource. | public static function on($datasource = null)
{
// First we will just create a fresh instance of this model, and then we can
// set the datasource on the model so that it is be used for the queries.
$instance = new static;
$instance->setDatasource($datasource);
return $instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _begin() {\n $this->dataSource = $this->getDataSource();\n }",
"public function query()\n {\n }",
"public function query()\n {\n }",
"public static function query()\n {\n }",
"protected function _prepareDataSource()\n {\n $studentDbTable = new Admin_Db_Table_Student();\n $this->setDataSource($studentDbTable->dataGrid());\n }",
"protected function _prepareDataSource()\n {\n $studentDbTable = new Admin_Db_Table_Student();\n $this->setDataSource($studentDbTable->getByClasses(array($this->_options->classesId)));\n }",
"public function doLoad()\n {\n $this->DataSourceInstance->doLoad();\n }",
"public function dataBind(&$dataSource)\n {\n foreach ($this->onBeforeDataBindCallbacks as $callback)\n {\n call_user_func_array($callback, array(\n &$this,\n &$dataSource\n ));\n }\n \n if (ObjectIntrospector::isA($dataSource, 'IDataTableAdapter'))\n {\n // Filetering Manager = First WHERE clause \n $filterIndex = $this->state->getFilterExpressionIndex();\n if ($filterIndex >= 0)\n {\n $whereClauseItem = $this->filteringManager->getFilterExpressions()->getItem($filterIndex);\n $whereClause = $whereClauseItem->getValue();\n $dataSource->where($whereClause);\n }\n \n // Search Manager = Second WHERE clause\n if ($this->state->getSearchColumnName() != '~')\n {\n $searchOperator = $this->state->getSearchOperator();\n /**\n * @var BoundGridColumn\n */\n $column = $this->getColumn($this->state->getSearchColumnName());\n \n $column->getSearchDialog()->getArgumentControl()->setValue($this->state->getSearchArgument());\n $column->getSearchDialog()->getSearchOperatorsControl()->setValue($this->state->getSearchOperator());\n \n if ($column->getSearchDialog()->getArgumentAltControl() != null)\n {\n $column->getSearchDialog()->getArgumentAltControl()->setValue($this->state->getSearchArgumentAlt());\n }\n \n switch ($searchOperator)\n {\n case GridSearchDialogBase::OPER_LITERAL_CONTAINS:\n $dataSource->where($column->getSearchExpression() . \" LIKE '%\" . $this->state->getSearchArgument() . \"%'\");\n break;\n case GridSearchDialogBase::OPER_LITERAL_ENDSWITH:\n $dataSource->where($column->getSearchExpression() . \" LIKE '%\" . $this->state->getSearchArgument() . \"'\");\n break;\n case GridSearchDialogBase::OPER_LITERAL_EQUALS:\n $dataSource->where($column->getSearchExpression() . \" LIKE '\" . $this->state->getSearchArgument() . \"'\");\n break;\n case GridSearchDialogBase::OPER_LITERAL_STARTSWITH:\n $dataSource->where($column->getSearchExpression() . \" LIKE '\" . $this->state->getSearchArgument() . \"%'\");\n break;\n case GridSearchDialogBase::OPER_LOGICAL_BETWEEN:\n $dataSource->where($column->getSearchExpression() . \" BETWEEN \" . $this->state->getSearchArgument() . \" AND \" . $this->state->getSearchArgumentAlt());\n break;\n case GridSearchDialogBase::OPER_LOGICAL_GT:\n $dataSource->where($column->getSearchExpression() . \" > '\" . $this->state->getSearchArgument() . \"'\");\n break;\n case GridSearchDialogBase::OPER_LOGICAL_LT:\n $dataSource->where($column->getSearchExpression() . \" < '\" . $this->state->getSearchArgument() . \"'\");\n break;\n case GridSearchDialogBase::OPER_LOGIGAL_EQUALS:\n $dataSource->where($column->getSearchExpression() . \" = '\" . $this->state->getSearchArgument() . \"'\");\n break;\n case GridSearchDialogBase::OPER_NONE:\n break;\n default:\n break;\n }\n }\n \n // Paging\n if ($this->isPaged === true)\n {\n if ($this->state->getTotalRecordCount() === -1)\n {\n $countSource = clone $dataSource;\n $recordCount = $countSource->count();\n $this->state->setTotalRecordCount($recordCount);\n $pageCount = intval(ceil($recordCount / $this->pageSize));\n $this->state->setPageCount($pageCount);\n \n if ($this->state->getPageIndex() > 0 && $this->state->getPageIndex() >= $this->state->getPageCount())\n {\n $this->state->setPageIndex($this->state->getPageCount() - 1);\n }\n }\n \n $dataSource->take($this->pageSize)->skip($this->state->getPageIndex() * $this->pageSize);\n }\n \n // Grouping columns = order-by arguments\n \n /**\n * @var array\n */\n $groupingColumnNames = $this->getChildren()->getTypedControlNames(true, 'GroupingColumn');\n \n if (count($groupingColumnNames > 0))\n {\n foreach ($groupingColumnNames as $colName)\n {\n /**\n * @var GroupingColumn\n */\n $groupingCol = $this->getColumn($colName);\n if ($groupingCol->getVisible() !== true)\n continue;\n \n if ($groupingCol->getSortMode() == GridState::GRID_SORT_ASCENDING)\n {\n $dataSource->orderBy($groupingCol->getSortExpression());\n }\n else\n {\n $dataSource->orderByDescending($groupingCol->getSortExpression());\n }\n }\n }\n \n // Column Sorting Manager\n if ($this->state->getSortColumnName() != '~')\n {\n $column = $this->getColumn($this->state->getSortColumnName(), true);\n if ($this->state->getSortDirection() == GridState::GRID_SORT_ASCENDING)\n {\n $dataSource->orderBy($column->getSortExpression());\n }\n else\n {\n $dataSource->orderByDescending($column->getSortExpression());\n }\n }\n // Default the sorting to the first bound column column\n else\n {\n if ($this->getIsPaged() === true)\n {\n $foundDefaultSortingColumn = false;\n $boundGridColNames = $this->getChildren()->getTypedControlNames(true, 'BoundGridColumnBase');\n foreach ($boundGridColNames as $colName)\n {\n $column = $this->getColumn($colName);\n if ($column->getIsSortable() === true)\n {\n $foundDefaultSortingColumn = true;\n $dataSource->orderBy($column->getSortExpression());\n $this->state->setSortColumnName($colName);\n $this->state->setSortDirection(GridState::GRID_SORT_ASCENDING);\n break;\n }\n }\n \n if ($foundDefaultSortingColumn !== true)\n throw new SystemException(SystemException::EX_INVALIDMETHODCALL, 'The paging feature requires at least one sortable BoundGridColumn.');\n }\n }\n \n $rows = $dataSource->selectNew()->getArrayReference();\n $this->dataItems->addRange($rows);\n }\n else\n {\n foreach ($dataSource as $item)\n {\n $obj = $item->toStdClass();\n $this->dataItems->addItem($obj);\n }\n \n $this->state->setTotalRecordCount($dataSource->getCount());\n }\n \n foreach ($this->onAfterDataBindCallbacks as $callback)\n {\n call_user_func_array($callback, array(\n &$this,\n &$dataSource\n ));\n }\n }",
"function getDataSource() {return $this->_datasource;}",
"function getDataSource() { return $this->_datasource; }",
"function query() {}",
"function query() {\n }",
"abstract protected function initQuery(): void;",
"public function query()\n\t{\n\t\t\n\t}",
"public function query();",
"public function query();",
"public function query();",
"public function setDatasource($datasource)\n {\n $this->datasource = $datasource;\n }",
"abstract public function query();",
"public function dataBind(&$dataSource);",
"public function run()\n {\n DB::disableQueryLog();\n parent::run();\n }",
"function doQuery(&$sql,$dsn=\"default\") {\n\t\t//use this tableName\n\t\t$db = DB::getHandle($dsn);\n\n\t\t$db->query($sql);\n\n\t \treturn;\n\t}",
"function doQuery(&$sql,$dsn=\"default\") {\n\t\t//use this tableName\n\t\t$db = DB::getHandle($dsn);\n\n\t\t$db->query($sql);\n\n\t \treturn;\n\t}",
"public function _query()\n {\n }",
"function begin() {\n\t\t\tself::$db->begin();\n\t\t\t$this->begin_executed = true;\n\t\t}",
"public function query(QueryObject $query);",
"private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }",
"abstract public function filter(Builder $dataSource);",
"public function query() {\n\n }",
"public function source($source)\n {\n $this->query = $source;\n }",
"public function Query() {\n \n }",
"private function detectDataSource()\n {\n $key = $this->config['datasource']['key'];\n $this->log(\"Detecting if there's a data source with key {$key}\");\n $this->dataSource = DataSource::where('key', $key)->get()->first();\n if (!$this->dataSource) {\n $this->info(\"No data source found. Proceeding to automatically create a data source\");\n $this->createDataSource();\n }\n\n $this->info(\"Importing to Data source {$this->dataSource->title}({$this->dataSource->data_source_id})...\");\n }",
"public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }",
"private function loadFromStore() {\r\n \r\n /*\r\n * Request start time\r\n */\r\n $this->requestStartTime = microtime(true);\r\n \r\n /*\r\n * Clean search filters\r\n */\r\n $originalFilters = $this->defaultModel->getFiltersFromQuery($this->context->query);\r\n \r\n /*\r\n * Number of returned results is never greater than MAXIMUM_LIMIT\r\n */\r\n $limit = isset($originalFilters['count']) && is_numeric($originalFilters['count']) ? min($originalFilters['count'], isset($this->defaultModel->searchFilters['count']->maximumInclusive) ? $this->defaultModel->searchFilters['count']->maximumInclusive : 500) : $this->context->dbDriver->resultsPerPage;\r\n\r\n /*\r\n * Compute offset based on startPage or startIndex\r\n */\r\n $offset = $this->getOffset($originalFilters, $limit);\r\n \r\n /*\r\n * Query Analyzer \r\n */\r\n $analysis = $this->analyze($originalFilters);\r\n \r\n /*\r\n * Completely not understood query - return an empty result without\r\n * launching a search on the database\r\n */\r\n if (isset($analysis['notUnderstood'])) {\r\n $this->restoFeatures = array();\r\n $this->paging = $this->getPaging(array(\r\n 'total' => 0,\r\n 'isExact' => true\r\n ), $limit, $offset);\r\n }\r\n /*\r\n * Read features from database\r\n */ \r\n else {\r\n $this->loadFeatures($analysis['appliedFilters'], $limit, $offset);\r\n }\r\n \r\n /*\r\n * Set description\r\n */\r\n $this->setDescription($analysis, $offset, $limit);\r\n \r\n }",
"public static function query();",
"function readDataSource() {return $this->_datasource;}",
"public function query() {\n if ($this->get_option('geocluster_enabled')) {\n if ($algorithm = geocluster_init_algorithm($this->config)) {\n $algorithm->pre_execute();\n }\n }\n }",
"public function query()\n {\n $args = func_get_args();\n\n $this->connect(atkDb::getQueryMode($args[0]));\n\n return call_user_method_array('query',$this->m_current_clusternode, $args);\n }",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function queryAll();",
"public function query(ActionDataTable $model)\n {\n //return $model->newQuery();\n $data = Action::select();\n return $this->applyScopes($data);\n }",
"public function search() {\n\t\t$data = $this->model->getSearchData($this->table->getFilterNames());\n\t\t$this->table->setData($data);\n\t\t// Store the user/object ids in the session so the report() can reuse them\n\t\t$this->storeIdsInSession($data);\n\t\t$this->tpl->setContent($this->table->getHTML());\n\t}",
"public function fetchDataTableSource()\n { \n $dataTableConfig = [\n 'searchable' => [\n 'title' \n ]\n ];\n\n return SpecificationPreset::with([\n 'presetItem' => function($query) {\n $query->with('specification');\n }\n ])->dataTables($dataTableConfig)->toArray();\n }",
"function Borrow_model()\n\t{\n\t\tparent::Query();\n\t}",
"public function is_main_query()\n {\n }",
"function setSource($source){\n if($this->memorize){\n if (isset($_GET[$this->skip_var])){\n $this->skip=$this->memorize('skip', (int)$_GET[$this->skip_var]);\n } else {\n $this->skip=(int)$this->recall('skip');\n }\n }else{\n $this->skip=@$_GET[$this->skip_var]+0;\n }\n\n // Start iterating early ($source = DSQL of model)\n if($source instanceof SQL_Model){\n $source = $source->_preexec();\n }\n\n if($source instanceof DB_dsql){\n $source->limit($this->ipp, $this->skip);\n $source->calcFoundRows();\n $this->source = $source;\n\n }elseif($source instanceof Model){\n $this->source = $source->setLimit($this->ipp,$this->skip);\n\n }else{\n // NOTE: no limiting enabled for unknown data source\n $this->source =& $source;\n }\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function doQuery() {\n // Selects all of ads' title and writer's name\n $queryString = \"SELECT title, name FROM advertisements INNER JOIN users ON users.id = advertisements.userid ORDER BY advertisements.id DESC\";\n\n $getAds = $this->sql->query($queryString);\n\n // Store the result array in the $data variable, which can be available by getData() later\n while($rows = $getAds->fetch_array(MYSQLI_ASSOC)) {\n array_push($this->data, $rows);\n }\n }",
"public function preRetrieve();",
"protected function _useSourceDatasource() {\n\n // Instantiate source datasource if it's not already instantiated\n if (is_null($this->_externalNewsSourceDatasource)) {\n $this->_externalNewsSourceDatasource = new Datasource_Cms_ExternalNews_Source();\n }\n }",
"public function Query(){\n\t}",
"public function Query(){\n\t}",
"public function Query(){\n\t}",
"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 query()\n\t{\n\t\treturn false;\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 }",
"public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }",
"public function query() {\n // Leave empty to avoid a query on this field.\n }",
"public function readAction() {\n\t\tif(getParam('id')){\n\t\t\t$model = new $this->model(intval(getParam('id')));\n\t\t\t$records = array(\n\t\t\t\t$this->formatRow($model->get())\n\t\t\t);\n\t\t\t$this->setParam('records', $records);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get submitted params\n\t\t$sortBy = getParam('sort', false);\n\t\t$filter = json_decode(getParam('filter', '{}'), true);\n\t\t\n\t\t// Setup the filtering and query variables\n\t\t$start = intval(getParam('start', 0));\n\t\t$limit = intval(getParam('limit', 0));\n\t\t\n\t\t//Fields to select\n\t\t$fields = $this->getFields();\n\t\t\n\t\t//From to use\n\t\t$from = $this->getFrom();\n\t\t\n\t\t//Join tables\n\t\t$join = $this->getJoin();\n\t\t\n\t\t//Base where clause\n\t\t$where = $this->getWhere();\n\t\t\n\t\t//Sort\n\t\t$sort = $this->getSort();\n\t\t\n\t\tif ($sortBy) {\n\t\t\t$sortArray = json_decode($sortBy, true);\n\t\t\t$numSorters = count($sortArray);\n\t\t\t$sort = array();\n\t\t\tfor ($i = 0; $i < $numSorters; $i++) {\n\t\t\t\t$sort[] = $sortArray[$i]['property'] . ' ' . $sortArray[$i]['direction'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Filter\n\t\t$where = array_merge($where, $this->applyFilter($filter));\n\t\t\n\n\t\t\n\t\t// convert query data to sql\n\t\t$fieldsSql = implode(',', $fields);\n\t\t$fromSql = ' FROM ' . implode(',', $from);\n\t\t$joinSql = implode(' ', $join);\n\t\t$whereSql = 'WHERE ' . implode(' AND ', $where);\n\t\tif (!count($where)) {\n\t\t\t$whereSql = '';\n\t\t}\n\t\t$sortSql = implode(',', $sort);\n\n\t\t// get total count\n\t\t$total = 0;\n\t\t$totalQuery = \"SELECT COUNT(*) total $fromSql $joinSql $whereSql\";\n\t\t$row = LP_Db::fetchRow($totalQuery);\n\t\tif ($row) {\n\t\t\t$total = $row['total'];\n\t\t}\n\t\t$this->setParam('total', $total);\n\t\t\n\t\t// get records\n\t\t$query = \"SELECT $fieldsSql $fromSql $joinSql $whereSql\";\n\t\t$this->setParam('query', $query);\n\t\tif($limit){\n\t\t\t$query = LP_Util::buildQuery($query, $sortSql, $limit, $start);\n\t\t}\n\t\t$rows = LP_Db::fetchAll($query);\n\t\t$numRows = count($rows);\n\t\t$records = array();\n\t\t\n\t\t//Format rows\n\t\tforeach ($rows as $row){\n\t\t\t$records[] = $this->formatRow($row);\n\t\t}\n\t\t\n\t\t$this->setParam('records', $records);\n\t}",
"public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }",
"protected function validateSourceData() {\n if (empty($this->query) || !$this->query instanceof ActiveQuery) {\n throw new InvalidConfigException(\n \"The 'query' property must be defined and must be an instance of '\" . ActiveQuery::className() . \"'.\"\n );\n }\n $class = isset($this->query->modelClass) ? $this->query->modelClass : null;\n if (empty($class) || !is_subclass_of($class, ActiveRecord::className())) {\n throw new InvalidConfigException(\"The 'query' must be implemented using 'ActiveRecord::find()' method.\");\n }\n// $trait = 'kartik\\tree\\models\\TreeTrait';\n// if (!self::usesTrait($class, $trait)) {\n// throw new InvalidConfigException(\n// \"The model class '{$class}' for the 'query' must use the trait '{$trait}' or extend from '\" .\n// Tree::className() . \"''.\"\n// );\n// }\n }",
"public function triggerBeforeFind()\n {\n if (!$this->_beforeFindFired && $this->clause('action') === self::ACTION_READ) {\n /** @var \\Muffin\\Webservice\\Model\\Endpoint $endpoint */\n $endpoint = $this->getRepository();\n $this->_beforeFindFired = true;\n $endpoint->dispatchEvent('Model.beforeFind', [\n $this,\n new ArrayObject($this->_options),\n !$this->isEagerLoaded(),\n ]);\n }\n }",
"function query() {\n // Don't filter if we're exposed and the checkbox isn't selected.\n\n if ((!empty($this->options['exposed'])) && empty($this->value)) {\n return;\n }\n if (!$this->options['exposed']) {\n $value = $this->options['uid'];\n }\n else {\n $value = $this->validated_exposed_input[0];\n }\n\n\n $this->ensure_my_table();\n\n\n $table = 'scheduling_appointments';\n //$field1 = $this->query->add_field($table, 'nid');\n //$field2 = $this->query->add_field($table, 'title');\n\n\n //$field1 = $table . '.nid';\n //$field2 = $table . '.title';\n if ($value != '') {\n $this->query->add_where(\n $this->options['group'],\n db_and()\n ->condition($table . '.uid', $value, '=')\n );\n }\n }",
"protected function begin()\n\t{\n\t\t$this->beginTransaction();\n\t}",
"public function applyFilter($dataSource)\r\n\t{\r\n\t\t$where = $this->filterWhere($dataSource);\r\n\t\tif ($where) {\r\n\t\t\t$dataSource->andWhere($where);\r\n\t\t}\r\n\t}",
"public function preExecute(SelectInterface $query = NULL);",
"public function initQuickSearch()\r\n {\r\n $quickSearchValue = $this->getParamAdapter()->getQuickSearch();\r\n $quickSearchQuery = new \\Zend\\Db\\Sql\\Select();\r\n\r\n if (strlen($quickSearchValue)) {\r\n //Unsecure query (without quote)\r\n $quickSearchQuery->where('name like \"%' . $quickSearchValue . '%\"');\r\n $this->getSource()->setQuickSearchQuery($quickSearchQuery);\r\n }\r\n }",
"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}",
"abstract public function\r\n\t\tget_query_for_something();",
"public static function query()\n {\n QueryBuilder::$dataSource = true;\n\n return new QueryBuilder();\n }",
"public function query(IQuery $query);",
"public function fetchData()\r\n {\r\n $this->objectcount = $this->search_obj->getObjectQueryCount($this->extra);\r\n }",
"public function getQueryDataProvider() {}",
"public function query() {\n if (!empty($this->value)) {\n parent::query();\n }\n }",
"abstract public function filterWhere(Builder $dataSource);",
"public function query_start($query)\n {\n if (($this->mode > 0) and (!$this->sql_query_running)) {\n $this->sql_query_running = true;\n $this->sql_query_start = microtime(true);\n $this->sql_query_string = $query;\n }\n }",
"public function queryAction()\n {\n $this->logger = Zend_Registry::get('logger');\n $this->getHelper('ViewRenderer')->setNoRender('false');\n $this->_helper->layout()->disableLayout();\n try {\n if ($this->getRequest()->isPost()) {\n $this->logger->log('Post Parameters Received', Zend_Log::INFO,\n 'PASS');\n $data = $this->getRequest()->getPost();\n if (! $data['complain_type'] || ! $data['district_id'] || ! $data['date']) {\n throw new Exception('Bad Parameters', '400');\n }\n $model = new Model_DbTable_Complain();\n $response = $model->getComplainsByCondition($data);\n if ($response) {\n $this->getResponse()->setHttpResponseCode(200);\n $this->logger->log('Succesful QueryPerformed', Zend_Log::INFO,\n 'SUCCESS');\n $xml = $model->xmlConverter($response);\n print $xml;\n } else {\n throw new Exception('Service Unavailable', '503');\n }\n } else {\n throw new Exception('Bad Parameters', '400');\n }\n } catch (Exception $e) {\n $this->getResponse()->setHttpResponseCode($e->getCode());\n if ($e->getCode() == 503) {\n $this->logger->log($e->getMessage(), Zend_Log::WARN,\n 'SYSTEM ERROR');\n } else {\n $this->logger->log($e->getMessage(), Zend_Log::ERR, 'QUERY: ERROR');\n }\n $this->_response->setHttpResponseCode($e->getCode()); \n print 0;\n }\n }"
] | [
"0.62705046",
"0.57180166",
"0.57180166",
"0.55329007",
"0.54861385",
"0.5434531",
"0.5391682",
"0.5382354",
"0.5382226",
"0.5377971",
"0.5340848",
"0.5328232",
"0.53251165",
"0.5315929",
"0.53053886",
"0.53053886",
"0.53053886",
"0.5304093",
"0.5261137",
"0.5259548",
"0.52526325",
"0.52264553",
"0.52264553",
"0.52163976",
"0.51810026",
"0.5168593",
"0.51175654",
"0.51160735",
"0.51144135",
"0.5089609",
"0.5045547",
"0.50431573",
"0.5027093",
"0.50125754",
"0.50101894",
"0.50077736",
"0.49965975",
"0.4961625",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49511048",
"0.49340245",
"0.493052",
"0.49292445",
"0.49079302",
"0.48906362",
"0.48890468",
"0.4882462",
"0.4882462",
"0.48721898",
"0.48694158",
"0.4867207",
"0.48643196",
"0.48643196",
"0.48643196",
"0.4821257",
"0.4820442",
"0.48097646",
"0.4805755",
"0.47896552",
"0.47868875",
"0.47722504",
"0.47712928",
"0.4752812",
"0.473068",
"0.4726058",
"0.47201112",
"0.46952584",
"0.46869892",
"0.46779022",
"0.46740103",
"0.4672199",
"0.46642604",
"0.46603307",
"0.4656379",
"0.46536663",
"0.46517336",
"0.46509385",
"0.46508667"
] | 0.0 | -1 |
Get all of the models from the datasource. | public static function all()
{
$instance = new static;
return $instance->newQuery()->get();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModels();",
"public function getModels();",
"public function all()\n {\n return $this->model->get();\n }",
"private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }",
"public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }",
"public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }",
"public function GetAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }",
"public function findAll()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function findAll()\n {\n return $this->driver->findAll($this->model);\n }",
"public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }",
"public function getAll()\n {\n return $this->prepareData($this->model->all());\n }",
"public function all()\n {\n return $this->getModel()->all();\n }",
"public function getAll()\n {\n return $this->findAll();\n }",
"private function getAllFromDatabase()\n {\n if ($this->config()->get('use_database')) {\n return $this->model->all();\n } else {\n return collect([]);\n }\n }",
"public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function getAll(): Collection\n {\n return $this->model->all();\n }",
"public function getAll()\r\n\t{\r\n\t\treturn $this->findAll();\r\n\t}",
"public function getModels()\n {\n return $this->_models;\n }",
"public function getAll()\n {\n return $this->model->orderBy('id', 'DESC')->get();\n }",
"public function all()\n {\n return Model::all();\n }",
"public function all()\n {\n return Model::all();\n }",
"public function all()\n\t{\n\t\treturn $this->model->all();\n\t}",
"public function getAll()\n {\n return $this->wrapper(\n $this->model->getAll()\n );\n }",
"public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}",
"public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }",
"public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }",
"public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }",
"public function retrieve()\n {\n return $this->getRepository()->findAll();\n }",
"public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}",
"public function all()\n {\n return $this->repository->findAll();\n }",
"public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }",
"public function fetchAll() {\r\n\t\treturn $this->getMapper()->fetchAll();\r\n\t\t\r\n\t}",
"public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}",
"public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }",
"public function getAll()\n {\n $sql = \"SELECT * FROM \".$this->table;\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_OBJ);\n \n }",
"public function fetchAll(){\n\t\treturn $this->instance->fetchAll();\n\t}",
"public function getAll()\n {\n return $this->get();\n }",
"public function fetchAll()\n {\n $products = product::with('brand')->paginate(8);\n return productResource::collection($products);\n }",
"public static function findAll(){\n \t$data = self::all();\n \treturn $data;\n }",
"public static function findAll(){\n \t$data = self::all();\n \treturn $data;\n }",
"public static function findAll(){\n \t$data = self::all();\n \treturn $data;\n }",
"public function get_all()\n {\n return $this->findAll();\n // return $this->db->table('settings')->get();\n // return $this->builder->get();\n }",
"public function getAll()\n {\n return $this->query()->get();\n }",
"public function getAll()\n {\n return $this->query()->get();\n }",
"private static function _loadModels(){\n if (self::$_models == null){\n $sql = 'SELECT id, uuid, name, description, version_id, created FROM v_model WHERE 1';\n $models = Mysql::query($sql);\n if ($models){\n $_models = array();\n foreach($models as $model){\n $sql = \"SELECT id, model_id, uuid, name, description, type, list, instance_model_id, version_id, created FROM v_property WHERE model_id = '{$model->id}'\";\n $properties = Mysql::query($sql);\n if ($properties){\n $model->properties = $properties;\n $_models[] = $model;\n }\n }\n self::$_models = $_models;\n }\n }\n }",
"public function all(): Collection\n {\n return $this->model->all();\n }",
"public function getAll()\n\t{\n\t\treturn $this->getMyRepository()->findAll();\n\t}",
"public function getAll()\n {\n if (!isset($this->data)) {\n $this->init();\n }\n\n return $this->data;\n }",
"public function fetchRecords() {\n return self::all();\n }",
"public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }",
"public function get()\n {\n return self::fetchAll();\n }",
"public function getAll()\r\n {\r\n $data = $this->select()\r\n ->from($this->_name);\r\n return $this->fetchAll($data);\r\n }",
"public static function all() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$liste = db::findAll(db::table($table));\n\t\treturn $liste;\n\t}",
"public static function getAll()\n\t{\n\t\treturn self::find()->asArray()->all();\n\t}",
"private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}",
"public function findAll($model);",
"public function getAll()\n {\n $model = new static::$model;\n\n $per_page = request('per_page');\n $query = $model::with($model::$localWith);\n $this->qualifyCollectionQuery($query);\n\n // Handle pagination, if applicable\n if( $per_page ) $model->setPerPage($per_page);\n\n $perPage = $model->getPerPage();\n if ($perPage) {\n $paginator = $query->paginate($perPage);\n return $this->response->paginator($paginator, $this->getTransformer());\n } else {\n $resources = $query->get();\n\n return $this->response->collection($resources, $this->getTransformer());\n }\n }",
"public function getAll()\n {\n $records = $this->getRecordsModel()->getAll();\n \n return $records;\n }",
"public function findAll()\n {\n return $this->find([], ['name' => 'ASC']);\n }",
"public static function findAll()\n {\n $model = new static();\n $fetchResult = Db::getInstance()->fetchAll($model->getTableName());\n if (!$fetchResult) {\n return null;\n }\n $arrayOfObjects = [];\n foreach ($fetchResult as $objectState) {\n $object = new static();\n $object->initStateFromArray($objectState);\n $arrayOfObjects[] = $object;\n }\n\n return $arrayOfObjects;\n }",
"public function all() {\n return $this->model->orderBy('created_at', 'ASC')->get();\n }",
"public function all()\n {\n $sql = \"SELECT * FROM {$this->table()}\";\n return $this->db->query($sql)->fetchAll();\n }",
"public function getAll()\n {\n return $this->data;\n }",
"public function getAll()\n {\n return $this->data;\n }",
"public final function get_all()\n {\n }",
"public function getAll()\n {\n $sql = \"SELECT * FROM $this->table\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll();\n }",
"public function findAll()\n {\n return $this->findBy(array());\n }",
"public function findAll()\n {\n return $this->getEntityRepository()->findAll();\n }",
"public function getAll()\n\t{\n\t\treturn $this->data;\n\t}",
"public function findAll() {\n }",
"public function index()\n {\n return $this->model->all();\n }",
"public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }",
"public static function findAll()\n\t\t{\n\t\t\t$tb = self::get('tabla') ;\n\t\t\t\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb ;\")\n\t\t\t\t\t->getObjects(get_called_class()) ;\n\t\t}",
"public function getList()\n {\n return $this->model->getList();\n }",
"public function index()\n {\n return $this->model->getAll();\n }",
"public function get(){\n\n if(is_null($this->columns)) $this->columns = ['*'];\n $select_statement = $this->grammer->compileSelect($this);\n \n \n $result = $this->connection->get($select_statement); \n \n if(!empty($this->model)){\n \n return $this->return_results_objects($result);\n\n }else{\n \n return $this->return_result_as_array($result);\n }\n \n }",
"public function getAll() {\n return $this->data;\n }",
"public function getAll(){\n $adapter = $this->createAdapter();\n $results = $adapter->query($this->getSelectStatement());\n return $results;\n $adapter = null;\n }",
"public function getAll() {\n\t\treturn $this->data;\n\t}",
"public function getAll()\n {\n return $this->findAllByAttributes();\n }",
"public function findAll()\n\t{\n\t\t$aTableSource = array_merge($this->_acceptedFields, $this->_cascadeFields);\n\t\t\n\t\t$aTables\t= $this->extractTables($aTableSource);\n\t\t$sSelect\t= implode(', ', $this->_acceptedFields);\n\t\t$sWhere \t= $this->compileClauseStrings($this->_cascadeFields);\n\t\t\n\t\t$this->_adapter->select($aTables, $sWhere, $sSelect);\n\t\t\n\t\t$collection = $this->buildCollection();\n\t\t\n\t\twhile($data = $this->_adapter->fetch())\n\t\t{\n\t\t\t$collection->add(null, $this->buildEntity($data));\n\t\t}\n\t\t\n\t\treturn $collection;\n\t}",
"public function findAll() {\n\t\treturn $this->createQuery()->execute();\n\t}",
"public function findAll()\n {\n $this->ensureIsConfigured();\n $classname = $this->getRecordClassname();\n return $classname::find();\n }",
"public function getReturnModels(){\r\n return array_values($this->models);\r\n }",
"public function fetchAll();"
] | [
"0.7429063",
"0.7429063",
"0.73888606",
"0.73372847",
"0.728668",
"0.72763205",
"0.72763205",
"0.7238573",
"0.71929073",
"0.71878695",
"0.7182593",
"0.7147522",
"0.7147522",
"0.7147522",
"0.7116513",
"0.70011634",
"0.6961512",
"0.6951955",
"0.68648547",
"0.68562293",
"0.68237484",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6801439",
"0.6787675",
"0.6778466",
"0.6766671",
"0.6763159",
"0.67257696",
"0.67257696",
"0.67207694",
"0.67191637",
"0.6714238",
"0.6689132",
"0.66648674",
"0.66567487",
"0.6639762",
"0.66353476",
"0.6608311",
"0.6604541",
"0.66031057",
"0.6596922",
"0.65568256",
"0.65466344",
"0.65386593",
"0.6534273",
"0.6525463",
"0.652209",
"0.652209",
"0.652209",
"0.650851",
"0.6499177",
"0.6499177",
"0.6490885",
"0.6490808",
"0.64890534",
"0.64699155",
"0.64688736",
"0.64560246",
"0.6437196",
"0.6435357",
"0.6434721",
"0.64151657",
"0.6393151",
"0.63842523",
"0.6375089",
"0.6373494",
"0.6365111",
"0.6363852",
"0.63584125",
"0.63521564",
"0.6343962",
"0.6343962",
"0.6343932",
"0.63391674",
"0.6336777",
"0.63343495",
"0.6327287",
"0.6325194",
"0.6324159",
"0.6323369",
"0.63222975",
"0.6313675",
"0.6312205",
"0.63097394",
"0.63080615",
"0.6302695",
"0.6296949",
"0.62924004",
"0.62869084",
"0.62829685",
"0.62827086",
"0.62814355",
"0.62710506"
] | 0.0 | -1 |
Determine if the given attribute may be mass assigned. | public function isFillable($key)
{
// File name is always treated as a fillable attribute.
if ($key === 'fileName') {
return true;
}
// If the key is in the "fillable" array, we can of course assume that it's
// a fillable attribute. Otherwise, we will check the guarded array when
// we need to determine if the attribute is black-listed on the model.
if (in_array($key, $this->fillable)) {
return true;
}
return empty($this->fillable) && !Str::startsWith($key, '_');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function checkMassAssignment(array $attributes);",
"public function totallyGuarded()\n {\n return count($this->fillable) == 0 && $this->guarded == ['*'];\n }",
"public function totallyGuarded()\n {\n return count($this->fillable) == 0 && $this->guarded == ['*'];\n }",
"public function isDynamicAttribute()\n {\n return in_array($this->arrConfig['attribute'], Attribute::getDynamicAttributeFields());\n }",
"public function totallyGuarded()\n {\n return count($this->getFillable()) === 0 && $this->getGuarded() == ['*'];\n }",
"public function validateAssignmentData(Collection $data, string $attribute): bool;",
"abstract protected function mustApplyRuleOnAttribute(): bool;",
"function IsAttributeRequired( $attribute )\r\n\t{\r\n\t\tswitch ( $attribute )\r\n\t\t{\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->object->isAttributeRequired( $attribute );\r\n\t\t}\r\n\t}",
"public function supportsAttribute($attribute);",
"public function supportsAttribute($attribute)\n {\n return in_array($attribute, FamilyPermission::getPermissions(), true);\n }",
"public static function fillableIsSetAndContainsAttribute($attribute): bool\n {\n return (isset(static::$fillable) && count(static::$fillable) > 0 && in_array($attribute, static::$fillable));\n }",
"protected function fillableNotSet()\n {\n return ! isset($this->fillable);\n }",
"private function has_attribute($attribute){\n\t\t//(inlcuding private ones) as keys and current values as value.\n\t\t\n\t\t$object_vars = $this->attributes();\n\t\t//want to check key exists, dont care about value here\n\t\t//returns true or false\t\n\t\t\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}",
"protected function validate_attributes()\n {\n foreach (static::$object_attributes as $key => $value) {\n if (!isset($this->{$key})) {\n Error::set(Error::ERROR_MISSING_ATTRIBUTE, [$key], Error::ERROR);\n }\n }\n\n return true;\n }",
"private function has_attribute($attribute){\r\n //(incl.private ones!) as the keys and their current values as the value\r\n $object_vars = $this->attributes();\r\n //we dont care about the value, we just want to know if the key exists\r\n //will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }",
"private function has_attribute($attribute)\n {\n //including priate ones as the keys and their current values are the value\n $object_vars = $this->attributes();\n\n //here i do not care what the specific values are but just interested if they exist\n return array_key_exists($attribute, $object_vars);\n }",
"public function isAttribute($field){\n\t\treturn $this->hasField($field);\n\t}",
"protected abstract function supportsAttribute($attribute);",
"public function assignProductAttribute($productAttribute): bool\n {\n if (!$this->hasProductAttribute($productAttribute)) {\n if (is_numeric($productAttribute) && is_finite(intval($productAttribute))) {\n $productAttribute = ProductAttribute::where('id', intval($productAttribute))\n ->select(['id'])\n ->firstOrFail();\n }\n\n if ($productAttribute instanceof ProductAttribute) {\n return ($this->productAttributes()->save($productAttribute)) ? true : false;\n } else {\n return false;\n }\n }\n\n return true;\n }",
"public function isFillable($key)\n {\n if (static::$unguarded) {\n return true;\n }\n\n // If the key is in the \"fillable\" array, we can of course assume that it's\n // a fillable attribute. Otherwise, we will check the guarded array when\n // we need to determine if the attribute is black-listed on the model.\n if (in_array($key, $this->getFillable())) {\n return true;\n }\n\n // If the attribute is explicitly listed in the \"guarded\" array then we can\n // return false immediately. This means this attribute is definitely not\n // fillable and there is no point in going any further in this method.\n if ($this->isGuarded($key)) {\n return false;\n }\n\n return empty($this->getFillable()) &&\n strpos($key, '.') === false &&\n ! Str::startsWith($key, '_');\n }",
"public function hasAttr(){\n return (is_array($this->attr) && !empty($this->attr));\n }",
"private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}",
"private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}",
"private function has_attribute($attribute){\r\n\t // (incl. private ones!) as the keys and their current values as the value\r\n\t $object_vars = get_object_vars($this);\r\n\t // We don't care about the value, we just want to know if the key exists\r\n\t // Will return true or false\r\n\t return array_key_exists($attribute, $object_vars);\r\n }",
"private function has_attribute($attribute) {\r\n // (incl. private ones!) as the keys and their current values as the value\r\n $object_vars = get_object_vars($this);\r\n // We don't care about the value, we just want to know if the key exists\r\n // Will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }",
"public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }",
"public function isAttributeSave(string $attribute): bool;",
"public function isReservedAttribute ($attribute)\n {\n return $attribute->getIsUserDefined()\n && in_array($attribute->getAttributeCode(), $this->getReservedAttributes());\n }",
"private function has_attribute($attribute) {\n\t\t// Wil return true or false\n\t\t$object_vars = get_object_vars($this);\n\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}",
"function IsAttributeModifiable( $attribute )\r\n\t{\r\n\t\treturn getFactory()->getAccessPolicy()->can_modify_attribute($this->getObject(), $attribute)\r\n && $this->getObject()->getAttributeEditable($attribute);\r\n\t}",
"private function has_attribute($attribute){\n // (including private ones) as the keys and their current values as the value\n $object_vars = get_object_vars($this);\n\n // We don't care about the value, we just want to know if the key exists\n // does $attribute(key) exist in $object_vars\n // Will return true or false\n return array_key_exists($attribute, $object_vars);\n }",
"private function has_attribute($attribute)\n\t\t{\n\t\t//(incl. private ones!) as the keys and their current values as the value\n\t\t$object_vars = get_object_vars($this);\n\t\t//we don't care about the value, we just want to know if the key exists \n\t\t//will return true or false\n\t\treturn array_key_exists($attribute, $object_vars);\n\t\t}",
"protected function fillableIsSetAndContainsAttribute($attribute)\n {\n return (isset($this->fillable) && count($this->fillable) > 0 && in_array($attribute, $this->fillable));\n }",
"public function __isset($attribute)\n {\n if (empty($this->attributes[$attribute]) === false) {\n return true;\n } else {\n return false;\n }\n }",
"private function has_the_attribute($the_attribute){\n \n $object_properties = get_object_vars($this); //Function get_object_vars\n \n return array_key_exists($the_attribute, $object_properties);\n }",
"protected function supportsAttribute($attribute)\n {\n return in_array($attribute, $this->getSupportedAttributes());\n }",
"public function hasDirtyValueOfAttribute($attributeName);",
"public function isAssignment()\n {\n return ($this->getToken() == self::T_SINGLECHAR AND $this->getCode() == '=');\n }",
"public function has_attribute( $name ) {\n\t\treturn array_key_exists( $name, $this->attributes );\n\t}",
"public static function attributeExists(Attribute $data) {\n $model = self::_getDataType();\n $pId = $data->getId();\n if($pId > 0) {\n return parent::dbRecordExists($data);\n } elseif((string) $data->getName() !== '') {\n $att = self::getAttributeByName($data->getName());\n return (boolean) ($att instanceof Attribute);\n } else {\n throw new \\Exception(__METHOD__.\" requires valid/populated model as input\");\n }\n }",
"protected function getIsCustomAttribute()\n {\n return !$this->is_organizational;\n }",
"function has_attributes() {\n\t\tif (isset($this->attributes) && sizeof($this->attributes)>0) :\n\t\t\tforeach ($this->attributes as $attribute) :\n\t\t\t\tif ($attribute['visible'] == 'yes') return true;\n\t\t\tendforeach;\n\t\tendif;\n\t\treturn false;\n\t}",
"public function hasAttribute($name)\n {\n return array_key_exists($name, $this->_attributes);\n }",
"public static function isInyectedAttribute( $attr )\n {\n return ( strcmp($attr, \"id\") == 0 || strcmp($attr, \"deleted\") == 0 || strcmp($attr, \"class\") == 0 );\n }",
"public function hasAttribute($name)\n {\n return array_key_exists($name, $this->attributes);\n }",
"private function has_attribute($attribute) {\r\n\t\t//get_object_vars returns an associative array with all attributes as the keys and their current values as value\r\n\t\t\t\t\t\t//this refers to get_object_vars\r\n\t\t$object_vars = get_object_vars($this);\r\n\t\t//checks to see if the key exists\r\n\r\n\t\t//returns true of false\r\n\t\t//does the key attribute exists in the array object vars?\r\n\t\treturn array_key_exists($attribute, $object_vars);\r\n\t}",
"public function isMandatory() {\n\t\t$this->getMandatory();\n\t}",
"private function _check_valid_attr($string) {\n\t\t\n\t\t$result = true;\n\t\t\n\t\t// Check $name for correct characters\n\t\t// \"^[a-zA-Z0-9_-]*$\"\n\t\t\n\t\treturn $result;\n\t\t\n\t}",
"public function isGuarded()\n {\n return $this->guarded;\n }",
"private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }",
"private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}",
"function has_attrs() {\n $has_attrs = True;\n if (empty($this->attrs)) {\n $has_attrs = False;\n }\n return $has_attrs;\n }",
"public function has_the_attribute($the_attribute){\n\t\t$object_properties = get_object_vars($this); \n\t\treturn array_key_exists($the_attribute,$object_properties);\n\t }",
"public function supportsAttribute($attribute)\n {\n die('ProjectVoter::supportsAttribute ' . $attribute);\n return in_array($attribute, array(\n self::VIEW,\n self::EDIT,\n ));\n }",
"public function hasAttributes() {\n return $this->_has(9);\n }",
"public function hasAttribute($attr_name)\n {\n return isset($this->attributes[$attr_name]);\n }",
"public function attribute($name, $object)\n {\n return \\property_exists($object, $name);\n }",
"public function ContainsEmptyAttribute()\n {\n foreach(self::$attributes as $attribute)\n {\n if($this->$attribute == '')\n {\n $this->_error = 'All attributes cannot be empty';\n return true;\n }\n }\n \n return false;\n }",
"private function is_attribute_exist(Array $attribute = [],$not_strict = true)\n {\n $has_empty = constraint::isThereEmpty($attribute);\n\n if($has_empty) return false;\n\n return $this->database->has('user',\"*\",$attribute);\n\n }",
"public function canSetCreatable();",
"public function isValid()\n {\n return !$this->guarded && null !== $this->name;\n }",
"public static function isUnguarded()\n {\n return static::$unguarded;\n }",
"public static function isUnguarded()\n {\n return static::$unguarded;\n }",
"public function hasAttribute($name)\n {\n $name = htmlspecialchars($name, ENT_QUOTES);\n return array_key_exists($name, $this->attributes);\n }",
"protected static function _isMutable()\n {\n return false;\n }",
"public function isMultilingualAttribute()\n {\n return in_array($this->arrConfig['attribute'], Attribute::getMultilingualFields());\n }",
"public function isFillable($key)\n {\n if (static::$unguarded)\n return true;\n\n if (in_array($key, $this->fillable))\n return true;\n\n if ($this->isGuarded($key))\n return false;\n\n return empty($this->fillable);\n }",
"function taxonomy_is_movie_attribute( $name ) {\n global $masvideos_attributes;\n\n return taxonomy_exists( $name ) && array_key_exists( $name, (array) $masvideos_attributes['movie'] );\n }",
"function areAttributesValid($request) : bool{\n foreach($request->getAttributes() as $key => $value)\n if(!is_numeric($value)) return false;\n return true;\n}",
"public function hasAttribute($name)\n {\n $attribute = $this->getAttribute($name);\n if (!is_null($attribute)) {\n return true;\n } else {\n return false;\n }\n }",
"public function passes($attribute, $value)\n {\n if ($value->getSize() > $this->postMaxSize) {\n return false;\n }\n\n return true;\n }",
"public function hasAttribute($name)\n {\n return isset($this->_attributes[$name]) || in_array($name, $this->attributes(), true);\n }",
"public function hasAttributes() {\n return $this->_has(24);\n }",
"protected function validateAttribute($object, $attribute) {\n \n }",
"public function hasAttribute(string $attribute): bool\n {\n return array_key_exists($attribute, $this->data);\n }",
"public function isGuarded($key)\n {\n return in_array($key, $this->guarded) || $this->guarded == ['*'];\n }",
"protected function supports($attribute, $subject)\n {\n return true;\n }",
"public function validateCatalogProductAttributeCreateAction()\n {\n if (!$this->_role->getIsAll() && !$this->_request->getParam('attribute_id')) {\n $this->_forward();\n return false;\n }\n\n return true;\n }",
"public function hasNewAttribute($name)\n {\n return array_key_exists($name, $this->attributes);\n }",
"private function has_attribute($attritube)\n {\n $allattribute=$this->attribute();\n if(array_key_exists($attritube,$allattribute))\n return true;\n return false;\n }",
"public function __isset($name)\n\t{\n\t\tif(isset($this->_attributes[$name]))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn parent::__isset($name);\n\t}",
"public function hasAttributeByName($attributeName);",
"public function hasAttribute ($attr) {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\tif (!$node->attributes->getNamedItem($attr)) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function hasAttr($attr);",
"public function hasAttribute($name) {\n\t\treturn isset($this->_attributes[$name]);\n\t}",
"public function hasAttribute($name)\n {\n return isset($this->attributes[$name]);\n }",
"public function isPermit()\n {\n if ($this->isLoaded()) {\n $result = $this->getField('type') == self::TYPE_PERMIT;\n } else {\n $result = false;\n }\n return $result;\n }",
"protected abstract function hasAccess($object, $attribute);",
"public function hasAttributes() {\n return $this->_has(3);\n }",
"public function isError($attribute);",
"public function unassignProductAttribute($productAttribute): bool\n {\n if ($this->hasProductAttribute($productAttribute)) {\n if (is_numeric($productAttribute) && is_finite(intval($productAttribute))) {\n return ($this->productAttributes()->detach(intval($productAttribute))) ? true : false;\n }\n\n if ($productAttribute instanceof ProductAttribute) {\n return ($this->productAttributes()->detach($productAttribute->id)) ? true : false;\n }\n }\n\n return true;\n }",
"public function hasProductAttributes(): bool\n {\n return ($this->productAttributes()->count() !== 0) ? true : false;\n }",
"public function hasAttributes() {\n return $this->_has(15);\n }",
"public function hasAttributes() {\n return $this->_has(15);\n }",
"public function checkAttributes($attributes = array())\n {\n return (\n $this->modelAcceptsAttributes($attributes, $this->getModelAttributes()) &&\n $this->modelNonNullableAttributesSet($attributes, $this->getModelAttributes()) &&\n $this->checkMajorFormatsAreValid($attributes, $this->getModelAttributes()) &&\n $this->avoidDuplicationOfUniqueData($attributes, $this->getModelAttributes(), $this->getModelClassName())\n == true ) ? :false;\n\n }",
"private function has_attribute($attribute)\n {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }",
"public function passes($attribute, $value)\n {\n $keys = array_keys(json_decode($value, true));\n $diff = array_diff($keys, $this->model->getFillable());\n\n return !count($diff);\n }",
"function valid()\n {\n if (isset($this->aid))\n return true;\n else\n return false;\n }",
"public function hasAttribute ($name)\n {\n\n return isset($this->attributes[$name]);\n\n }",
"function canCreate() {\r\n\t\treturn !DataObject::get_one($this->class);\r\n\t}"
] | [
"0.6812852",
"0.62336075",
"0.62336075",
"0.61449885",
"0.6084034",
"0.59754044",
"0.5960416",
"0.5914456",
"0.58636475",
"0.58603245",
"0.5849821",
"0.58410704",
"0.58376294",
"0.58182704",
"0.5798177",
"0.57913953",
"0.5790532",
"0.57881373",
"0.57667387",
"0.57655424",
"0.5739225",
"0.57274234",
"0.57274234",
"0.57256866",
"0.571554",
"0.5712887",
"0.5711529",
"0.5699077",
"0.56951046",
"0.5628003",
"0.5618793",
"0.561015",
"0.559955",
"0.5568185",
"0.5562238",
"0.5547635",
"0.55431736",
"0.5521922",
"0.551769",
"0.5505125",
"0.55029446",
"0.5499707",
"0.5486399",
"0.54808277",
"0.54712176",
"0.54699177",
"0.54580027",
"0.54467976",
"0.5440687",
"0.54268193",
"0.54239655",
"0.542377",
"0.5400439",
"0.5392973",
"0.53894013",
"0.5388361",
"0.53879064",
"0.5383636",
"0.5366628",
"0.53611976",
"0.53569216",
"0.5350282",
"0.5350282",
"0.5348739",
"0.5342388",
"0.5333993",
"0.53100973",
"0.53051305",
"0.52984524",
"0.5287253",
"0.52861696",
"0.52645075",
"0.5261429",
"0.5261025",
"0.5260693",
"0.52597004",
"0.5255747",
"0.52367437",
"0.52232623",
"0.5217998",
"0.5216581",
"0.520539",
"0.52034914",
"0.51993716",
"0.5197109",
"0.5196526",
"0.5191662",
"0.518767",
"0.5186108",
"0.5179312",
"0.51751953",
"0.5170694",
"0.51698244",
"0.51698244",
"0.5167311",
"0.5159147",
"0.5156503",
"0.5156376",
"0.51541764",
"0.5152989"
] | 0.5559737 | 35 |
Convert the model instance to JSON. | public function toJson($options = 0)
{
return json_encode($this->jsonSerialize(), $options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toJson() {\n\t\t\treturn json_encode(array(\n\t\t\t\t'id' => $this->id,\n\t\t\t\t'model' => $this->model,\n\t\t\t\t'type' => json_decode($this->type->toJson()),\n\t\t\t\t'description' => $this->description,\n\t\t\t\t'area' => json_decode($this->area->toJson()),\n\t\t\t\t'status' => $this->status\n\t\t\t));\n\t\t}",
"public function toJson()\n {\n return $this->serializer()->serialize($this);\n }",
"public function toJSON(){\n return json_encode($this);\n }",
"function toJSON()\n {\n return json_encode($this->toArray());\n }",
"public function toJson();",
"public function toJson();",
"public function toJson() {\n return json_encode($this);\n }",
"public function toObject() \n {\n return $this->toJson();\n }",
"public function toJSON()\n {\n return json_encode( $this->toArray() );\n }",
"public function toJson()\n {\n return json_encode($this);\n }",
"public function toJson() {\n return $this->jsonSerialize();\n }",
"public function toJson() {\n\t\treturn json_encode($this->jsonSerialize());\n\t}",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function ToJson()\n {\n return json_encode($this);\n }",
"public function serialize()\n {\n return json_encode($this);\n }",
"public function toJson() {\n\t\tdebug($this);\n\t}",
"public function serialize() {\r\n return json_encode($this);\r\n }",
"public function jsonSerialize()\n {\n return $this->toJson();\n }",
"public function toJson()\n {\n return json_encode( $this->toArray() );\n }",
"public function toJson() {\r\n\t\t// Returns:\t\tReturns JSON encoded string\r\n\t\treturn json_encode($this);\r\n\t}",
"public function toJson()\n\t{\n\t\treturn json_encode($this->data());\n\t}",
"public function toJson() {\n return json_encode(get_object_vars($this));\n }",
"public function toJSON() {\n return json_encode($this->data);\n }",
"public function toJson(){\n\t\t$array = $this->toArray();\n\t\treturn json_encode($array);\n\t}",
"public function json(){ return json_encode( $this->objectify() ); }",
"public function toJson()\n {\n return json_encode($this->toArray(), true);\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function jsonize()\n {\n return json_encode($this->toArray());\n }",
"public function toJson() {\n\t\treturn json_encode($this->toArray());\n\t}",
"public function toJson()\r\n {\r\n return json_encode($this->toArray());\r\n }",
"public function makeJSON()\n {\n return(json_encode($this));\n }",
"public function makeJSON()\n {\n return(json_encode($this));\n }",
"public function toJson() {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->jsonSerialize(), JSON_THROW_ON_ERROR);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function toJson()\n {\n return json_encode($this->toArray(), JSON_FORCE_OBJECT | JSON_NUMERIC_CHECK);\n }",
"public function toJSON( ) {\n\n\t\t$data = $this->_toJsonOrXMLDataPrepare();\n\n\t\treturn json_encode( $data );\n\t}",
"public function toJson()\n {\n return json_decode(json_encode($this->toArray()));\n }",
"public function toJson()\n {\n return Json::encode($this->toArray(), false, array(\n 'enableJsonExprFinder' => TRUE,\n ));\n }",
"public function toJson() {\n return json_encode($this->data);\n }",
"protected function toJson()\n {\n $this->formatter->setInstance($this);\n\n return $this->formatter->format();\n }",
"public function toObject(){\r\n return json_decode($this->toJson());\r\n }",
"function asJSON(){\n\t\t\treturn json_encode($this->asArray());\n\t\t}",
"public function toJson()\n {\n return json_encode($this->data);\n }",
"public function toJSON()\n\t{\n\t\treturn $this->json;\n\t}"
] | [
"0.77430385",
"0.75988156",
"0.7591963",
"0.74660426",
"0.73752135",
"0.73752135",
"0.73489326",
"0.7348418",
"0.7344734",
"0.73240274",
"0.7286465",
"0.7279254",
"0.72728163",
"0.72728163",
"0.72728163",
"0.72728163",
"0.72728163",
"0.72728163",
"0.72728163",
"0.72728163",
"0.72728163",
"0.7219936",
"0.7216354",
"0.72016823",
"0.71963876",
"0.71825343",
"0.71818316",
"0.7176895",
"0.7165099",
"0.71507514",
"0.7147737",
"0.71145517",
"0.7107943",
"0.7105071",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.7101678",
"0.71012336",
"0.7093718",
"0.7089563",
"0.7076608",
"0.7076608",
"0.7054709",
"0.7049234",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70418507",
"0.70354056",
"0.70354056",
"0.6998023",
"0.69907856",
"0.6985412",
"0.695094",
"0.6940788",
"0.6927867",
"0.6924353",
"0.6917475",
"0.6911632",
"0.69065183"
] | 0.0 | -1 |
Convert the object into something JSON serializable. | public function jsonSerialize()
{
return $this->toArray();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toJson($object);",
"function to_json(tSerializable $object){\r\n return json_encode($object->jsonData());\r\n}",
"public function _jsonSerialize();",
"final public function jsonSerialize() {}",
"public function json(){ return json_encode( $this->objectify() ); }",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize();",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"function jsonSerialize()\n {\n return Helper::serialize(get_object_vars($this));\n }",
"public function jsonSerialize() : mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize() : mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"function jsonSerialize()\n {\n return $this->jsonObjectSerialize()->jsonSerialize();\n }",
"public function jsonSerialize(): mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize(): mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function jsonSerialize()\n {\n return $this->toJson();\n }",
"public function toJson($object){\n\t\t// FIXME: right now this only supports the official PHP JSON extension,\n\t\t// which is officially part of the language as of 5.2, and exists\n\t\t// as a PECL extension prior to that. It might be good to update\n\t\t// this to support PEAR JSON, Zend_Json, etc...\n\t\treturn json_encode($object);\n\t}",
"public function toObject(){\r\n return json_decode($this->toJson());\r\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize() : string\n {\n return \\json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);\n }",
"public function jsonSerialize()\n {\n return $this->jsonObjectSerialize()->jsonSerialize();\n }",
"public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}",
"public function serializar() {\n\t return json_encode(get_object_vars($this), JSON_FORCE_OBJECT);\n\t\t}",
"public function jsonize()\n {\n return json_encode($this->toArray());\n }",
"public function toJson();",
"public function toJson();",
"public function jsonSerialize()\n {\n }",
"public function jsonSerialize()\n {\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Voximplant\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Voximplant\\ObjectSerializer::sanitizeForSerialization($this));\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Voximplant\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Voximplant\\ObjectSerializer::sanitizeForSerialization($this));\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize() {\n return $this->__toString();\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Yext\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Yext\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Ubo\\Client\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Ubo\\Client\\ObjectSerializer::sanitizeForSerialization($this));\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this));\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\Tweak\\Api\\ObjectSerializer::sanitizeForSerialization($this));\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\ChrisHemmings\\Electio\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\ChrisHemmings\\Electio\\ObjectSerializer::sanitizeForSerialization($this));\n }",
"public function toObject() \n {\n return $this->toJson();\n }",
"public function jsonSerialize()\n {\n return (object) get_object_vars($this);\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) {\n return json_encode(\\Nomad\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n } else {\n return json_encode(\\Nomad\\ObjectSerializer::sanitizeForSerialization($this));\n }\n }",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) {\n return json_encode(\\Infoplus\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n } else {\n return json_encode(\\Infoplus\\ObjectSerializer::sanitizeForSerialization($this));\n }\n }",
"function jsonSerialize();",
"public function __toString()\n {\n if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print\n return json_encode(\\CyberSource\\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);\n }\n\n return json_encode(\\CyberSource\\ObjectSerializer::sanitizeForSerialization($this));\n }"
] | [
"0.8040326",
"0.77460027",
"0.7661239",
"0.7634606",
"0.7590505",
"0.74368227",
"0.74368227",
"0.74368227",
"0.74368227",
"0.74368227",
"0.74368227",
"0.74368227",
"0.74368227",
"0.7416366",
"0.7416366",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.7401669",
"0.739179",
"0.73434746",
"0.73434746",
"0.732698",
"0.7323211",
"0.7323211",
"0.7287233",
"0.72860086",
"0.72672665",
"0.72401094",
"0.72401094",
"0.72401094",
"0.72401094",
"0.72401094",
"0.72401094",
"0.7218002",
"0.7207405",
"0.7207405",
"0.72071785",
"0.72028375",
"0.72028375",
"0.7200149",
"0.7200149",
"0.71918947",
"0.71918947",
"0.7183099",
"0.7182808",
"0.71734",
"0.7172498",
"0.7172498",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71639717",
"0.71638477",
"0.7162776",
"0.716173",
"0.7143063",
"0.71332306",
"0.7129844",
"0.7123914"
] | 0.0 | -1 |
Convert the model instance to an array. | public function toArray()
{
return $this->attributesToArray();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function toArray($model);",
"function asArray(){\n\t\t\t$array = $this->toArray( $this );\n\t\t\treturn $array;\n\t\t}",
"public function toArray()\n {\n return $this->cast('array');\n }",
"public function toArray() {\n return (array)$this;\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function toArray()\n {\n return (array)$this;\n }",
"public function toArray()\n {\n return (array)$this;\n }",
"public function toArray()\n {\n return (array)$this;\n }",
"public function toArray(): array\n {\n return (array) $this->result();\n }",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray(): array\n {\n $data = $this->model->toArray();\n\n /**\n * Model's toArray method gives us raw entity data.\n * Here we replace some special attributes with human readable values.\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->getDisplayValue($key, $value);\n }\n\n return $data;\n }",
"public function toArray()\n {\n return $this->transform();\n }",
"public function to_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}",
"public function as_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}",
"public function toArray()\n {\n // TODO: Implement toArray() method.\n }",
"public function toArray()\n {\n // TODO: Implement toArray() method.\n }",
"public function asArray()\n {\n return $this->data;\n }",
"public function toArray()\n {\n $output = [];\n\n foreach ($this->models as $model) {\n $output[] = $model->toArray();\n }\n\n return $output;\n }",
"public function toArray()\n {\n $array = array_values($this->getModels());\n return $array;\n }",
"public function asArray()\r\n {\r\n return $this->data;\r\n }",
"public function toArray() : array\n {\n return $this->data;\n }",
"public function toArray() // untested\n {\n return $this->data;\n }",
"public function asArray(){\n return $this->data;\n }",
"public function toArray(){\n $this->buildArray();\n return $this->array;\n }",
"abstract public function to_array();",
"public function toArray() {\n return $this->array;\n }",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function toArray()\n {\n\n }",
"public function to_array() {\n\n $array = array();\n\n foreach ($this->collection as $model) {\n $model_to_array = $model->to_array($this->options);\n\n foreach ($model_to_array as &$attribute) {\n if ($attribute instanceof ModelCollection) {\n $attribute = $attribute->to_array($this->options);\n }\n }\n\n $array[] = $model_to_array;\n }\n\n return $array;\n }",
"public function toArray() {\n return json_decode(json_encode($this), true);\n }",
"public static function instanceToArray() : array{\n\n if(!method_exists(self::class,'instance')):\n return [];\n endif;\n\n return self::instance()->toArray();\n }",
"public function to_array()\n {\n//var_dump($this->data);die();\n return $this->data;\n }",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray() {\n\t\treturn $this->array;\n\t}",
"public function toArray()\n {\n return json_decode(json_encode($this), true);\n }"
] | [
"0.77884513",
"0.772852",
"0.76385117",
"0.76180094",
"0.76172066",
"0.76172066",
"0.76172066",
"0.761628",
"0.761628",
"0.7615716",
"0.75758183",
"0.75758183",
"0.75758183",
"0.74546975",
"0.744609",
"0.744609",
"0.74454",
"0.74454",
"0.74454",
"0.74454",
"0.74454",
"0.74454",
"0.74454",
"0.74454",
"0.74454",
"0.74454",
"0.74453855",
"0.74453855",
"0.74453855",
"0.74453855",
"0.738603",
"0.7362454",
"0.73347396",
"0.73112607",
"0.72568303",
"0.72568303",
"0.72427887",
"0.7239907",
"0.72316533",
"0.7230373",
"0.72202253",
"0.7203668",
"0.72027916",
"0.7195168",
"0.7192273",
"0.719196",
"0.7188446",
"0.7188446",
"0.7188446",
"0.7188446",
"0.7188446",
"0.7188446",
"0.7187805",
"0.71870506",
"0.7182954",
"0.71742517",
"0.71720004",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.71665287",
"0.7161433",
"0.7156405"
] | 0.7185874 | 55 |
Convert the model's attributes to an array. | public function attributesToArray()
{
$attributes = $this->attributes;
$mutatedAttributes = $this->getMutatedAttributes();
// We want to spin through all the mutated attributes for this model and call
// the mutator for the attribute. We cache off every mutated attributes so
// we don't have to constantly check on attributes that actually change.
foreach ($mutatedAttributes as $key) {
if (!array_key_exists($key, $attributes)) {
continue;
}
$attributes[$key] = $this->mutateAttributeForArray(
$key, $attributes[$key]
);
}
// Here we will grab all of the appended, calculated attributes to this model
// as these attributes are not really in the attributes array, but are run
// when we need to array or JSON the model for convenience to the coder.
foreach ($this->getArrayableAppends() as $key) {
$attributes[$key] = $this->mutateAttributeForArray($key, null);
}
return $attributes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n\n return $attributes;\n }",
"public function toArray()\n {\n return $this->attributesToArray();\n }",
"public function toArray()\n {\n return $this->attributesToArray();\n }",
"public function toArray(): array {\n return $this->attributes()->toArray();\n }",
"public function toArray(): array\n {\n $data = $this->model->toArray();\n\n /**\n * Model's toArray method gives us raw entity data.\n * Here we replace some special attributes with human readable values.\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->getDisplayValue($key, $value);\n }\n\n return $data;\n }",
"public function toArray()\n {\n return $this->attributes;\n }",
"public function toArray()\n {\n return $this->attributes;\n }",
"public function toArray()\n {\n return $this->attributes;\n }",
"public function toArray()\n {\n return $this->attributes;\n }",
"public function to_array() {\n\n $array = array();\n\n foreach ($this->collection as $model) {\n $model_to_array = $model->to_array($this->options);\n\n foreach ($model_to_array as &$attribute) {\n if ($attribute instanceof ModelCollection) {\n $attribute = $attribute->to_array($this->options);\n }\n }\n\n $array[] = $model_to_array;\n }\n\n return $array;\n }",
"public function toArray()\n {\n return $this->getAttributes();\n }",
"public function attributesToArray()\n {\n return Helper::toCamelCase($this->attributes());\n }",
"public function toArray()\n {\n $attributes = $this->attributesToArray();\n\n return $attributes;\n }",
"public function getAttributesAsArray()\n {\n $attributes = explode(',', $this->attributes);\n\n if ($attributes === false) {\n return [];\n }\n\n return $attributes;\n }",
"public function attributesToArray()\n {\n $attributes = parent::attributesToArray();\n\n foreach ($attributes as $key => $value) {\n $attributes[$key] = $value instanceof ValueObject ? $this->fromValueObjectToArray($key, $value) : $value;\n }\n\n return $attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"public function toAPIArray()\n\t{\n\t\t$out = array();\n\n\t\tforeach($this as $i => $v)\n\t\t{\n\t\t\tif (method_exists($v, 'toApiArray'))\n\t\t\t{\n\t\t\t\t$out[$i] = $v->toApiArray();\n\t\t\t} else {\n\t\t\t\t$out[$i] = $v->attributes;\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}",
"public function toArray()\r\n\t{\r\n\t\t$attributes = parent::toArray();\r\n\r\n\t\tif (! $this->autoTranslations) return $attributes;\r\n\r\n\t\tforeach ($this->translatableAttributes as $field) {\r\n\t\t\t$attributes[$field] = $this->getTranslation($field);\r\n\t\t}\r\n\r\n\t\treturn $attributes;\r\n\t}",
"public function toArray()\n {\n $attributes = $this->getConfiguredAttributes();\n\n $values = [];\n\n foreach (explode(',', $attributes) as $attribute) {\n $values[$attribute] = str_replace(' ','', $attribute);\n }\n\n return $values;\n }",
"public function toArray()\n {\n return array_map(function ($attribute) {\n if ($attribute instanceof \\DateTimeInterface) {\n return $attribute->format('Y-m-d H:i:s.u');\n } \n elseif ($attribute instanceof \\JsonSerializable) {\n return $attribute->jsonSerialize();\n } \n elseif (is_iterable($attribute)) {\n return (array) $attribute;\n }\n return $attribute;\n }, $this->attributes);\n }",
"public function to_array() {\n\t\t$attributes = array();\n\n\t\t// First we need to gather all of the regular attributes. If the attribute\n\t\t// exists in the array of \"hidden\" attributes, it will not be added to\n\t\t// the array so we can easily exclude things like passwords, etc.\n\t\tforeach (array_keys($this->attributes) as $attribute) {\n\t\t\tif ( ! in_array($attribute, static::$hidden)) {\n\t\t\t\t$attributes[$attribute] = $this->$attribute;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->relationships as $name => $models) {\n\t\t\t// If the relationship is not a \"to-many\" relationship, we can just\n\t\t\t// to_array the related model and add it as an attribute to the\n\t\t\t// array of existing regular attributes we gathered.\n\t\t\tif ($models instanceof Model) {\n\t\t\t\t$attributes[$name] = $models->to_array();\n\t\t\t}\n\n\t\t\t// If the relationship is a \"to-many\" relationship we need to spin\n\t\t\t// through each of the related models and add each one with the\n\t\t\t// to_array method, keying them both by name and ID.\n\t\t\telseif (is_array($models)) {\n\t\t\t\t$attributes[$name] = array();\n\n\t\t\t\tforeach ($models as $id => $model) {\n\t\t\t\t\t$attributes[$name][$id] = $model->to_array();\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif (is_null($models)) {\n\t\t\t\t$attributes[$name] = $models;\n\t\t\t}\n\t\t}\n\n\t\treturn $attributes;\n\t}",
"public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n $mutatedAttributes = $this->getMutatedAttributes();\n\n foreach ($mutatedAttributes as $key)\n {\n if (!array_key_exists($key, $attributes))\n continue;\n\n $attributes[$key] = $this->mutateAttributeForArray(\n $key,\n $attributes[$key]\n );\n }\n\n foreach ($this->casts as $key => $value)\n {\n if (!array_key_exists($key, $attributes) ||\n in_array($key, $mutatedAttributes))\n {\n continue;\n }\n\n $attributes[$key] = $this->castAttribute(\n $key,\n $attributes[$key]\n );\n }\n\n foreach ($this->getArrayableAppends() as $key)\n $attributes[$key] = $this->mutateAttributeForArray($key, null);\n\n return $attributes;\n }",
"public function toArray() {\n\t\treturn $this->tblAttributes;\n\t}",
"public function toArray()\n {\n $attributes = $this->attributes;\n\n // If an attribute is a date, we will cast it to a string after converting it\n // to a DateTime / Carbon instance. This is so we will get some consistent\n // formatting while accessing attributes vs. arraying / JSONing a model.\n foreach ($this->getDates() as $key) {\n if (! isset($attributes[$key])) {\n continue;\n }\n\n if ($attributes[$key] instanceof DateTime) {\n $attributes[$key] = $attributes[$key]->format('Y-m-d\\TH:i:s\\Z');\n }\n }\n\n return $attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->getArrayableItems($this->attributes);\n }",
"public function toArray()\n {\n //Skip modified attributes and get raw data in admin\n if (Admin::isAdmin()) {\n return array_merge(parent::attributesToArray(), $this->relationsToArray());\n }\n\n return array_merge($this->attributesToArray(), $this->relationsToArray());\n }",
"public function toArray(): array\n {\n $attributes = collect($this->attributes);\n $relations = collect($this->relations)->map(function ($relation) {\n if (!$relation instanceof Arrayable) {\n return $relation;\n }\n\n return $relation->toArray();\n });\n return $attributes->merge($relations)->sortKeys()->toArray();\n }",
"public function toArray()\n\t{\n\t\t$defaults = $this->reflectionClass->getDefaultProperties();\n\t\t$return = array();\n\t\t\n\t\tforeach($defaults as $var => $val)\n\t\t{\n\t\t\tif($this->$var instanceof Model)\n\t\t\t{\n\t\t\t\t$return[$var] = $this->$var->toArray();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$return[$var] = $this->$var;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\t}",
"public abstract function toArray($model);",
"public function toArray(): array\n {\n $attributes = get_object_vars($this);\n\n unset($attributes['originals']);\n\n return $attributes;\n }",
"public function toArray()\n {\n $data = [];\n\n foreach (get_object_vars($this) as $attribute => $value) {\n if ($attribute != 'resource' and !empty($value)) {\n $data[$attribute] = $value;\n }\n }\n\n return $data;\n }",
"public function toArray()\n {\n return array_merge($this->attributesToArray(), $this->relationsToArray());\n }",
"public function toArray()\n {\n return array_merge($this->attributesToArray(), $this->relationsToArray());\n }",
"public function toArray()\n {\n return array_merge($this->attributesToArray(), $this->relationsToArray());\n }",
"public function toArray()\n {\n $returnArr = [];\n\n $this->attributes->each(function($attribute) use (&$returnArr){\n /* @var ConfigurationAttribute $attribute **/\n $returnArr[$attribute->getName()] = $attribute->getValue();\n });\n\n return $returnArr;\n }",
"public function toArray()\n {\n $attributes = parent::toArray();\n \n foreach ($this->getTranslatableAttributes() as $name) {\n $attributes[$name] = $this->getTranslation($name, app()->getLocale());\n }\n \n return $attributes;\n }",
"public function toArray()\n {\n $array = array_values($this->getModels());\n return $array;\n }",
"public function getAttributes() {\n return $this->attributes->getArray();\n }",
"public function toArray(): array\n {\n return [\n $this->attribute->getName(),\n $this->name,\n ];\n }",
"public function getAttributes(): array\n {\n // Collects a list of usable Attributes from the Value Object.\n $fields = $this->filterSystemControlFields(\n \\get_object_vars($this)\n );\n\n foreach ($fields as $name => $value) {\n if ($value instanceof AbstractValueObject || $value instanceof EntityCollection) {\n unset($fields[$name]);\n }\n }\n\n // Converts all objects into primitives.\n return $this->convertIntoPrimitiveValues($fields);\n }",
"public function attributesToArray()\n {\n $attributes = parent::attributesToArray(); // call the parent method\n\n foreach ($this->encryptable as $key) {\n if (isset($attributes[$key])) {\n $attributes[$key] = Crypt::decrypt($attributes[$key]);\n }\n }\n\n return $attributes;\n }",
"public function getAll()\n {\n $valueArray = [];\n\n foreach(self::$validAttributes as $attribute) {\n $valueArray[$attribute] = $this->$attribute;\n }\n\n return $valueArray;\n }",
"public function toArray() {\n $attrs = $this->_private_attributes;\n $result = array();\n foreach ($attrs as $key => $attr) {\n if (method_exists($this, \"get\" . underscore_to_camel_case($key, true))) {\n eval('$result[\"' . $key . '\"] = $this->get' . underscore_to_camel_case($key, true) . '();');\n } else {\n $result[$key] = $attr;\n }\n }\n return $result;\n }",
"public function toArray()\n {\n\n $attributes = parent::toArray();\n $attributes['size'] = $this->getSize();\n return $attributes;\n }",
"public function __toArray(array $arrAttributes = array()) {\n if (empty($arrAttributes)) {\n return $this->data;\n }\n\n $arrRes = array();\n foreach ($arrAttributes as $attribute) {\n if (isset($this->valid($attribute))) {\n $arrRes[$attribute] = $this->data[$attribute];\n } else {\n $arrRes[$attribute] = null;\n }\n }\n return $arrRes;\n }",
"protected function attributes(): array\n {\n try {\n $attributes = [];\n $i = 0;\n foreach (static::$db_columns as $column) {\n $attributes[$column] = $this->$column;\n $i++;\n }\n return $attributes;\n } catch (Exception $e) {\n die(\"Error \" . $e);\n }\n }",
"public function toArray()\n {\n return $this->cast('array');\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}",
"function asArray(){\n\t\t\t$array = $this->toArray( $this );\n\t\t\treturn $array;\n\t\t}",
"public function getAttributes() : array\n {\n\n return $this->attributes;\n }",
"public function toArray()\n {\n $output = [];\n\n foreach ($this->models as $model) {\n $output[] = $model->toArray();\n }\n\n return $output;\n }",
"public function getAttributes()\n {\n return $this->where('isRelation', false)->pluck('attribute')->toArray();\n }",
"public function toArray()\n {\n return $this->transform();\n }",
"protected function getAttributes()\n {\n return [];\n }",
"public function toArray()\n {\n // build the list of properties to retrieve\n $properties = array_keys(static::$properties);\n\n // remove any hidden properties\n $hide = (property_exists($this, 'hidden')) ? static::$hidden : [];\n $properties = array_diff($properties, $hide);\n\n // add any appended properties\n $append = (property_exists($this, 'appended')) ? static::$appended : [];\n $properties = array_merge($properties, $append);\n\n // get the values for the properties\n $result = $this->get($properties);\n\n foreach ($result as $k => &$value) {\n // convert any models to arrays\n if ($value instanceof self) {\n $value = $value->toArray();\n }\n }\n\n // DEPRECATED\n // apply the transformation hook\n if (method_exists($this, 'toArrayHook')) {\n $this->toArrayHook($result, [], [], []);\n }\n\n return $result;\n }",
"public function getAttributes(): array {\n return $this->attributes;\n }",
"public function getAttributes(): array\n {\n return $this->_attributes;\n }",
"public function toArray()\n {\n return (array)$this->properties;\n }",
"public function getAttributes(): array\n {\n return $this->attributes;\n }",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function getAttributes(): array;",
"public function attributes(): array\n {\n return [\n //\n ];\n }",
"public function attributes(): array\n {\n return [\n //\n ];\n }",
"public function getArrayableAttributes()\n {\n $attributes = parent::getArrayableAttributes();\n\n foreach ($attributes as $key => $attribute) {\n if ($this->encryptable($key)) {\n $attributes[$key] = $this->decryptAttribute($attribute);\n }\n }\n\n return $attributes;\n }",
"public function toArray()\n {\n $values = [];\n\n foreach ($this->_allowedProperties as $key) {\n $methodName = 'get' . ucfirst($key);\n\n if (method_exists($this, $methodName)) {\n $values[$key] = $this->$methodName();\n } elseif (array_key_exists($key, $this->_properties)) {\n $values[$key] = $this->_properties[$key];\n }\n\n if (!empty($values[$key]) && ($values[$key] instanceof ModelAbstract || $values[$key] instanceof ModelRowsetAbstract)) {\n $values[$key] = $values[$key]->toArray();\n }\n }\n\n return $values;\n }",
"public function toArray(): array\n\t{\n\t\treturn array_map([$this, 'toArrayValue'], get_object_vars($this));\n\t}",
"public function attributesToArray()\n {\n $attributes = parent::attributesToArray();\n\n // Convert dot-notation dates.\n foreach ($this->getDates() as $key) {\n if (str_contains($key, '.') and array_has($attributes, $key)) {\n array_set($attributes, $key, (string)$this->asDateTime(array_get($attributes, $key)));\n }\n }\n\n return $attributes;\n }",
"public function toArray()\n {\n $a = parent::toArray();\n\n if ($this->shouldReturnIdAsToken()) {\n $unique_column = $this->getUniqueTokenColumn();\n\n unset($a[$unique_column]);\n $a['id'] = $this->getAttribute($unique_column);\n }\n\n return $a;\n }",
"public function toArray(): array\n {\n // Collects a list of usable Attributes from the Value Object.\n $fields = $this->filterSystemControlFields(\n \\get_object_vars($this)\n );\n\n // Converts all objects into primitives.\n return $this->convertIntoPrimitiveValues($fields);\n }",
"public function to_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"protected function attributes()\n {\n return [];\n }",
"public function toArray()\n {\n $data = array();\n\n collect($this->touchedBySetter)\n ->each(function ($property) use (&$data): void {\n $data[$property] = $this->{$property};\n });\n\n return $data;\n }",
"public function transformData($model)\n {\n return $model->toArray();\n }",
"public function to_array()\n\t{\n\t\treturn array(\n\t\t\t'id'\t\t=> $this->get_id(),\n\t\t\t'label'\t\t=> $this->get_label()\n\t\t);\n\t}",
"public function toArray()\n {\n $a = parent::toArray();\n return $a;\n }",
"public function attributes()\n {\n return [];\n }",
"public function attributes()\n {\n return [];\n }",
"public function attributes()\n {\n return [];\n }",
"function to_array() \n {\n $d = array();\n $d[\"vocab\"] = $this->vocab;\n $d[\"meta_name\"] = $this->meta_name;\n $d[\"text\"] = $this->text;\n $d[\"lang\"] = $this->lang;\n foreach($this->attrs as $key => $value) {\n $d[$key] = $value;\n }\n return $d;\n }",
"public function toArray()\n {\n $params = array();\n\n //prepare an array of scalar properties\n $this->prepareParams($this->_request, $params);\n\n return $params;\n }",
"public function toArray(): array\n {\n return (array) $this->result();\n }",
"public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }",
"public function __toArray()\n {\n return $this->toArray();\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function to_array()\n {\n }",
"public function jsonSerialize(): array\n {\n return $this->getAttributes();\n }",
"public function to_array()\n {\n }",
"private function arrayify(): array\n {\n return $this->toArray();\n }",
"public function toArray()\n {\n $_data = array();\n \n foreach ($this->_data as $key=>$val) {\n $_data[$key] = method_exists($val, 'toArray') ? $val->toArray() : $val;\n }\n \n return $_data;\n }",
"public function getAttributes()\n {\n $array = [];\n\n if ($this->getValueSet() === null) {\n return $array;\n }\n\n foreach ($this->getValueSet()->getValues() as $value) {\n $array[$value->getAttribute()->getName()] = $value;\n }\n\n return $array;\n }"
] | [
"0.80428535",
"0.7896457",
"0.7896457",
"0.78604525",
"0.7803931",
"0.77749693",
"0.77749693",
"0.77749693",
"0.77749693",
"0.7734881",
"0.77163154",
"0.77087635",
"0.7693619",
"0.7691863",
"0.763805",
"0.7616516",
"0.7616516",
"0.7614991",
"0.7529832",
"0.7518526",
"0.7460926",
"0.74557275",
"0.74311084",
"0.741585",
"0.74108195",
"0.7394705",
"0.7314169",
"0.7300656",
"0.72526234",
"0.72482854",
"0.7244285",
"0.7241717",
"0.7220669",
"0.7220669",
"0.7220669",
"0.72137094",
"0.721088",
"0.7191953",
"0.71509147",
"0.71505064",
"0.71473527",
"0.713514",
"0.71193063",
"0.7111526",
"0.7101085",
"0.7055372",
"0.7028741",
"0.7014675",
"0.70109206",
"0.6991474",
"0.69858116",
"0.6981908",
"0.6945908",
"0.6942248",
"0.6923423",
"0.69221365",
"0.69179404",
"0.6911053",
"0.6902403",
"0.68946373",
"0.68938506",
"0.68938506",
"0.68938506",
"0.68938506",
"0.68830305",
"0.68830305",
"0.68728536",
"0.68646795",
"0.6853331",
"0.6847544",
"0.6845139",
"0.68282455",
"0.68265015",
"0.68009937",
"0.68009937",
"0.68009937",
"0.68009937",
"0.6800964",
"0.68002826",
"0.6790219",
"0.6784947",
"0.677891",
"0.6778291",
"0.6778291",
"0.6778291",
"0.67742157",
"0.67718405",
"0.6770035",
"0.6765267",
"0.67595965",
"0.67586493",
"0.67586493",
"0.67586493",
"0.67578316",
"0.67578316",
"0.6757507",
"0.67569375",
"0.6754657",
"0.67433095",
"0.6739287"
] | 0.80184025 | 1 |
Get all of the appendable values that are arrayable. | protected function getArrayableAppends()
{
$defaults = ['settings'];
if (!count($this->appends)) {
return $defaults;
}
return array_merge($defaults, $this->appends);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getArrayableAppends()\n {\n if (!count($this->appends))\n return [];\n\n return $this->getArrayableItems(\n array_combine($this->appends, $this->appends)\n );\n }",
"protected function getArrayableAppends()\n\t{\n\t\tif(self::$withoutAppends){\n\t\t\treturn [];\n\t\t}\n\t\treturn parent::getArrayableAppends();\n\t}",
"public function getAsArray();",
"private function arrayify(): array\n {\n return $this->toArray();\n }",
"protected function getArrayableAttributes()\n {\n return $this->getArrayableItems($this->attributes);\n }",
"protected function getArrayableAppends()\n {\n $this->appends = array_unique(array_merge($this->appends, [\n 'total_visits_count',\n 'last_24h_visits_count',\n 'last_7d_visits_count',\n ]));\n return parent::getArrayableAppends();\n }",
"function isArrayVal()\n {\n return $this->_arrayVal;\n }",
"public function intoArrays()\n {\n return self::arraysOf($this);\n }",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"abstract public function getArray();",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"public function asArray() : array\n {\n return $this->a;\n }",
"public function arr()\n {\n return $this->array;\n }",
"public function getInternalArray() {}",
"public function getIsArray()\n {\n return $this->_isArray;\n }",
"public function all()\n\t{\n\t\treturn $this->getArray();\n\t}",
"public function getArray () {\n\n return $this->values;\n\n }",
"public function isArray()\n {\n return \\is_array($this->value);\n }",
"public function AsArray();",
"public function getArray()\n {\n return $this->get(self::_ARRAY);\n }",
"public function all()\n {\n return $this->getArray('');\n }",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function getArray()\n {\n return $this->array;\n }",
"public function as_array() {\n return $this->elements;\n }",
"public abstract function toArray(): array;",
"public function getArray()\n {\n if (!empty($this->array))\n {\n return $this->array;\n }\n \n // return false if $this->array empty\n return false;\n }",
"public function toArray()\n {\n $_data = array();\n \n foreach ($this->_data as $key=>$val) {\n $_data[$key] = method_exists($val, 'toArray') ? $val->toArray() : $val;\n }\n \n return $_data;\n }",
"public function getArray() {\n\t\treturn $this->data; \n\t}",
"public function getArray() {\n\t\treturn $this->data; \n\t}",
"public function getArray(): array\n {\n return $this->array;\n }",
"public function getArray(): array\n {\n return $this->array;\n }",
"public function toArray()\n {\n return $this->cast('array');\n }",
"public function getArray(): array\n {\n $output = [];\n foreach (get_object_vars($this) as $key => $value) {\n $output[$key] = gettype($value) === 'object' ? $value->getArray() : $value;\n }\n return $output;\n }",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"public function getArray()\n {\n return iterator_to_array($this->getIterator());\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 toArray() {\n $return = array();\n foreach($this as $value) {\n $return[] = $value;\n }\n return $return;\n }",
"abstract protected function toArray();",
"public function toArray() {\n\t\treturn $this->array;\n\t}",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();"
] | [
"0.7508744",
"0.72422355",
"0.69321793",
"0.68003803",
"0.678907",
"0.6783425",
"0.6760019",
"0.6733572",
"0.66122735",
"0.66122735",
"0.66122735",
"0.66122735",
"0.66122735",
"0.66122735",
"0.6548164",
"0.6446483",
"0.6446483",
"0.64455384",
"0.64127076",
"0.636783",
"0.6362873",
"0.6350931",
"0.6342161",
"0.6341166",
"0.6318617",
"0.6308616",
"0.63043493",
"0.63028026",
"0.63028026",
"0.63028026",
"0.63028026",
"0.63028026",
"0.63028026",
"0.63028026",
"0.63028026",
"0.63028026",
"0.63028026",
"0.630211",
"0.630211",
"0.630211",
"0.630211",
"0.6301284",
"0.6301284",
"0.62923497",
"0.627222",
"0.6240693",
"0.62211984",
"0.6217125",
"0.6216268",
"0.6216268",
"0.62015444",
"0.62015444",
"0.6196371",
"0.6191234",
"0.6188042",
"0.6188042",
"0.6188042",
"0.6188042",
"0.6188042",
"0.6180235",
"0.6179828",
"0.6179828",
"0.6179757",
"0.617767",
"0.6172742",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626",
"0.6165626"
] | 0.7204137 | 2 |
Get a plain attribute. | public function getAttribute($key)
{
// Before Event
if (($attr = $this->fireEvent('model.beforeGetAttribute', [$key], true)) !== null) {
return $attr;
}
$value = $this->getAttributeFromArray($key);
// If the attribute has a get mutator, we will call that then return what
// it returns as the value, which is useful for transforming values on
// retrieval from the model to a form that is more useful for usage.
if ($this->hasGetMutator($key)) {
return $this->mutateAttribute($key, $value);
}
// After Event
if (($_attr = $this->fireEvent('model.getAttribute', [$key, $attr], true)) !== null) {
return $_attr;
}
return $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAttribute(string $attribute): string;",
"public function getAttr(): string\r\n {\r\n return $this->attr;\r\n }",
"public function getAttribute(): string\n {\n return $this->attribute;\n }",
"public function getIdentifyingAttribute();",
"public function get($attribute);",
"public function getRawAttribute($key);",
"public function get($attr = null);",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"public function __get($attribute)\n {\n if ( isset($this->attributes[$attribute]) ) return $this->attributes[$attribute];\n }",
"public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }",
"public function get_attribute($key, $defaut = NULL);",
"public function get_attribute($field){\n\t\treturn $this->{$field};\n\t}",
"public function readAttribute($attribute) {}",
"public function attr() {\n\t\treturn utils::attr($this->attr, func_get_args());\n\t}",
"public function get($attr) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] : null;\n }",
"public function __get($attribute)\n {\n return array_get($this->attributes, $attribute);\n }",
"public function get_attribute($name)\n {\n }",
"public function getAttribute($type)\n {\n return $this->attributes[$type];\n }",
"public function __get($attr)\n {\n return $this->get($attr);\n }",
"public function getAttribute($attribute)\n {\n }",
"public function getAttribute(): string|null\n {\n return $this->attribute;\n }",
"public function __get($attribute) {\n return $this->getAttribute($attribute);\n }",
"public function __get($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function getAttrib() {\n return $this->attrib;\n }",
"public function __GET($attr){\n\n\t\t return $this->$attr;\n\t\t}",
"public function getAttribute($attribute)\r\n\t{\r\n\t\t\r\n\t}",
"public function attribute(string $name) {\n\t\treturn $this->m_attributes[$name] ?? null;\n\t}",
"private function getAttribute($attribute)\n\t{\n\t\treturn isset($this->_data->{$attribute}) ? $this->_data->{$attribute} : '';\n\t}",
"public function getAttribute(string $name);",
"public function getAttribute($name);",
"public function get($attr) {\n if (!isset($this->attrs[$attr])) {\n return null;\n }\n return $this->attrs[$attr];\n }",
"public function getAttribute($attribute)\n {\n return $this->{$attribute};\n }",
"function attribute($text) {\n\t\treturn $this->text($text);\n\t}",
"public function getAttribute($key);",
"public function __attribute($name)\n {\n return $this->__attributes[$name];\n }",
"public function getAttribute($attribute) {\n\t\tif (!$this->attributes) {\n\t\t\t$this->attributes = tx_newspaper::selectOneRow(\n\t\t\t\t'*', tx_newspaper::getTable($this), $this->getCondition()\n\t\t\t);\n\t\t\t$this->setUid($this->attributes['uid']);\n\t\t}\n\n \t\tif (!array_key_exists($attribute, $this->attributes)) {\n \tthrow new tx_newspaper_WrongAttributeException($attribute);\n \t\t}\n \t\treturn $this->attributes[$attribute];\n \t}",
"public function getAttribute($attribute)\n {\n return $this->attributes[$attribute];\n }",
"public function getIdentityAttribute(): string;",
"public function __get($attribute)\r\n {\r\n if ($attribute == 'tag') {\r\n return $this->attributes[0];\r\n }\r\n return array_key_exists($attribute, $this->attributes) ? $this->attributes[$attribute] : null;\r\n }",
"public function get($attributeName);",
"public function __get($name)\n {\n return $this->attributes[$name];\n }",
"public function get($name): Attribute {\n $name = str_replace([\"-\", \" \"], \"_\", strtolower($name));\n if (isset($this->attributes[$name])) {\n return $this->attributes[$name];\n }\n\n return new Attribute($name);\n }",
"public function getAttributes() {}",
"public function getAttributes() {}",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"function std_attr($at){\n switch($at){\n case 'wrap': $attr = array('id'=>strval($this->obj->id));break;\n default:\n $attr = array();\n\n }\n return new opc_attrs(NULL,$attr);\n }",
"public function __get($attr)\n {\n if (isset($this->{$attr})) {\n return $this->{$attr};\n } elseif (method_exists($this, 'get'.camel_case($attr).'Attribute')) {\n $methodName = camel_case('get_'.$attr.'Attribute');\n\n return $this->$methodName();\n }\n }",
"abstract public function getAttribute($key);",
"public function attr($key) {\n\t\treturn isset($this->attributes[$key]) ? $this->attributes[$key] : null;\n\t}",
"public function getAttribute($name)\r\n\t{\r\n\t\treturn $this->__get($name);\r\n\t}",
"public function __get($name)\n\t{\n\t\tif(array_key_exists($name, $this->_attributes))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function get_attribute($key) {\n\t\treturn array_get($this->attributes, $key);\n\t}",
"function get_attribute($attribute)\n\t{\n\t\t$attribute = $this->db->getAttribute(constant(\"PDO::\".$attribute.\"\"));\n\n\t\treturn $attribute;\n\t}",
"function get_attribute( $key ) {\n\t\treturn isset( $this->attributes[$key] ) ? $this->attributes[$key] : null;\n\t}",
"public function getAttribute($name) {\n\t\tif (isset ( $this->$name ))\treturn $this->$name;\n\t}",
"public function getAttributes(){ }",
"public function __get($atrib){\n\t\treturn $this->$atrib;\n\t}",
"public function raw()\n {\n return $this->attr_raw;\n }",
"public function readAttribute($attribute){\n\t\t#if[compile-time]\n\t\tCoreType::assertString($attribute);\n\t\t#endif\n\t\t$this->_connect();\n\t\treturn $this->$attribute;\n\t}",
"public function getAttribute($name)\n {\n if (in_array($name, static::$fields)) {\n return $this->attributes[$name];\n }\n }",
"function getAttributes()\n {\n }",
"public function attr($attribute) {\n if (array_key_exists($attribute, $this->attributes)) {\n return $this->attributes[$attribute];\n } else {\n return 'PopShops API Error: Invalid attribute passed to ' . get_class($this) . '->attr: ' . $attribute;\n }\n }",
"public function __get($key)\n {\n return $this->attributes[$key];\n }",
"public function __get($attr)\n\t{\n\t\t$functionName = \"get\".$attr;\n\t\treturn $this->$functionName();\n\t}",
"public function getAttribute($name)\n {\n $value = false;\n $name = htmlspecialchars($name, ENT_QUOTES);\n if (isset($this->attributes[$name])) {\n $value = $this->attributes[$name];\n }\n return $value;\n }",
"public function getAttribute($key)\n {\n return $this->attributes[$key];\n }",
"public function getAttr(string $key) {\n return (array_key_exists($key, $this->attributes) ? $this->attributes[$key] : null);\n }",
"public function getAttribute($name) {\n\t\tif (property_exists($this, $name))\n\t\t\treturn $this->$name;\n\t\telse if ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t}",
"public function getViaTableAttributesValue();",
"public function getAttribute($key)\n {\n $value = parent::getAttribute($key);\n\n if ($this->encryptable($key)) {\n $value = $this->decryptAttribute($value);\n }\n\n return $value;\n }",
"public function getAttribute()\r\n {\r\n return $this->getElement()->getEntityAttribute();\r\n }",
"public function attribute($id, $name)\n\t{\n\t\treturn $this->connection()->get(\"element/$id/attribute/$name\");\n\t}",
"#[Pure]\n public function withAttribute(string $foo): string\n {\n return $foo;\n }",
"public static function get_attribute_returns() {\n return new external_value(PARAM_RAW, 'The course element attribute value');\n }",
"public function getAttributes()\n {\n }",
"#[\\ReturnTypeWillChange]\n public function offsetGet($offset)\n {\n return $this->attributes[$offset];\n }",
"public function getAttributesProperty()\n {\n return Attribute::whereAttributeType(Customer::class)->get();\n }",
"public function getAttrString(){\n\t\t$this->attrString = '';\n\t\tif(is_array($this->attr))\n\t\t\tarray_walk($this->attr, array($this, 'attrToString')); \n\t}",
"public final function &__get(string $name)\n {\n return $this->attrs[$name];\n }",
"public function __get(string $attribute)\n {\n $getter = 'get' . ucfirst(preg_replace_callback('/_[a-zA-Z0-9]/', function ($matches) {\n $str = '';\n\n foreach ($matches as $match) {\n $str .= ucfirst(str_replace('_', '', $match));\n }\n\n return $str;\n }, $attribute));\n\n if (!method_exists($this, $getter)) {\n return null;\n }\n\n return $this->$getter();\n }",
"public function getAttribute($attr_name)\n {\n return false === $this->hasAttribute($attr_name) ? null : $this->attributes[$attr_name];\n }",
"public function getAttribute($name)\n\t{\n\t\tif(property_exists($this,$name))\n\t\t\treturn $this->$name;\n\t\telseif(isset($this->_attributes[$name])) {\n\t\t\treturn $this->_attributes[$name];\n\t\t}\n\t}",
"public function getSRAttribute($attribute)\n {\n return $this->$attribute;\n }",
"public function getAttribute($key)\n {\n $inAttributes = array_key_exists($key, $this->attributes);\n\n // If the key references an attribute, we can just go ahead and return the\n // plain attribute value from the model. This allows every attribute to\n // be dynamically accessed through the __get method without accessors.\n if ($inAttributes || $this->hasGetMutator($key)) {\n return $this->getAttributeValue($key);\n }\n }",
"public function getAttributeValue() {\n return $this->attributeValue;\n }",
"public function __get($name)\n\t{\n\t\tif (isset($this->attributes[$name])) {\n\t\t\treturn $this->attributes[$name];\n\t\t} \n\t\treturn null;\n\t\t\n\t}",
"public function __get($attribute)\r\n\t{\r\n\t\tif (isset($this->{\"_\".$attribute}))\r\n\t\t{\r\n\t\t\treturn $this->{\"_\".$attribute};\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function __get($name)\n {\n if (isset($this->_attributes[$name]) || array_key_exists($name, $this->_attributes)) {\n return $this->_attributes[$name];\n } elseif ($this->hasAttribute($name)) {\n return null;\n } else {\n return parent::__get($name);\n }\n }",
"public function __get($name)\n\t{\n\t\tif (isset($this->_attributes[$name]))\n\t\t\treturn $this->_attributes[$name];\n\t\treturn null;\n\t}",
"public function getAttribute($key)\n {\n return $this->getAttributeValue($key);\n }",
"public function __get($attribute)\n\t{\n\t\tif (isset($this->{\"_\".$attribute}))\n\t\t{\n\t\t\treturn $this->{\"_\".$attribute};\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getAttributeValue($index = null);"
] | [
"0.7258921",
"0.715107",
"0.7112046",
"0.7079923",
"0.7025909",
"0.6914427",
"0.68775004",
"0.684036",
"0.684036",
"0.68111414",
"0.6805041",
"0.67985743",
"0.67982066",
"0.6755392",
"0.6750193",
"0.6712033",
"0.67109144",
"0.67087054",
"0.6690986",
"0.66888374",
"0.66766447",
"0.66674864",
"0.6657254",
"0.665162",
"0.6603297",
"0.6591337",
"0.6537919",
"0.65146685",
"0.65127176",
"0.6506715",
"0.6502598",
"0.6494105",
"0.64845514",
"0.64673877",
"0.6432675",
"0.64217824",
"0.64029545",
"0.6394635",
"0.6388341",
"0.6370181",
"0.63683283",
"0.63609606",
"0.635466",
"0.6340293",
"0.63401055",
"0.63355094",
"0.63355094",
"0.63355094",
"0.63355094",
"0.63355094",
"0.63355094",
"0.63355094",
"0.63355094",
"0.63355094",
"0.6312912",
"0.63064873",
"0.63061416",
"0.6288513",
"0.628369",
"0.6280284",
"0.62598604",
"0.6247701",
"0.6242155",
"0.62236863",
"0.6220239",
"0.62166256",
"0.6207496",
"0.62060773",
"0.62049913",
"0.61893374",
"0.6186996",
"0.6179937",
"0.61780995",
"0.6171158",
"0.61561054",
"0.614972",
"0.61397994",
"0.6138931",
"0.61387056",
"0.61349165",
"0.6132006",
"0.6107712",
"0.6092924",
"0.60925543",
"0.60813934",
"0.60741264",
"0.6065935",
"0.60577774",
"0.6035596",
"0.60307664",
"0.6028028",
"0.6017768",
"0.6015979",
"0.60121447",
"0.6001246",
"0.59982467",
"0.5996009",
"0.5995988",
"0.59936076",
"0.59779674",
"0.5966074"
] | 0.0 | -1 |
Get an attribute from the $attributes array. | protected function getAttributeFromArray($key)
{
if (array_key_exists($key, $this->attributes)) {
return $this->attributes[$key];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __get($attribute)\n {\n return array_get($this->attributes, $attribute);\n }",
"public function __get($attribute)\n {\n if ( isset($this->attributes[$attribute]) ) return $this->attributes[$attribute];\n }",
"public function get($attribute);",
"public function getAttribute($attribute)\n {\n return $this->attributes[$attribute];\n }",
"public function getAttribute($attributeName) {\n\t\tif (!$this->attributeExists($attributeName)) {\n\t\t\tthrow new CException(\"Unable to resolve attribute '{$attributeName}'!\");\n\t\t}\n\t\treturn $this->_attributes[$attributeName];\n\t}",
"public function attr($attribute) {\n if (array_key_exists($attribute, $this->attributes)) {\n return $this->attributes[$attribute];\n } else {\n return 'PopShops API Error: Invalid attribute passed to ' . get_class($this) . '->attr: ' . $attribute;\n }\n }",
"public function getAttribute($attribute)\n {\n }",
"public function getAttribute($attribute)\n {\n return $this->{$attribute};\n }",
"public function get_attribute($key) {\n\t\treturn array_get($this->attributes, $key);\n\t}",
"public function get($name): Attribute {\n $name = str_replace([\"-\", \" \"], \"_\", strtolower($name));\n if (isset($this->attributes[$name])) {\n return $this->attributes[$name];\n }\n\n return new Attribute($name);\n }",
"public function attribute(string $name) {\n\t\treturn $this->m_attributes[$name] ?? null;\n\t}",
"public function getAttribute(string $attribute): string;",
"public function getAttribute($attribute)\r\n\t{\r\n\t\t\r\n\t}",
"public function __get($name)\n\t{\n\t\tif(array_key_exists($name, $this->_attributes))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function getAttributeByName($attributeName);",
"public function getAttribute($name)\n {\n if (in_array($name, static::$fields)) {\n return $this->attributes[$name];\n }\n }",
"public function readAttribute($attribute) {}",
"public function attr()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && is_array($args[0])) {\n $this->attributes = $args[0];\n return $this;\n } elseif (isset($args[0]) && isset($args[1])) {\n $this->attributes[$args[0]] = $args[1];\n return $this;\n } elseif (isset($args[0])) {\n return isset($this->attributes[$args[0]]) ? $this->attributes[$args[0]] : null;\n }\n\n return $this->attributes;\n }",
"public function getAttribute($attribute) {\n\t\tif (!$this->attributes) {\n\t\t\t$this->attributes = tx_newspaper::selectOneRow(\n\t\t\t\t'*', tx_newspaper::getTable($this), $this->getCondition()\n\t\t\t);\n\t\t\t$this->setUid($this->attributes['uid']);\n\t\t}\n\n \t\tif (!array_key_exists($attribute, $this->attributes)) {\n \tthrow new tx_newspaper_WrongAttributeException($attribute);\n \t\t}\n \t\treturn $this->attributes[$attribute];\n \t}",
"public function get($attributeName);",
"public function getAttribute($type)\n {\n return $this->attributes[$type];\n }",
"public function getAttributesByKey($attributes)\n {\n // Get key value.\n $key = $this->getKey();\n\n if ($key !== null && isset($attributes[$key])) {\n return $attributes[$key];\n }\n\n return $attributes;\n }",
"public function __attribute($name)\n {\n return $this->__attributes[$name];\n }",
"protected function getAttribute(array &$query)\n {\n // Get the attribute to query\n $attribute = array_shift($query);\n\n // Check to see if we received an array\n // of arrays and work from there\n if(is_array($attribute)) {\n $tmp = array_shift($attribute);\n $query = $attribute;\n $attribute = $tmp;\n }\n\n return $attribute;\n }",
"public function attr() {\n\t\treturn utils::attr($this->attr, func_get_args());\n\t}",
"public function getAttribute($name);",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"public function getAttribute($attribute)\n {\n //Check this attribute is support\n if (isset($this->input_map[$attribute])) {\n return $this->input_map[$attribute];\n } else {\n throw new AttributeInvalidException('Attribute not supported by this library');\n }\n }",
"public function __get($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function getAttribute(string $name);",
"public function getAttribute($attribute)\n\t{\n\t\tif(isset($this->attributes[$attribute]))\n\t\t\treturn $this->attributes[$attribute];\n\n\t\treturn null;\n\t}",
"public function __get($attribute)\r\n {\r\n if ($attribute == 'tag') {\r\n return $this->attributes[0];\r\n }\r\n return array_key_exists($attribute, $this->attributes) ? $this->attributes[$attribute] : null;\r\n }",
"public function getAttribute($name)\n {\n return (isset($this->_attributes[$name])) ? $this->_attributes[$name] : NULL;\n }",
"public function __get($name)\n {\n return $this->attributes[$name];\n }",
"function get_atribute_by_attribute($attr_name,$attr_value,$exactly,$name_attr)\n {\n return $this->get_attribute_by_attribute($attr_name,$attr_value,$exactly,$name_attr);\n }",
"public function getAttribute($name) {\n\t\tif (property_exists($this, $name))\n\t\t\treturn $this->$name;\n\t\telse if ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t}",
"public function __get($attribute) {\n return $this->getAttribute($attribute);\n }",
"public function getAttribute($attribute) {\n\t\tif (!isset($this->{$attribute})) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->{$attribute};\n\t}",
"public function getAttribute($attribute) {\n\t\tif (!isset($this->{$attribute})) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->{$attribute};\n\t}",
"public function getAttribute($attribute) {\n\t\tif (!isset($this->{$attribute})) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->{$attribute};\n\t}",
"public function getAttribute($attribute) {\n\t\tif (!isset($this->{$attribute})) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $this->{$attribute};\n\t}",
"function get_attribute($attribute)\n\t{\n\t\t$attribute = $this->db->getAttribute(constant(\"PDO::\".$attribute.\"\"));\n\n\t\treturn $attribute;\n\t}",
"public function get_attribute($name)\n {\n }",
"private function getAttributeValue($attribute)\n {\n return array_key_exists($attribute, $this->data) ? $this->data[$attribute] : null;\n }",
"public function getAttribute($key)\n {\n return $this->attributes[$key];\n }",
"public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }",
"public function offsetGet($key)\n {\n return $this->attributes[$key];\n }",
"function getAttributeValue($name) {\n if(array_key_exists($name, $this->_attributes)) {\n return $this->_attributes[$name];\n } else {\n return null;\n }\n }",
"public function offsetGet($attribute)\n {\n return (\n $this->offsetExists($attribute) ?\n $this->attributeList[$attribute] :\n null\n );\n }",
"public function getAttribute($attribute)\n {\n $attributes = $this->xml_value_[0][\"attributes\"];\n return $attributes[$attribute];\n }",
"public function get($attr) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] : null;\n }",
"public function getAttribute($key);",
"public function getAttribute($name)\n\t{\n\t\tif(property_exists($this,$name))\n\t\t\treturn $this->$name;\n\t\telseif(isset($this->_attributes[$name])) {\n\t\t\treturn $this->_attributes[$name];\n\t\t}\n\t}",
"public function getAttribute($attributeName)\n {\n return $this->attributes->getStructAttributeByName($attributeName);\n }",
"public function getAttribute($attr_name)\n {\n return false === $this->hasAttribute($attr_name) ? null : $this->attributes[$attr_name];\n }",
"public function getAttribute($name)\n {\n return isset($this->attributes[$name]) ? $this->attributes[$name] : null;\n }",
"protected function getAttributeFromArray($key)\n {\n if (array_key_exists($key, $this->attributes))\n return $this->attributes[$key];\n else\n return null;\n }",
"public function getAttribute($name)\r\n\t{\r\n\t\treturn $this->__get($name);\r\n\t}",
"public function getAttr(string $key) {\n return (array_key_exists($key, $this->attributes) ? $this->attributes[$key] : null);\n }",
"function get_attribute( $key ) {\n\t\treturn isset( $this->attributes[$key] ) ? $this->attributes[$key] : null;\n\t}",
"public function attr($key) {\n\t\treturn isset($this->attributes[$key]) ? $this->attributes[$key] : null;\n\t}",
"public function get($name)\n {\n if (array_key_exists($name, $this->attributes)) {\n return $this->attributes[$name];\n }\n\n throw new LogicException(\n sprintf(\n 'Attribute %s does not exist.',\n json_encode($name)\n )\n );\n }",
"public function getAttribute($name) {\n\t\tif (isset ( $this->$name ))\treturn $this->$name;\n\t}",
"public function getAttrib() {\n return $this->attrib;\n }",
"public function findByAttributes(array $attributes)\n {\n return $this\n ->model\n ->where($attributes)\n ->first();\n }",
"#[\\ReturnTypeWillChange]\n public function offsetGet($offset)\n {\n return $this->attributes[$offset];\n }",
"public function __get($attribute) {\n\t\tif (array_key_exists($attribute, $this->_data)) {\n\t\t\treturn $this->_data[$attribute];\n\t\t}\n\n\t\tthrow new Exception(\"unknown attribute {$attribute}\");\n\t}",
"public function __get($name)\n\t{\n\t\tif (isset($this->_attributes[$name]))\n\t\t\treturn $this->_attributes[$name];\n\t\treturn null;\n\t}",
"public function getAttribute($key)\n\t{\n\t\t$value = null;\n\t\tif (array_key_exists($key, $this->attributes)) {\n\t\t\tif (array_key_exists($key, $this->attributes)) {\n\t\t\t\t$value = $this->attributes[$key];\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}",
"public function get($attr) {\n if (!isset($this->attrs[$attr])) {\n return null;\n }\n return $this->attrs[$attr];\n }",
"public function getIdentifyingAttribute();",
"public function readAttribute($attribute){\n\t\t#if[compile-time]\n\t\tCoreType::assertString($attribute);\n\t\t#endif\n\t\t$this->_connect();\n\t\treturn $this->$attribute;\n\t}",
"public function offsetGet($key)\n {\n return $this->attributes->get($key);\n }",
"public function __get($attribute)\r\n\t{\r\n\t\tif (isset($this->{\"_\".$attribute}))\r\n\t\t{\r\n\t\t\treturn $this->{\"_\".$attribute};\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function get($attr = null);",
"public function getAttribute($name)\n {\n return isset($this->attributes[$name]) ? $this->attributes[$name] : false;\n }",
"function getAttribute($Model, $attribute_name) {\n extract($this->settings[$Model->alias]);\n\n return ($Model->{$with}->Attribute->find(\n 'first',\n array(\n 'fields' => array(\n 'Datatype.name',\n 'Datatype.table',\n 'Datatype.validation_proc',\n 'Datatype.format',\n 'Attribute.name',\n 'Attribute.id'\n ),\n 'conditions' => array(\n 'Attribute.name' => $attribute_name,\n ),\n 'recursive' => 0\n )\n )\n );\n }",
"public function __get($name)\n\t{\n\t\tif (isset($this->attributes[$name])) {\n\t\t\treturn $this->attributes[$name];\n\t\t} \n\t\treturn null;\n\t\t\n\t}",
"public function getAttribute($name)\n {\n SERVICES_HYPERESTRAIER_DEBUG && Services_HyperEstraier_Utility::checkTypes(\n array($name, 'string')\n );\n return (isset($this->_attrs[$name])) ? $this->_attrs[$name] : null;\n }",
"public function getAttribute($attribute, $defaultValue = null)\n {\n return array_get($this->attributes, $attribute, $defaultValue);\n }",
"public function getAttribute(): string\n {\n return $this->attribute;\n }",
"public function __get($key)\n {\n return $this->attributes[$key];\n }",
"private function attr($name)\n {\n if (!$this->attrs) {\n $this->attrs = $this->metadata['attrs'];\n }\n\n try {\n return $this->attrs->get($name);\n } catch (InvalidAttrException $e) {\n return null;\n }\n }",
"public function __get(string $name)\n {\n if (array_key_exists($name, $this->attributes)) {\n return $this->attributes[$name];\n }\n \n return null;\n }",
"public function __get($attribute)\n\t{\n\t\tif (isset($this->{\"_\".$attribute}))\n\t\t{\n\t\t\treturn $this->{\"_\".$attribute};\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getAttribute($key)\n {\n if (array_key_exists($key,$this->_attributes)) {\n return $this->_attributes[$key];\n }\n return false;\n }",
"public function get_attribute($field){\n\t\treturn $this->{$field};\n\t}",
"public function getByAttributesFirst(array $attributes)\n {\n return $this->user->where($attributes)->first();\n }",
"public function getAttribute($key)\n\t{\n\t\treturn (($this->_attributes !== NULL && array_key_exists($key, $this->_attributes))? $this->_attributes[$key] : NULL);\n\t}",
"public function __get($attr)\n {\n return $this->get($attr);\n }",
"abstract public function getAttribute($key);",
"public function __GET($attr){\n\n\t\t return $this->$attr;\n\t\t}",
"public function getAttribute($key)\n {\n $inAttributes = array_key_exists($key, $this->attributes);\n\n // If the key references an attribute, we can just go ahead and return the\n // plain attribute value from the model. This allows every attribute to\n // be dynamically accessed through the __get method without accessors.\n if ($inAttributes || $this->hasGetMutator($key)) {\n return $this->getAttributeValue($key);\n }\n }",
"public function __get($name)\n {\n if (isset($this->_attributes[$name]) || array_key_exists($name, $this->_attributes)) {\n return $this->_attributes[$name];\n } elseif ($this->hasAttribute($name)) {\n return null;\n } else {\n return parent::__get($name);\n }\n }",
"public function getAttribute($key)\n {\n if (! $key) {\n return;\n }\n\n if ( array_key_exists($key, $this->attributes) ) {\n return $this->getAttributeValue($key);\n }\n\n if (method_exists(self::class, $key)) {\n return;\n }\n\n return;\n }",
"public function attribute($id, $name)\n\t{\n\t\treturn $this->connection()->get(\"element/$id/attribute/$name\");\n\t}",
"private function getAttribute($attribute, $property = NULL, $callback = NULL) {\n\t\t$attributes = array_map(function($attributes) use ($attribute, $callback) {\n\t\t\t$value = isset($attributes[$attribute]) ? $attributes[$attribute] : NULL;\n\n\t\t\tif (is_callable($callback))\n\t\t\t\t$value = call_user_func($callback, $value);\n\n\t\t\treturn $value;\n\t\t}, (array) $this);\n\n\t\tif (isset($property))\n\t\t\treturn isset($attributes[$property]) ? $attributes[$property] : NULL;\n\n\t\treturn $attributes;\n\t}"
] | [
"0.72491",
"0.68765575",
"0.6843601",
"0.6758843",
"0.6733515",
"0.66935533",
"0.6678788",
"0.6601271",
"0.65416783",
"0.6533229",
"0.65319824",
"0.6495795",
"0.6488818",
"0.6457798",
"0.64456236",
"0.6427168",
"0.642036",
"0.6388759",
"0.63680077",
"0.63577133",
"0.63506186",
"0.6319238",
"0.63108474",
"0.63025844",
"0.6299032",
"0.6297673",
"0.62885934",
"0.62885934",
"0.6287066",
"0.62864006",
"0.627051",
"0.62462926",
"0.6245848",
"0.62457913",
"0.6234516",
"0.6233338",
"0.622385",
"0.6210498",
"0.6207055",
"0.6207055",
"0.6207055",
"0.6207055",
"0.6183712",
"0.61585796",
"0.6156916",
"0.61567044",
"0.615339",
"0.6146232",
"0.6137395",
"0.6130488",
"0.612886",
"0.61247945",
"0.612241",
"0.61132187",
"0.6110122",
"0.6098153",
"0.6091651",
"0.60830635",
"0.6068005",
"0.6056644",
"0.60554385",
"0.60424507",
"0.6030201",
"0.6025707",
"0.6004254",
"0.60024345",
"0.599554",
"0.59901655",
"0.5978371",
"0.5978125",
"0.5967266",
"0.59578484",
"0.5945312",
"0.59437555",
"0.5943273",
"0.5942195",
"0.59369814",
"0.59352386",
"0.5929714",
"0.5926167",
"0.5914022",
"0.5904596",
"0.58993286",
"0.5894949",
"0.5892242",
"0.58912724",
"0.5886435",
"0.5883512",
"0.5868519",
"0.5862102",
"0.585943",
"0.5852982",
"0.5852578",
"0.58519953",
"0.58506644",
"0.5835073",
"0.5828925",
"0.58127743"
] | 0.6207074 | 40 |
Determine if a get mutator exists for an attribute. | public function hasGetMutator($key)
{
return $this->methodExists('get'.Str::studly($key).'Attribute');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . Str::studly($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . studly_case($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }",
"public function hasAttributeGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasAttributeGetMutator($key);\n }",
"protected function hasGetMutator($key)\n {\n return method_exists($this, 'set' . $this->getMutatorName($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return $this->hasField($key);\n }",
"public function hasGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasGetMutator($key);\n }",
"protected function hasAccessor(string $key, ?string &$accessor = null): bool\n {\n $studly_key = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $key)));\n $accessor = 'get' . $studly_key . 'Property';\n\n return method_exists($this, $accessor);\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . Str::studly($key) . 'Attribute');\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . studly_case($key) . 'Attribute');\n }",
"public function __isset($key)\n {\n return isset($this->attributes[$key]) ||\n (\n $this->hasGetMutator($key) &&\n !is_null($this->getAttribute($key))\n );\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }",
"public function hasSetMutator($key)\n {\n return $this->methodExists('set'.Str::studly($key).'Attribute');\n }",
"public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }",
"public function is_get() {\n return $this->method == 'get';\n }",
"public function hasAttribute($key);",
"public static function isGet(): bool {\r\n return static :: isMethod('get');\r\n }",
"public function hasAttr ($attr) { return $this->hasAttribute($attr); }",
"public function hasGet(string $name): bool {}",
"public function hasAttr($attr);",
"private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }",
"public function __isset($attribute) {\n return $this->hasAttribute($attribute);\n }",
"private function has_attribute($attribute) {\n\t\t// Wil return true or false\n\t\t$object_vars = get_object_vars($this);\n\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}",
"public function hasAttribute(string $name): bool;",
"public function __isset($key)\n {\n return (isset($this->attributes[$key]) || isset($this->relations[$key])) ||\n ($this->hasGetMutator($key) && !is_null($this->getAttributeValue($key)));\n }",
"private function has_attribute($attribute) {\r\n // (incl. private ones!) as the keys and their current values as the value\r\n $object_vars = get_object_vars($this);\r\n // We don't care about the value, we just want to know if the key exists\r\n // Will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }",
"private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}",
"public function testModelAttributeExists()\n {\n // exists mutator\n $this->assertFalse($this->post->hasGetMutator('id'));\n $this->assertArrayHasKey('id', $this->post->getAttributes());\n\n // exists native\n $this->assertTrue($this->post->hasGetMutator('exits'));\n $this->assertArrayNotHasKey('exits', $this->post->getAttributes());\n\n // not exists\n $this->assertFalse($this->post->hasGetMutator('notExits'));\n $this->assertArrayNotHasKey('notExits', $this->post->getAttributes());\n }",
"public function supportsAttribute($attribute);",
"public function isAccessor(CComponent $object, $type)\n {\n $accessor = property_exists($object, $this->name);\n if ($object instanceof CActiveRecord)\n {\n if ($object->hasAttribute($this->name))\n {\n return true;\n }\n }\n if (!$accessor && $object->{'can' . ucfirst($type) . 'Property'}($this->name))\n {\n $m = new ReflectionMethod($object, $type . $this->name);\n if ($m->getNumberOfRequiredParameters() <= ($type == 'set' ? 1 : 0))\n {\n $accessor = true;\n }\n else\n {\n return false;\n }\n }\n\n if (!$accessor)\n {\n $accessor = $object->hasEvent($this->name);\n }\n if (!$accessor && $object instanceof CActiveRecord)\n {\n $rels = $object->relations();\n $accessor = isset($rels[$this->name]);\n }\n return $accessor;\n }",
"public function has($attribute);",
"private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}",
"private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}",
"protected function handleGetMutatorColumn($method, $label)\n {\n if ($this->model()->eloquent()->hasGetMutator($method)) {\n return $this->addColumn($method, $label);\n }\n\n return false;\n }",
"private function has_attribute($attribute){\r\n\t // (incl. private ones!) as the keys and their current values as the value\r\n\t $object_vars = get_object_vars($this);\r\n\t // We don't care about the value, we just want to know if the key exists\r\n\t // Will return true or false\r\n\t return array_key_exists($attribute, $object_vars);\r\n }",
"public function method_exists($method)\n {\n if (!is_string($method)) {\n return false;\n }\n \n if (method_exists($this, $method)) {\n return true;\n }\n \n if ((substr($method, 0, 3) == 'get' || substr($method, 0, 3) == 'set')\n && property_exists($this, lcfirst(substr($method, 3)))\n ) {\n return true;\n }\n \n return false;\n }",
"public function hasAttribute($attr_name)\n {\n return isset($this->attributes[$attr_name]);\n }",
"public function hasAttribute(string $key)\n {\n return isset($this->getAttributes()[$key]);\n }",
"private function has_attribute($attribute){\n\t\t//(inlcuding private ones) as keys and current values as value.\n\t\t\n\t\t$object_vars = $this->attributes();\n\t\t//want to check key exists, dont care about value here\n\t\t//returns true or false\t\n\t\t\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}",
"public function __get($attribute)\n\t{\n\t\tif (isset($this->{\"_\".$attribute}))\n\t\t{\n\t\t\treturn $this->{\"_\".$attribute};\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isGet(): bool {}",
"public function isGet()\n {\n return $this->getMethod() === self::METHOD_GET;\n }",
"private function has_attribute($attribute){\n // (including private ones) as the keys and their current values as the value\n $object_vars = get_object_vars($this);\n\n // We don't care about the value, we just want to know if the key exists\n // does $attribute(key) exist in $object_vars\n // Will return true or false\n return array_key_exists($attribute, $object_vars);\n }",
"public function isGet();",
"public function __get($attribute)\r\n\t{\r\n\t\tif (isset($this->{\"_\".$attribute}))\r\n\t\t{\r\n\t\t\treturn $this->{\"_\".$attribute};\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function attrExists($attrKey) {\n return isset($this->attributes[$attrKey]);\n }",
"public function isGet(): bool\n {\n return $this->getMethod() === self::METHOD_GET;\n }",
"public function hasAttribute($attribute)\n {\n return (isset($this->attributes[$attribute]));\n }",
"private function has_attribute($attribute)\n\t\t{\n\t\t//(incl. private ones!) as the keys and their current values as the value\n\t\t$object_vars = get_object_vars($this);\n\t\t//we don't care about the value, we just want to know if the key exists \n\t\t//will return true or false\n\t\treturn array_key_exists($attribute, $object_vars);\n\t\t}",
"private function has_attribute($attribute)\n {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }",
"public function getIsGet()\n {\n return $this->getMethod() === 'GET';\n }",
"public function getIsGet()\n {\n return $this->getMethod() === 'GET';\n }",
"private function has_the_attribute($the_attribute){\n \n $object_properties = get_object_vars($this); //Function get_object_vars\n \n return array_key_exists($the_attribute, $object_properties);\n }",
"protected abstract function supportsAttribute($attribute);",
"function IsAttributeModifiable( $attribute )\r\n\t{\r\n\t\treturn getFactory()->getAccessPolicy()->can_modify_attribute($this->getObject(), $attribute)\r\n && $this->getObject()->getAttributeEditable($attribute);\r\n\t}",
"public function hasAttribute(string $attribute): bool\n {\n return array_key_exists($attribute, $this->data);\n }",
"public function hasAttribute ($attr) {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\tif (!$node->attributes->getNamedItem($attr)) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function isAttribute($field){\n\t\treturn $this->hasField($field);\n\t}",
"protected function isMutatorMethod($callable)\n {\n return method_exists($this, $callable) || static::hasMacro($callable);\n }",
"private function has_attribute($attribute){\r\n //(incl.private ones!) as the keys and their current values as the value\r\n $object_vars = $this->attributes();\r\n //we dont care about the value, we just want to know if the key exists\r\n //will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }",
"public function isGet()\n {\n return $this->getMethod() == 'GET';\n }",
"public function isGet()\n {\n return ($this->getMethod() == 'GET') ? true : false;\n }",
"public function isGet()\n {\n return $this->getMethod() === 'GET';\n }",
"public function isGet()\n {\n return $this->getMethod() === 'GET';\n }",
"public function hasAttr($key) {\n\t\treturn isset($this->attributes[$key]);\n\t}",
"public function isGet() {\n return $this->method == self::METHOD_GET;\n }",
"public function __isset($key)\n {\n return isset($this->attributes[$key]);\n }",
"public function __isset($key)\n {\n return isset($this->attributes[$key]);\n }",
"public function isGet()\n {\n return $this->method === self::METHOD_GET;\n }",
"public function __get($attr)\n {\n if (isset($this->{$attr})) {\n return $this->{$attr};\n } elseif (method_exists($this, 'get'.camel_case($attr).'Attribute')) {\n $methodName = camel_case('get_'.$attr.'Attribute');\n\n return $this->$methodName();\n }\n }",
"public function __isset($key)\n {\n return ($this->tinydb_getset_is_table_field($key) || $this->tinydb_getset_is_method(\"get_$key\") ||\n $this->tinydb_getset_is_foreign($key));\n }",
"public function has_the_attribute($the_attribute){\n\t\t$object_properties = get_object_vars($this); \n\t\treturn array_key_exists($the_attribute,$object_properties);\n\t }",
"public function hasGet($name)\n {\n return isset($this->get[$name]) ? $this->get[$name] : false;\n }",
"public function isAttributeSave(string $attribute): bool;",
"public function __isset($key) {\n\t\tforeach (array('attributes', 'relationships') as $source) {\n\t\t\tif (array_key_exists($key, $this->$source)) return true;\n\t\t}\n\n\t\tif (method_exists($this, $key)) return true;\n\t}",
"private function has_attribute($attribute) {\r\n\t\t//get_object_vars returns an associative array with all attributes as the keys and their current values as value\r\n\t\t\t\t\t\t//this refers to get_object_vars\r\n\t\t$object_vars = get_object_vars($this);\r\n\t\t//checks to see if the key exists\r\n\r\n\t\t//returns true of false\r\n\t\t//does the key attribute exists in the array object vars?\r\n\t\treturn array_key_exists($attribute, $object_vars);\r\n\t}",
"public function isGet()\n\t{\n\t\treturn $this->httpMethod() == self::MethodGet;\n\t}",
"public function __isset($name)\n {\n $getter = $this->toCamel('get', $name);\n if (method_exists($this, $getter)) {\n return null !== $this->$getter();\n }\n\n return false;\n }",
"protected function has_get( $key = '' ) {\n\t\treturn $this->has( $key, 'GET' );\n\t}",
"private function has_attribute($attritube)\n {\n $allattribute=$this->attribute();\n if(array_key_exists($attritube,$allattribute))\n return true;\n return false;\n }",
"public function isGet(): bool\n {\n return $this->method === self::GET;\n }",
"public function isGet(): bool \r\n {\r\n return $this -> method() === 'GET' ? true : false;\r\n }",
"public function isGet() {\n return $this->method == 'GET';\n }",
"public function isGet() {\n\t\tif ('GET' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function __isset($name)\n\t{\n\t\t$name = ucfirst(strtolower($name));\n\t\t$method = \"get{$name}\";\n\n\t\treturn method_exists($this, $method);\n\t}",
"public function isGet() :bool\n {\n return $this->getMethod() === 'GET';\n }",
"public function canGetProperty($name) {\r\n return parent::canGetProperty($name)||$this->__isset($name);\r\n }",
"public function isGet()\n {\n if ('GET' == $this->getMethod()) {\n return true;\n }\n\n return false;\n }",
"public function has($attribute = null) {\n return $this->hasAttribute($attribute);\n }",
"private function has_attribute($attribute)\n {\n //including priate ones as the keys and their current values are the value\n $object_vars = $this->attributes();\n\n //here i do not care what the specific values are but just interested if they exist\n return array_key_exists($attribute, $object_vars);\n }",
"public function isGet()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::GET;\n }",
"public function hasAttribute($name) {\n\t\treturn isset($this->_attributes[$name]);\n\t}",
"public function hasAttribute($key)\n {\n return $this->getAttribute($key) !== null;\n }",
"public function hasAttributeSavedMethod($attribute)\n {\n return method_exists($this, 'saved'.Str::studly($attribute).'Attribute');\n }",
"public function __isset($name)\n {\n $getter = 'get' . $name;\n if (method_exists($this, $getter)) {\n return $this->$getter() !== null;\n }\n\n\n return false;\n }",
"public function hasAttributeByName($attributeName);",
"public function hasAttribute($name)\n {\n return isset($this->attributes[$name]);\n }",
"public function __isset($name)\n {\n $getter = 'get' . $name;\n if (method_exists($this, $getter)) {\n return $this->$getter() !== null;\n } else {\n return false;\n }\n }"
] | [
"0.7768784",
"0.77530867",
"0.7690894",
"0.7690894",
"0.7635883",
"0.75039136",
"0.72599494",
"0.711803",
"0.65001476",
"0.64817536",
"0.6368092",
"0.63547635",
"0.6345683",
"0.6345683",
"0.6326818",
"0.62785614",
"0.6278046",
"0.62641793",
"0.6239149",
"0.62237495",
"0.615508",
"0.6146525",
"0.61241883",
"0.60715777",
"0.6043055",
"0.6042976",
"0.6027482",
"0.601844",
"0.60154694",
"0.5985118",
"0.5982606",
"0.5982592",
"0.5982252",
"0.59705776",
"0.59705776",
"0.59618104",
"0.5937936",
"0.593305",
"0.5932933",
"0.59163874",
"0.59123975",
"0.58986485",
"0.5884026",
"0.58727777",
"0.5860733",
"0.58594996",
"0.5838767",
"0.5834303",
"0.58297133",
"0.5819555",
"0.5816714",
"0.57957196",
"0.5795056",
"0.5795056",
"0.5785497",
"0.5783343",
"0.5782924",
"0.57705975",
"0.57529753",
"0.5752025",
"0.5749685",
"0.5740524",
"0.5739346",
"0.57346094",
"0.57268286",
"0.57268286",
"0.57145077",
"0.56965804",
"0.5688528",
"0.5688528",
"0.5673499",
"0.5671748",
"0.56621385",
"0.56588495",
"0.56538355",
"0.5647006",
"0.56399554",
"0.56394887",
"0.56355053",
"0.56217915",
"0.5616514",
"0.56163317",
"0.5615704",
"0.56113005",
"0.5610106",
"0.560967",
"0.5598424",
"0.55982053",
"0.55919564",
"0.5582125",
"0.55751127",
"0.55693376",
"0.55691904",
"0.5552165",
"0.5547452",
"0.5543517",
"0.55418456",
"0.55408174",
"0.553818",
"0.55372924"
] | 0.7816478 | 0 |
Get the value of an attribute using its mutator. | protected function mutateAttribute($key, $value)
{
return $this->{'get'.Str::studly($key).'Attribute'}($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getValueAttribute() {}",
"public function getAttribute($key)\n {\n $value = $this->getAttributeValue($key);\n\n // First we will check for the presence of a mutator for the set operation\n // which simply lets the developers tweak the attribute as it is set.\n if ($this->hasGetMutator($key)) {\n $method = 'get' . Str::studly($key) . 'Attribute';\n\n return $this->{$method}($value);\n }\n\n return $value;\n }",
"public function getValue(string $attr)\n {\n $this->checkAttribute($attr);\n return $this->attributes[$attr];\n }",
"public function get($attribute);",
"public function __get($attr)\n {\n return $this->get($attr);\n }",
"public function __GET($attr){\n\n\t\t return $this->$attr;\n\t\t}",
"public function getAttributeValue() {\n return $this->attributeValue;\n }",
"public function __get($attribute) {\n return $this->getAttribute($attribute);\n }",
"public function getValue() {\n return $this->attributes['value'];\n }",
"public function __get($attribute)\n {\n if ( isset($this->attributes[$attribute]) ) return $this->attributes[$attribute];\n }",
"public function __get($attr)\n {\n if (isset($this->{$attr})) {\n return $this->{$attr};\n } elseif (method_exists($this, 'get'.camel_case($attr).'Attribute')) {\n $methodName = camel_case('get_'.$attr.'Attribute');\n\n return $this->$methodName();\n }\n }",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"public function getAttr(): string\r\n {\r\n return $this->attr;\r\n }",
"public function __get($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function __get($attribute)\n {\n return array_get($this->attributes, $attribute);\n }",
"public function getAttribute($key)\n {\n // Before Event\n if (($attr = $this->fireEvent('model.beforeGetAttribute', [$key], true)) !== null) {\n return $attr;\n }\n\n $value = $this->getAttributeFromArray($key);\n\n // If the attribute has a get mutator, we will call that then return what\n // it returns as the value, which is useful for transforming values on\n // retrieval from the model to a form that is more useful for usage.\n if ($this->hasGetMutator($key)) {\n return $this->mutateAttribute($key, $value);\n }\n\n // After Event\n if (($_attr = $this->fireEvent('model.getAttribute', [$key, $attr], true)) !== null) {\n return $_attr;\n }\n\n return $value;\n }",
"public function get($attr) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] : null;\n }",
"public function __get($attr)\n\t{\n\t\t$functionName = \"get\".$attr;\n\t\treturn $this->$functionName();\n\t}",
"public function get($attr = null);",
"public function __get($name)\n {\n $attribute = parent::__get($name);\n if ($name == 'values' && $attribute) {\n return $attribute[0]['value'];\n }\n return $attribute;\n }",
"function getValue()\n {\n return $this->getAttribute(\"value\");\n }",
"public function __get($name)\n {\n if(isset($this->_attribs[$name]))\n return $this->_attribs[$name];\n return $this->_value->$name;\n }",
"public function getAttributeValue($key)\n {\n $value = $this->getAttributeFromArray($key);\n\n // If the attribute has a get mutator, we will call that then return what\n // it returns as the value, which is useful for transforming values on\n // retrieval from the model to a form that is more useful for usage.\n if ($this->hasGetMutator($key)) {\n return $this->mutateAttribute($key, $value);\n }\n\n // decrypt value before casts\n if (in_array($key, $this->encryptable) && !is_null($value) && $value !== '') {\n $value = $this->decrypt($value);\n }\n\n // If the attribute exists within the cast array, we will convert it to\n // an appropriate native PHP type dependant upon the associated value\n // given with the key in the pair. Dayle made this comment line up.\n if ($this->hasCast($key)) {\n return $this->castAttribute($key, $value);\n }\n\n // If the attribute is listed as a date, we will convert it to a DateTime\n // instance on retrieval, which makes it quite convenient to work with\n // date fields without having to create a mutator for each property.\n if (in_array($key, $this->getDates()) &&\n ! is_null($value)) {\n return $this->asDateTime($value);\n }\n\n return $value;\n }",
"public function getAttribute(): string\n {\n return $this->attribute;\n }",
"public function getAttributeValue($key)\n {\n $value = parent::getAttributeValue($key);\n\n //Some database values are store as different types that we would like.\n //Check to see if any mutators are registered and if so mutate the\n //value from the database.\n $value = $this->decodeAttributeValue($key,$value);\n\n return $value;\n }",
"public function get($attributeName);",
"public function get()\n {\n \n return $this->value;\n \n }",
"public function getValueAttribute($value)\n {\n return $value;\n }",
"public final function &__get(string $name)\n {\n return $this->attrs[$name];\n }",
"public function __get($name)\n {\n return $this->attributes[$name];\n }",
"public function getAttribute($key)\n {\n $inAttributes = array_key_exists($key, $this->attributes);\n\n // If the key references an attribute, we can just go ahead and return the\n // plain attribute value from the model. This allows every attribute to\n // be dynamically accessed through the __get method without accessors.\n if ($inAttributes || $this->hasGetMutator($key)) {\n return $this->getAttributeValue($key);\n }\n }",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class]))\n static::cacheMutatedAttributes($class);\n\n return static::$mutatorCache[$class];\n }",
"public function __get($name) {\n // attribute-reader value\n if(in_array($name, $this->_attrReaders)) {\n return $this->_get($name);\n }\n // call overloading for subclass\n if(method_exists($this, '_get')) {\n return $this->_get($name);\n }\n show_error(\"Unrecognized attribute '$name'\");\n }",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }",
"public function getAttribute(string $attribute): string;",
"public function getAccessor()\n {\n return $this->accessor;\n }",
"protected function mutateAttribute($key, $value)\n {\n return $this->{'get' . studly_case($key) . 'Attribute'}($value);\n }",
"public function get()\n {\n return $this->value;\n }",
"public function get()\n {\n return $this->value;\n }",
"public function get()\n {\n return $this->value;\n }",
"public function get()\n {\n return $this->value;\n }",
"public function __get($name)\n\t{\n\t\tif(array_key_exists($name, $this->_attributes))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function __invoke() {\n \n return $this->_value;\n }",
"public function __get( string$attribute )\n\t{\n\t\t$getter= \"__get__$attribute\";\n\t\t\n\t\tif( is_callable( [ $this, $getter ] ) )\n\t\t\treturn $this->$getter();\n\t\telse\n\t\tif( get_parent_class( self::class ) && is_callable( [ $this, parent::__get, ] ) )\n\t\t\treturn parent::__get( $attribute );\n\t\telse\n\t\t\treturn null;\n\t}",
"public function __invoke()\n {\n return $this->value;\n }",
"public function get()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function __get($key)\n {\n return $this->attributes[$key];\n }",
"public function getAttributeToEditProperty()\n {\n return Attribute::find($this->editAttributeId);\n }",
"public function getAttribute()\r\n {\r\n return $this->getElement()->getEntityAttribute();\r\n }",
"#[\\ReturnTypeWillChange]\n public function offsetGet($offset)\n {\n return $this->attributes[$offset];\n }",
"protected function mutateAttribute($key, $value)\n {\n if (! array_key_exists($key, $this->{config('mutators.accessors_property')} ?: [])) {\n $value = parent::mutateAttribute($key, $value);\n } elseif (method_exists($this, 'get'.Str::studly($key).'Attribute')) {\n $value = parent::mutateAttribute($key, $value);\n }\n\n return $this->applyAccessors($key, $value);\n }",
"public function attr() {\n\t\treturn utils::attr($this->attr, func_get_args());\n\t}",
"public function __get($name)\n\t{\n\t\t// return custom field value\n\t\tif ($this->isCustomField($name)) {\n\t\t\treturn $this->getCustomFieldModel($name)->value;\n\t\t}\n\t\t\n\t\t// return model attribute\n\t\treturn $this->getAttribute($name);\n\t}",
"public function __get($value);",
"public function __get($field)\n {\n $this->checkForNecessaryProperties();\n\n $unmodifiedField = lcfirst(str_replace('unmodified', '', $field));\n\n if (!array_key_exists($unmodifiedField, $this->data)) {\n return NULL;\n }\n\n $attributeMutator = 'get' . str_replace('_', '', ucwords($field, '_')) . 'Attribute';\n return (method_exists($this, $attributeMutator)) ? call_user_func([$this, $attributeMutator]) : $this->data[$unmodifiedField];\n }",
"public function getMutatedAttributes()\n {\n $class = static::class;\n\n if (! isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }",
"public function getAttribute($attribute)\n {\n return $this->{$attribute};\n }",
"public function get()\n {\n $this->set();\n \n return $this->value;\n }",
"public function __get($attr) {\n if ($this->isMeta($attr)) {\n return isset($this->meta()->$attr) ? $this->meta()->$attr : null;\n } else {\n return parent::__get($attr);\n }\n }",
"public function __get($atributo) {\n\t\t\treturn $this->$atributo;\n\t\t}",
"public function __get($atrib){\n\t\treturn $this->$atrib;\n\t}",
"public function get_attribute($field){\n\t\treturn $this->{$field};\n\t}",
"public function readAttribute($attribute) {}",
"public function __get($name) {\n if (!isset($this->attributes[$name]) && isset($this->builders[$name])) {\n $this->attributes[$name] = $this->builders[$name]($this);\n }\n\n return $this->attributes[$name];\n }",
"public function __get($atributo){\n\t\treturn $this->$atributo;\n\t}",
"function __get($attribute)\n {\n if(method_exists($this,$attribute)){\n return $this->{$attribute}();\n }\n return $this->model->{$attribute};\n }",
"public function getAttribute($key)\n {\n $value = parent::getAttribute($key);\n\n if ($this->encryptable($key)) {\n $value = $this->decryptAttribute($value);\n }\n\n return $value;\n }",
"public function get($atributo) {\r\n\t\t\treturn $this->$atributo;\r\n\t\t}",
"final public function getValue()\n {\n return $this->value;\n }",
"function getValue() {\n return $this->value;\n }",
"public function getAttributeValue($key)\n {\n $value = parent::getAttributeValue($key);\n\n return $this->applyAccessors($key, $value);\n }",
"public function get($attr) {\n if (!isset($this->attrs[$attr])) {\n return null;\n }\n return $this->attrs[$attr];\n }",
"public function __get(string $attribute)\n {\n $getter = 'get' . ucfirst(preg_replace_callback('/_[a-zA-Z0-9]/', function ($matches) {\n $str = '';\n\n foreach ($matches as $match) {\n $str .= ucfirst(str_replace('_', '', $match));\n }\n\n return $str;\n }, $attribute));\n\n if (!method_exists($this, $getter)) {\n return null;\n }\n\n return $this->$getter();\n }",
"function __get($name) {\n if(array_key_exists($name, $this->_prop)) return $this->_prop[$name];\n return $this->attr($name);\n }",
"public function __get($attribute)\r\n {\r\n if ($attribute == 'tag') {\r\n return $this->attributes[0];\r\n }\r\n return array_key_exists($attribute, $this->attributes) ? $this->attributes[$attribute] : null;\r\n }",
"public function __get($attribute)\n {\n if (!isset($this->{$attribute})) {\n Error::set(Error::ERROR_INVALID_PROPERTY, [$attribute], Error::ERROR);\n }\n return $this->{$attribute};\n }",
"public function getAttrib() {\n return $this->attrib;\n }",
"public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }",
"public function getValue() {\n\t\treturn $this -> value;\n\t}",
"public function getValor($atributo){//retornar algún valor\n \treturn $this->$atributo;\n }",
"public function __get($key)\n\t{\n\t\treturn $this->getAttribute($key);\n\t}",
"public function __get($key) {\n if (key_exists($key, $this->getCachedProperties())) {\n return $this->castAttribute($key, $this->getCachedProperties()[$key]);\n }\n\n return parent::__get($key);\n }",
"public function getAttributeValue($key)\n {\n $value = $this->getAttributeFromArray($key);\n\n // If the attribute has a get mutator, we will call that then return what\n // it returns as the value, which is useful for transforming values on\n // retrieval from the model to a form that is more useful for usage.\n if ($this->hasGetMutator($key)) {\n return $this->mutateAttribute($key, $value);\n }\n\n // If the attribute exists within the cast array, we will convert it to\n // an appropriate native PHP type dependant upon the associated value\n // given with the key in the pair. Dayle made this comment line up.\n if ($this->hasCast($key)) {\n return $this->castAttribute($key, $value);\n }\n\n return $value;\n }",
"public function get_attribute($key, $defaut = NULL);",
"protected function mutateAttribute($key, $value)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return $value;\n }\n\n return parent::mutateAttribute($key, $value);\n }",
"public function __attribute($name)\n {\n return $this->__attributes[$name];\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"function get_value() {return $this->get();}",
"public function getAttribute($name) {\n\t\tif (property_exists($this, $name))\n\t\t\treturn $this->$name;\n\t\telse if ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t}",
"public function getValue(){\n return $this->_value;\n }",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"public function get_attribute($name)\n {\n }",
"public function getValueAttribute()\n\t{\n\t\treturn $this->attributes['valor_total'];\n\t}",
"public function getAttribute($name) {\n\t\tif (isset ( $this->$name ))\treturn $this->$name;\n\t}"
] | [
"0.68495345",
"0.661161",
"0.65844136",
"0.6577312",
"0.6557404",
"0.655217",
"0.6447143",
"0.6400954",
"0.6361808",
"0.63159263",
"0.63065463",
"0.6277778",
"0.6277778",
"0.6191973",
"0.61884415",
"0.6176769",
"0.61404353",
"0.6088523",
"0.6080024",
"0.6064639",
"0.605968",
"0.6055782",
"0.6053669",
"0.60187835",
"0.5995621",
"0.59947175",
"0.5991448",
"0.59814423",
"0.59763163",
"0.59756017",
"0.59555167",
"0.5950741",
"0.5948536",
"0.5942549",
"0.59248793",
"0.59240216",
"0.5914351",
"0.5900505",
"0.5897953",
"0.5897953",
"0.5897953",
"0.5897953",
"0.5875127",
"0.58688587",
"0.584375",
"0.5842636",
"0.5841234",
"0.5828678",
"0.58184755",
"0.5803306",
"0.5792638",
"0.5779643",
"0.5761484",
"0.5748587",
"0.5746472",
"0.5745428",
"0.57442206",
"0.5742813",
"0.57417995",
"0.5737106",
"0.57317764",
"0.5727718",
"0.5725321",
"0.5718301",
"0.57143384",
"0.57076764",
"0.57068515",
"0.5706023",
"0.5693031",
"0.5689352",
"0.5688637",
"0.5685994",
"0.5684829",
"0.56826633",
"0.5682622",
"0.5668148",
"0.56620955",
"0.5661377",
"0.5658775",
"0.56570643",
"0.5652082",
"0.56508166",
"0.5649175",
"0.5647851",
"0.5642154",
"0.56418675",
"0.5637823",
"0.5637514",
"0.5637514",
"0.5637514",
"0.563148",
"0.5627421",
"0.5626712",
"0.5625223",
"0.5625223",
"0.56209487",
"0.5603113",
"0.5600497"
] | 0.5849656 | 45 |
Get the value of an attribute using its mutator for array conversion. | protected function mutateAttributeForArray($key, $value)
{
$value = $this->mutateAttribute($key, $value);
return $value instanceof Arrayable ? $value->toArray() : $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getValueAttribute() {}",
"public function __get($name)\n {\n $attribute = parent::__get($name);\n if ($name == 'values' && $attribute) {\n return $attribute[0]['value'];\n }\n return $attribute;\n }",
"public function __get($attribute)\n {\n return array_get($this->attributes, $attribute);\n }",
"public function getInternalValueAttribute()\n {\n $value = $this->data->get($this->localKey);\n if (!$this->is_serialized) {\n return $value;\n }\n \n return (@unserialize($value) ?: []);\n }",
"#[\\ReturnTypeWillChange]\n public function offsetGet($offset)\n {\n return $this->attributes[$offset];\n }",
"public function getValue(string $attr)\n {\n $this->checkAttribute($attr);\n return $this->attributes[$attr];\n }",
"public function __get($attr)\n {\n return $this->get($attr);\n }",
"public function getAttributeValue($key)\n {\n $value = $this->getAttributeFromArray($key);\n\n // If the attribute has a get mutator, we will call that then return what\n // it returns as the value, which is useful for transforming values on\n // retrieval from the model to a form that is more useful for usage.\n if ($this->hasGetMutator($key)) {\n return $this->mutateAttribute($key, $value);\n }\n\n // decrypt value before casts\n if (in_array($key, $this->encryptable) && !is_null($value) && $value !== '') {\n $value = $this->decrypt($value);\n }\n\n // If the attribute exists within the cast array, we will convert it to\n // an appropriate native PHP type dependant upon the associated value\n // given with the key in the pair. Dayle made this comment line up.\n if ($this->hasCast($key)) {\n return $this->castAttribute($key, $value);\n }\n\n // If the attribute is listed as a date, we will convert it to a DateTime\n // instance on retrieval, which makes it quite convenient to work with\n // date fields without having to create a mutator for each property.\n if (in_array($key, $this->getDates()) &&\n ! is_null($value)) {\n return $this->asDateTime($value);\n }\n\n return $value;\n }",
"public function get($attribute);",
"public function getValue()\n {\n $value = $this->value;\n $attribute = $this->getAttribute();\n if ($attribute->getFieldTypeChoiceType()) {\n if ($value) {\n $value = json_decode($value);\n } else {\n $value = [];\n }\n }\n\n return $value;\n }",
"public function getAttributeValue() {\n return $this->attributeValue;\n }",
"public function getValue() {\n return $this->attributes['value'];\n }",
"public function __get($attribute)\n {\n if ( isset($this->attributes[$attribute]) ) return $this->attributes[$attribute];\n }",
"public function __get($attribute) {\n return $this->getAttribute($attribute);\n }",
"public function __GET($attr){\n\n\t\t return $this->$attr;\n\t\t}",
"public function getValue()\n {\n if ($this->isArrayField()) {\n return json_decode($this->value);\n }\n return $this->value;\n }",
"public function getAttributeValue($key)\n {\n $value = $this->getAttributeFromArray($key);\n\n // If the attribute has a get mutator, we will call that then return what\n // it returns as the value, which is useful for transforming values on\n // retrieval from the model to a form that is more useful for usage.\n if ($this->hasGetMutator($key)) {\n return $this->mutateAttribute($key, $value);\n }\n\n // If the attribute exists within the cast array, we will convert it to\n // an appropriate native PHP type dependant upon the associated value\n // given with the key in the pair. Dayle made this comment line up.\n if ($this->hasCast($key)) {\n return $this->castAttribute($key, $value);\n }\n\n return $value;\n }",
"public function attr() {\n\t\treturn utils::attr($this->attr, func_get_args());\n\t}",
"public function __get($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"protected function value_get(){\n\t\t\n\t\tif ( is_serialized( $this->value ) ) {\n\t\t\t$this->value = unserialize( $this->value );\n\t\t} elseif ( is_string( $this->value ) && 0 === strpos( $this->value, '{' ) && is_object( $_value = json_decode( $this->value ) ) ) {\n\t\t\t$this->value = (array) $_value;\n\t\t}\n\n\t\treturn $this->value;\n\t\t\n\t}",
"public function getValueAttribute($value)\n {\n return $value;\n }",
"public function __get($name)\n\t{\n\t\tif(array_key_exists($name, $this->_attributes))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function __get(string $name)\n {\n $value = $this->getWithAttr($name);\n\n if ($value === null)\n return null;\n\n return $value['value'] ?? array_map(function ($record) { return $record['value']; }, $value);\n }",
"public function offsetGet($offset)\n {\n return $this->getAttribute($offset);\n }",
"protected function getAttribute(array &$query)\n {\n // Get the attribute to query\n $attribute = array_shift($query);\n\n // Check to see if we received an array\n // of arrays and work from there\n if(is_array($attribute)) {\n $tmp = array_shift($attribute);\n $query = $attribute;\n $attribute = $tmp;\n }\n\n return $attribute;\n }",
"public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }",
"protected function getValueAttribute($value)\n\t{\n\t\treturn is_serialized($value) ? unserialize($value) : $value;\n\t}",
"public function offsetGet($offset)\n {\n return $this->getAttribute($offset);\n }",
"public function offsetGet($offset)\n {\n return $this->getAttribute($offset);\n }",
"public function offsetGet($offset)\n {\n return $this->getAttribute($offset);\n }",
"public function getValueFormattedAttribute()\n {\n return DataHelper::getFloat2Real($this->getAttribute('value'));\n }",
"public function attr()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && is_array($args[0])) {\n $this->attributes = $args[0];\n return $this;\n } elseif (isset($args[0]) && isset($args[1])) {\n $this->attributes[$args[0]] = $args[1];\n return $this;\n } elseif (isset($args[0])) {\n return isset($this->attributes[$args[0]]) ? $this->attributes[$args[0]] : null;\n }\n\n return $this->attributes;\n }",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"public function getAttribute()\n {\n return $this->attribute;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"protected function getAttributeValue($key)\n {\n $value = $this->getAttributeFromArray($key);\n\n if ($this->hasGetMutator($key))\n return $this->mutateAttribute($key, $value);\n\n if ($this->hasCast($key))\n $value = $this->castAttribute($key, $value);\n\n return $value;\n }",
"protected function getAttributeValue($attribute, $option) {\n if(empty($attribute) || empty($option)) {\n return;\n }\n\n if(isset($this->attributeValues[$attribute][$option])) {\n return $this->attributeValues[$attribute][$option];\n }\n\n $attribute_model\t= Mage::getModel('eav/entity_attribute');\n $attribute_table\t= Mage::getModel('eav/entity_attribute_source_table');\n\n $attribute_code\t\t= $attribute_model->getIdByCode('catalog_product', $attribute);\n $loadedAttribute\t= $attribute_model->load($attribute_code);\n\n $attribute_table->setAttribute($loadedAttribute);\n\n $optionValue = $attribute_table->getOptionText($option);\n\n if(!empty($optionValue)) {\n if (is_array($optionValue)) {\n $optionValue = implode(',', $optionValue);\n }\n\n $this->attributeValues[$attribute][$option] = $optionValue;\n return $optionValue;\n } else {\n return $option;\n }\n }",
"protected function getAttributeFromArray($key)\n {\n if (array_key_exists($key, $this->attributes)) {\n return $this->attributes[$key];\n }\n }",
"protected function getAttributeFromArray($key)\n {\n if (array_key_exists($key, $this->attributes)) {\n return $this->attributes[$key];\n }\n }",
"protected function getAttributeFromArray($key)\n {\n if (array_key_exists($key, $this->attributes)) {\n return $this->attributes[$key];\n }\n }",
"public function getValueAttribute()\n\t{\n\t\treturn $this->attributes['valor_total'];\n\t}",
"public function getAttribute($key)\n {\n // Before Event\n if (($attr = $this->fireEvent('model.beforeGetAttribute', [$key], true)) !== null) {\n return $attr;\n }\n\n $value = $this->getAttributeFromArray($key);\n\n // If the attribute has a get mutator, we will call that then return what\n // it returns as the value, which is useful for transforming values on\n // retrieval from the model to a form that is more useful for usage.\n if ($this->hasGetMutator($key)) {\n return $this->mutateAttribute($key, $value);\n }\n\n // After Event\n if (($_attr = $this->fireEvent('model.getAttribute', [$key, $attr], true)) !== null) {\n return $_attr;\n }\n\n return $value;\n }",
"public function __get($name)\n {\n return $this->attributes[$name];\n }",
"public function getAttributeValue($key)\n {\n $value = parent::getAttributeValue($key);\n\n //Some database values are store as different types that we would like.\n //Check to see if any mutators are registered and if so mutate the\n //value from the database.\n $value = $this->decodeAttributeValue($key,$value);\n\n return $value;\n }",
"public function __get($name)\n {\n if(isset($this->_attribs[$name]))\n return $this->_attribs[$name];\n return $this->_value->$name;\n }",
"private function getAttributeValue($attribute)\n {\n return array_key_exists($attribute, $this->data) ? $this->data[$attribute] : null;\n }",
"public function offsetGet(mixed $offset): mixed\n {\n return Arr::get($this->value, $offset);\n }",
"public function getValue() {\n \n return $this->toScalar();\n }",
"public function offsetGet($key)\n {\n return $this->attributes[$key];\n }",
"public function get_attribute($field){\n\t\treturn $this->{$field};\n\t}",
"protected function getArrayableAttributes()\n {\n return $this->getArrayableItems($this->attributes);\n }",
"public function attribute($value, $format = 'put', $type_override = null)\n\t{\n\t\t$info = $this->get_attribute_value_info($value);\n\n\t\tif (!$info)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($type_override)\n\t\t{\n\t\t\tstatic $valid_types = array(\n\t\t\t\tself::TYPE_STRING,\n\t\t\t\tself::TYPE_NUMBER,\n\t\t\t\tself::TYPE_ARRAY_OF_STRINGS,\n\t\t\t\tself::TYPE_ARRAY_OF_NUMBERS\n\t\t\t);\n\n\t\t\t$info['type'] = in_array($type_override, $valid_types) ? $type_override : $info['type'];\n\t\t}\n\n\t\t$result = array($info['type'] => $info['value']);\n\n\t\t// In some cases the result needs to be wrapped with \"Value\"\n\t\tif ($format === 'update' || $format === 'expected')\n\t\t{\n\t\t\t$result = array('Value' => $result);\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getValue(): mixed;",
"public function getValue(): mixed;",
"public function get($attr) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] : null;\n }",
"public function __get($attribute)\r\n {\r\n if ($attribute == 'tag') {\r\n return $this->attributes[0];\r\n }\r\n return array_key_exists($attribute, $this->attributes) ? $this->attributes[$attribute] : null;\r\n }",
"protected function getValue($attribute)\n {\n if (!array_key_exists($attribute, $this->data)) {\n return null;\n }\n\n return $this->data[$attribute];\n }",
"protected function getAttributeFromArray($key)\r\n {\r\n $value = parent::getAttributeFromArray($key);\r\n if (in_array($key, $this->booleanFields)) {\r\n $value = boolval($value);\r\n }\r\n return $value;\r\n }",
"public function __get($attr)\n {\n if (isset($this->{$attr})) {\n return $this->{$attr};\n } elseif (method_exists($this, 'get'.camel_case($attr).'Attribute')) {\n $methodName = camel_case('get_'.$attr.'Attribute');\n\n return $this->$methodName();\n }\n }",
"public function pluck(string $attribute): array;",
"public function getViaTableAttributesValue();",
"public function &getValue();",
"public function getAttributeValue($index = null);",
"public function getValor($atributo){//retornar algún valor\n \treturn $this->$atributo;\n }",
"public function getAttribute($key)\n {\n $value = $this->getAttributeValue($key);\n\n // First we will check for the presence of a mutator for the set operation\n // which simply lets the developers tweak the attribute as it is set.\n if ($this->hasGetMutator($key)) {\n $method = 'get' . Str::studly($key) . 'Attribute';\n\n return $this->{$method}($value);\n }\n\n return $value;\n }",
"public function getRawAttribute($key);",
"public function get($attr = null);",
"public function readAttribute($attribute) {}",
"public function getVal()\n {\n return $this->val_arr;\n }",
"public function offsetGet($key)\n {\n return $this->attributes->get($key);\n }",
"public function __get($field)\n {\n $this->checkForNecessaryProperties();\n\n $unmodifiedField = lcfirst(str_replace('unmodified', '', $field));\n\n if (!array_key_exists($unmodifiedField, $this->data)) {\n return NULL;\n }\n\n $attributeMutator = 'get' . str_replace('_', '', ucwords($field, '_')) . 'Attribute';\n return (method_exists($this, $attributeMutator)) ? call_user_func([$this, $attributeMutator]) : $this->data[$unmodifiedField];\n }",
"public function getDataAttribute($value)\n {\n return json_decode($value, true);\n }",
"public function getValue(): mixed\n {\n return $this->field?->getValue();\n }",
"public function getAttrib() {\n return $this->attrib;\n }",
"public function __get($name) {\n if (!isset($this->attributes[$name]) && isset($this->builders[$name])) {\n $this->attributes[$name] = $this->builders[$name]($this);\n }\n\n return $this->attributes[$name];\n }",
"public function __get($atrib){\n\t\treturn $this->$atrib;\n\t}",
"public function getAttribute(string $attribute): string;",
"protected function getAttributeFromArray($key)\n {\n if (array_key_exists($key, $this->attributes))\n return $this->attributes[$key];\n else\n return null;\n }",
"public function getAttr(): string\r\n {\r\n return $this->attr;\r\n }",
"public function getFriendlyAttributeValue($attribute)\r\n {\r\n if (!array_key_exists($attribute, $this->attributeValueLists())) {\r\n return $this->$attribute;\r\n }\r\n $list = $this->valueList($attribute);\r\n if (!isset($list[$this->$attribute])) {\r\n return $this->$attribute;\r\n }\r\n\r\n return $list[$this->$attribute];\r\n }",
"public function get($attributeName);",
"public function __get($name)\n\t{\n\t\t// return custom field value\n\t\tif ($this->isCustomField($name)) {\n\t\t\treturn $this->getCustomFieldModel($name)->value;\n\t\t}\n\t\t\n\t\t// return model attribute\n\t\treturn $this->getAttribute($name);\n\t}",
"public function getValue() {\n\t\treturn $this -> value;\n\t}",
"public function __get($attr)\n\t{\n\t\t$functionName = \"get\".$attr;\n\t\treturn $this->$functionName();\n\t}",
"public function __get( string$attribute )\n\t{\n\t\t$getter= \"__get__$attribute\";\n\t\t\n\t\tif( is_callable( [ $this, $getter ] ) )\n\t\t\treturn $this->$getter();\n\t\telse\n\t\tif( get_parent_class( self::class ) && is_callable( [ $this, parent::__get, ] ) )\n\t\t\treturn parent::__get( $attribute );\n\t\telse\n\t\t\treturn null;\n\t}",
"public function __get($name) {\n // attribute-reader value\n if(in_array($name, $this->_attrReaders)) {\n return $this->_get($name);\n }\n // call overloading for subclass\n if(method_exists($this, '_get')) {\n return $this->_get($name);\n }\n show_error(\"Unrecognized attribute '$name'\");\n }",
"public function getValue()\n {\n return self::decodeValue($this->value);\n }",
"protected function getAttributeFromArray($key)\n {\n // Support keys in dot notation.\n if (str_contains($key, '.')) {\n $attributes = array_dot($this->attributes);\n\n if (array_key_exists($key, $attributes)) {\n return $attributes[$key];\n }\n }\n\n return parent::getAttributeFromArray($key);\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }",
"public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }"
] | [
"0.693335",
"0.66888875",
"0.6461216",
"0.64513874",
"0.6390669",
"0.63683414",
"0.60958546",
"0.60728246",
"0.60693884",
"0.6058542",
"0.605457",
"0.6037888",
"0.6026632",
"0.5992204",
"0.59782696",
"0.5973587",
"0.59735066",
"0.5949071",
"0.5946819",
"0.59147197",
"0.5910964",
"0.5897724",
"0.58899355",
"0.5885021",
"0.5854822",
"0.5854643",
"0.5842144",
"0.57871825",
"0.57871825",
"0.57871825",
"0.5782204",
"0.5769427",
"0.57504135",
"0.57504135",
"0.57499",
"0.57499",
"0.5741283",
"0.5736855",
"0.57037884",
"0.57037884",
"0.57037884",
"0.56899786",
"0.568397",
"0.5672955",
"0.5667904",
"0.5647551",
"0.5643904",
"0.5630678",
"0.5628232",
"0.56176114",
"0.56131",
"0.56106216",
"0.56089",
"0.5606123",
"0.5606123",
"0.56044537",
"0.5602413",
"0.560182",
"0.5578541",
"0.5576615",
"0.55689687",
"0.55682886",
"0.55575097",
"0.55499166",
"0.5546865",
"0.554354",
"0.5538444",
"0.55269665",
"0.5517241",
"0.55108273",
"0.5505295",
"0.55000794",
"0.5495801",
"0.54935503",
"0.5492694",
"0.549037",
"0.54862356",
"0.54847336",
"0.5481999",
"0.54815304",
"0.54800385",
"0.5474173",
"0.5469301",
"0.54681927",
"0.5465868",
"0.546259",
"0.54621464",
"0.54615766",
"0.54462826",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134",
"0.54431134"
] | 0.0 | -1 |
Set a given attribute on the model. | public function setAttribute($key, $value)
{
// Before Event
if (($_value = $this->fireEvent('model.beforeSetAttribute', [$key, $value], true)) !== null) {
$value = $_value;
}
// First we will check for the presence of a mutator for the set operation
// which simply lets the developers tweak the attribute as it is set on
// the model, such as "json_encoding" an listing of data for storage.
if ($this->hasSetMutator($key)) {
$method = 'set'.Str::studly($key).'Attribute';
// If we return the returned value of the mutator call straight away, that will disable the firing of
// 'model.setAttribute' event, and then no third party plugins will be able to implement any kind of
// post processing logic when an attribute is set with explicit mutators. Returning from the mutator
// call will also break method chaining as intended by returning `$this` at the end of this method.
$this->{$method}($value);
}
else {
$this->attributes[$key] = $value;
}
// After Event
$this->fireEvent('model.setAttribute', [$key, $value]);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __set($attribute, $param) {\n $this->$attribute = $param;\n }",
"public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}",
"public function setAttribute(string $attribute, string $value);",
"public function __set($attribute, $value) {\n $this->setAttribute($attribute, $value);\n }",
"public function setAttribute($attribute, $value)\n {\n }",
"function set($attr, $value)\r\n\t{\r\n\t\t$this->$attr = $value;\r\n\t}",
"public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}",
"public function setAttr($attribute, $value) {\n $this->attributes[$attribute] = $value;\n }",
"public function setAttribute($attribute, $value)\r\n\t{\r\n\t\t\r\n\t}",
"public function set($attribute, $value)\n {\n $this->attributes[$attribute] = $value;\n }",
"function setAttribute ($attribute, $value) {\n return $this->dbH->setAttribute($attribute, $value);\n }",
"public function __set($attribute, $value)\n {\n $this->set($attribute, $value);\n }",
"public function __set($attr, $value)\n\t{\n\t\t$this->$attr = $value;\n\t}",
"public function __set($attribute, $value) {\n\t\tif (strpos($attribute, '_') === 0) {\n\t\t\t$this->{$attribute} = $value;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setData($attribute, $value);\n\t}",
"public function setAttribute($attribute, $value) {\n\t\tif (!$this->attributes) {\n\t\t\t$this->attributes = tx_newspaper::selectOneRow(\n\t\t\t\t\t'*', tx_newspaper::getTable($this), $this->condition\n\t\t\t);\n\t\t}\n\t\t\n\t\t$this->attributes[$attribute] = $value;\n\t}",
"public function __set($attribute, $value)\n {\n array_set($this->attributes, $attribute, $value);\n }",
"public function __set($atrib, $value){\n\t\t$this->$atrib = $value;\n\t}",
"public function set_attribute($name, $value)\n {\n }",
"public function set_attribute( $attribute_name = '', $value = null ) {\n\t\t\n\t\t$this->attributes[$attribute_name] = $value;\n\t\t\n\t}",
"public function setAttribute($attribute, $value)\n {\n array_set($this->attributes, $attribute, $value);\n\n $this->update();\n }",
"public function setAttribute($attribute, $value)\n {\n $this->attributes[$attribute] = $value;\n\n return $this;\n\n }",
"protected function setAttribute($dataArray, $attribute)\n {\n if (isset($dataArray[$attribute])) {\n if (in_array($attribute, self::$validAttributes)) {\n $this->$attribute = $dataArray[$attribute];\n }\n }\n }",
"public function __set($name, $value)\n { \n //set the attribute with the value\n $this->$name = $value;\n }",
"public function __set($attribute, $value)\n {\n // If we are locked tell them\n if ($this->isLocked) {\n\n throw new \\IllegalAccessException('The entity ' . get_called_class() . ' is in a locked state');\n }\n\n // If we do not have this property we should tell them\n if (!property_exists($this, $attribute)) {\n\n throw new \\IllegalArgumentException('There is no attribute called ' . $attribute);\n }\n\n // Still here? Set it then\n $this->$attribute = $value;\n }",
"public function set_attribute($key, $value) {\n\t\t$this->attributes[$key] = $value;\n\t}",
"public function setAttribute($key, $value);",
"public function setAttribute($key, $value);",
"function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }",
"public function setAttribute($attribute, $value) {\n parent::setAttribute($attribute, $value);\n\n return $this;\n }",
"public function __set($attri, $value) {\n if (in_array($attri, self::DYN_ATTRIBUTES)) {\n $this->{$attri} = $value;\n }\n }",
"abstract public function setAttribute($key, $value);",
"public function setAttribute($name, $value);",
"public function set($model, $attribute, $groups)\n {\n \n }",
"function __set($attr_name, $value) {\n // in $attr_name, replace _ with \" \"\n $attr_name = str_replace('_', ' ', $attr_name);\n $attr_name = ucwords($attr_name);\n $attr_name = str_replace(' ', '', $attr_name);\n $function = \"set$attr_name\";\n //var_dump($function);\n $this->$function($value);\n }",
"function __set($attributeToChange, $newValueToAssign) {\n //check that name is valid class attribute\n switch($attributeToChange) {\n case \"name\":\n $this->name = $newValueToAssign;\n break;\n case \"favoriteFood\":\n $this->favoriteFood = $newValueToAssign;\n break;\n case \"sound\":\n $this->sound = $newValueToAssign;\n break;\n default:\n echo $attributeToChange . \" was not found <br>\";\n }\n echo \"Set \" . $attributeToChange . \" to \" . $newValueToAssign . \"<br>\";\n }",
"public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}",
"public function __set(string $attribute, $value)\n {\n $setter = 'set' . ucfirst(preg_replace_callback('/_[a-zA-Z0-9]/', function ($matches) {\n $str = '';\n\n foreach ($matches as $match) {\n $str .= ucfirst(str_replace('_', '', $match));\n }\n\n return $str;\n }, $attribute));\n\n if (!method_exists($this, $setter)) {\n return null;\n }\n\n return $this->$setter($value);\n }",
"public function setAttributeModel($attribute)\n {\n $this->setRequestVar($attribute->getAttributeCode());\n $this->setData('attribute_model', $attribute);\n return $this;\n }",
"public function setAttribute($attribute, $value) {\n #Seems a bit too straightforward, no?\n $this->attributes[$attribute] = $value;\n return true;\n }",
"public function setIdentifyingAttribute($string);",
"public function writeAttribute($attribute, $value){\n\t\t#if[compile-time]\n\t\tCoreType::assertString($attribute);\n\t\t#endif\n\t\t$this->_connect();\n\t\t$this->$attribute = $value;\n\t}",
"public function writeAttribute($attribute, $value) {}",
"public function setAttributeName(?string $value): void {\n $this->getBackingStore()->set('attributeName', $value);\n }",
"public function __set($name, $value)\n\t{\n\t\t$this->attributes[$name] = $value;\n\t\t\n\t}",
"public function define_attribute($attribute,$value)\n\t\t{\n\t\t\tif(!isset($this->matchcode[$attribute]))\n\t\t\t{\n\t\t\t\terror_log(__FILE__.' name '.$attribute.' not defined in matchcode array');die();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($this->matchcode[$attribute][1] == 'A' || $this->matchcode[$attribute][1] == 'W')\n\t\t\t\t{\n\t\t\t\t\t$var = $this->matchcode[$attribute][0];\n\t\t\t\t\t$this->$var = $value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\terror_log(__FILE__.' name '.$attribute.' no write access');die();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function setAttribute($key, $value)\n {\n // First we will check for the presence of a mutator for\n // the set operation which simply lets the developers\n // tweak the attribute as it is set on the model.\n if ($this->hasSetMutator($key)) {\n $method = 'set' . studly_case($key) . 'Attribute';\n\n return $this->{$method}($value);\n }\n\n // TODO: handle dates\n\n // TODO: handle casts/datatypes\n\n $this->attributes[$key] = $value;\n }",
"public function setAttribute($attribute, $value)\n\t{\n\t\t$this->attributes[$attribute] = $value;\n\n\t\t$this->pdo->setAttribute($attribute, $value);\n\n\t\treturn $this;\n\t}",
"public function __set( $name, $value )\n\t{\n\t\t$this->attributes[$name] = $value;\n\t}",
"public function __set($name, $value)\n {\n $this->attributes[$name] = $value;\n }",
"public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }",
"public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }",
"public function _set($key, $value){\r\n\t\t$this->_attributes[$key] = $value;\r\n\t}",
"public function setAttribute($attribute, $value)\n {\n $this->attributes[$attribute] = $value;\n\n return $this;\n }",
"public function setValue(string $attr, $value)\n {\n $this->checkAttribute($attr);\n $this->attributes[$attr] = $value;\n }",
"public function setAttribute($attr_name, $attr_value)\n {\n $this->attributes[$attr_name] = $attr_value;\n return $this;\n }",
"public function setAttribute(String $attr, $value) {\n return $this->attributes->set($attr, $value);\n }",
"public function setAttribute(string $attribute, $value): self\n {\n $this->attributes[ $attribute ] = $value;\n\n return $this;\n }",
"public function __set($name, $value)\n {\n $this->_attributes[$name] = $value;\n }",
"public function setAttribute($key, $value = null);",
"public function setAttribute($name, $value)\n {\n if (in_array($name, static::$fields)) {\n $this->attributes[$name] = $value;\n }\n }",
"public function setAttributeValue( Inx_Api_Recipient_Attribute $oAttr, $mNewValue, Inx_Api_IndexSelection $oSelection=null );",
"public function offsetSet($attribute, $value)\n {\n $this->attributeList[$attribute] = $value;\n }",
"public function setViaTableAttributesValue($value);",
"public function setAttribute($attribute, $value)\n {\n //Check this attribute is support\n if (isset($this->input_map[$attribute])) {\n $this->input_map[$attribute] = $value;\n\n return $value;\n } else {\n throw new AttributeInvalidException('Attribute not supported by this library');\n }\n }",
"public function __set($name, $value ) {\r\n \r\n // first check whether the given name is valid attribute or not\r\n // for that we are gonna use a switch statement\r\n switch($name) {\r\n \r\n case \"username\" :\r\n $this -> first_name = $value;\r\n break;\r\n default : return \"Invalid\"; // when the passes attribute doesnt exist\r\n }\r\n }",
"public function __set($name, $value)\n {\n if ($this->hasAttribute($name)) {\n $this->_attributes[$name] = $value;\n } else {\n parent::__set($name, $value);\n }\n }",
"public function __set($name, $value)\n\t{\n\t\tswitch($name) {\n\t\t\tcase 'USER_GROUP_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->USER_GROUP_ID) ) {\n\t\t\t\t\tthrow new Exception('Cannot update USER_GROUP_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 assignAttribute($attribute, $data)\n {\n return $this->attributes()->save(\n Attribute::whereName($attribute)->firstOrFail(),\n ['data' => $data]\n );\n }",
"public function attribute(string $attribute): self\n {\n $this->attribute = $attribute;\n\n return $this;\n }",
"public function __set($key, $value)\n {\n $this->attributes[$key] = $value;\n }",
"public function set($attribute, $value = null)\n {\n parent::set($attribute, $value);\n \n return $this;\n }",
"public function setAttr($attr) {\n\t\t$this->attr = $attr;\n\t\treturn $this;\n\t}",
"protected function setAttribute(string $attribute, $value)\n {\n $this->$attribute = $value;\n\n return $this;\n }",
"public function attribute(string $attribute) : self\n {\n $this->attribute = $attribute;\n\n return $this;\n }",
"public function setAttribute($name, $value)\n\t{\n\t\t// If value is valid timestamp and the underlying column type is datetime, convert to datetime object\n\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t{\n\t\t\t$table = blx()->db->schema->getTable(\"{{{$this->getTableName()}}}\");\n\t\t\t$column = $table->getColumn($name);\n\t\t\tif ($column->dbType == ColumnType::DateTime)\n\t\t\t{\n\t\t\t\t$dt = new DateTime('@'.$value);\n\t\t\t\t$value = $dt;\n\t\t\t}\n\t\t}\n\n\t\tif (property_exists($this, $name))\n\t\t{\n\t\t\t$this->$name = $value;\n\t\t}\n\t\telse if (isset($this->getMetaData()->columns[$name]))\n\t\t{\n\t\t\t$this->_attributes[$name] = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function setAttribute($key, $value)\n {\n $this->attributes[$key] = $value;\n }",
"public function setAttribute($attribute, $value)\n {\n $this->_options[$attribute] = $value;\n return true;\n }",
"public function setAttribute ($name, $value)\n {\n\n $this->attributes[$name] = $value;\n\n }",
"public function __set($atributo, $valor) {\n\t\t\t// $this->modelo = $valor;\n\t\t\t$this->$atributo = $valor;\n\t\t}",
"public function setAttribute($name, $value)\n {\n $this->attributes[$name] = $value;\n }",
"public function setAttribute($name, $value)\n {\n $this->attributes[$name] = $value;\n }",
"public function setAttribute($name, $value)\n {\n $this->attributes[$name] = $value;\n }",
"public function attribute($name, $value){\n $this->_attributes[$name] = $value;\n return $this;\n }",
"public function __set($name, $value) {\n\t\t$this->setAttribute($name, $value);\n\t}",
"public function onUnsafeAttribute($name, $value)\n {\n $this->$name = $value;\n }",
"public function setAttribute($key, $value)\n {\n // First we will check for the presence of a mutator for the set operation\n // which simply lets the developers tweak the attribute as it is set on\n // the model, such as \"json_encoding\" an listing of data for storage.\n if ($this->hasSetMutator($key)) {\n $method = 'set'.Str::studly($key).'Attribute';\n\n return $this->{$method}($value);\n }\n\n if ($this->isJsonCastable($key) && ! is_null($value)) {\n $value = $this->castAttributeAsJson($key, $value);\n }\n\n // If this attribute contains a JSON ->, we'll set the proper value in the\n // attribute's underlying array. This takes care of properly nesting an\n // attribute in the array's value in the case of deeply nested items.\n if (Str::contains($key, '->')) {\n return $this->fillJsonAttribute($key, $value);\n }\n\n $this->attributes[$key] = $value;\n\n return $this;\n }",
"public function setAttribute ($key, $value) {\n return parent::setAttribute(camel_case($key), $value);\n }",
"public function setAttributeMetadata($attributeName, $definition){\n\t\tActiveRecordMetaData::setAttributeMetadata($this->_source, $this->_schema, $attributeName, $definition);\n\t}",
"public function setAttribute($key, $value)\n {\n // First we will check for the presence of a mutator for the set operation\n // which simply lets the developers tweak the attribute as it is set.\n if ($this->hasSetMutator($key)) {\n $method = 'set' . Str::studly($key) . 'Attribute';\n\n return $this->{$method}($value);\n }\n\n // If an attribute is listed as a \"date\", we'll convert it from a DateTime\n // instance into a form proper for storage on the database tables using\n // the connection grammar's date format. We will auto set the values.\n if ($value && in_array($key, $this->getDates())) {\n $value = $this->asDateTime($value);\n }\n\n // If an attribute is listed as media, we'll convert it to the correct\n // media object.\n if (in_array($key, $this->media)) {\n $value = new Media($value);\n }\n\n $this->attributes[$key] = $value;\n\n return $this;\n }",
"public function setAttributes();",
"public function __set($attr, $value)\n {\n return $this->set($attr, $value);\n\n return null;\n }",
"public function setAttribute($key, $value)\n {\n //The type of a value used in the app may be different then how it is \n //stored in the database. Therefore, mutate it to a value to be stored\n //in the database.\n $value = $this->encodeAttributeValue($key,$value);\n\n return parent::setAttribute($key, $value);\n }",
"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 setAttribute($attribute, $value)\n {\n // Give mutator priority over custom casts\n if ($this->hasSetMutator($attribute)) {\n $method = 'set' . studly_case($attribute) . 'Attribute';\n\n return $this->{$method}($value);\n }\n\n if (array_key_exists($attribute, $this->filterCustomCasts())) {\n /** @var $customCastObject CustomCastBase */\n $customCastObject = $this->getCustomCastObject($attribute);\n\n $this->attributes[$attribute] = $customCastObject->setAttribute($value);\n\n return $this;\n }\n\n parent::setAttribute($attribute, $value);\n }",
"public function set($attr, $value) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] = $value : false;\n }",
"public function setAttribute($type, $value)\n {\n $this->attributes[$type] = $value;\n }",
"abstract public function writeAttribute($name, $value);",
"public function setAttribute($name, $value)\r\n\t{\r\n\t\treturn $this->__set($name, $value);\r\n\t}",
"public function setAttribute($name, $value) {\n\t\tif (property_exists($this, $name))\n\t\t\t$this->$name = $value;\n\t\telse\n\t\t\t$this->_attributes[$name] = $value;\n\t\treturn true;\n\t}",
"public function setAttribute($attribute, $value)\n {\n $this->options[$attribute] = $value;\n\n return true;\n }"
] | [
"0.76855254",
"0.766302",
"0.7508671",
"0.74314046",
"0.7416725",
"0.73780745",
"0.7357619",
"0.7338746",
"0.72974455",
"0.7246165",
"0.72431934",
"0.7210178",
"0.7206504",
"0.7199687",
"0.71688366",
"0.71502733",
"0.6981605",
"0.6944696",
"0.6931927",
"0.69077706",
"0.6844722",
"0.6808428",
"0.67807305",
"0.6745927",
"0.67431694",
"0.6718435",
"0.6718435",
"0.67013586",
"0.667251",
"0.6635486",
"0.660995",
"0.6592153",
"0.65767616",
"0.6571097",
"0.65406096",
"0.65230864",
"0.64777094",
"0.64667547",
"0.6443713",
"0.6436974",
"0.6428633",
"0.6419159",
"0.6401978",
"0.6397261",
"0.63957167",
"0.6380364",
"0.6377421",
"0.6370083",
"0.63501555",
"0.63484544",
"0.63484544",
"0.634261",
"0.6341736",
"0.6339289",
"0.63042855",
"0.62966216",
"0.62945426",
"0.6289705",
"0.6279545",
"0.6275976",
"0.6273633",
"0.6268363",
"0.62596065",
"0.62587595",
"0.624321",
"0.6238902",
"0.6237055",
"0.6233038",
"0.6219083",
"0.6219009",
"0.6198876",
"0.6193067",
"0.61923504",
"0.6187401",
"0.6181149",
"0.6173589",
"0.6147356",
"0.61454815",
"0.61340034",
"0.61113465",
"0.61113465",
"0.61113465",
"0.6104758",
"0.60864204",
"0.60838294",
"0.6056671",
"0.6055939",
"0.6049146",
"0.60485864",
"0.60456985",
"0.6039096",
"0.60256565",
"0.60191315",
"0.60172045",
"0.6007845",
"0.5993821",
"0.59853446",
"0.5984037",
"0.5983811",
"0.59723157"
] | 0.65197396 | 36 |
Determine if a set mutator exists for an attribute. | public function hasSetMutator($key)
{
return $this->methodExists('set'.Str::studly($key).'Attribute');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . Str::studly($key) . 'Attribute');\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . studly_case($key) . 'Attribute');\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }",
"public function hasAttributeGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasAttributeGetMutator($key);\n }",
"protected function hasGetMutator($key)\n {\n return method_exists($this, 'set' . $this->getMutatorName($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . studly_case($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . Str::studly($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return $this->methodExists('get'.Str::studly($key).'Attribute');\n }",
"public function __isset($key)\n {\n return isset($this->attributes[$key]) ||\n (\n $this->hasGetMutator($key) &&\n !is_null($this->getAttribute($key))\n );\n }",
"public function __isset($attribute) {\n return $this->hasAttribute($attribute);\n }",
"private function has_attribute($attribute) {\r\n // (incl. private ones!) as the keys and their current values as the value\r\n $object_vars = get_object_vars($this);\r\n // We don't care about the value, we just want to know if the key exists\r\n // Will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }",
"private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}",
"private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}",
"private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }",
"private function has_attribute($attribute){\n // (including private ones) as the keys and their current values as the value\n $object_vars = get_object_vars($this);\n\n // We don't care about the value, we just want to know if the key exists\n // does $attribute(key) exist in $object_vars\n // Will return true or false\n return array_key_exists($attribute, $object_vars);\n }",
"public function hasGetMutator($key)\n {\n return $this->hasField($key);\n }",
"public function hasAttr($attr);",
"public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }",
"private function has_attribute($attribute){\r\n\t // (incl. private ones!) as the keys and their current values as the value\r\n\t $object_vars = get_object_vars($this);\r\n\t // We don't care about the value, we just want to know if the key exists\r\n\t // Will return true or false\r\n\t return array_key_exists($attribute, $object_vars);\r\n }",
"private function has_attribute($attribute){\n\t\t//(inlcuding private ones) as keys and current values as value.\n\t\t\n\t\t$object_vars = $this->attributes();\n\t\t//want to check key exists, dont care about value here\n\t\t//returns true or false\t\n\t\t\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}",
"private function has_attribute($attribute) {\n\t\t// Wil return true or false\n\t\t$object_vars = get_object_vars($this);\n\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}",
"public function has($attribute);",
"public function hasAttribute($key);",
"private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}",
"public function hasGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasGetMutator($key);\n }",
"public function hasAttribute(string $attribute): bool\n {\n return array_key_exists($attribute, $this->data);\n }",
"private function has_attribute($attribute)\n\t\t{\n\t\t//(incl. private ones!) as the keys and their current values as the value\n\t\t$object_vars = get_object_vars($this);\n\t\t//we don't care about the value, we just want to know if the key exists \n\t\t//will return true or false\n\t\treturn array_key_exists($attribute, $object_vars);\n\t\t}",
"public function is_set($key){\n\t\treturn isset($this->data[$key]);\n\t}",
"protected function isMutatorMethod($callable)\n {\n return method_exists($this, $callable) || static::hasMacro($callable);\n }",
"private function has_attribute($attribute){\r\n //(incl.private ones!) as the keys and their current values as the value\r\n $object_vars = $this->attributes();\r\n //we dont care about the value, we just want to know if the key exists\r\n //will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }",
"public function hasAttribute(string $name): bool;",
"public function isAttributeSave(string $attribute): bool;",
"public function supportsAttribute($attribute);",
"public function hasAttribute($attribute)\n {\n return (isset($this->attributes[$attribute]));\n }",
"public function __isset($key)\n {\n return (isset($this->attributes[$key]) || isset($this->relations[$key])) ||\n ($this->hasGetMutator($key) && !is_null($this->getAttributeValue($key)));\n }",
"private function has_attribute($attribute)\n {\n //including priate ones as the keys and their current values are the value\n $object_vars = $this->attributes();\n\n //here i do not care what the specific values are but just interested if they exist\n return array_key_exists($attribute, $object_vars);\n }",
"private function has_attribute($attribute)\n {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }",
"public function offsetExists($attribute)\n {\n return isset($this->attributeList[$attribute]);\n }",
"function is_set($field) {\n\t\treturn isset($this->data[$field]) || isset($this->associations[$field]);\n\n\t}",
"public function testModelAttributeExists()\n {\n // exists mutator\n $this->assertFalse($this->post->hasGetMutator('id'));\n $this->assertArrayHasKey('id', $this->post->getAttributes());\n\n // exists native\n $this->assertTrue($this->post->hasGetMutator('exits'));\n $this->assertArrayNotHasKey('exits', $this->post->getAttributes());\n\n // not exists\n $this->assertFalse($this->post->hasGetMutator('notExits'));\n $this->assertArrayNotHasKey('notExits', $this->post->getAttributes());\n }",
"public function hasAttr ($attr) { return $this->hasAttribute($attr); }",
"public function __isset($key)\n {\n return isset($this->attributes[$key]);\n }",
"public function __isset($key)\n {\n return isset($this->attributes[$key]);\n }",
"private function has_attribute($attribute) {\r\n\t\t//get_object_vars returns an associative array with all attributes as the keys and their current values as value\r\n\t\t\t\t\t\t//this refers to get_object_vars\r\n\t\t$object_vars = get_object_vars($this);\r\n\t\t//checks to see if the key exists\r\n\r\n\t\t//returns true of false\r\n\t\t//does the key attribute exists in the array object vars?\r\n\t\treturn array_key_exists($attribute, $object_vars);\r\n\t}",
"public function __isset($attribute)\n {\n if (empty($this->attributes[$attribute]) === false) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasAttribute($attr_name)\n {\n return isset($this->attributes[$attr_name]);\n }",
"private function has_the_attribute($the_attribute){\n \n $object_properties = get_object_vars($this); //Function get_object_vars\n \n return array_key_exists($the_attribute, $object_properties);\n }",
"protected abstract function supportsAttribute($attribute);",
"public function __isset($key)\n {\n if (array_key_exists($key, get_object_vars($this))) {\n return isset($this->$key);\n }\n\n return isset($this->attributes[$key]);\n }",
"public function __isset($key)\n {\n return ($this->tinydb_getset_is_table_field($key) || $this->tinydb_getset_is_method(\"get_$key\") ||\n $this->tinydb_getset_is_foreign($key));\n }",
"function attrExists($attrKey) {\n return isset($this->attributes[$attrKey]);\n }",
"public function has_the_attribute($the_attribute){\n\t\t$object_properties = get_object_vars($this); \n\t\treturn array_key_exists($the_attribute,$object_properties);\n\t }",
"public function hasAttributeByName($attributeName);",
"public function __isset($key)\n {\n $attributes = $this->getAttributes();\n return isset($attributes[$key]);\n }",
"public function hasAttributeSavedMethod($attribute)\n {\n return method_exists($this, 'saved'.Str::studly($attribute).'Attribute');\n }",
"public function hasAttribute(string $key)\n {\n return isset($this->getAttributes()[$key]);\n }",
"public function hasAttribute($attribute)\n {\n return isset($this->lcAttributeNameMap[strtolower($attribute)]);\n }",
"protected function hasAccessor(string $key, ?string &$accessor = null): bool\n {\n $studly_key = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $key)));\n $accessor = 'get' . $studly_key . 'Property';\n\n return method_exists($this, $accessor);\n }",
"public function __isset($key) {\n\t\tforeach (array('attributes', 'relationships') as $source) {\n\t\t\tif (array_key_exists($key, $this->$source)) return true;\n\t\t}\n\n\t\tif (method_exists($this, $key)) return true;\n\t}",
"public function __isset($name)\n {\n return $this->attr($name) || $this->data->has($name);\n }",
"public function hasAttribute ($attr) {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\tif (!$node->attributes->getNamedItem($attr)) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"private function has_attribute($attritube)\n {\n $allattribute=$this->attribute();\n if(array_key_exists($attritube,$allattribute))\n return true;\n return false;\n }",
"public function hasAttribute(AttributeValueInterface $attribute);",
"public function __isset($key)\n {\n return array_key_exists($key, $this->attributes);\n }",
"public function __isset($key)\n {\n if (isset($this->attributes[$key])) {\n return true;\n }\n\n return false;\n }",
"public function hasAttribute($name)\n {\n return array_key_exists($name, $this->attributes);\n }",
"public function hasAttribute($name)\n {\n return array_key_exists($name, $this->_attributes);\n }",
"public function hasAttribute($name) {\n\t\treturn isset($this->_attributes[$name]);\n\t}",
"public function __isset($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn parent::__isset($name);\n\t}",
"public function __isset($name)\n\t{\n\t\tif(isset($this->_attributes[$name]))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn parent::__isset($name);\n\t}",
"public function has_attribute( $name ) {\n\t\treturn array_key_exists( $name, $this->attributes );\n\t}",
"public function hasAttribute($attribute)\n {\n if (is_string($attribute)) {\n return $this->attributes->contains('name', $attribute);\n }\n\n return (bool) $attribute->intersect($this->attributes)->count();\n }",
"public function hasAttribute($name)\n {\n return isset($this->attributes[$name]);\n }",
"public function testMagicMethodIssetThrowsException()\n\t{\n\t\t$stub = new \\Orchestra\\Support\\Form\\Fieldset(function ($f) {});\n\n\t\t$invalid = isset($stub->invalid_property) ? true : false;\n\t}",
"public function offsetExists($offset) : bool\n {\n return isset($this->attributes[$offset]);\n }",
"protected function looksLikeSetter($line)\n {\n return strpos($line, '=') !== false;\n }",
"public static function isInyectedAttribute( $attr )\n {\n return ( strcmp($attr, \"id\") == 0 || strcmp($attr, \"deleted\") == 0 || strcmp($attr, \"class\") == 0 );\n }",
"function is_Set($key)\n {\n return isset($this->keyvalList[$key]);\n }",
"function is_set($item,$alter=false){\n\treturn isset($item)?$item:$alter;\n}",
"function is_set($item,$alter=false){\n\treturn isset($item)?$item:$alter;\n}",
"public function offsetExists($key)\n\t{\n\t\treturn isset($this->attributes[$key]);\n\t}",
"public function hasAttr($key) {\n\t\treturn isset($this->attributes[$key]);\n\t}",
"protected function isMeta($attr) {\n return preg_match('#^' . static::meta_prefix() . '#', $attr);\n }",
"public function hasAttribute ($name)\n {\n\n return isset($this->attributes[$name]);\n\n }",
"function IsAttributeModifiable( $attribute )\r\n\t{\r\n\t\treturn getFactory()->getAccessPolicy()->can_modify_attribute($this->getObject(), $attribute)\r\n && $this->getObject()->getAttributeEditable($attribute);\r\n\t}",
"public function hasAttribute(string $name): bool {\n return isset($this->attributes[$name]);\n }",
"public function hasAttribute($name)\n {\n return isset($this->_attributes[$name]) || in_array($name, $this->attributes(), true);\n }",
"public function has($attribute = null) {\n return $this->hasAttribute($attribute);\n }",
"public function isAccessor(CComponent $object, $type)\n {\n $accessor = property_exists($object, $this->name);\n if ($object instanceof CActiveRecord)\n {\n if ($object->hasAttribute($this->name))\n {\n return true;\n }\n }\n if (!$accessor && $object->{'can' . ucfirst($type) . 'Property'}($this->name))\n {\n $m = new ReflectionMethod($object, $type . $this->name);\n if ($m->getNumberOfRequiredParameters() <= ($type == 'set' ? 1 : 0))\n {\n $accessor = true;\n }\n else\n {\n return false;\n }\n }\n\n if (!$accessor)\n {\n $accessor = $object->hasEvent($this->name);\n }\n if (!$accessor && $object instanceof CActiveRecord)\n {\n $rels = $object->relations();\n $accessor = isset($rels[$this->name]);\n }\n return $accessor;\n }",
"protected function hasAttribute(string $key): bool\n {\n return in_array($key, $this->getAttributes());\n }",
"public function offsetExists($offset): bool\n {\n return $this->attribs->offsetExists($offset);\n }",
"public function offsetExists($key) {\n\t\treturn isset($this->sets[$key]);\n\t}",
"public function supportsAttribute($attribute)\n {\n return in_array($attribute, FamilyPermission::getPermissions(), true);\n }",
"public static function fillableIsSetAndContainsAttribute($attribute): bool\n {\n return (isset(static::$fillable) && count(static::$fillable) > 0 && in_array($attribute, static::$fillable));\n }",
"public function __isset(string $key): bool;",
"public function isAttribute($field){\n\t\treturn $this->hasField($field);\n\t}",
"public function willGenerateSet(): bool;"
] | [
"0.7262567",
"0.72312343",
"0.7197799",
"0.7197799",
"0.6677842",
"0.664554",
"0.6518645",
"0.65154284",
"0.64689076",
"0.64689076",
"0.64452624",
"0.62474126",
"0.6231419",
"0.62125957",
"0.6177204",
"0.6177204",
"0.61649835",
"0.6161747",
"0.6148717",
"0.61353886",
"0.6133223",
"0.6125293",
"0.61205715",
"0.6111688",
"0.6072066",
"0.60423374",
"0.60392445",
"0.6037412",
"0.6021556",
"0.6014608",
"0.5971156",
"0.5968934",
"0.5940207",
"0.59397906",
"0.59379315",
"0.59045213",
"0.5896625",
"0.5896146",
"0.58832985",
"0.588318",
"0.5858486",
"0.58561885",
"0.58482516",
"0.5821859",
"0.58181477",
"0.58181477",
"0.58130455",
"0.5812781",
"0.5766504",
"0.57555693",
"0.5731619",
"0.57219464",
"0.57210207",
"0.57168037",
"0.5712124",
"0.57007456",
"0.567226",
"0.5666889",
"0.56473815",
"0.56443065",
"0.5642485",
"0.5611872",
"0.56068367",
"0.5601506",
"0.55919284",
"0.55910987",
"0.55828416",
"0.5571059",
"0.5565586",
"0.55639946",
"0.5562652",
"0.5553065",
"0.55518407",
"0.55392843",
"0.5538979",
"0.5529831",
"0.5521887",
"0.55136305",
"0.55089676",
"0.54949224",
"0.5493684",
"0.54875326",
"0.54875326",
"0.5475994",
"0.5469806",
"0.5458609",
"0.5448703",
"0.54461855",
"0.5441618",
"0.5441592",
"0.5431557",
"0.54306763",
"0.5429481",
"0.5422257",
"0.54189676",
"0.5417512",
"0.54106617",
"0.54066074",
"0.5401062",
"0.539672"
] | 0.7232248 | 1 |
Get all of the current attributes on the model. | public function getAttributes()
{
return $this->attributes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function all()\n\t{\n\t\treturn $this->attributes;\n\t}",
"public function getModelAttributes()\n {\n return $this->model->getAttributes();\n }",
"public function attributes()\n {\n return $this->activeAttributes();\n }",
"function attributes() {\n\t\t$this->load_attributes();\n\t\treturn $this->_attributes;\n\t}",
"public function attributes()\n {\n return parent::attributes();\n }",
"public function attributes() { return $this->attributes; }",
"public function getAttributes() {\n return $this->_attributes;\n }",
"public function getAttributes()\n {\n return $this->_attributes;\n }",
"public function getAttributes()\n {\n return $this->_attributes;\n }",
"public function getAttributes(){\n\t\treturn $this->_attributes;\n\t}",
"public function getAttributes() {\n return $this->attributes;\n }",
"public function getAttributes(){\n return $this->attributes;\n }",
"public function getAttributes() {\n return array_merge($this->getFields(), $this->getProperties());\n }",
"public function getAttributes() {\n\t\treturn $this->_attributes;\n\t}",
"public function getAttributes() {\n\t\treturn $this->_attributes;\n\t}",
"public function attributes()\n {\n return $this->model->getFillable();\n }",
"public function getAttributes() {\n\t\treturn $this->attributes;\n\t}",
"public function getAttributes()\n {\n return $this->where('isRelation', false)->pluck('attribute')->toArray();\n }",
"public function getAttributes(){\n\t\t$this->_connect();\n\t\treturn $this->_getAttributes();\n\t}",
"protected function _getAttributes(){\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}",
"public function getAttributes() {}",
"public function getAttributes() {}",
"public function get_attributes()\n {\n }",
"public function get_attributes()\n {\n }",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAttributes();",
"public function getAllAtributes() {\r\n $class = get_class($this->getInvoker());\r\n return mdAttributeHandler::getAllAttributes($class);\r\n }",
"public function getAttributes() {\n return $this->attributes->getArray();\n }",
"public function getAttributes(): array {\n return $this->attributes;\n }",
"public function listProductAttributes(): Collection\n {\n return $this->model->attributes()->get();\n }",
"public function getAllAttributes()\n\t{\n\t\t$intID\t = $this->Input->get('id');\n\t\t$intPID\t = $this->Input->get('pid');\n\n\t\t$arrReturn = array();\n\n\t\t// Add meta fields.\n\t\t$arrReturn['meta'] = $GLOBALS['METAMODELS_SYSTEM_COLUMNS'];\n\n\t\tif (empty($intPID))\n\t\t{\n\t\t\t$objResult = $this->Database\n\t\t\t\t\t->prepare('SELECT pid FROM tl_metamodel_attribute WHERE id=?')\n\t\t\t\t\t->limit(1)\n\t\t\t\t\t->execute($intID);\n\n\t\t\tif ($objResult->numRows == 0)\n\t\t\t{\n\t\t\t\treturn $arrReturn;\n\t\t\t}\n\n\t\t\t$objMetaModel = MetaModelFactory::byId($objResult->pid);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$objMetaModel = MetaModelFactory::byId($intPID);\n\t\t}\n\n\t\tforeach ($objMetaModel->getAttributes() as $objAttribute)\n\t\t{\n\t\t\t$arrReturn['attributes'][$objAttribute->getColName()] = sprintf('%s (%s)', $objAttribute->getName(), str_replace('MetaModelAttribute', '', get_class($objAttribute)));\n\t\t}\n\n\t\treturn $arrReturn;\n\t}",
"protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$table_fields as $field) {\n\t if(property_exists( $this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n }",
"public function getAttributes(): array\n {\n return $this->attributes;\n }",
"protected function getAttributes()\n {\n return [];\n }",
"public function getAttributes(): array\n {\n return $this->_attributes;\n }",
"public function getAttributes()\n {\n $this->attributes['id'] = $this->getId();\n\n return $this->attributes;\n }",
"public function getAttributes(){ }",
"public function getAttributes()\n {\n return $this->getSchema()->getRelationAttributes( $this->getName() );\n }",
"public function getAttributes()\n {\n return collect(parent::getAttributes())\n ->except(array_keys($this->fieldAttributes()))\n ->toArray();\n }",
"protected function attributes()\n {\n return [];\n }",
"public function getAttributes() : array\n {\n\n return $this->attributes;\n }",
"public function attributes()\n\t{\n\t\treturn $this->attribs;\n\t}",
"public function attributes()\r\n\t{\r\n\t\treturn $this->attribs;\r\n\t}",
"public function getAttributesList() {\n return $this->_get(9);\n }",
"public function getAll() {\n return array_keys($this->attrs);\n }",
"public function getAttributesList() {\n return $this->_get(24);\n }",
"public function getAttributes()\n {\n }",
"protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach (self::$db_fields as $field) {\n\t\t\tif (property_exists($this, $field)) {\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributes()\n {\n return array();\n }",
"public function getAttributesList() {\n return $this->_get(3);\n }",
"public function attributes()\n {\n $attributes = array();\n foreach(self::$db_fields as $field)\n {\n if(property_exists($this,$field))\n {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }",
"public function getAttributes()\n {\n return [\n Attributes\\IdAttribute::make(),\n Attributes\\CreatedAtAttribute::make(),\n Attributes\\UpdatedAtAttribute::make(),\n ];\n }",
"protected function attributes() {\n $attributes = array();\n foreach(static::$db_fields as $field) {\n if(property_exists($this, $field)) {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }",
"public function getAttributesList() {\n return $this->_get(7);\n }",
"protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach(self::$db_fields as $field) {\n\t\t\tif(property_exists($this, $field)){\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}",
"public function getAll()\n {\n $valueArray = [];\n\n foreach(self::$validAttributes as $attribute) {\n $valueArray[$attribute] = $this->$attribute;\n }\n\n return $valueArray;\n }",
"public function getAttributesList() {\n return $this->_get(15);\n }",
"public function getAttributesList() {\n return $this->_get(15);\n }",
"public function attributes()\n {\n return [];\n }",
"public function attributes()\n {\n return [];\n }",
"public function attributes()\n {\n return [];\n }",
"public function attributes(){\r\n /*\r\n $attributes = array();\r\n foreach(self::$db_fields as $field){\r\n if(property_exists($this, $field)){\r\n\t $attributes[$field] = $this->$field;\r\n\t }\r\n }\r\n return $attributes;\r\n */\r\n \r\n //return get_object_vars($this);\r\n return $this->variables;\r\n }",
"public function getAttributesList() {\n return $this->_get(2);\n }",
"protected function attributes() {\n\t $attributes = array();\n\t foreach(self::$db_fields as $field) {\n\t if(property_exists($this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n\t}",
"public function getAttributes()\r\n\t{\r\n\t\treturn $this->attr;\r\n\t}",
"public function getAttributes()\n {\n return array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'role' => $this->role,\n 'status' => $this->status,\n 'created' => $this->created,\n 'modified' => $this->modified\n );\n }",
"public function getAttributes(): iterable;",
"public function getAttributes() {\n $toReturn = array();\n $toReturn[\"id\"] = $this->id_;\n $toReturn[\"username\"] = $this->username_;\n $toReturn[\"email\"] = $this->email_;\n $toReturn[\"displayName\"] = $this->displayName_;\n $toReturn[\"firstName\"] = $this->firstName_;\n $toReturn[\"lastName\"] = $this->lastName_;\n $toReturn[\"postalCode\"] = $this->postalCode_;\n if ($this->privileges_ !== null) {\n $toReturn[\"privileges\"] = $this->privileges_;\n } else {\n $toReturn[\"privileges\"] = array();\n }\n \n $toReturn[\"isVerified\"] = $this->isVerified_;\n return $toReturn;\n }",
"public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }",
"public function getAll()\n {\n return $this->findAllByAttributes();\n }"
] | [
"0.82305926",
"0.80878913",
"0.8085684",
"0.80186427",
"0.7821868",
"0.7808438",
"0.77517354",
"0.77345043",
"0.77345043",
"0.7730291",
"0.7721688",
"0.7698713",
"0.76920563",
"0.76871777",
"0.76871777",
"0.7687157",
"0.76759857",
"0.7670685",
"0.76664263",
"0.7588164",
"0.7556508",
"0.7555134",
"0.7554914",
"0.7554914",
"0.74661344",
"0.74661344",
"0.74661344",
"0.74661344",
"0.74661344",
"0.74661344",
"0.74661344",
"0.74661344",
"0.74661344",
"0.74394125",
"0.74332184",
"0.74155074",
"0.7396238",
"0.736214",
"0.7360605",
"0.73556113",
"0.73495054",
"0.73472804",
"0.733821",
"0.73370844",
"0.7334529",
"0.73010004",
"0.729195",
"0.7276509",
"0.727509",
"0.7267134",
"0.7259653",
"0.7255465",
"0.7236674",
"0.7225149",
"0.7222446",
"0.7216865",
"0.7216865",
"0.7216865",
"0.7216865",
"0.72147304",
"0.7209904",
"0.71935695",
"0.71812546",
"0.717801",
"0.7174957",
"0.7174957",
"0.71665037",
"0.71665037",
"0.7157759",
"0.7157759",
"0.7157759",
"0.7151044",
"0.7148814",
"0.7129845",
"0.7118243",
"0.7102947",
"0.7084046",
"0.7010282",
"0.69986206",
"0.6993363"
] | 0.77108544 | 27 |
Set the array of model attributes. No checking is done. | public function setRawAttributes(array $attributes, $sync = false)
{
// merge dynamic properties to the base attributes
if ($sync) {
$attributes = array_merge($this->attributes, $attributes);
}
$this->attributes = $attributes;
if ($sync) {
$this->syncOriginal();
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAttributes();",
"public function setAttributes(array $attributes);",
"public function setAttributes(array $attributes);",
"public function setAttributes(array $attributes);",
"public function setAttributes($arr) {\n foreach($arr as $key => $val) {\n switch($key) {\n case \"id\":\n case \"user_id\":\n //casting null to int will return 0; don't want that\n if ($val !== null) {\n $this->id_ = (int) $val;\n }\n break; \n case \"username\":\n $this->username_ = $val;\n break; \n case \"email\":\n $this->email_ = $val;\n break; \n case \"displayName\":\n case \"display_name\":\n $this->displayName_ = $val;\n break; \n case \"firstName\":\n case \"first_name\":\n $this->firstName_ = $val;\n break; \n case \"lastName\":\n case \"last_name\":\n $this->lastName_ = $val;\n break; \n case \"postalCode\":\n case \"postal_code\":\n $this->postalCode_ = $val;\n break; \n case \"isVerified\":\n case \"is_verified\":\n $this->isVerified_ = (int) $val;\n break; \n case \"privileges\":\n //might be a string of comma-separated numbers, or an array\n if (is_array($val)) {\n $this->privileges_ = $val;\n } else if ($val !== null) {\n //clear array first\n unset($this->privileges_);\n $this->privileges_ = array();\n $tmp = explode(\",\", $val);\n foreach($tmp as $v){\n if (is_numeric($v)) {\n //$this->privileges_[(int) $v] = 1;\n $this->privileges_[] = (int) $v;\n }\n }\n \n }\n break;\n\n default:\n //ignore any others\n }\n }\n }",
"public function setAttributes($attributes){ }",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'nombre',\n 'estado',\n 'pais_idpais'\n ],\n 'date' => []\n ];\n }",
"public function setAttributes ($attributes)\n {\n\n $this->attributes = array_merge($this->attributes, $attributes);\n\n }",
"public function set()\n {\n $args = func_get_args();\n\n if ( count($args) == 2 )\n {\n $this->attributes[$args[0]] = $args[1];\n }\n elseif ( count($args) == 1 && is_array($args[0]) ) \n {\n $this->attributes = ( array_merge($this->attributes, $args[0]) );\n }\n\n return $this;\n }",
"public function setAttributes($attributes);",
"protected abstract function initializeAttributes(): array;",
"public function setAllowedAttributes(array $allowedAttributes);",
"function update_attributes($array = array())\n {\n foreach ($array as $key => $value) {\n $this->_stdObject->{$key} = $value;\n }\n }",
"public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }",
"public function setAttrs($attrs);",
"public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}",
"public function setAttributes(array $attributes)\n\t{\n\t\t$allowedAttributes = array('usuario','correo','cedula');\n\t\tforeach($attributes as $name=>$value) {\n\t\t\tif (in_array($name, $allowedAttributes))\n\t\t\t\t\t$this->$name = $value;\n\t\t}\n\t\treturn true;\n\t}",
"function set_attrs($attrs)\n {\n foreach($attrs as $key => $value) {\n if ($key == \"meta_name\") { continue; }\n if ($key == \"vocab\") { continue; }\n if ($key == \"text\") { continue; }\n if ($key == \"lang\") { continue; }\n $this->attrs[$key] = $value; \n }\n }",
"abstract protected function getModelAttributes();",
"public function setAll(array $dataArray)\n {\n foreach ($dataArray as $attribute => $value) {\n $this->setAttribute($dataArray, $attribute);\n }\n }",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_documento',\n 'fk_funcionario',\n 'accion',\n 'fecha',\n 'descripcion',\n 'titulo'\n ],\n 'date' => ['fecha']\n ];\n }",
"abstract protected function setValidationCustomAttributes(): array;",
"public function setAttrs($attrs) {\n\t\t$this->attrs = $attrs;\n\t}",
"public function set_attributes($attributes)\n {\n }",
"public function fill(array $attributes)\n {\n $existingAttributes = get_object_vars($this);\n\n foreach ($existingAttributes as $attributeName => $oldAttributeValue) {\n array_key_exists($attributeName, $attributes) ? $this->$attributeName = $attributes[$attributeName] : NULL;\n }\n }",
"public function setAttributes($attributes)\n {\n foreach($attributes as $key => $value) {\n $this->$key = $value;\n }\n }",
"public function setAttributes(array $params)\n {\n foreach($params as $name => $value) {\n $this->setAttribute($name, $value);\n }\n }",
"public function addAttributes($arrAttributes) {\n foreach ($arrAttributes as $key => $val) {\n $this->attributes[$key] = $val;\n }\n }",
"public function set_field_attributes( $attributes = array() ) {\n\t\n\t\t$this->field_attributes = $attributes;\n\t\n\t}",
"public function setAttributes(Array $attributes): self\n {\n\t\tforeach($attributes as $k => $v) {\n\t\t\t$this->setAttribute($k, $v);\n\t\t}\n\t\treturn $this;\n\t}",
"function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }",
"public function setRequiredAttributes(array $attributes)\n {\n $this->requiredAttributes = $attributes;\n }",
"public function update($arr) {\n // update attribute\n foreach ($arr as $key => $value) {\n $this->{$key} = $value;\n }\n }",
"public function update($arr) {\n // update attribute\n foreach ($arr as $key => $value) {\n $this->{$key} = $value;\n }\n }",
"function set(array $array){\n foreach($this as $atributo => $valor){\n if(isset($array[$atributo])){\n $this->$atributo = $array[$atributo];\n }\n }\n }",
"public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\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$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function fillAttributes(array $attributes = []): void\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n }",
"public function setAttributes(array $attributes, $merge = false);",
"public function fill(array $attributes);",
"public function fill(array $attributes = [])\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n }",
"public function setAttributes(array $attributes = null)\n {\n $this->setCustomAttributes($attributes);\n }",
"public function setAttributes($values)\n {\n if (!empty($values)) {\n foreach ($values as $name => $value) {\n $this->setAttribute($name, $value);\n }\n }\n }",
"public function setFromArray(array $array) {\n\t\tforeach ($array as $key => $value) {\n\t\t\tif (array_key_exists($key, $this->data)) {\n\t\t\t\t$this->$key = $value;\n\t\t\t}\n\t\t}\n\n\t\tif (array_key_exists('attributes', $array)) {\n\t\t\t$attributes = $array['attributes'];\n\n\t\t\tif (array_key_exists('disabled', $attributes)) {\n\t\t\t\t$input = $this->input;\n\t\t\t\t$input['attributes']['disabled'] = $attributes['disabled'];\n\t\t\t\t$this->input = $input;\n\n\t\t\t\t$button = $this->button;\n\t\t\t\t$button['attributes']['disabled'] = $attributes['disabled'];\n\t\t\t\t$this->button = $button;\n\t\t\t}\n\n\t\t\tif (array_key_exists('readonly', $attributes)) {\n\t\t\t\t$input = $this->input;\n\t\t\t\t$input['attributes']['readonly'] = $attributes['readonly'];\n\t\t\t\t$this->input = $input;\n\n\t\t\t\t$button = $this->button;\n\t\t\t\t$button['attributes']['disabled'] = $attributes['readonly'];\n\t\t\t\t$this->button = $button;\n\t\t\t}\n\t\t}\n\t}",
"public function set_attributes( $attributes = array(), $override = true ) {\n\t\n\t\tif ( true == $override ) {\n\t\t\t$this->attributes = array_merge( $this->attributes, $attributes );\n\t\t}\n\t\telse {\n\t\t\t$this->attributes = array_merge( $attributes, $this->attributes );\n\t\t}\n\t\n\t}",
"private function setAttributeFieldValue()\n {\n // Get all our attribute objects\n $proxiedAttrs = $this->getAttributes();\n \n $data = [];\n foreach ($proxiedAttrs as $attrObjArr) {\n foreach ($attrObjArr as $attrObj) {\n $dataKey = $attrObj->getFieldName();\n $dataVal = $this->getRequest()->postVar($dataKey);\n $data[$dataKey] = $dataVal;\n }\n }\n \n $json = $this->dbObject('AttributeData')->toJson($data);\n $this->setField('AttributeData', $json);\n }",
"protected static function setAttributes( Model &$object, array $attributes )\n\t{\n\t\tforeach($attributes as $key => $value)\n\t\t{\n\t\t\tif( array_search($key, static::$hidden) === false )\n\t\t\t{\n\t\t\t\t$object->attributes[$key] = $value;\n\t\t\t}\n\t\t}\n\t}",
"private function setCustomAttributes(array $attributes = null)\n {\n if (!is_null($attributes)) {\n $this->customAttributes->mergeAttributes($attributes);\n }\n }",
"public function setAttributes($values)\n {\n if (is_array($values)) {\n foreach ($values as $name => $value) {\n $setter = 'set' . ucfirst($name);\n if (method_exists($this, $setter)) {\n // set property\n $this->$setter($value);\n }\n }\n }\n }",
"private function addAtrributesToCRUD() {\r\n if (!empty($this->__attributes)) {\r\n $this->myCRUD()->setAtributes($this->__attributes);\r\n }\r\n }",
"function action_unique_attribute_list() {\n $this->layout = null;\n\n $this->model = DB::model('Model')->fetch($_REQUEST['model_id']);\n if ($this->model->value['id']) {\n $this->model->bindMany('Attribute');\n }\n }",
"public function forceFill(array $attributes)\n {\n $this->attributes = $attributes;\n }",
"public function setRawAttributes($attributes) {\n $regex_attributes = \"/(?P<key>[a-z0-9-]+)=?(?P<value> [a-z0-9-]+)?,?/ix\";\n $attrib = array();\n if($attributes != '') {\n $parts = array();\n $result = preg_match_all($regex_attributes, $attributes, $parts);\n if(!$result) {\n $this->attributes = $attrib;\n return $this;\n }\n $keys = $parts['key'];\n $values = $parts['value'];\n $allowed_keys = $this->getAllowedAttributes();\n $allowed_values = $this->getAllowedAttributeValues();\n foreach ($keys as $index => $key) {\n $key = strtolower($key);\n // The key is in the allowed_keys array\n if(in_array($key, $allowed_keys)) {\n $value = strtolower($values[$index]);\n if(array_key_exists($key, $allowed_values)) {\n // For this key exists a allowed values array\n if(in_array($value, $allowed_values[$key])) {\n // Otherwise we check if the value is in the array\n $attrib[$key][] = $value; \n } else {\n // OK, we found a key wich is not allowed\n $allowedValues = implode(', ', $allowed_values[$key]);\n throw new Exception(\"$this->class: '$value' not allowed for attribute '$key'! Allowed values are: $allowedValues\");\n } \n } else {\n // For this key, no array with allowed values exist. we just save the key and asume any value is allowed\n $attrib[$key][] = $value;\n //throw new Exception(\"$this->class: '$value' not allowed for attribute '$key'! Allowed values are: $allowedValues\");\n }\n } else {\n $keyIsAllowed = false;\n foreach($allowed_values as $otherKey => $otherValues) {\n if(in_array($key, $otherValues)) {\n $attrib[$otherKey][] = $key;\n $keyIsAllowed = true;\n }\n }\n if(!$keyIsAllowed) {\n throw new Exception(sprintf(\"%s: '%s' not allowed as attribute!\", $this->class, $key));\n }\n }\n }\n }\n $this->attributes = $attrib;\n return $this;\n }",
"public function __construct(){\n if(count($this->fillable) == 0){\n foreach($this->attributes as $key => $attr){\n array_push($this->fillable, $key);\n }\n }\n }",
"public function setAttributes(array $attributes)\n {\n $this->attributes = $attributes;\n\n return $this;\n }",
"public function setAttrList($attrList) {\n\t$this->attrList = $attrList;\n }",
"public function setAttributes($data = []) {\n if (empty($data)) {\n //init\n $data = array_fill_keys(array_keys(static::attributLabels()), null);\n }\n if (is_array($data)) {\n $this->attributes = self::$wpdb->_escape($data);\n } else {\n parse_str($data, $this->attributes);\n }\n foreach ($this->attributes as $name => $value)\n if (property_exists($this, $name)) {\n $this->$name = $this->attributes[$name] = stripslashes_deep($value);\n } else {\n unset($this->attributes[$name]);\n }\n }",
"public function fill(array $attributes = []);",
"public function setAttributes($values, $safeOnly = true)\n\t{\n\t\tparent::setAttributes($values, $safeOnly);\n\n\t\t// Looking only for file attributes (and fix null error on fly)\n\t\tif ( is_array($values) )\n\t\t{\n\t\t\t$attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());\n\n\t\t\t$class = StringHelper::basename(get_called_class());\n\n\t\t\tforeach ($values as $name => $value)\n\t\t\t{\n\t\t\t\tif ( isset( $attributes[$name] ) )\n\t\t\t\t{\n\t\t\t\t\tif ( isset($_FILES[$class]['name'][$name]) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$uploadedFile = UploadedFile::getInstance($this, $name);\n\n\t\t\t\t\t\tif ( $uploadedFile )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $uploadedFile;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ( ! $this->isNewRecord )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $this->oldAttributes[$name];\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}",
"public function setAttributes($values, $safeOnly = true)\n\t{\n\t\tparent::setAttributes($values, $safeOnly);\n\n\t\t// Looking only for file attributes (and fix null error on fly)\n\t\tif ( is_array($values) )\n\t\t{\n\t\t\t$attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());\n\n\t\t\t$class = StringHelper::basename(get_called_class());\n\n\t\t\tforeach ($values as $name => $value)\n\t\t\t{\n\t\t\t\tif ( isset( $attributes[$name] ) )\n\t\t\t\t{\n\t\t\t\t\tif ( isset($_FILES[$class]['name'][$name]) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$uploadedFile = UploadedFile::getInstance($this, $name);\n\n\t\t\t\t\t\tif ( $uploadedFile )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $uploadedFile;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ( ! $this->isNewRecord )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->$name = $this->oldAttributes[$name];\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}",
"public function setAttributes(array $attr)\n {\n foreach ($attr as $key => $value) {\n $this->setAttribute($key, $value);\n }\n\n return $this;\n }",
"public function setProperties( ArrayObject $params )\n {\n foreach ( $this->attributeTypes as $attr => $type )\n {\n // 1: fijarse si esta en params\n // 2: verificar si el valor que tiene en params es del mismo tipo que el atributo\n // - Si el tipo es numerico, y el valor es string, ver que sea un string numerico. http://www.php.net/is_numeric (ojo con numeros negativos o si empiezan con \".\" o \",\", probar!!!)\n // - Si el tipo es date o time, y el tipo es un string, ver que el string tiene forma de date o time.\n // - Distinguir entre valor cero y valor null.\n\n // TODO: Ver como se podrian tambien setear listas de \"objetos simples\" (no es la idea que esto setee atributos que son PO, solo atributos simples)\n if (isset($params[$attr]) && !$this->isInyectedAttribute($attr)) // IMPORTANTE: id, class, deleted no se pueden setear por set properties!!!\n {\n // Esto es set$attr pero mas rapido!\n // TODO: Chekeos de tipos...\n // WARNING: Esto solo setea atributos simples! Hay que ver si puedo hacer el tema de setear atributos de clases asociadas... (depende de la notacion de las keys de params)\n // SI HAGO TODO EL CHEKEO EN setAttributeValue, solo llamo a esa y listo...\n \n $this->attributeValues[$attr] = (is_string($params[$attr]) ? trim($params[$attr]) : $params[$attr]);\n \n // Si attr el un id de un hasOne, y viene un string vacio, me tira un error en DatabaseXXX\n // al intentar poner un '' en un campo INT id, pero NULL le puedo poner. Asi que si viene\n // un valor vacio, le pongo NULL.\n if ($this->attributeValues[$attr] === '') $this->attributeValues[$attr] = NULL;\n \n \n // FIXME: deberia garantizar que solo vienen valores simples en params.\n \n // Marco como dirty en atributos simples (asignar en cada loop del for es mas barato\n // que estar chequeando si se modifico un campo y setear afuera del loop).\n $this->dirty = true;\n }\n }\n }",
"public function fill(array $attributes)\n {\n $totallyGuarded = $this->totallyGuarded();\n\n // TODO: check if its fillable\n // TODO: set attribute\n // TODO: else throw exception\n\n // TODO: return $this for chaining\n }",
"public function setAttributeList(array $attribute_list): void;",
"public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}",
"public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}",
"public function fill(array $attributes, $raw = false) {\n\t\tforeach ($attributes as $key => $value) {\n\t\t\t// If the \"raw\" flag is set, it means that we'll just load every value from\n\t\t\t// the array directly into the attributes, without any accessibility or\n\t\t\t// mutators being accounted for. What you pass in is what you get.\n\t\t\tif ($raw) {\n\t\t\t\t$this->set_attribute($key, $value);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the \"accessible\" property is an array, the developer is limiting the\n\t\t\t// attributes that may be mass assigned, and we need to verify that the\n\t\t\t// current attribute is included in that list of allowed attributes.\n\t\t\tif (is_array(static::$accessible)) {\n\t\t\t\tif (in_array($key, static::$accessible)) {\n\t\t\t\t\t$this->$key = $value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If the \"accessible\" property is not an array, no attributes have been\n\t\t\t\t// white-listed and we are free to set the value of the attribute to\n\t\t\t\t// the value that has been passed into the method without a check.\n\n\t\t\t\t$this->$key = $value;\n\t\t\t}\n\t\t}\n\n\t\t// If the original attribute values have not been set, we will set\n\t\t// them to the values passed to this method allowing us to easily\n\t\t// check if the model has changed since hydration.\n\t\tif (count($this->original) === 0) {\n\t\t\t$this->original = $this->attributes;\n\t\t}\n\n\t\treturn $this;\n\t}",
"protected function attributes()\n {\n return [];\n }",
"public function setOldAttributes($values)\n {\n $this->_oldAttributes = $values;\n }",
"public function attributes(array $attributes=array())\n {\n $this->_attributes = $attributes;\n return $this;\n }",
"public function attributesToArray()\n {\n $attributes = $this->attributes;\n\n $mutatedAttributes = $this->getMutatedAttributes();\n\n // We want to spin through all the mutated attributes for this model and call\n // the mutator for the attribute. We cache off every mutated attributes so\n // we don't have to constantly check on attributes that actually change.\n foreach ($mutatedAttributes as $key) {\n if (!array_key_exists($key, $attributes)) {\n continue;\n }\n\n $attributes[$key] = $this->mutateAttributeForArray(\n $key, $attributes[$key]\n );\n }\n\n // Here we will grab all of the appended, calculated attributes to this model\n // as these attributes are not really in the attributes array, but are run\n // when we need to array or JSON the model for convenience to the coder.\n foreach ($this->getArrayableAppends() as $key) {\n $attributes[$key] = $this->mutateAttributeForArray($key, null);\n }\n\n return $attributes;\n }",
"function update_attributes($attributes) {\n\t\t\tif(is_array($attributes)) {\n\t\t \t \t// Test each attribute to be updated\n\t\t \t \t// and process according to its type\n\t\t\t\tforeach($attributes as $field => $value) {\n\t\t\t\t\t# datetime / date parts check\n\t\t\t\t\tif(preg_match('/^\\w+\\(.*i\\)$/i', $field)) {\n\t\t\t\t\t\t// The name of this attribute ends in '(?i)'\n\t\t\t\t\t\t// indicating that it's part of a date or time\n\t\t\t\t\t\t$datetime_field = substr($field, 0, strpos($field, '('));\n\t\t\t\t\t\tif(!in_array($datetime_field, $datetime_fields)) {\n\t\t\t\t\t\t\t$datetime_fields[] = $datetime_field;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif(is_object($value) && get_parent_class($value) == __CLASS__ && $this->auto_save_associations) {\n\t\t\t\t\t\t# this elseif checks if first its an object if its parent is ActiveRecord\n\t\t\t\t\t\tif($association_type = $this->get_association_type($field)) {\n\t\t\t\t\t\t\t$this->save_associations[$association_type][] = $value;\n\t\t\t\t\t\t\tif($association_type == \"belongs_to\") {\n\t\t\t\t\t\t\t\t$foreign_key = Inflector::singularize($value->table_name).\"_id\";\n\t\t\t\t\t\t\t\t$this->$foreign_key = $value->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif(is_array($value) && $this->auto_save_associations) {\n\t\t\t\t\t\t# this elseif checks if its an array of objects and if its parent is ActiveRecord\n\t\t\t\t\t\tif($association_type = $this->get_association_type($field)) {\n\t\t\t\t\t\t\t$this->save_associations[$association_type][] = $value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->$field = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t \t \t \t\t// Just a simple attribute, copy it\n\t\t\t\t\t\t$this->$field = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If any date/time fields were found, assign the\n\t\t\t\t// accumulated values to corresponding attributes\n\t\t\t\tif(count($datetime_fields)) {\n\t\t\t\t\tforeach($datetime_fields as $datetime_field) {\n\t\t\t\t\t\t$datetime_format = '';\n\t\t\t\t\t\t$datetime_value = '';\n\n\t\t\t\t\t\tif($attributes[$datetime_field.'(1i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(2i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(3i)']) {\n\t\t\t\t\t\t\t$datetime_value = $attributes[$datetime_field.'(1i)']\n\t\t\t\t\t\t\t. '-' . $attributes[$datetime_field.'(2i)']\n\t\t\t\t\t\t\t. '-' . $attributes[$datetime_field.'(3i)'];\n\t\t\t\t\t\t\t$datetime_format = $this->date_format;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$datetime_value .= ' ';\n\n\t\t\t\t\t\tif($attributes[$datetime_field.'(4i)']\n\t\t\t\t\t\t\t&& $attributes[$datetime_field.'(5i)']) {\n\t\t\t\t\t\t\t$datetime_value .= $attributes[$datetime_field.'(4i)']\n\t\t\t\t\t\t\t. ':' . $attributes[$datetime_field.'(5i)'];\n\t\t\t\t\t\t\t$datetime_format .= ' '.$this->time_format;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($datetime_value = trim($datetime_value)) {\n\t\t\t\t\t\t\t$datetime_value = date($datetime_format, strtotime($datetime_value));\n\t\t\t\t\t\t\t//error_log('($field) $datetime_field = $datetime_value');\n\t\t\t\t\t\t\t$this->$datetime_field = $datetime_value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->set_habtm_attributes($attributes);\n\t\t\t}\n\t\t}",
"public function fill(Identifiable $model, array $attributes);",
"public function attributes(array $attributes)\n\t{\n\t\t$this->attributes = $attributes;\n\n\t\treturn $this;\n\t}",
"public function setAttributesByRef (&$attributes)\n {\n\n foreach ($attributes as $key => &$value)\n {\n\n $this->attributes[$key] =& $value;\n\n }\n\n }",
"public function setAttributes(array $attributes): void\n {\n foreach ($attributes as $key => $value) {\n\n // Search for the setter method.\n $setter = 'set' . str_replace('_', '', \\ucwords($key, '_'));\n\n // If it exists, call it.\n if (\\method_exists($this, $setter)) {\n $this->{$setter}($value);\n } else {\n throw new \\InvalidArgumentException(\"This attribute '$key' doesn't exists.\");\n }\n }\n\n // Check if all required attributes are not null.\n foreach (static::$required as $attribute) {\n if ($this->$attribute === null) {\n throw new RequiredAttributeMissingException($attribute);\n }\n }\n }",
"protected function setAttribute($dataArray, $attribute)\n {\n if (isset($dataArray[$attribute])) {\n if (in_array($attribute, self::$validAttributes)) {\n $this->$attribute = $dataArray[$attribute];\n }\n }\n }",
"public function fillAttributes($attr_arr) {\n // If $attr_arr is an associative array, convert it to numerically indexed\n // If it's a numerically indexed array, treat it the same\n $index_keys = array_keys($attr_arr);\n foreach ($index_keys as $num => $val) {\n $attr_to_add = $attr_arr[$val];\n /* echo \"index_keys is $val \\n\"; */\n foreach ($this->attr as $key => $value) {\n /* echo \"this->key is $key and index_keys is $val \\n\"; */\n if ($attr_to_add and $key === $val) {\n $this->attr[$key] = $attr_to_add;\n break 1;\n }\n } \n }\n }",
"function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}",
"function setValues($array){\r\n\t\tforeach($array as $key => $val){\r\n\t\t\t$key = lcfirst(str_replace(\" \",\"\",ucwords(str_replace(\"_\",\" \",$key))));\r\n\t\t\tif(property_exists($this,$key))\r\n\t\t\t\t$this->$key = $val;\r\n\t\t}\r\n\t}",
"public function setAttrs(array $value): self\n {\n $this->attrs = $value;\n\n return $this;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"public function setAttributes(array $attributes)\n\t{\n\t\tforeach($attributes as $attribute => $value)\n\t\t\t$this->setAttribute($attribute, $value);\n\n\t\treturn $this;\n\t}",
"private function addAttributes(array $attributes) : void\n {\n $this->attributes = $attributes;\n }",
"public function __construct(array $attributes)\n {\n foreach ($attributes as $attribute => $value){\n $this->$attributes = $value;\n }\n }",
"private function prepareItems()\n {\n $attribute = $this->attribute;\n $items = $this->model->$attribute;\n if (!is_array($items)) {\n $items = [];\n }\n\n $this->_items = $items;\n }",
"function set(array $data) {\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}",
"public function updateAttributes(&$attributes)\n {\n if ($validator = $this->getValidator()) {\n \n if ($extra = $validator->getAttributesForField($this->owner)) {\n $attributes = array_merge($attributes, $extra);\n }\n \n }\n }",
"protected function getAttributes()\n {\n return [];\n }",
"protected function setAttributes($attributes) {\n $this->_formAttributes = $attributes;\n }",
"public function setAttributes($values, $safeOnly = true){\n $params = $this->limpiarParametrosConEspacios($values);\n parent::setAttributes($params, $safeOnly);\n $this->barrio = strtolower($this->barrio);\n $this->calle = strtolower($this->calle);\n }",
"public function defineAttributes()\n\t{\n\t\treturn array();\n\t}",
"public function setAttributes(array $attributes)\n {\n $this->audience_member = $attributes;\n return $this;\n }",
"function SetAttributes($attributes = array()) {\n if (is_array($attributes)) {\n $t = '';\n foreach ($attributes as $key => $value) {\n $t .= \" $key=\" . '\"' . $this->CheckPlain($value) . '\"';\n }\n return $t;\n }\n }",
"protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"assignments\";\n\t}",
"public function populateAttributes(array $attributes) {\n\t\tforeach ($attributes as $attributeName => $attributeValue) {\n\t\t\t$this->_attributes[$attributeName] = $attributeValue;\n\t\t}\n\t\treturn true;\n\t}",
"public function fill(array $attributes)\n\t{\n\t\t$this->fillCustomAttributes($attributes);\n\t\t\n\t\treturn parent::fill($attributes);\n\t}",
"public function set(array $models,array $options = []);",
"public function setAll($array) {\n $this->elements = $array;\n }",
"protected function setUpdateArray() {\n $column_names = getColumnNames($this->table_name);\n foreach ($column_names as $column_name) {\n if (isset($_POST[$column_name])) {\n $this->update[$column_name] = Mysql::SQLValue($_POST[$column_name]);\n } else if (isset($_GET[$column_name])) {\n $this->update[$column_name] = Mysql::SQLValue($_GET[$column_name]);\n }\n }\n }",
"public function set($model, $attribute, $groups)\n {\n \n }"
] | [
"0.7478687",
"0.7472387",
"0.7472387",
"0.7472387",
"0.7045413",
"0.685604",
"0.6740626",
"0.67223793",
"0.670339",
"0.6677488",
"0.6658305",
"0.65901446",
"0.65852576",
"0.6581184",
"0.6571815",
"0.65355766",
"0.650922",
"0.6506179",
"0.65045655",
"0.6501468",
"0.64682156",
"0.6464743",
"0.6448037",
"0.64414924",
"0.6417163",
"0.6414188",
"0.6388139",
"0.63673544",
"0.63491124",
"0.6340842",
"0.63132584",
"0.62871474",
"0.62778753",
"0.62778753",
"0.6274044",
"0.62520367",
"0.62502235",
"0.62455195",
"0.62190527",
"0.6191077",
"0.6184364",
"0.61785084",
"0.61743766",
"0.617278",
"0.6163255",
"0.61564416",
"0.6150269",
"0.6143134",
"0.6141722",
"0.61375344",
"0.6129049",
"0.6124478",
"0.61111593",
"0.6110953",
"0.6091713",
"0.6090895",
"0.6087267",
"0.605945",
"0.605945",
"0.60573494",
"0.6031027",
"0.6021265",
"0.60109913",
"0.60097295",
"0.6008021",
"0.5984833",
"0.59460443",
"0.59224075",
"0.59149367",
"0.5907057",
"0.5887431",
"0.58710253",
"0.585872",
"0.585351",
"0.58488554",
"0.5847369",
"0.58429295",
"0.5837223",
"0.5837223",
"0.5833698",
"0.58067274",
"0.58067274",
"0.5802023",
"0.5799662",
"0.5796259",
"0.57948154",
"0.5790139",
"0.5789887",
"0.5785458",
"0.5778323",
"0.57742363",
"0.5768095",
"0.5767811",
"0.5766504",
"0.5762065",
"0.57522345",
"0.57516897",
"0.57516617",
"0.5749359",
"0.57461196",
"0.57457423"
] | 0.0 | -1 |
Get the model's original attribute values. | public function getOriginal($key = null, $default = null)
{
return Arr::get($this->original, $key, $default);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function backupOriginalAttributes()\n {\n $this->backup_original = $this->getRawOriginal() ?: [];\n\n return $this->getOriginal();\n }",
"public function getUnchangedAttributes()\n {\n $output = array();\n\n foreach ($this->attributes as $name => $value) {\n if (!$this->hasChanged($name)) {\n $output[$name] = $value;\n }\n }\n\n return $output;\n }",
"protected function getOriginalAll()\n {\n return $this->original;\n }",
"public function getOldAttributes()\n {\n return $this->_oldAttributes === null ? [] : $this->_oldAttributes;\n }",
"public function getChangedAttributes()\n {\n $output = array();\n\n foreach ($this->attributes as $name => $value) {\n if ($this->hasChanged($name)) {\n $output[$name] = $value;\n }\n }\n\n return $output;\n }",
"public function getOriginalModelInfo()\n {\n return $this->original_model_info;\n }",
"public function getOriginalData(): array\n {\n return $this->originalData;\n }",
"public function getOriginal() {\n return $this->original;\n }",
"public function getOriginal()\n {\n return $this->original;\n }",
"public function getChanges(): array\n {\n $changes = [];\n\n foreach ($this->changedAttributesName() as $key) {\n $changes[$key] = $this->originals[$key];\n }\n\n return $changes;\n }",
"public function getAttributes()\n {\n return collect(parent::getAttributes())\n ->except(array_keys($this->fieldAttributes()))\n ->toArray();\n }",
"public function getModelAttributes()\n {\n return $this->model->getAttributes();\n }",
"public function get_dirty() {\n\t\t$dirty = array();\n\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\tif ( ! array_key_exists($key, $this->original) or $value != $this->original[$key]) {\n\t\t\t\t$dirty[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $dirty;\n\t}",
"public function getDirty()\n {\n $dirty = [];\n\n foreach ($this->attributes as $key => $value) {\n if (!array_key_exists($key, $this->original)) {\n $dirty[$key] = $value;\n }\n elseif (\n $value !== $this->original[$key] &&\n !$this->originalIsNumericallyEquivalent($key)\n ) {\n $dirty[$key] = $value;\n }\n }\n\n return $dirty;\n }",
"public function changedAttributesName(): array\n {\n $changedAttributes = [];\n $attributes = $this->toArray();\n foreach ($attributes as $key => $value) {\n if (isset($this->originals[$key]) && $value !== $this->originals[$key] && ! ((is_array($this->originals[$key]) || is_object($this->originals[$key])))) {\n $changedAttributes[] = $key;\n }\n }\n return $changedAttributes;\n }",
"public function attributesToArray()\n {\n $attributes = $this->attributes;\n\n $mutatedAttributes = $this->getMutatedAttributes();\n\n // We want to spin through all the mutated attributes for this model and call\n // the mutator for the attribute. We cache off every mutated attributes so\n // we don't have to constantly check on attributes that actually change.\n foreach ($mutatedAttributes as $key) {\n if (!array_key_exists($key, $attributes)) {\n continue;\n }\n\n $attributes[$key] = $this->mutateAttributeForArray(\n $key, $attributes[$key]\n );\n }\n\n // Here we will grab all of the appended, calculated attributes to this model\n // as these attributes are not really in the attributes array, but are run\n // when we need to array or JSON the model for convenience to the coder.\n foreach ($this->getArrayableAppends() as $key) {\n $attributes[$key] = $this->mutateAttributeForArray($key, null);\n }\n\n return $attributes;\n }",
"public function getOriginalModel()\n {\n return $this->originalModel;\n }",
"public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }",
"public function getAttributes()\n {\n return $this->where('isRelation', false)->pluck('attribute')->toArray();\n }",
"public function getDirty()\n {\n $dirty = [];\n\n foreach ($this->attributes as $key => $value) {\n if (! array_key_exists($key, $this->original)) {\n $dirty[$key] = $value;\n }\n elseif ($value !== $this->original[$key] &&\n ! $this->originalIsNumericallyEquivalent($key)) {\n if( $value instanceof Arrayable &&\n count($this->diffAssocRecursive($value->toArray(), $this->original[$key]))>0) {\n $dirty[$key] = $value;\n }\n elseif ( is_array($value) &&\n count($this->diffAssocRecursive($value, $this->original[$key]))>0) {\n $dirty[$key] = $value;\n }\n elseif ($value instanceof Type &&\n $value == (string) $this->original[$key]) {\n $dirty[$key] = $value;\n }\n else {\n $dirty[$key] = $value;\n }\n }\n }\n\n return $dirty;\n }",
"protected function getModelAttributesForTesting()\n {\n return $this->getModelAttributes();\n }",
"public function getAttributeValues()\n {\n return $this->attributeValues;\n }",
"public function toArray(): array\n {\n $attributes = get_object_vars($this);\n\n unset($attributes['originals']);\n\n return $attributes;\n }",
"public function restoreOriginalAttributes($original = null)\n {\n return $this->original = is_array($original)\n ? $original\n : ($this->backup_original ?: []);\n }",
"public function safeAttributes()\n {\n return $this->attributes();\n }",
"public function attributesToArray()\n {\n $attributes = parent::attributesToArray();\n\n foreach ($attributes as $key => $value) {\n $attributes[$key] = $value instanceof ValueObject ? $this->fromValueObjectToArray($key, $value) : $value;\n }\n\n return $attributes;\n }",
"function attributes() {\n\t\t$this->load_attributes();\n\t\treturn $this->_attributes;\n\t}",
"public function getAttributes(){\n return $this->attributes;\n }",
"function getOriginal()\n {\n }",
"public function separateTranslationsFromAttributes(): array\n\t{\n\t\t$attributes = collect($this->attributes);\n\n\t\t// Extract the translated values\n\t\t$translatables = $attributes->only($this->translatable);\n\t\t$this->translatedAttributes = $translatables->toArray();\n\n\t\t// Keep only the non-translatable attributes\n\t\t$this->attributes = $attributes->forget($this->translatable)->toArray();\n\n\t\treturn $this->translatedAttributes;\n\t}",
"public function getAttributes() {\n return $this->attributes;\n }",
"public function getDirty(): array\n {\n $dirty = [];\n $attributes = $this->toArray();\n\n foreach ($this->changedAttributesName() as $key) {\n $dirty[$key] = $attributes[$key];\n }\n\n return $dirty;\n }",
"public function attributes() { return $this->attributes; }",
"public function attributesToArray()\n {\n return Helper::toCamelCase($this->attributes());\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"protected function _getAttributes(){\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}",
"public function attributesToArray()\n {\n $attributes = parent::attributesToArray(); // call the parent method\n\n foreach ($this->encryptable as $key) {\n if (isset($attributes[$key])) {\n $attributes[$key] = Crypt::decrypt($attributes[$key]);\n }\n }\n\n return $attributes;\n }",
"public function getAttributes() {\n\t\treturn $this->attributes;\n\t}",
"public function getAttributes(): array {\n return $this->attributes;\n }",
"public function getAttributes(){\n\t\treturn $this->_attributes;\n\t}",
"public function getOldValues()\n {\n return isset($this->table[count($this->table)-1]) ? $this->table[count($this->table)-1] : $this->value;\n }",
"public function attributes()\n {\n return parent::attributes();\n }",
"public function getAttributes() {\n return $this->attributes->getArray();\n }",
"public function getAttributes(): array\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n $attributes = parent::getAttributes();\n $validator = $this->getValidator();\n $attributes['value'] = $validator->getHash();\n return $attributes;\n }",
"public function getAttributes() {\n return $this->_attributes;\n }",
"public function getAttributes() : array\n {\n\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->_attributes;\n }",
"public function getAttributes()\n {\n return $this->_attributes;\n }",
"public function getOriginalArrayCollection()\n {\n return $this->originalArrayCollection;\n }",
"public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n\n return $attributes;\n }",
"public function getAttributes() {\n\t\treturn $this->_attributes;\n\t}",
"public function getAttributes() {\n\t\treturn $this->_attributes;\n\t}",
"public function get_input_attributes() {\n\n\t\t$attributes = parent::get_input_attributes();\n\t\t$this->data_att = $attributes['data-field'];\n\n\t\tunset( $attributes['data-field'] );\n\n\t\treturn $attributes;\n\t}",
"public function getAttributes(): array\n {\n // Collects a list of usable Attributes from the Value Object.\n $fields = $this->filterSystemControlFields(\n \\get_object_vars($this)\n );\n\n foreach ($fields as $name => $value) {\n if ($value instanceof AbstractValueObject || $value instanceof EntityCollection) {\n unset($fields[$name]);\n }\n }\n\n // Converts all objects into primitives.\n return $this->convertIntoPrimitiveValues($fields);\n }",
"public function getAttributes(): array\n {\n return $this->_attributes;\n }",
"public function toArray(): array\n {\n $data = $this->model->toArray();\n\n /**\n * Model's toArray method gives us raw entity data.\n * Here we replace some special attributes with human readable values.\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->getDisplayValue($key, $value);\n }\n\n return $data;\n }",
"public function getAttributes() {\n return array_merge($this->getFields(), $this->getProperties());\n }",
"function getValuesAttributes(){\n $complete = [];\n \n foreach($this as $attribute => $valor){\n $complete[$attribute] = $valor;\n }\n \n return $complete;\n }",
"public function getOriginalAmount()\n {\n return $this->originalAmount;\n }",
"public function getOriginals() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('originals'));\n return (is_array($result)) ? reset($result) : $result;\n }",
"public function toArray()\n {\n return $this->getAttributes();\n }",
"protected function getAttributes()\n {\n return [];\n }",
"public function attributes()\n {\n return $this->activeAttributes();\n }",
"public function getRemoveOriginalValue();",
"public function attributes()\n {\n return $this->model->getFillable();\n }",
"public function getAttributes()\r\n\t{\r\n\t\treturn $this->attr;\r\n\t}",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"protected function getArrayableAttributes()\n {\n return $this->attributes;\n }",
"public function getTranslatableEntityObjectValues() {\n return get_object_vars($this);\n }",
"private function getOldAttributes()\n {\n return $this->sessionBag->get(self::PARAM_STORAGE_KEY);\n }",
"public function getNormalizedData()\n {\n return parent::getNormalizedData();\n }",
"public function getTranslatableAttributes()\n\t{\n\t\treturn (isset($this->translatable) && is_array($this->translatable)\n\t\t\t\t? $this->translatable\n\t\t\t\t: []);\n\n\t}",
"public function getModel()\n\t{\n\t\treturn $this->_values;\n\t}",
"public function syncOriginal()\n {\n $this->original = $this->attributes;\n\n return $this;\n }",
"public function toArray()\r\n\t{\r\n\t\t$attributes = parent::toArray();\r\n\r\n\t\tif (! $this->autoTranslations) return $attributes;\r\n\r\n\t\tforeach ($this->translatableAttributes as $field) {\r\n\t\t\t$attributes[$field] = $this->getTranslation($field);\r\n\t\t}\r\n\r\n\t\treturn $attributes;\r\n\t}",
"public function getOriginalUrlParameters() {\n\t\treturn $this->originalUrlParameters;\n\t}",
"public function syncOriginal(): Model\n {\n $this->original = $this->getAttributes();\n\n return $this;\n }",
"public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }",
"public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }",
"public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }"
] | [
"0.78856134",
"0.73431104",
"0.7183134",
"0.71351904",
"0.7073124",
"0.70482856",
"0.6953721",
"0.6931459",
"0.6920631",
"0.6911287",
"0.6798541",
"0.67981696",
"0.6792991",
"0.6732015",
"0.6680729",
"0.6561729",
"0.6522301",
"0.6440069",
"0.64344627",
"0.64179194",
"0.64170694",
"0.64061177",
"0.6397362",
"0.6391878",
"0.6391319",
"0.638628",
"0.63259387",
"0.63133764",
"0.630823",
"0.6308107",
"0.62674516",
"0.62636065",
"0.6253136",
"0.624042",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62360835",
"0.62266773",
"0.6222653",
"0.6211648",
"0.6207488",
"0.62020826",
"0.6199563",
"0.6193812",
"0.61884457",
"0.6170375",
"0.61674285",
"0.6163572",
"0.61402464",
"0.6139482",
"0.6139482",
"0.6136964",
"0.61253124",
"0.61168814",
"0.61168814",
"0.6115292",
"0.6092783",
"0.6091176",
"0.6076053",
"0.60402924",
"0.6021878",
"0.60049427",
"0.5998363",
"0.5994825",
"0.5987972",
"0.59848505",
"0.5982657",
"0.5977122",
"0.5971887",
"0.5968147",
"0.5968147",
"0.5956707",
"0.594956",
"0.5945355",
"0.5924315",
"0.5923585",
"0.59210676",
"0.5898072",
"0.58963877",
"0.5893842",
"0.58859175",
"0.58859175",
"0.58859175"
] | 0.0 | -1 |
Sync the original attributes with the current. | public function syncOriginal()
{
$this->original = $this->attributes;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final public function sync() {\n\t\t$this->original = $this->attributes;\n\n\t\treturn true;\n\t}",
"public function syncOriginal()\n {\n $this->original = $this->toArray();\n\n return $this;\n }",
"public function syncOriginal(): Model\n {\n $this->original = $this->getAttributes();\n\n return $this;\n }",
"public function syncOriginalAttributes($attributes): Model\n {\n $attributes = is_array($attributes) ? $attributes : func_get_args();\n\n $modelAttributes = $this->getAttributes();\n\n foreach ($attributes as $attribute) {\n $this->original[$attribute] = $modelAttributes[$attribute];\n }\n\n return $this;\n }",
"public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }",
"public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }",
"public function backupOriginalAttributes()\n {\n $this->backup_original = $this->getRawOriginal() ?: [];\n\n return $this->getOriginal();\n }",
"public function syncWith(array $attributes = [])\n {\n $this->original = $attributes;\n $this->attributes = $attributes;\n\n $this->synced();\n\n return $this;\n }",
"protected function mergeTranslationsWithAttributes()\n\t{\n\t\t$this->attributes = array_merge($this->attributes, $this->translatedAttributes);\n\t}",
"protected function _resetModifiedAttributesFlags() {\n\t\t$this->_modifiedAttributes = array();\n\t}",
"public function syncOriginalAttribute($attribute)\n {\n $this->original[$attribute] = $this->attributes[$attribute];\n\n return $this;\n }",
"public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}",
"public function afterSave()\r\n\t{\r\n\t\tif(count($this->serialAttributes)) {\r\n\t\t\tforeach($this->serialAttributes as $attribute) {\r\n\t\t\t\t$_att = $this->owner->$attribute;\r\n\t\t\t\tif(!empty($_att)\r\n\t\t\t\t && is_scalar($_att)) {\r\n\t\t\t\t\t$a = @unserialize($_att);\r\n\t\t\t\t\tif($a !== false) {\r\n\t\t\t\t\t\t$this->owner->$attribute = $a;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->owner->$attribute = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}",
"protected function sync()\n {\n $this->image =& $this->temp;\n unset($this->temp);\n }",
"public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}",
"public function sync($attributes)\n {\n foreach ($attributes as $key => $attribute) {\n if ($key[0] !== '$') {\n $this->attributes[$key] = $attribute;\n }\n }\n\n if (isset($attributes['$id'])) {\n $this->attributes['$id'] = $attributes['$id'];\n $this->id = $attributes['$id'];\n }\n\n }",
"public function updateAttributes(&$attributes)\n {\n if ($validator = $this->getValidator()) {\n \n if ($extra = $validator->getAttributesForField($this->owner)) {\n $attributes = array_merge($attributes, $extra);\n }\n \n }\n }",
"public function setRawAttributes(array $attributes, $sync = false)\n {\n // merge dynamic properties to the base attributes\n if ($sync) {\n $attributes = array_merge($this->attributes, $attributes);\n }\n\n $this->attributes = $attributes;\n\n if ($sync) {\n $this->syncOriginal();\n }\n\n return $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 syncOriginalAttribute($attribute)\n {\n if(is_object($this->attributes[$attribute])) {\n if($this->attributes[$attribute] instanceof Type) {\n $this->original[$attribute] = (string) $attribute;\n }\n elseif($this->attributes[$attribute] instanceof Arrayable) {\n $this->original[$attribute] = $this->attributes[$attribute]->getArray();\n }\n }\n else {\n $this->original[$attribute] = $this->attributes[$attribute];\n }\n\n return $this;\n }",
"public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }",
"protected function _prepareSyncFieldsMap()\n {\n $old2New = $this->_oldFieldsMap;\n $new2Old = array_flip ( $this->_oldFieldsMap );\n $this->_syncFieldsMap = array_merge ( $old2New, $new2Old );\n return $this;\n }",
"function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n if( $dataText != '' )\n {\n // update the path top newest image version\n $contentObject = eZContentObject::fetch( $originalContentObjectAttribute->attribute( 'contentobject_id' ) );\n if( $contentObject instanceof eZContentObject && $dataText != NULL && $dataText != '' )\n {\n $data = $this->updateImagePath( $dataText, $contentObject, $originalContentObjectAttribute );\n $dataText = $data['data_text'];\n }\n $dataInt = $originalContentObjectAttribute->attribute( \"data_int\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n $contentObjectAttribute->setAttribute( \"data_int\", $dataInt );\n }\n }\n }",
"public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n }",
"public function __clone()\n {\n foreach ($this as $key => $val)\n {\n if (is_object($val) || is_array($val))\n $this->{$key} = unserialize(serialize($val));\n }\n }",
"public function setOldAttributes($values)\n {\n $this->_oldAttributes = $values;\n }",
"public function shuffle(): void\n {\n $keys = array_keys($this->attributes);\n shuffle($keys);\n $random = [];\n\n foreach ($keys as $key) {\n $random[$key] = $this->attributes[$key];\n }\n\n $this->attributes = $random;\n }",
"protected function resetProperties() {}",
"function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $data = $originalContentObjectAttribute->attribute( \"content\" );\n $contentObjectID = $contentObjectAttribute->attribute( 'contentobject_id' );\n $originalContentObjectID = $originalContentObjectAttribute->attribute( 'contentobject_id' );\n \n if ( is_object( $data ) )\n {\n if ( $contentObjectID != $originalContentObjectID )\n {\n $gp = new xrowGISPosition( array( \n 'contentobject_attribute_id' => $contentObjectAttribute->attribute( 'id' ) , \n 'contentobject_attribute_version' => $contentObjectAttribute->attribute( 'version' ) , \n 'latitude' => $data->attribute( 'latitude' ) , \n 'longitude' => $data->attribute( 'longitude' ) , \n 'street' => $data->attribute( 'street' ) , \n 'zip' => $data->attribute( 'zip' ) , \n 'district' => $data->attribute( 'district' ) , \n 'city' => $data->attribute( 'city' ) , \n 'state' => $data->attribute( 'state' ) , \n 'country' => $data->attribute( 'country' ),\n 'accurate' => $data->attribute( 'accurate' )\n ) );\n $contentObjectAttribute->Content = $gp;\n }\n else\n {\n \n if ( $originalContentObjectAttribute->attribute( 'data_int' ) )\n {\n $contentObjectAttribute->setAttribute( 'data_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n $contentObjectAttribute->setAttribute( 'sort_key_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n }\n $data->setAttribute( 'contentobject_attribute_id', $contentObjectAttribute->attribute( 'id' ) );\n $data->setAttribute( 'contentobject_attribute_version', $contentObjectAttribute->attribute( 'version' ) );\n $contentObjectAttribute->setContent( $data );\n }\n $contentObjectAttribute->store();\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }",
"public function fill(array $attributes)\n {\n $existingAttributes = get_object_vars($this);\n\n foreach ($existingAttributes as $attributeName => $oldAttributeValue) {\n array_key_exists($attributeName, $attributes) ? $this->$attributeName = $attributes[$attributeName] : NULL;\n }\n }",
"function resetModified() { $this->_modified = 0; }",
"function resetModified() { $this->_modified = 0; }",
"function initializeObjectAttribute ( \n $contentObjectAttribute, \n $currentVersion, \n $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n // $contentObjectAttributeID = $contentObjectAttribute->attribute( \"id\" );\n // $currentObjectAttribute = eZContentObjectAttribute::fetch( $contentObjectAttributeID,\n // $currentVersion );\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n }\n }",
"public function __clone()\n\t{\n\t\tforeach ($this as $k => $v)\n\t\t{\n\t\t\tif (is_object($v) || is_array($v))\n\t\t\t{\n\t\t\t\t$this->{$k} = unserialize(serialize($v));\n\t\t\t}\n\t\t}\n\t}",
"public function setAttributesByRef (&$attributes)\n {\n\n foreach ($attributes as $key => &$value)\n {\n\n $this->attributes[$key] =& $value;\n\n }\n\n }",
"function initializeObjectAttribute( &$objectAttribute, $currentVersion, &$originalContentObjectAttribute )\n {\n\n\t//skip if this is a new content object, THREE === IS VITAL DON'T CHANGE!!!\n\n\tif (!($originalContentObjectAttribute === null))\n\t{\t\n\t\teZDebug::writeError( $objectAttribute );\n\t\teZDebug::writeError ($currentVersion);\n\t\t\n\t\teZDebug::writeError($originalContentObjectAttribute);\n\n\t\t$ContentObjectID=(int) $originalContentObjectAttribute->ContentObjectID;\n\t\t$OriginalVersion=(int) $originalContentObjectAttribute->Version;\n\t\t$ContentClassAttributeID= (int) $originalContentObjectAttribute->ContentClassAttributeID;\n\n\t\t$NewVersion= (int) $objectAttribute->Version;\n\n\t\teZDebug::writeDebug( $ContentObjectID );\n\t eZDebug::writeDebug( $currentVersion );\t\n\t\n\n\n\t\t//fetch original relations\n \t$db =& eZDB::instance();\n\t\t$oldRelations=$db->arrayQuery(\"SELECT * FROM ezcontentobject_link WHERE from_contentobject_id='$ContentObjectID' AND from_contentobject_version='$OriginalVersion'\");\n\n\t\teZDebug::writeDebug($oldRelations);\n\t\t//remove relations\n\t\t$db->query(\"DELETE FROM ezcontentobject_link WHERE from_contentobject_id='$ContentObjectID' AND from_contentobject_version='$NewVersion'\");\n\t\t//re-add, corrected.\n\n\t\tforeach ($oldRelations as $relation) {\n\t\t\t $from_contentobject_id=$relation['from_contentobject_id'];\n\t\t\t $to_contentobject_id=$relation['to_contentobject_id'];\n \t\t\t$contentclassattribute_id=$relation['contentclassattribute_id'];\n\n \t \t\t$this->addContentObjectRelation($from_contentobject_id, $NewVersion, $contentclassattribute_id, $to_contentobject_id );\n\t\t\t\n\t\t}\n\t}\n }",
"public function clearAttributes ()\n {\n\n $this->attributes = null;\n $this->attributes = array();\n\n }",
"public function __clone()\n {\n $this->id = null;\n\n // Generate a new identifier\n $identifier = Uuid::uuid1()->toString();\n $this->identifier = $identifier;\n $this->uri = 'local:'.$this->identifier;\n\n // Set last change/update to now\n $this->updatedAt = new \\DateTimeImmutable();\n $this->changedAt = $this->updatedAt;\n }",
"public function __clone()\n\t{\n\t\tforeach ($this as $k => $v)\n\t\t{\n\t\t\tif ((is_object($v)) || is_array($v)) {\n\t\t\t\t$this->{$k} = unserialize(serialize($v));\n\t\t\t}\n\t\t}\n\t}",
"public function __clone()\n\t{\n\t\tforeach ($this as $k => $v)\n\t\t{\n\t\t\tif ((is_object($v)) || is_array($v)) {\n\t\t\t\t$this->{$k} = unserialize(serialize($v));\n\t\t\t}\n\t\t}\n\t}",
"public function copy()\n\t\t{\n\t\t\treturn unserialize(serialize($this)); \n\t\t}",
"public function storeOriginals()\n {\n $this->originals = $this->toArray();\n }",
"public static function updateInitialChatAttributes(erLhcoreClassModelChat & $prefillChat, erLhcoreClassModelChat $currentChat) {\n \t$attributesPrefill = array(\n \t\t'nick',\n \t\t'email',\n \t\t'phone'\n \t);\n \t\n \t$attrChanged = false;\n \tforeach ($attributesPrefill as $attr) {\n \t\tif ($prefillChat->$attr == '' && $currentChat->$attr != '') {\n \t\t\t$prefillChat->$attr = $currentChat->$attr;\n \t\t\t$attrChanged = true;\n \t\t}\n \t}\n \t\n \tif ($attrChanged) {\n \t\t$prefillChat->saveThis();\n \t}\n }",
"public function setUnmodified()\n {\n\t$this->modified= false;\n }",
"public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }",
"public function syncLdap()\n {\n $this->updateName();\n $this->updateEmail();\n $this->updateInfo();\n $this->save();\n }",
"public function restoreAfterRequest()\n {\n Facade::clearResolvedInstances();\n\n foreach ($this->backupedValuesBeforeRequest as $attri => $v) {\n// echo \"\\n $attri\\n\";\n// if (is_array($this->$attri))\n// echo 'dif:', count($this->$attri) - count($this->__oldValues[$attri]);\n $this->$attri = $v;\n }\n\n\n foreach ($this->restoreTool as $tool) {\n $tool();\n }\n\n\n if ($this->configNeedBackup ) {\n\n $config = $this->make('config');\n\n foreach ($config->changedConfig as $key => $value) {\n $config->set($key, $value);\n }\n $config->changedConfig = [];\n }\n\n $this->booted = false;\n }",
"function apply_fix($old_obj){\t\r\r\n\t\t// to be copied vars\r\r\n\t\t$vars = array('active_modules','active_plugins','setting');\r\r\n\t\t// set\r\r\n\t\tforeach($vars as $var){\r\r\n\t\t\t// var\r\r\n\t\t\t$this->{$var} = (isset( $old_obj->{$var} ) ) ? $old_obj->{$var} : '';\r\r\n\t\t}\t\t\t\t\t\r\r\n\t\t// save\r\r\n\t\t$this->save();\t\r\r\n\t}",
"public function beforeSave() {\r\n $data = $this->getData();\r\n\r\n if ($this->element) {\r\n $default = $this->element->getProperties();\r\n foreach ($data as $k => $prop) {\r\n if (array_key_exists($prop['name'],$default)) {\r\n if ($prop['value'] == $default[$prop['name']]) {\r\n unset($data[$k]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->setProperty('data', $data);\r\n\r\n return parent::beforeSave();\r\n }",
"public function syncToElement(ElementInterface &$target)\n {\n if (!is_a($target, self::class)) {\n return;\n }\n\n foreach ($this::defineComparableAttributes() as $attribute) {\n $target->$attribute = $this->$attribute;\n }\n }",
"public function syncMetadata() {}",
"protected function _syncTrapped() {}",
"public function syncOriginalAttribute(string $attribute): Model\n {\n return $this->syncOriginalAttributes($attribute);\n }",
"public function restoreOriginalAttributes($original = null)\n {\n return $this->original = is_array($original)\n ? $original\n : ($this->backup_original ?: []);\n }",
"function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->content();\n $contentObjectAttribute->setContent( $dataText );\n }\n else\n {\n $default = array( 'value' => array() );\n $contentObjectAttribute->setContent( $default );\n }\n }",
"public function saveObjectState() {\n $this->objectState = base64_encode(serialize($this));\n $this->isNewRecord = false;\n $this->update();\n $this->reconstructCombatants();\n }",
"public function fill(array $attributes, $raw = false) {\n\t\tforeach ($attributes as $key => $value) {\n\t\t\t// If the \"raw\" flag is set, it means that we'll just load every value from\n\t\t\t// the array directly into the attributes, without any accessibility or\n\t\t\t// mutators being accounted for. What you pass in is what you get.\n\t\t\tif ($raw) {\n\t\t\t\t$this->set_attribute($key, $value);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the \"accessible\" property is an array, the developer is limiting the\n\t\t\t// attributes that may be mass assigned, and we need to verify that the\n\t\t\t// current attribute is included in that list of allowed attributes.\n\t\t\tif (is_array(static::$accessible)) {\n\t\t\t\tif (in_array($key, static::$accessible)) {\n\t\t\t\t\t$this->$key = $value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If the \"accessible\" property is not an array, no attributes have been\n\t\t\t\t// white-listed and we are free to set the value of the attribute to\n\t\t\t\t// the value that has been passed into the method without a check.\n\n\t\t\t\t$this->$key = $value;\n\t\t\t}\n\t\t}\n\n\t\t// If the original attribute values have not been set, we will set\n\t\t// them to the values passed to this method allowing us to easily\n\t\t// check if the model has changed since hydration.\n\t\tif (count($this->original) === 0) {\n\t\t\t$this->original = $this->attributes;\n\t\t}\n\n\t\treturn $this;\n\t}",
"protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }",
"public function __clone()\n {\n foreach ( $this->props as $path => $propStorage )\n {\n $this->props[$path] = clone $propStorage;\n }\n }",
"public function reset()\n {\n $this->id = null;\n $this->attributes = array();\n }",
"public function update() {\r\n\t\t$this->getMapper()->update($this);\r\n\t}",
"public function applyOptions(): void\n {\n if ($this->hasEndpoint()) {\n $this->withOptions(['endpoint' => $this->endpoint]);\n }\n\n $this->setProp('value', $this->attribute);\n $this->setProp('entities', $this->options(), false);\n }",
"public function __clone()\n {\n $this->data = clone $this->data;\n }",
"public function setRawAttributes(array $attributes, $sync = false)\n\t{\n\t\tforeach ($attributes as $index => $attribute)\n\t\t{\n\t\t\t$attributes[$index] = utf8_encode($attribute);\n\t\t}\n\t\treturn parent::setRawAttributes($attributes, $sync);\n\t}",
"function save()\n {\n $this->setAttribute(\"updated\", time());\n\n foreach($this->attributes AS $attribute)\n {\n\n if($attribute->name=='title')\n {\n //if the user has changed the datasource's title then we need to update the datsources slug based on that title;\n $this->setSlug($attribute->value);\n }\n\n if ($attribute->dirty)\n {\n\n if ($attribute->core)\n {\n $theUpdate=array();\n $theUpdate[$attribute->name] =$attribute->value;\n $this->db->where(\"data_source_id\", $this->id);\n $this->db->update(\"data_sources\", $theUpdate);\n $attribute->dirty = FALSE;\n }\n else\n {\n\n if ($attribute->value !== NULL)\n {\n if ($attribute->new)\n {\n $this->db->insert(\"data_source_attributes\", array(\"data_source_id\" => $this->id, \"attribute\" => $attribute->name, \"value\"=>$attribute->value));\n $attribute->dirty = FALSE;\n $attribute->new = FALSE;\n }\n else\n {\n $this->db->where(array(\"data_source_id\" => $this->id, \"attribute\" => $attribute->name));\n $this->db->update(\"data_source_attributes\", array(\"value\"=>$attribute->value));\n $attribute->dirty = FALSE;\n }\n }\n else\n {\n $this->db->where(array(\"data_source_id\" => $this->id, \"attribute\" => $attribute->name));\n $this->db->delete(\"data_source_attributes\");\n unset($this->attributes[$attribute->name]);\n }\n }\n\n\n }\n }\n return $this;\n }",
"public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }",
"public function setAttributes ($attributes)\n {\n\n $this->attributes = array_merge($this->attributes, $attributes);\n\n }",
"public function resetAttributeEdit()\n {\n $this->attributeCreateGroupId = null;\n $this->editAttributeId = null;\n $this->refreshGroups();\n }",
"public function stick()\n {\n $this->sticked = 1;\n //This prevents the call of beforesave, and the setting of update_at \n $this->updateAttributes(['sticked']);\n }",
"public function set_attributes( $attributes = array(), $override = true ) {\n\t\n\t\tif ( true == $override ) {\n\t\t\t$this->attributes = array_merge( $this->attributes, $attributes );\n\t\t}\n\t\telse {\n\t\t\t$this->attributes = array_merge( $attributes, $this->attributes );\n\t\t}\n\t\n\t}",
"public function updateOwners(): void\n {\n foreach ($this->attributes as $attributeName) {\n $this->removeOwner($this->owner->primaryKey, $this->name, $attributeName);\n $this->linkModelWithOwner($attributeName, $this->owner->{$attributeName});\n }\n }",
"function sync() {\n\t\t// TODO\n\t}",
"public function copy(): self\n {\n return $this->immute(true); // force immute\n }",
"public function freeze()\n {\n $this->frozen = true;\n }",
"public function setAttributes();",
"protected function _flushVars() {\n if (isset($this->LdapObject->id)) {\n $this->LdapObject->id = null;\n }\n if (isset($this->LdapObject->primaryKey)) {\n $this->LdapObject->primaryKey = 'uid';\n }\n \n $this->sforceData = array();\n $this->stagingData = array();\n $this->ldapData = array();\n $this->syncOperation = 'nothing';\n \n }",
"public function synchronized($sync = true)\n {\n\n // Data und saved data sind jetzt identisch\n if ($sync)\n $this->savedData = $this->data;\n\n $this->synchronized = $sync;\n\n }",
"public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }",
"public function update(){\n parent::update();\n $this->collection = null;\n $this->files = null;\n $this->dublinCore = null;\n }",
"protected function update() {}",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class]))\n static::cacheMutatedAttributes($class);\n\n return static::$mutatorCache[$class];\n }",
"public function fill(array $attributes)\n {\n $this->saving = true;\n\n $totallyGuarded = $this->totallyGuarded();\n\n foreach ($attributes as $key => $values) {\n if ($this->isKeyALocale($key)) {\n foreach ($values as $translationAttribute => $translationValue) {\n if ($this->alwaysFillable() or $this->isFillable($translationAttribute)) {\n $this->getTranslationOrNew($key)->$translationAttribute = $translationValue;\n } elseif ($totallyGuarded) {\n throw new MassAssignmentException($key);\n }\n }\n unset($attributes[$key]);\n }\n }\n\n $result = parent::fill($attributes);\n\n $this->saving = false;\n\n return $result;\n }",
"protected function afterFind(){\t\t\n\t\t\n\t\tif(isset($this->history))\n\t\t\t$this->history=json_decode($this->history,true);\n\t\t\n\t\t$this->_oldAttributes = $this->attributes;\n\t\n\t\treturn parent::afterFind();\n\t}",
"public function setOriginal($original) {\n $this->original = $original;\n }",
"public function resetDirty()\n {\n $this->dirty = false;\n $this->dirtyOne = false;\n $this->dirtyMany = false;\n }",
"public function set_to_default()\n\t{\n\t\t// SimpleDB requires a value for every attribue...\n\t\t$this->_name = NULL;\n\t\t$this->_contextid = NULL;\n\t\t$this->_userid = NULL;\n $this->_deleted = 0;\n\t\t$this->_lastmodified = 0;\t\n\t}",
"public function for_update(){\n\t\t$this->for_update = true;\n\t\treturn $this;\n\t}",
"public function _fill($attributes)\n \t{\n \t\tforeach($attributes as $key => $value) {\n \t\t\t$this->$key = $value;\n \t\t}\n\n \t\treturn $this;\n \t}",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }",
"public function testImmutable(): void\n {\n //Value is empty\n $this->category->setCustomAttribute('custom_layout_update', false);\n $this->category->setOrigData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n\n //New value\n $this->category->setCustomAttribute('custom_layout_update', 'test');\n $this->category->setOrigData('custom_layout_update', null);\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n $this->category->setCustomAttribute('custom_layout_update', 'testNew');\n $this->category->setOrigData('custom_layout_update', 'test');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n\n //Removing a value\n $this->category->setCustomAttribute('custom_layout_update', '');\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n $this->assertNull($this->category->getCustomAttribute('custom_layout_update')->getValue());\n\n //Using old stored value\n //Saving old value 1st\n $this->recreateCategory();\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->category->setData('custom_layout_update', 'test');\n $this->category->save();\n $this->recreateCategory();\n $this->category = $this->categoryFactory->create(['data' => $this->category->getData()]);\n\n //Trying the same value.\n $this->category->setData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n //Trying new value\n $this->category->setData('custom_layout_update', 'test2');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n //Empty value\n $this->category->setData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n }",
"public function updateAttributes($attributes) {\n\t\t$this->setData($attributes);\n\t\treturn $this->save();\n\t}",
"public function resetOriginalStatus() {\n $this->orig_status = $this->getStatus();\n }",
"abstract protected function setModifiedState();",
"public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\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$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function reset()\n {\n $this->setData(array());\n $this->setOrigData();\n $this->_attributes = null;\n return $this;\n }",
"public function setAttributes($attributes){ }",
"public function __clone()\n {\n $this->init(clone $this->original, $this->encoding);\n }",
"function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_nom('');\n $this->setId_nivel('');\n $this->setId_asignatura('');\n $this->setId_situacion('');\n // la fecha debe estar antes del acta por si hay que usar la funcion inventarActa.\n $this->setF_acta('');\n $this->setActa('');\n $this->setDetalle('');\n $this->setPreceptor('');\n $this->setId_preceptor('');\n $this->setEpoca('');\n $this->setId_activ('');\n $this->setNota_num('');\n $this->setNota_max('');\n $this->setTipo_acta('');\n $this->setPrimary_key($aPK);\n }",
"private function appendOldAttributes(array $attributes)\n {\n // Get a current collection\n $collection = $this->sessionBag->get(self::PARAM_STORAGE_KEY);\n\n // Merge new attributes with collection\n $collection = array_merge($collection, $attributes);\n\n // Override old collection with a new one\n $this->sessionBag->set(self::PARAM_STORAGE_KEY, $collection);\n }",
"protected function resetCleanState()\n {\n $this->isModified = false;\n }"
] | [
"0.74845415",
"0.680344",
"0.6802746",
"0.6786014",
"0.63640785",
"0.63399667",
"0.63048583",
"0.60904676",
"0.6056318",
"0.6033761",
"0.590117",
"0.5896081",
"0.589403",
"0.5851019",
"0.58411443",
"0.5820354",
"0.5798619",
"0.5727194",
"0.57045454",
"0.5635495",
"0.56159526",
"0.55982685",
"0.5558804",
"0.5554975",
"0.55461925",
"0.5545374",
"0.5536428",
"0.55276537",
"0.54895294",
"0.5479901",
"0.5468808",
"0.5468808",
"0.54651886",
"0.5465188",
"0.544664",
"0.54453206",
"0.544251",
"0.5432431",
"0.54307765",
"0.54307765",
"0.54277927",
"0.5425907",
"0.5425099",
"0.5408528",
"0.5400552",
"0.5375238",
"0.5374611",
"0.53608036",
"0.5343858",
"0.53423154",
"0.53416115",
"0.53364855",
"0.5334447",
"0.5306149",
"0.53049755",
"0.53002816",
"0.52976066",
"0.5289998",
"0.5288452",
"0.52872074",
"0.5280151",
"0.5256167",
"0.5238398",
"0.523819",
"0.5236173",
"0.5225354",
"0.5223471",
"0.5211963",
"0.5207411",
"0.5198467",
"0.51949257",
"0.5194237",
"0.5191667",
"0.51901",
"0.51714545",
"0.5170634",
"0.51613426",
"0.51590663",
"0.5149297",
"0.51464295",
"0.5144677",
"0.5137824",
"0.51311576",
"0.51304615",
"0.51269555",
"0.5121789",
"0.51168275",
"0.511053",
"0.5095026",
"0.5092324",
"0.509019",
"0.50875056",
"0.5085794",
"0.50795126",
"0.5076387",
"0.50660926",
"0.5058569",
"0.5053671",
"0.505151",
"0.50404066"
] | 0.74856496 | 0 |
Sync a single original attribute with its current value. | public function syncOriginalAttribute($attribute)
{
$this->original[$attribute] = $this->attributes[$attribute];
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final public function sync() {\n\t\t$this->original = $this->attributes;\n\n\t\treturn true;\n\t}",
"public function syncOriginal()\n {\n $this->original = $this->attributes;\n\n return $this;\n }",
"public function syncOriginalAttribute(string $attribute): Model\n {\n return $this->syncOriginalAttributes($attribute);\n }",
"public function syncOriginalAttribute($attribute)\n {\n if(is_object($this->attributes[$attribute])) {\n if($this->attributes[$attribute] instanceof Type) {\n $this->original[$attribute] = (string) $attribute;\n }\n elseif($this->attributes[$attribute] instanceof Arrayable) {\n $this->original[$attribute] = $this->attributes[$attribute]->getArray();\n }\n }\n else {\n $this->original[$attribute] = $this->attributes[$attribute];\n }\n\n return $this;\n }",
"public function syncOriginal(): Model\n {\n $this->original = $this->getAttributes();\n\n return $this;\n }",
"public function syncOriginalAttributes($attributes): Model\n {\n $attributes = is_array($attributes) ? $attributes : func_get_args();\n\n $modelAttributes = $this->getAttributes();\n\n foreach ($attributes as $attribute) {\n $this->original[$attribute] = $modelAttributes[$attribute];\n }\n\n return $this;\n }",
"public function syncOriginal()\n {\n $this->original = $this->toArray();\n\n return $this;\n }",
"public function testImmutable(): void\n {\n //Value is empty\n $this->category->setCustomAttribute('custom_layout_update', false);\n $this->category->setOrigData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n\n //New value\n $this->category->setCustomAttribute('custom_layout_update', 'test');\n $this->category->setOrigData('custom_layout_update', null);\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n $this->category->setCustomAttribute('custom_layout_update', 'testNew');\n $this->category->setOrigData('custom_layout_update', 'test');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n\n //Removing a value\n $this->category->setCustomAttribute('custom_layout_update', '');\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n $this->assertNull($this->category->getCustomAttribute('custom_layout_update')->getValue());\n\n //Using old stored value\n //Saving old value 1st\n $this->recreateCategory();\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->category->setData('custom_layout_update', 'test');\n $this->category->save();\n $this->recreateCategory();\n $this->category = $this->categoryFactory->create(['data' => $this->category->getData()]);\n\n //Trying the same value.\n $this->category->setData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n //Trying new value\n $this->category->setData('custom_layout_update', 'test2');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n //Empty value\n $this->category->setData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n }",
"public function setOriginal($original) {\n $this->original = $original;\n }",
"public function setUpdated(): void\n {\n $this->originalData = $this->itemReflection->dehydrate($this->item);\n }",
"public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}",
"public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }",
"function initializeObjectAttribute ( \n $contentObjectAttribute, \n $currentVersion, \n $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n // $contentObjectAttributeID = $contentObjectAttribute->attribute( \"id\" );\n // $currentObjectAttribute = eZContentObjectAttribute::fetch( $contentObjectAttributeID,\n // $currentVersion );\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n }\n }",
"public function updateObject( Inx_Api_Recipient_Attribute $attr, $oValue );",
"public function testChangeAttributeUseFillMethod()\n {\n // set value\n $this->post->tags = 'value1';\n $this->post->save();\n\n // change value\n $this->post->fill([\n 'tags' => $newValue = 'value2'\n ]);\n\n $this->post->save();\n\n // equals\n $this->assertEquals($this->post->tags, $newValue);\n }",
"public function __set($attr, $value) {\n if ($this->isMeta($attr)) {\n if ($value === null || $value === '') {\n // UNSET VALUE\n if (isset($this->meta()->$attr)) {\n if (isset($this->_metaModified[$attr]) && $this->_metaModified[$attr] == self::META_ADDED) {\n // unset what's to be added - not to add it at all\n unset($this->_metaModified[$attr]);\n } else {\n // unset what was modified or initially existed\n $this->_metaModified[$attr] = self::META_UNSET;\n }\n unset($this->meta()->$attr);\n }\n } else {\n // SET VALUE\n if (isset($this->meta()->$attr)) {\n // field exists\n if (isset($this->_metaModified[$attr]) && ($this->_metaModified[$attr] == self::META_ADDED)) {\n // updating previously added field; do nothing - stay in add mode\n } else {\n // updating field that was deleted, modified before or initially loaded\n $this->_metaModified[$attr] = self::META_MODIFIED;\n }\n } else {\n // non-existing field\n if (isset($this->_metaModified[$attr]) && ($this->_metaModified[$attr] == self::META_UNSET)) {\n // field initially existed, but to be deleted. Modify instead\n $this->_metaModified[$attr] = self::META_MODIFIED;\n } else {\n // first access of non-existed field\n $this->_metaModified[$attr] = self::META_ADDED;\n }\n }\n $this->meta()->$attr = $value;\n }\n } else {\n parent::__set($attr, $value);\n }\n }",
"public function syncToElement(ElementInterface &$target)\n {\n if (!is_a($target, self::class)) {\n return;\n }\n\n foreach ($this::defineComparableAttributes() as $attribute) {\n $target->$attribute = $this->$attribute;\n }\n }",
"public function getRemoveOriginalValue();",
"public function onUnsafeAttribute($name, $value)\n {\n $this->$name = $value;\n }",
"public function sync($attributes)\n {\n foreach ($attributes as $key => $attribute) {\n if ($key[0] !== '$') {\n $this->attributes[$key] = $attribute;\n }\n }\n\n if (isset($attributes['$id'])) {\n $this->attributes['$id'] = $attributes['$id'];\n $this->id = $attributes['$id'];\n }\n\n }",
"public function afterSave()\r\n\t{\r\n\t\tif(count($this->serialAttributes)) {\r\n\t\t\tforeach($this->serialAttributes as $attribute) {\r\n\t\t\t\t$_att = $this->owner->$attribute;\r\n\t\t\t\tif(!empty($_att)\r\n\t\t\t\t && is_scalar($_att)) {\r\n\t\t\t\t\t$a = @unserialize($_att);\r\n\t\t\t\t\tif($a !== false) {\r\n\t\t\t\t\t\t$this->owner->$attribute = $a;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->owner->$attribute = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}",
"public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}",
"public function writeAttribute($attribute, $value) {}",
"function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->content();\n $contentObjectAttribute->setContent( $dataText );\n }\n else\n {\n $default = array( 'value' => array() );\n $contentObjectAttribute->setContent( $default );\n }\n }",
"public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }",
"public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}",
"public function assignAttribute($attribute, $data)\n {\n return $this->attributes()->save(\n Attribute::whereName($attribute)->firstOrFail(),\n ['data' => $data]\n );\n }",
"function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n if( $dataText != '' )\n {\n // update the path top newest image version\n $contentObject = eZContentObject::fetch( $originalContentObjectAttribute->attribute( 'contentobject_id' ) );\n if( $contentObject instanceof eZContentObject && $dataText != NULL && $dataText != '' )\n {\n $data = $this->updateImagePath( $dataText, $contentObject, $originalContentObjectAttribute );\n $dataText = $data['data_text'];\n }\n $dataInt = $originalContentObjectAttribute->attribute( \"data_int\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n $contentObjectAttribute->setAttribute( \"data_int\", $dataInt );\n }\n }\n }",
"function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $data = $originalContentObjectAttribute->attribute( \"content\" );\n $contentObjectID = $contentObjectAttribute->attribute( 'contentobject_id' );\n $originalContentObjectID = $originalContentObjectAttribute->attribute( 'contentobject_id' );\n \n if ( is_object( $data ) )\n {\n if ( $contentObjectID != $originalContentObjectID )\n {\n $gp = new xrowGISPosition( array( \n 'contentobject_attribute_id' => $contentObjectAttribute->attribute( 'id' ) , \n 'contentobject_attribute_version' => $contentObjectAttribute->attribute( 'version' ) , \n 'latitude' => $data->attribute( 'latitude' ) , \n 'longitude' => $data->attribute( 'longitude' ) , \n 'street' => $data->attribute( 'street' ) , \n 'zip' => $data->attribute( 'zip' ) , \n 'district' => $data->attribute( 'district' ) , \n 'city' => $data->attribute( 'city' ) , \n 'state' => $data->attribute( 'state' ) , \n 'country' => $data->attribute( 'country' ),\n 'accurate' => $data->attribute( 'accurate' )\n ) );\n $contentObjectAttribute->Content = $gp;\n }\n else\n {\n \n if ( $originalContentObjectAttribute->attribute( 'data_int' ) )\n {\n $contentObjectAttribute->setAttribute( 'data_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n $contentObjectAttribute->setAttribute( 'sort_key_int', $originalContentObjectAttribute->attribute( 'data_int' ) );\n }\n $data->setAttribute( 'contentobject_attribute_id', $contentObjectAttribute->attribute( 'id' ) );\n $data->setAttribute( 'contentobject_attribute_version', $contentObjectAttribute->attribute( 'version' ) );\n $contentObjectAttribute->setContent( $data );\n }\n $contentObjectAttribute->store();\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }\n else\n {\n $contentObjectAttribute->setContent( null );\n }\n }",
"public function beforeSave()\n {\n $value = $this->getValue();\n if (is_array($value)) {\n $value = $this->_helper->makeStorableArrayFieldValue($value);\n }\n \n $this->setValue($value);\n }",
"public final function setImmutable()\n {\n $this->isImmutable = true;\n }",
"public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }",
"private function setAttributeFieldValue()\n {\n // Get all our attribute objects\n $proxiedAttrs = $this->getAttributes();\n \n $data = [];\n foreach ($proxiedAttrs as $attrObjArr) {\n foreach ($attrObjArr as $attrObj) {\n $dataKey = $attrObj->getFieldName();\n $dataVal = $this->getRequest()->postVar($dataKey);\n $data[$dataKey] = $dataVal;\n }\n }\n \n $json = $this->dbObject('AttributeData')->toJson($data);\n $this->setField('AttributeData', $json);\n }",
"abstract public function writeAttribute($name, $value);",
"public function getDirtyValueOfAttribute($attributeName);",
"public function backupOriginalAttributes()\n {\n $this->backup_original = $this->getRawOriginal() ?: [];\n\n return $this->getOriginal();\n }",
"public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}",
"public function setUnmodified()\n {\n\t$this->modified= false;\n }",
"public function __set($attr, $value)\n\t{\n\t\t$this->$attr = $value;\n\t}",
"public function getOldValue();",
"public function __set($attribute, $value)\n {\n array_set($this->attributes, $attribute, $value);\n }",
"function atkClone($attribute)\n{\n\tif (intval(substr(phpversion(),0,1))<5)\n\t$attr = $attribute;\n\telse\n\t$attr = clone($attribute);\n\n\treturn $attr;\n}",
"public function __set($name, $value){\n\t\t\tif($this->$name != $value){\n\t\t\t\t$this->$name = $value;\n\t\t\t\t$this->toUpdate[] = $name;\n\t\t\t}\n\t\t\treturn $value;\n\t\t}",
"public function __set($attribute, $value) {\n $this->setAttribute($attribute, $value);\n }",
"public function syncWith(array $attributes = [])\n {\n $this->original = $attributes;\n $this->attributes = $attributes;\n\n $this->synced();\n\n return $this;\n }",
"public function setRawAttributes(array $attributes, $sync = false)\n\t{\n\t\tforeach ($attributes as $index => $attribute)\n\t\t{\n\t\t\t$attributes[$index] = utf8_encode($attribute);\n\t\t}\n\t\treturn parent::setRawAttributes($attributes, $sync);\n\t}",
"public function __set($attribute, $value)\n {\n // If we are locked tell them\n if ($this->isLocked) {\n\n throw new \\IllegalAccessException('The entity ' . get_called_class() . ' is in a locked state');\n }\n\n // If we do not have this property we should tell them\n if (!property_exists($this, $attribute)) {\n\n throw new \\IllegalArgumentException('There is no attribute called ' . $attribute);\n }\n\n // Still here? Set it then\n $this->$attribute = $value;\n }",
"public function beforeSave() {\n $this->owner->{$this->column} = Yii::$app->db->createCommand(\"SELECT UUID()\")->queryScalar();\n }",
"function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }",
"public function __set($attr, $value)\n {\n return $this->set($attr, $value);\n\n return null;\n }",
"public function __set($attribute, $value) {\n\t\tif (strpos($attribute, '_') === 0) {\n\t\t\t$this->{$attribute} = $value;\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setData($attribute, $value);\n\t}",
"function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $obj = $contentObjectAttribute->attribute( 'object' );\n $dataInt = $obj->attribute( 'published' );\n $contentObjectAttribute->setAttribute( \"data_int\", $dataInt );\n }\n else\n {\n $contentClassAttribute =& $contentObjectAttribute->contentClassAttribute();\n $defaultType = $contentClassAttribute->attribute( self::DEFAULT_FIELD );\n if ( $defaultType == self::DEFAULT_CURRENT_DATE )\n {\n $contentObjectAttribute->setAttribute( \"data_int\", mktime() );\n }\n else if ( $defaultType == self::DEFAULT_ADJUSTMENT )\n {\n $adjustments = eZDateTimeType::classAttributeContent( $contentClassAttribute );\n $value = new eZDateTime();\n $value->adjustDateTime( $adjustments['hour'], $adjustments['minute'], 0, $adjustments['month'], $adjustments['day'], $adjustments['year'] );\n $contentObjectAttribute->setAttribute( \"data_int\", $value->timeStamp() );\n }\n }\n }",
"function __set($attributeToChange, $newValueToAssign) {\n //check that name is valid class attribute\n switch($attributeToChange) {\n case \"name\":\n $this->name = $newValueToAssign;\n break;\n case \"favoriteFood\":\n $this->favoriteFood = $newValueToAssign;\n break;\n case \"sound\":\n $this->sound = $newValueToAssign;\n break;\n default:\n echo $attributeToChange . \" was not found <br>\";\n }\n echo \"Set \" . $attributeToChange . \" to \" . $newValueToAssign . \"<br>\";\n }",
"function set($attr, $value)\r\n\t{\r\n\t\t$this->$attr = $value;\r\n\t}",
"public function synchronized($sync = true)\n {\n\n // Data und saved data sind jetzt identisch\n if ($sync)\n $this->savedData = $this->data;\n\n $this->synchronized = $sync;\n\n }",
"public function __set($attribute, $value)\n {\n $this->set($attribute, $value);\n }",
"public function setAsModified($name = NULL);",
"public function setModified($value) {}",
"public function updateDouble( Inx_Api_Recipient_Attribute $attr, $fValue );",
"public function __clone()\n {\n $this->attribute = clone $this->attribute;\n $this->value = null;\n\n if ($this->isMultilingual()) {\n $this->attribute->delete(['unique', 'uniques']);\n\n $options = [];\n if (is_array($this->multilingual)) {\n $options = $this->multilingual;\n } elseif (true === $this->multilingual) {\n $options = $this->rules->getAttribute(null);\n// Translation input is not required\n unset($options['notnull']);\n } elseif (1 === $this->multilingual) {\n $options = $this->rules->getAttribute(null);\n } elseif (!is_numeric($this->multilingual)) {\n $options = ['rules' => $this->multilingual];\n }\n\n $this->setRule($options);\n }\n }",
"public function getOriginal() {\n return $this->original;\n }",
"public function getOriginal()\n {\n return $this->original;\n }",
"public function stick()\n {\n $this->sticked = 1;\n //This prevents the call of beforesave, and the setting of update_at \n $this->updateAttributes(['sticked']);\n }",
"public function setRaw($name, $value)\n\t{\n\t\t$this->set($name, $value, true);\n\t}",
"public function setRawAttributes(array $attributes, $sync = false)\n {\n // merge dynamic properties to the base attributes\n if ($sync) {\n $attributes = array_merge($this->attributes, $attributes);\n }\n\n $this->attributes = $attributes;\n\n if ($sync) {\n $this->syncOriginal();\n }\n\n return $this;\n }",
"protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }",
"public function copy(): self\n {\n return $this->immute(true); // force immute\n }",
"public function markUnchanged();",
"public function __set($name, $value)\n {\n // Don't allow to set attributes\n }",
"function setAttribute ($attribute, $value) {\n return $this->dbH->setAttribute($attribute, $value);\n }",
"function read_set()\n\t{\n\t\tglobal $REQUEST;\n\t\tif (!$this->writeable)\n\t\t{\n\t\t\tpage_error('Read only attribute ' . $this->name);\n\t\t}\n\t\t$this->value = $REQUEST->read($this->id, $this->mandatory);\n\t\t\n\t\tUtilLogging::getInstance()->debug(\"read_set - Attribute: \". $this->id . \" - value set: \" . $this->value);\n\t}",
"public function beforeSave() {\r\n $data = $this->getData();\r\n\r\n if ($this->element) {\r\n $default = $this->element->getProperties();\r\n foreach ($data as $k => $prop) {\r\n if (array_key_exists($prop['name'],$default)) {\r\n if ($prop['value'] == $default[$prop['name']]) {\r\n unset($data[$k]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n $this->setProperty('data', $data);\r\n\r\n return parent::beforeSave();\r\n }",
"public function mutate();",
"public function mutate();",
"protected function sync()\n {\n $this->image =& $this->temp;\n unset($this->temp);\n }",
"protected function _syncTrapped() {}",
"public function restoreOriginalAttributes($original = null)\n {\n return $this->original = is_array($original)\n ? $original\n : ($this->backup_original ?: []);\n }",
"function initializeObjectAttribute( &$objectAttribute, $currentVersion, &$originalContentObjectAttribute )\n {\n\n\t//skip if this is a new content object, THREE === IS VITAL DON'T CHANGE!!!\n\n\tif (!($originalContentObjectAttribute === null))\n\t{\t\n\t\teZDebug::writeError( $objectAttribute );\n\t\teZDebug::writeError ($currentVersion);\n\t\t\n\t\teZDebug::writeError($originalContentObjectAttribute);\n\n\t\t$ContentObjectID=(int) $originalContentObjectAttribute->ContentObjectID;\n\t\t$OriginalVersion=(int) $originalContentObjectAttribute->Version;\n\t\t$ContentClassAttributeID= (int) $originalContentObjectAttribute->ContentClassAttributeID;\n\n\t\t$NewVersion= (int) $objectAttribute->Version;\n\n\t\teZDebug::writeDebug( $ContentObjectID );\n\t eZDebug::writeDebug( $currentVersion );\t\n\t\n\n\n\t\t//fetch original relations\n \t$db =& eZDB::instance();\n\t\t$oldRelations=$db->arrayQuery(\"SELECT * FROM ezcontentobject_link WHERE from_contentobject_id='$ContentObjectID' AND from_contentobject_version='$OriginalVersion'\");\n\n\t\teZDebug::writeDebug($oldRelations);\n\t\t//remove relations\n\t\t$db->query(\"DELETE FROM ezcontentobject_link WHERE from_contentobject_id='$ContentObjectID' AND from_contentobject_version='$NewVersion'\");\n\t\t//re-add, corrected.\n\n\t\tforeach ($oldRelations as $relation) {\n\t\t\t $from_contentobject_id=$relation['from_contentobject_id'];\n\t\t\t $to_contentobject_id=$relation['to_contentobject_id'];\n \t\t\t$contentclassattribute_id=$relation['contentclassattribute_id'];\n\n \t \t\t$this->addContentObjectRelation($from_contentobject_id, $NewVersion, $contentclassattribute_id, $to_contentobject_id );\n\t\t\t\n\t\t}\n\t}\n }",
"public function getOldValue()\n {\n return $this->old_value;\n }",
"public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}",
"public function setAttribute($attribute, $value)\n {\n }",
"public function set($attr, $value) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] = $value : false;\n }",
"public function setAttributesByRef (&$attributes)\n {\n\n foreach ($attributes as $key => &$value)\n {\n\n $this->attributes[$key] =& $value;\n\n }\n\n }",
"public function __set($name, $value)\n\t{\n\t\t$this->attributes[$name] = $value;\n\t\t\n\t}",
"public function setAttribute($attribute, $value)\r\n\t{\r\n\t\t\r\n\t}",
"protected function _flagAttributeAsModified($attribute) {\n\t\tif (!in_array($attribute, $this->_modifiedAttributes)) {\n\t\t\t$this->_modifiedAttributes[] = $attribute;\n\t\t}\n\t}",
"abstract protected function setModifiedState();",
"public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }",
"public function getOriginalAmount()\n {\n return $this->originalAmount;\n }",
"abstract public function setAttribute($key, $value);",
"public function __set( $name, $value )\n\t{\n\t\t$this->attributes[$name] = $value;\n\t}",
"public function setAttribute($attribute, $value)\n {\n array_set($this->attributes, $attribute, $value);\n\n $this->update();\n }",
"public function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )\n {\n if ( $currentVersion != false )\n {\n $dataText = $originalContentObjectAttribute->attribute( \"data_text\" );\n $contentObjectAttribute->setAttribute( \"data_text\", $dataText );\n }\n else\n {\n $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();\n $default = $contentClassAttribute->attribute( \"data_text1\" );\n if ( $default !== \"\" )\n {\n $contentObjectAttribute->setAttribute( \"data_text\", $default );\n }\n }\n }",
"public function setNewVersion()\n {\n $difference = '9223372036854775806';\n $rand_percent = bcdiv(mt_rand(), mt_getrandmax(), 12);\n $version = bcmul($difference, $rand_percent, 0);\n $this->owner->setAttribute($this->versionField, $version);\n }",
"protected function _saveAttributeValue($object, $attribute, $value)\n {\n $write = $this->_getWriteAdapter();\n $storeId = (int)Mage::app()->getStore($object->getStoreId())->getId();\n $table = $attribute->getBackend()->getTable();\n\n /**\n * If we work in single store mode all values should be saved just\n * for default store id\n * In this case we clear all not default values\n */\n if (Mage::app()->isSingleStoreMode()) {\n $storeId = $this->getDefaultStoreId();\n $write->delete($table, array(\n 'attribute_id = ?' => $attribute->getAttributeId(),\n 'entity_id = ?' => $object->getEntityId(),\n 'store_id <> ?' => $storeId\n ));\n }\n\n $data = new Varien_Object(array(\n 'entity_type_id' => $attribute->getEntityTypeId(),\n 'attribute_id' => $attribute->getAttributeId(),\n 'store_id' => $storeId,\n 'entity_id' => $object->getEntityId(),\n 'value' => $this->_prepareValueForSave($value, $attribute)\n ));\n $bind = $this->_prepareDataForTable($data, $table);\n\n if ($attribute->isScopeStore()) {\n /**\n * Update attribute value for store\n */\n $this->_attributeValuesToSave[$table][] = $bind;\n } else if ($attribute->isScopeWebsite() && $storeId != $this->getDefaultStoreId()) {\n /**\n * Update attribute value for website\n */\n $storeIds = Mage::app()->getStore($storeId)->getWebsite()->getStoreIds(true);\n foreach ($storeIds as $storeId) {\n $bind['store_id'] = (int)$storeId;\n $this->_attributeValuesToSave[$table][] = $bind;\n }\n } else {\n /**\n * Update global attribute value\n */\n $bind['store_id'] = $this->getDefaultStoreId();\n $this->_attributeValuesToSave[$table][] = $bind;\n }\n\n return $this;\n }",
"public function __set($name, $value)\n { \n //set the attribute with the value\n $this->$name = $value;\n }",
"private function set_last_updated_at() {\n\n\t\tif ( ! static::get_table() instanceof TimestampedTable ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$dirty = $this->is_dirty();\n\n\t\t$this->set_attribute( static::get_table()->get_updated_at_column(), $this->fresh_timestamp() );\n\n\t\t// If the model is dirty, we don't want to commit our save since the user should already be calling save.\n\t\tif ( ! $dirty ) {\n\t\t\t$this->save();\n\t\t}\n\t}",
"public function getNewValue()\n {\n return $this->new_value;\n }",
"public function setAttribute(string $attribute, string $value);",
"public function makeEternal()\n {\n return $this->update([\n $this->model->getExpirationAttribute() => null\n ]);\n }"
] | [
"0.6735541",
"0.64017737",
"0.63092816",
"0.6272924",
"0.6106774",
"0.5659271",
"0.56214356",
"0.5590092",
"0.5521869",
"0.5507411",
"0.5492286",
"0.546862",
"0.54089236",
"0.5399785",
"0.53850245",
"0.53487664",
"0.532935",
"0.53268903",
"0.53224164",
"0.53037477",
"0.5280345",
"0.5266407",
"0.5243309",
"0.5222541",
"0.5218695",
"0.52165335",
"0.5211624",
"0.5193041",
"0.517983",
"0.5155664",
"0.5155316",
"0.5154103",
"0.51517975",
"0.5146715",
"0.512879",
"0.51255256",
"0.51010746",
"0.5087598",
"0.50651616",
"0.5061729",
"0.5035526",
"0.50339156",
"0.50324214",
"0.50161785",
"0.5005277",
"0.4968535",
"0.4961429",
"0.49590942",
"0.4956676",
"0.49439606",
"0.4942869",
"0.49373624",
"0.49344817",
"0.49310556",
"0.4927053",
"0.49163088",
"0.49144092",
"0.49005368",
"0.4896924",
"0.4894089",
"0.48872355",
"0.48834428",
"0.48611015",
"0.48597983",
"0.48595265",
"0.485837",
"0.48582405",
"0.48494336",
"0.4839157",
"0.4836376",
"0.48328072",
"0.48145363",
"0.480614",
"0.480614",
"0.47959542",
"0.47919425",
"0.4766834",
"0.47612152",
"0.47602957",
"0.47590846",
"0.4756971",
"0.47544006",
"0.47476003",
"0.47437224",
"0.47427812",
"0.4739653",
"0.47345302",
"0.47336563",
"0.47291893",
"0.47067523",
"0.4703642",
"0.47016412",
"0.46987134",
"0.4698182",
"0.46879974",
"0.46873823",
"0.46835205",
"0.46830016",
"0.46803302",
"0.46786588"
] | 0.6416313 | 1 |
Determine if the model or given attribute(s) have been modified. | public function isDirty($attributes = null)
{
$dirty = $this->getDirty();
if (is_null($attributes)) {
return count($dirty) > 0;
}
if (!is_array($attributes)) {
$attributes = func_get_args();
}
foreach ($attributes as $attribute) {
if (array_key_exists($attribute, $dirty)) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isModified() {\n return count($this->modifiedAttributes) > 0;\n }",
"public function isModified();",
"public function isDirty(): bool\n {\n return count($this->changedAttributesName()) > 0;\n }",
"public function isModified(): bool;",
"function isModified() {\n\t\t$modified = $this->_Modified;\n\t\tif ( !$modified && $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$modified = $modified || $oObject->isModified();\n\t\t\t}\n\t\t}\n\t\treturn $modified;\n\t}",
"function isModified() {\n\t\t$modified = $this->_Modified;\n\t\tif ( !$modified && $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$modified = $modified || $oObject->isModified();\n\t\t\t}\n\t\t}\n\t\treturn $modified;\n\t}",
"public function isModified()\n {\n\treturn $this->modified;\n }",
"public function wasModified()\n\t{\n\t\tif ($this->get('modified') && $this->get('modified') != '0000-00-00 00:00:00')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function isModified() { return $this->_modified; }",
"function isModified() { return $this->_modified; }",
"function isModified() {\n\t\treturn $this->_Modified;\n\t}",
"function isModified() {\n\t\treturn $this->_Modified;\n\t}",
"function isModified() {\n\t\treturn $this->_Modified;\n\t}",
"function isModified() {\n\t\treturn $this->_Modified;\n\t}",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isModified()\n {\n return !!$this->modifiedColumns;\n }",
"public function isDirty() {\n\t\treturn count($this->_modified);\n\t}",
"public function hasChanged(): bool\n {\n if (! $this->isSynced()) {\n return true;\n }\n\n return $this->attributes !== $this->original;\n }",
"public function isChanged() {\n\t\treturn $this->_changed > 0;\n\t}",
"public function isModified($name = NULL);",
"function isModified() {\n\t\t$modified = $this->_Modified;\n\n\t\treturn $modified;\n\t}",
"function isModified() {\n\t\t$modified = $this->_Modified;\n\n\t\treturn $modified;\n\t}",
"function isModified() {\n\t\t$modified = $this->_Modified;\n\n\t\treturn $modified;\n\t}",
"public function hasDirtyValueOfAttribute($attributeName);",
"public function isDirty()\n {\n return $this->isModified;\n }",
"public function changed() {\n\t\t\tif (!$this->original_data) {\n\t\t\t\tthrow new Exception('call exists() before calling changed()');\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->last_change != $this->original_last_change ||\n\t\t\t $this->last_change_reason != $this->original_last_change_reason ||\n\t\t\t $this->lanes_affected != $this->original_lanes_affected ||\n\t\t\t $this->traffic_impact != $this->original_traffic_impact ||\n\t\t\t $this->reason != $this->original_reason) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn false;\n\t\t}",
"public function hasChange()\n {\n return (\n count($this->getFieldsWithUpdate()) > 0\n || count($this->getIndexesWithUpdate()) > 0\n || $this->addSoftDelete\n || $this->dropSoftDelete\n || $this->addTimestamps\n || $this->dropTimestamps);\n }",
"function _are_attrs_modified($old_slice, $new_slice) {\n return $old_slice['index'] != $new_slice['index'];\n }",
"public function isDirty();",
"public function isChanged() : bool\n {\n\n return $this->_changed;\n\n }",
"public function isModified($name) {\n\t\treturn isset($this->_modified[$name]);\n\t}",
"public function changed($attribute) {\n\t\treturn array_get($this->attributes, $attribute) != array_get($this->original, $attribute);\n\t}",
"public function has_changes() {\n\t\t\t$properties = array_keys(get_object_vars($this));\n\t\t\t$order = SalesOrderEdit::load($this->sessionid, $this->orderno);\n\n\t\t\tforeach ($properties as $property) {\n\t\t\t\tif ($this->$property != $order->$property) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public function hasChanges () {\n return !!$this->dirty;\n }",
"public function isChanged()\n {\n return ! empty(array_diff_assoc($this->items, $this->clone));\n }",
"public function isUpdated() {}",
"private function changed() {\n return !empty($this->tags['new']) || \n !empty($this->tags['del']);\n }",
"public function hasChangedFields()\n {\n return (count($this->_changedFields) > 0);\n }",
"public function hasUpdates();",
"function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}",
"public function hasChanged() { return $this->changed; }",
"public function setModified($name) {\n if(!in_array($name, $this->modifiedAttributes)) {\n $this->modifiedAttributes[] = $name;\n return true;\n }\n return false;\n }",
"public function hasIfNotModified()\n {\n return isset($this->if_not_modified);\n }",
"public function hasChanged(): bool\n {\n return $this->changed;\n }",
"public function getIsUpdatedAttribute (): bool\n {\n return $this->created_at < $this->updated_at;\n }",
"public function isDirty()\n\t{\n\t\treturn (bool)count($this->dirtyFields);\n\t}",
"public function getHasChanged()\r\n {\r\n return $this->_hasChanged;\r\n }",
"function has_changes() {\n $changed = (count($this->add['tables' ]) + count($this->update['tables' ]) + count($this->remove['tables' ]) +\n count($this->add['routines']) + count($this->update['routines']) + count($this->remove['routines']) +\n count($this->add['events' ]) + count($this->update['events' ]) + count($this->remove['events' ]) +\n count($this->add['views' ]) + count($this->update['views' ]) + count($this->remove['views' ]) +\n count($this->add['triggers']) + count($this->update['triggers']) + count($this->remove['triggers'])\n );\n return ($changed != 0 or isset($this->schema->charset) or isset($this->schema->collate));\n }",
"public function areDirty()\n {\n return !empty($this->current) || !empty($this->remove);\n }",
"public function getIsModifiedOnStage() {\n\t\treturn true;\n\t}",
"public function isDirty()\r\n\t{\r\n\t\treturn (count($this->changelog)>0) ? true : false;\r\n\t}",
"public function isDirty(): bool;",
"public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }",
"public function hasChanged($name, $value = null)\n {\n if ($value !== null) {\n $this->setNewAttribute($name, $value);\n }\n\n if ($this->hasOldAttribute($name) && $this->hasNewAttribute($name)) {\n return $this->getOldAttribute($name) != $this->getNewAttribute($name);\n } else {\n // Unknown attribute\n }\n }",
"protected function onUpdating()\n {\n return $this->isDataOnUpdateValid();\n }",
"protected function modelIsWritable() {\n\t\t// Check if model has method dbUpdate\n\t\t$model = $this->model;\n\t\treturn method_exists($model, \"dbUpdate\");\n\t}",
"public function hasUpdate();",
"public function getModified() {}",
"function isUpdated() {\n\t\treturn $this->_Updated;\n\t}",
"public function props_changed()\n\t{\n\t\treturn $this->props_changed;\n\t}",
"private function GetModified()\n\t\t{\n\t\t\treturn $this->modified;\n\t\t}",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isColumnModified($col)\n {\n return $this->modifiedColumns && isset($this->modifiedColumns[$col]);\n }",
"public function isUpdate(){\n\t\treturn isset($this->{$this->getPrimaryKey()}) ? true : false;\n\t}",
"public function getModified();",
"public function isUpdateRequired();",
"function isDirty() : bool;",
"public function isModified($column)\n {\n if (empty($this->cleanData) || !array_key_exists($column, $this->cleanData)) {\n return array_key_exists($column, $this->data);\n }\n return $this->cleanData[$column] !== $this->data[$column];\n }",
"public function isDirty($names = null);",
"public function dataModified()\n\t{\n\t\treturn $this->_dataModified;\n\t}",
"public function hasChanged($fieldName=null) {}",
"protected function _flagAttributeAsModified($attribute) {\n\t\tif (!in_array($attribute, $this->_modifiedAttributes)) {\n\t\t\t$this->_modifiedAttributes[] = $attribute;\n\t\t}\n\t}",
"public function isAltered(): bool\n {\n return count($this->alteredColumns) > 0;\n }",
"public function _isDirty() {}",
"public function getModified()\r\n {\r\n return $this->modified;\r\n }",
"public function dirty() {\n\t\treturn ! $this->exists or count($this->get_dirty()) > 0;\n\t}",
"function isChanged(): bool;",
"public function isDirty($attributes = null)\n {\n if (parent::isDirty($attributes)) {\n return true;\n }\n\n foreach ($this->with as $relation) {\n foreach ($this->{$relation} as $item) {\n if ($item->isDirty()) {\n return true;\n }\n }\n }\n\n return false;\n }",
"public function isDirty()\r\n {\r\n if (!$this->id)\r\n return true;\r\n \r\n return $this->dirty;\r\n }",
"public function getModified()\n {\n return $this->modified;\n }",
"public function getModified()\n {\n return $this->modified;\n }"
] | [
"0.7909992",
"0.750378",
"0.7289874",
"0.7231672",
"0.7217978",
"0.7217978",
"0.7167217",
"0.7163574",
"0.7080674",
"0.7080674",
"0.70515615",
"0.70515615",
"0.70515615",
"0.70515615",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.70487374",
"0.6983949",
"0.69739246",
"0.6942413",
"0.6932305",
"0.6900984",
"0.6900984",
"0.6900984",
"0.6847697",
"0.6834699",
"0.67918336",
"0.6776169",
"0.6757382",
"0.673592",
"0.6721869",
"0.66796476",
"0.66627944",
"0.6658698",
"0.66371113",
"0.6618295",
"0.6554626",
"0.64975107",
"0.6490031",
"0.64225656",
"0.6419149",
"0.641878",
"0.64094603",
"0.6397762",
"0.63729805",
"0.6348915",
"0.63439775",
"0.63403606",
"0.6337202",
"0.6324109",
"0.62962955",
"0.62748677",
"0.6269109",
"0.62642604",
"0.625213",
"0.6248964",
"0.62368876",
"0.6228141",
"0.62100315",
"0.6189108",
"0.6168295",
"0.61629915",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61558604",
"0.61541253",
"0.61471134",
"0.61422265",
"0.61414593",
"0.611652",
"0.6107265",
"0.61071056",
"0.61040705",
"0.6102707",
"0.60926557",
"0.6088613",
"0.60573685",
"0.605484",
"0.60518104",
"0.6021388",
"0.6009943",
"0.6001214",
"0.6001214"
] | 0.0 | -1 |
Get the attributes that have been changed since last sync. | public function getDirty()
{
$dirty = [];
foreach ($this->attributes as $key => $value) {
if (!array_key_exists($key, $this->original)) {
$dirty[$key] = $value;
}
elseif (
$value !== $this->original[$key] &&
!$this->originalIsNumericallyEquivalent($key)
) {
$dirty[$key] = $value;
}
}
return $dirty;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChangedAttributes()\n {\n $output = array();\n\n foreach ($this->attributes as $name => $value) {\n if ($this->hasChanged($name)) {\n $output[$name] = $value;\n }\n }\n\n return $output;\n }",
"public function getOldAttributes()\n {\n return $this->_oldAttributes === null ? [] : $this->_oldAttributes;\n }",
"public function get_dirty() {\n\t\t$dirty = array();\n\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\tif ( ! array_key_exists($key, $this->original) or $value != $this->original[$key]) {\n\t\t\t\t$dirty[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $dirty;\n\t}",
"public function getDirty(): array\n {\n $dirty = [];\n $attributes = $this->toArray();\n\n foreach ($this->changedAttributesName() as $key) {\n $dirty[$key] = $attributes[$key];\n }\n\n return $dirty;\n }",
"public function getChanges(): array\n {\n $changes = [];\n\n foreach ($this->changedAttributesName() as $key) {\n $changes[$key] = $this->originals[$key];\n }\n\n return $changes;\n }",
"public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }",
"function get_updates() {\n\t\t\treturn $this->quoted_attributes(array_diff_key($this->get_attributes(), array_combine($this->primary_keys, $this->primary_keys)));\n\t\t}",
"public function getUnchangedAttributes()\n {\n $output = array();\n\n foreach ($this->attributes as $name => $value) {\n if (!$this->hasChanged($name)) {\n $output[$name] = $value;\n }\n }\n\n return $output;\n }",
"public function getModified()\n {\n return $this->systemProperties->getModified();\n }",
"public function getChanged()\n {\n return $this->entity->getChanged();\n }",
"function changed_properties() {\r\n \t$changed = array();\r\n \tforeach($this->_frozen_properties as $var => $val) {\r\n \t\tif ($this->$var != $this->_frozen_properties[$var])// This property has changed:\r\n \t\t\t$changed[$var] = $val;\r\n \t}\r\n \treturn $changed;\r\n }",
"public function getChangedFields()\n {\n\n $fields = [];\n\n if ($this->synchronized || !static::$track) {\n return $fields;\n }\n\n foreach ($this->savedData as $key => $value) {\n\n if ($value != $this->data[$key]) {\n $fields[] = $key;\n }\n }\n\n return $fields;\n\n }",
"public function getChanged()\n {\n return $this->_changed;\n }",
"public function getChanged() {\n return $this->changed;\n }",
"public function getChanged()\n {\n return $this->changed;\n }",
"public function getUpdatedProperties() {}",
"public function getChangedFields()\n {\n return $this->_changedFields;\n }",
"public function getDirty()\n {\n return array_keys($this->_dirty);\n }",
"public function getDirty()\n {\n $dirty = [];\n\n foreach ($this->attributes as $key => $value) {\n if (! array_key_exists($key, $this->original)) {\n $dirty[$key] = $value;\n }\n elseif ($value !== $this->original[$key] &&\n ! $this->originalIsNumericallyEquivalent($key)) {\n if( $value instanceof Arrayable &&\n count($this->diffAssocRecursive($value->toArray(), $this->original[$key]))>0) {\n $dirty[$key] = $value;\n }\n elseif ( is_array($value) &&\n count($this->diffAssocRecursive($value, $this->original[$key]))>0) {\n $dirty[$key] = $value;\n }\n elseif ($value instanceof Type &&\n $value == (string) $this->original[$key]) {\n $dirty[$key] = $value;\n }\n else {\n $dirty[$key] = $value;\n }\n }\n }\n\n return $dirty;\n }",
"private function getOldAttributes()\n {\n return $this->sessionBag->get(self::PARAM_STORAGE_KEY);\n }",
"function getChanged() {\n return $this->changed;\n }",
"public function attributes()\n {\n return $this->activeAttributes();\n }",
"public function getChangedFields() {}",
"public function changedAttributesName(): array\n {\n $changedAttributes = [];\n $attributes = $this->toArray();\n foreach ($attributes as $key => $value) {\n if (isset($this->originals[$key]) && $value !== $this->originals[$key] && ! ((is_array($this->originals[$key]) || is_object($this->originals[$key])))) {\n $changedAttributes[] = $key;\n }\n }\n return $changedAttributes;\n }",
"public function getUpdated()\n {\n return $this->getState()->getUpdated();\n }",
"public function getAttributes() {\n return $this->attributes;\n }",
"public function getAttributes() {\n return $this->_attributes;\n }",
"public function getFieldsWithUpdate()\n {\n return array_filter($this->fieldChanges, function ($fieldChange) {\n return $fieldChange->hasChange();\n });\n }",
"public function getModified()\r\n {\r\n return $this->modified;\r\n }",
"public function getModified()\n {\n return $this->modified;\n }",
"public function getModified()\n {\n return $this->modified;\n }",
"public function getModified()\n {\n return $this->modified;\n }",
"public function getModified()\n {\n return $this->modified;\n }",
"public function getModified()\n {\n return $this->modified;\n }",
"public function getModified()\n {\n return $this->modified;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getUpdated()\n {\n return $this->updated;\n }",
"public function getAttributes(){\n\t\t$this->_connect();\n\t\treturn $this->_getAttributes();\n\t}",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->attributes;\n }",
"public function getAttributes()\n {\n return $this->where('isRelation', false)->pluck('attribute')->toArray();\n }",
"public function getAttributes()\n {\n return $this->_attributes;\n }",
"public function getAttributes()\n {\n return $this->_attributes;\n }",
"protected function getAttributeSavedMethods()\n {\n $attributes = [];\n foreach($this->getDirty() as $attribute => $value) {\n if($this->hasAttributeSavedMethod($attribute)) {\n $attributes[] = $attribute;\n }\n }\n return $attributes;\n }",
"public function getAttributes() {\n\t\treturn $this->attributes;\n\t}",
"public function getAttributes() {\n\t\treturn $this->_attributes;\n\t}",
"public function getAttributes() {\n\t\treturn $this->_attributes;\n\t}",
"public function getUpdated() \n\t{\n\t\treturn $this->updated;\n\t}",
"function attributes() {\n\t\t$this->load_attributes();\n\t\treturn $this->_attributes;\n\t}",
"public function getAttributes(){\n\t\treturn $this->_attributes;\n\t}",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class]))\n static::cacheMutatedAttributes($class);\n\n return static::$mutatorCache[$class];\n }",
"public function attributes() { return $this->attributes; }",
"public function getAttributes(){\n return $this->attributes;\n }",
"public function getDirty()\n\t{\n\t\treturn $this->dirty;\n\t}",
"public function getUpdatedTime()\n {\n return $this->getAttribute('updatedTime');\n }",
"public function getModified() {\n\t\treturn $this->modified;\n\t}",
"public function getAttributes()\n {\n return collect(parent::getAttributes())\n ->except(array_keys($this->fieldAttributes()))\n ->toArray();\n }",
"public function getModified() {}",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }",
"public function getDirty();",
"private function GetModified()\n\t\t{\n\t\t\treturn $this->modified;\n\t\t}",
"public function getUpdated();",
"public function getUpdated();",
"public function list_dirty_fields() {\r\n return $this->orm->list_dirty_fields();\r\n }",
"public function getAttributes(): array {\n return $this->attributes;\n }",
"public function getTimestampUpdated()\n {\n return $this->_getData(self::TIMESTAMP_UPDATED);\n }",
"public function getModifiedAt()\n {\n return $this->getProperty(self::MODIFIED_AT);\n }",
"public function getAttributes() {\n return $this->attributes->getArray();\n }",
"public function getAtts() {\n\t\treturn $this->getAttributes();\n\t}",
"protected function getChangesForLog($oldAttributes)\n {\n $attributesToSkip = array(\n 'created',\n 'processed_on',\n 'secret',\n 'updated',\n );\n $changes = array();\n foreach ($this->attributes as $attributeName => $newValue) {\n if (in_array($attributeName, $attributesToSkip)) {\n continue;\n }\n if ( ! array_key_exists($attributeName, $oldAttributes)) {\n continue;\n }\n if ($oldAttributes[$attributeName] !== $newValue) {\n $changes[$attributeName] = $newValue;\n }\n }\n return $changes;\n }",
"public function getMutatedAttributes()\n {\n $class = static::class;\n\n if (! isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }",
"public function attributes()\n {\n return array_merge(parent::attributes(), [\n 'created_at_to',\n 'updated_at_to',\n ]);\n }",
"public function getAttributes(): array\n {\n return $this->attributes;\n }",
"public function getAttributes(): array\n {\n return $this->_attributes;\n }"
] | [
"0.7678346",
"0.73805124",
"0.7351105",
"0.7186306",
"0.71703416",
"0.6939382",
"0.6902964",
"0.68494815",
"0.6723025",
"0.6686933",
"0.6668847",
"0.66662854",
"0.6656645",
"0.66436267",
"0.66390693",
"0.66353935",
"0.6631507",
"0.66248626",
"0.6601305",
"0.6582987",
"0.6550519",
"0.64414006",
"0.64339507",
"0.64268625",
"0.63906515",
"0.63145536",
"0.6310421",
"0.63088053",
"0.63082975",
"0.63009554",
"0.63009554",
"0.63009554",
"0.63009554",
"0.63009554",
"0.63009554",
"0.62931967",
"0.62931967",
"0.62931967",
"0.62931967",
"0.62931967",
"0.62931967",
"0.62931967",
"0.62931967",
"0.62931967",
"0.6292162",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62818366",
"0.62793213",
"0.6275623",
"0.6275623",
"0.62682694",
"0.62635094",
"0.62594503",
"0.62594503",
"0.6259288",
"0.6231329",
"0.62289834",
"0.6227289",
"0.6222297",
"0.6203652",
"0.62020427",
"0.620056",
"0.6194793",
"0.6190143",
"0.61863875",
"0.6176464",
"0.61450225",
"0.6137257",
"0.6133649",
"0.6133649",
"0.6129481",
"0.6122352",
"0.6118131",
"0.6113654",
"0.6112668",
"0.61053944",
"0.6104391",
"0.6096049",
"0.6095562",
"0.6074593",
"0.6052345"
] | 0.6867197 | 7 |
Determine if the new and old values for a given key are numerically equivalent. | protected function originalIsNumericallyEquivalent($key)
{
$current = $this->attributes[$key];
$original = $this->original[$key];
return is_numeric($current) && is_numeric($original) && strcmp((string) $current, (string) $original) === 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function originalIsNumericallyEquivalent($key)\n {\n $current = $this->attributes[$key];\n $original = $this->original[$key];\n\n // Date comparison.\n if (in_array($key, $this->getDates())) {\n $current = $current instanceof Timestamp ? $this->asDateTime($current) : $current;\n $original = $original instanceof Timestamp ? $this->asDateTime($original) : $original;\n\n return $current == $original;\n }\n\n return parent::originalIsNumericallyEquivalent($key);\n }",
"protected function compare($new, $old)\n {\n $numeric = is_numeric($new) && is_numeric($old);\n if ($numeric) {\n // numeric, compare loosely\n return $new == $old;\n } else {\n // non-numeric, compare strictly\n return $new === $old;\n }\n }",
"public function testUpdateValuesContainNumbers(): void { }",
"public function isNumeric()\n {\n if ($this->isEmpty()) {\n return false;\n }\n\n foreach ($this->getKeys() as $key) {\n if (!is_int($key)) {\n return false;\n }\n }\n\n return true;\n }",
"private function isChangedElement(array $old, array $new): bool\n\t{\n\t\t$checkedFields = [\n\t\t\t'STORE_FROM' => 'intval',\n\t\t\t'STORE_TO' => 'intval',\n\t\t\t'ELEMENT_ID' => 'intval',\n\t\t\t'AMOUNT' => 'floatval',\n\t\t\t'PURCHASING_PRICE' => 'floatval',\n\t\t\t'BASE_PRICE' => 'floatval',\n\t\t\t'BASE_PRICE_EXTRA' => 'floatval',\n\t\t\t'BASE_PRICE_EXTRA_RATE' => 'strval',\n\t\t\t'COMMENT' => 'strval',\n\t\t];\n\n\t\tforeach ($checkedFields as $name => $typeCallback)\n\t\t{\n\t\t\t$oldValue = call_user_func($typeCallback, $old[$name] ?? null);\n\t\t\t$newValue = call_user_func($typeCallback, $new[$name] ?? null);\n\n\t\t\tif ($oldValue !== $newValue)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isEqual(string $key, $val) : bool;",
"public static function compareParams(array $oldParams, array $newParams): bool\n\t{\n\t\t// todo: or compare just file ids?\n\t\tunset(\n\t\t\t$oldParams['valueBefore'], $newParams['valueBefore'],\n\t\t\t$oldParams['type'], $newParams['type']\n\t\t);\n\n\t\treturn $oldParams === $newParams;\n\t}",
"public static function compareParams(array $oldParams, array $newParams): bool\n\t{\n\t\treturn $oldParams === $newParams;\n\t}",
"function record_event_equal($old_data,$new_data) {\n\t\tforeach(array_reverse($old_data) as $i => $data) {\n\t\t\tif($data[\"record\"] == $new_data[\"record\"] && $data[\"event\"] == $new_data[\"event\"]) {\n\t\t\t\tif($data[\"field_name\"] == $new_data[\"field_name\"] && $data[\"value\"] == $new_data[\"value\"]) {return true;}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function compareDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = $this->getData($key);\n $otherValue = $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }",
"function accept()\n {\n return is_numeric($this->key());\n }",
"public function compareIntDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = (int) $this->getData($key);\n $otherValue = (int) $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }",
"function _are_attrs_modified($old_slice, $new_slice) {\n return $old_slice['index'] != $new_slice['index'];\n }",
"private function isInverseMatch(): bool\n {\n return is_int($this->min) and is_int($this->max) and ($this->min > $this->max);\n }",
"protected function willChange($key)\n {\n return null !== $this->getCurrent($key);\n }",
"public function getValueCompare();",
"public function testIsNumeric() {\n $this->assertTrue(Hash::isNumeric(array('123', 456)));\n $this->assertTrue(Hash::isNumeric(array('foo' => 123, 'number' => '456')));\n\n $this->assertFalse(Hash::isNumeric(array('foo', 'bar')));\n $this->assertFalse(Hash::isNumeric(array('foo' => 'bar', 'number' => '123')));\n $this->assertFalse(Hash::isNumeric(array('bar', '123')));\n $this->assertFalse(Hash::isNumeric(array(null)));\n $this->assertFalse(Hash::isNumeric(array(true)));\n $this->assertFalse(Hash::isNumeric(array(false)));\n $this->assertFalse(Hash::isNumeric(array(array())));\n $this->assertFalse(Hash::isNumeric(array(new stdClass())));\n }",
"public function testAssertEqualsWithDelta() {\n\t\t$this->assertEqualsWithDelta( 2.3, 2.5, 0.5 );\n\t}",
"function d2d_public_key_eql($key1, $key2) {\n\t$key1 = d2d_clean_public_key($key1);\n\t$key2 = d2d_clean_public_key($key2);\n\treturn $key1 === $key2;\n}",
"private function checkNumberField ($attribute)\n {\n $currentValue = $this->model->getAttribute($attribute);\n $originalValue = $this->model->getOriginal($attribute);\n\n if ( !( is_numeric($currentValue) || is_numeric($originalValue) ) ) return true;\n\n if ( round($currentValue, 2) == round($originalValue, 2) ) return false;\n\n return true;\n }",
"function compare_array_item($setting, $existing) {\r\n\t$existing = (array)$existing;\r\n\tunset($setting['site_id']);\r\n\tunset($setting['_id']);\r\n\tunset($existing['_id']);\r\n\tunset($existing['site_id']);\r\n\tforeach($setting as $key => $value) {\r\n\t\tif(!is_array($setting[$key])) {\r\n\t\t\tif($setting[$key] != $existing[$key]){\r\n\t\t\t\techo \"setting key {$key} value {$value} differs from {$existing[$key]} - \";\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\tprint_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(is_array($setting[$key])) {\r\n\t\t\t$diff = array();\r\n\t\t\t$diff = array_diff_assoc($setting[$key], (array)$existing[$key]);\r\n\t\t\tif(!empty($diff)) {\r\n\t\t\t\techo \"setting subkey {$key} differs diff count \". count($diff).\"\\n\";\r\n\t\t\t\t// print_r($diff);\r\n\t\t\t\t// print_r($setting);\r\n\t\t\t\t// print_r($existing);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}",
"public function testKeyCasting()\n {\n $arr = [];\n $arr[] = 'a';\n $arr[\"1\"] = 'b';\n $arr[\"01\"] = 'c';\n $arr[true] = 'd';\n $arr[0.5] = 'e';\n $arr[false] = 'f';\n $arr[null] = 'g';\n\n // Which keys will have $arr\n //$this->assertEquals(?, array_keys($arr));\n\n // Which values will have $arr\n //$this->assertEquals(?, array_values($arr));\n }",
"public function hasOldPrice(){\n return $this->_has(17);\n }",
"public function checkDiff()\n {\n if ($this->tokensOriginal !== $this->tokensMutated) {\n return true;\n }\n\n return false;\n }",
"final protected function shouldHaveNumericalKeys ($value) {\n\t\t$arguments = func_get_args();\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!is_array($argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t} else {\n\n\t\t\t\t// Fail if incorrect key found\n\t\t\t\tforeach (array_keys($argument) as $key) {\n\t\t\t\t\tif (!is_int($key)) {\n\t\t\t\t\t\treturn $this->fail();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn $this->pass();\n\t}",
"private function save_plus_minus_votes()\n {\n $result = true;\n foreach ($this->votes_plus as $vote) {\n if (! empty( $vote)) {\n if (! $this->save_one_vote( $vote, 1,0) ) {\n $result = false;\n }\n }\n }\n foreach ($this->votes_minus as $vote) {\n if (! empty( $vote)) {\n if (! $this->save_one_vote( $vote, 0,1)) {\n $result = false;\n };\n }\n }\n return $result;\n }",
"public function isSameScoreDifference() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return $this->intRealHomeScore - $this->intRealAwayScore === $this->intBetHomeScore - $this->intBetAwayScore;\n }",
"protected function isEqual($key, $value1, $value2) {\n\t\tif($key) {} // intentional to avoid unused argument notice\n\t\t// $key intentionally not used here, but may be used by descending classes\n\t\treturn $value1 === $value2; \t\n\t}",
"function SetupKeyValues($key) {\n\t\t$sKeyFld = $key;\n\t\tif (!is_numeric($sKeyFld))\n\t\t\treturn FALSE;\n\t\t$this->product_id->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}",
"public function renameNx(string $key, string $newKey): bool\n {\n return $this->redis->renameNx($key, $newKey);\n }",
"function check_update($current, $new) {\n\tif (!isset($current) || !isset($new) ||\n\t !isset($current['version']) || !isset($new['version']) ||\n\t !isset($new['platform'])) {\n\t\treturn false;\n\t}\n\n\tif ($new['platform'] == \"4100\") {\n\t\tif (strlen($current['version']) != 21 ||\n\t\t strlen($new['version']) != 21 ||\n\t\t strpos($current['version'], '-2Ct-uc-') != 11 ||\n\t\t strpos($new['version'], '-2Ct-uc-') != 11) {\n\t\t\treturn false;\n\t\t}\n\t\t$curver = str_replace(array(\".\", \"-2Ct-uc-\"), \"\", $current['version']);\n\t\t$newver = str_replace(array(\".\", \"-2Ct-uc-\"), \"\", $new['version']);\n\t} elseif ($new['platform'] == \"6100\") {\n\t\tif (strlen($current['version']) != 18 ||\n\t\t strlen($new['version']) != 18 ||\n\t\t strpos($current['version'], 't-uc-') != 11 ||\n\t\t strpos($new['version'], 't-uc-') != 11) {\n\t\t\treturn false;\n\t\t}\n\t\t$curver = str_replace(array(\".\", \"t-uc-\"), \"\", $current['version']);\n\t\t$newver = str_replace(array(\".\", \"t-uc-\"), \"\", $new['version']);\n\t} else {\n\t\treturn ($current['version'] != $new['version']);\n\t}\n\n\treturn (intval($newver) > intval($curver));\n}",
"function DiferentKeys($keys_home, $keys_sync) {\r\n \tif (count($keys_home) != count($keys_sync)) {\r\n \treturn true;\r\n }\r\n\r\n for ($i = 0; $i < count($keys_home); $i++) {\r\n \tif ($keys_home[$i] != $keys_sync[$i]) {\r\n \treturn true;\r\n }\r\n }\r\n\r\n return false;\r\n }",
"public function existing_instance_is_different($inst_id, $nom_intern, $values, $status = 'O', &$difference, &$attr_difference) {\n\t\t// -2 status is different\n\t\t// -3 nom_intern is different\n\t\t// -4 some value is different\n\t\t// -5 some value not exists in current instance\n\t\t// 0 same!\n\t\tif (!$this->exist_instance($inst_id))\n\t\t\treturn -1;\n\n\t\t$current_inst = $this->get_instance($inst_id);\n\t\tif ($status != $current_inst['status']) {\n\t\t\t$difference = -1;\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($nom_intern != $current_inst['key_fields']) {\n\t\t\t$difference = -2;\n\t\t\treturn true;\n\t\t}\n\n\t\t$existing_attributes = array();\n\t\tforeach ($current_inst['values'] as $row) {\n\t\t\t$existing_attributes[] = $row['name'];\n\t\t\tif (array_key_exists($row['name'], $values)) {\n\t\t\t\tif (!empty($row['text_val']) && $values[$row['name']] != $row['text_val']) {\n\t\t\t\t\t$difference = -4;\n\t\t\t\t\t$attr_difference = $row['name'];\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (!empty($row['num_val']) && $values[$row['name']] != $row['num_val']) {\n\t\t\t\t\t$difference = -4;\n\t\t\t\t\t$attr_difference = $row['name'];\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif (!empty($row['date_val']) && $values[$row['name']] != $row['date_val']) {\n\t\t\t\t\t$difference = -4;\n\t\t\t\t\t$attr_difference = $row['name'];\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ($values as $key => $val) {\n\t\t\tif (!in_array($key, $existing_attributes)) {\n\t\t\t\t$difference = -5;\n\t\t\t\t$attr_difference = $key;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\n\n\t\t$difference = 0;\n\t\treturn false;\n\t}",
"private function isNumeric()\n {\n foreach (array_keys($this->options) as $key) {\n if (!is_int($key)) {\n return false;\n }\n }\n\n return true;\n }",
"public function isValidKey($key) {\n\t\treturn is_int($key);\n\t}",
"abstract function isStoreOutdated(string $storeKey): bool;",
"private function numeric($map)\n\t{\n\t\tif(is_array($map[\"values\"]))\n\t\t{\n\t\t\t$valid = true;\n\t\t\t$filter_vals = array_filter($map[\"values\"], \"is_numeric\");\n\t\t\t$valid = (count($filter_vals) == count($map[\"values\"]));\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$valid = is_numeric($map[\"values\"]);\n\t\t}\n\t\t\n\t\tif(!$valid)\n\t\t{\n\t\t\t$this->errors[$map[\"id\"]] = $map[\"error\"];\n\t\t}\n\t\treturn $valid;\n\t}",
"public static function is_numeric_array_key($input)\n {\n }",
"public function testIntegerKey()\n {\n $arr = [];\n $arr[] = 'a';\n $arr[] = 'b';\n $arr[] = 'c';\n\n // Which index will have 'c'?\n //$this->assertEquals(?, array_key_last($arr));\n\n $arr[10] = 'd';\n $arr[] = 'e';\n\n // Which index will have 'e'?\n //$this->assertEquals(?, array_key_last($arr));\n\n $arr['string'] = 'f';\n $arr[] = 'h';\n\n // Which index will have 'h'?\n //$this->assertEquals(?, array_key_last($arr));\n }",
"static function is_numeric($array){\n\t\tforeach($array as $k=>$v){\n\t\t\tif(!is_int($k)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function update($key, $newvars, $oldvars)\n {\n $ts = microtime(true);\n\n if ($newvars !== $oldvars || $ts - $this->changed > $this->lifetime / 3) {\n $data = serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars));\n $result = $this->memcache->set($key, $data, MEMCACHE_COMPRESSED, $this->lifetime + 60);\n\n if ($this->debug) {\n $this->debug('set', $key, $data, $result);\n }\n\n return $result;\n }\n\n return true;\n }",
"public function hasChanges(Tracker_Artifact_ChangesetValue $old_value, $new_value) { \n return false; \n }",
"protected function _hasTierPriceChanged(Mage_Catalog_Model_Product $product)\n\t{\n\t\t$orig = $product->getOrigData('tier_price');\n\t\t$new = $product->getData('tier_price');\n\t\t\n\t\tif (count($orig) != count($new)) return true;\n\n\t\tif (is_array($new))\n\t\t{\n\t\t\tforeach ($new as $i => $tier)\n\t\t\t{\n\t\t\t\tif ($tier['website_id'] != $orig[$i]['website_id']) return true;\n\n\t\t\t\tif ($tier['price_qty'] != $orig[$i]['price_qty']) return true;\n\n\t\t\t\tif ($tier['price'] != $orig[$i]['price']) return true;\n\n\t\t\t\tif (isset($tier['delete']) && $tier['delete']) return true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function hasDifference() {return !!$this->_calculateDifference();}",
"function c_text_to_num($key) \r\n {\r\n\r\n\t\t// Example \r\n \t$data = array(\r\n \t\t\"off\" => 0,\r\n \t\t\"on\" => 1\r\n \t);\r\n \t\r\n \t$result = $data[$key];\r\n \r\n \tif(is_null($result))\r\n \t{\r\n \t\treturn false;\r\n \t}\r\n \telse \r\n \t{\r\n \t\treturn $result;\t\r\n \t}\r\n\r\n }",
"public function calc($key);",
"protected function is_a_numeric_post_field( $key ) {\n\t\treturn in_array( $key, array( 'ID', 'post_author', 'post_parent', 'menu_order', 'comment_count' ) );\n\t}",
"function is_fraction($x) {\n global $Fractions;\n foreach($Fractions as $key => $val) {\n //echo $x . \" \" . $key . \" \" . $val . \"<br />\";\n \n if($x == $key) {\n //echo $x . \" \" . $key . \" \" . $val . \"<br />\";\n return true;\n }\n }\n return false;\n}",
"public function hasChanged() {\n\t\treturn trim( $this->fileSize ) != trim( $this->currentSize );\n\t}",
"protected function _key($cikey, &$actualKey)\n {\n foreach($this->_keyValPairs as $key => $value)\n {\n if(strcasecmp($key, $cikey) == 0)\n {\n $actualKey = $key;\n return true;\n }\n }\n\n return false;\n }",
"public function hasNewPrice(){\n return $this->_has(16);\n }",
"public function hasFixedValue();",
"public function isk_compare($a, $b) {\n\t\t/*\n\t\t * cast to int since it might be misbehaving with float\n\t\t *\n\t\t */\n\t\t$t1 = $a ['total'];\n\t\t$t2 = $b ['total'];\n\t\t\n\t\treturn $t2 - $t1;\n\t\t// return $t2 - $t1;\n\t}",
"public function isKeyModified(string $key)\n\t{\n\t\tif(((array_key_exists($key, $this->keyModified))))\n\t\t{\n\t\t\treturn $this->keyModified[$key]; \n\n\t\t}\n\t\treturn null; \n\n\t}",
"public function isKeyModified(string $key)\n\t{\n\t\tif(((array_key_exists($key, $this->keyModified))))\n\t\t{\n\t\t\treturn $this->keyModified[$key]; \n\n\t\t}\n\t\treturn null; \n\n\t}",
"public function isKeyModified(string $key)\n\t{\n\t\tif(((array_key_exists($key, $this->keyModified))))\n\t\t{\n\t\t\treturn $this->keyModified[$key]; \n\n\t\t}\n\t\treturn null; \n\n\t}",
"public function isKeyModified(string $key)\n\t{\n\t\tif(((array_key_exists($key, $this->keyModified))))\n\t\t{\n\t\t\treturn $this->keyModified[$key]; \n\n\t\t}\n\t\treturn null; \n\n\t}",
"public function hasChanges(Tracker_Artifact_ChangesetValue $old_value, $new_value) {\n // Submitted On is never updated\n return false;\n }",
"public function isValid(string $key) : bool;",
"protected function compareNumeric( IDBColumnDefinition $other ) {\n\n\t\t$definitionResults = array();\n\t\t$canUpdateColumn = DBTableDefinition::SAFE_UPDATE_TRUE;\n\n\t\tforeach ( self::$columnDefinitions as $definition ) {\n\n\t\t\t$ownValue = $this->columnSchema[ $definition ];\n\t\t\t$otherValue = $other->getValue( $definition );\n\n\n\t\t\t$canUpdateDefinition = DBTableDefinition::SAFE_UPDATE_UNKNOWN; //TODO: for each definition, check if there's any other definition that might prohibit a safe update (e.g. auto_increment only works on primary key)\n\n\t\t\tif ( $canUpdateDefinition === DBTableDefinition::SAFE_UPDATE_UNKNOWN && $canUpdateColumn == DBTableDefinition::SAFE_UPDATE_TRUE ) { // we don't want to revert from \"false\" to \"unknown\"\n\t\t\t\t$canUpdateColumn = DBTableDefinition::SAFE_UPDATE_UNKNOWN;\n\t\t\t}\n\n\t\t\tif ( $canUpdateDefinition === DBTableDefinition::SAFE_UPDATE_FALSE ) {\n\t\t\t\t$canUpdateColumn = DBTableDefinition::SAFE_UPDATE_FALSE;\n\t\t\t}\n\n\t\t\t$definitionResults[ $definition ] = array(\n\t\t\t\tDBTableDefinition::RESULT_EQUALS => $ownValue === $otherValue,\n\t\t\t\tDBTableDefinition::RESULT_CAN_UPDATE => $canUpdateDefinition,\n\t\t\t\tDBTableDefinition::RESULT_EXPECTED => $ownValue,\n\t\t\t\tDBTableDefinition::RESULT_ACTUAL => $otherValue\n\t\t\t);\n\t\t}\n\n\t\treturn array(\n\t\t\tDBTableDefinition::RESULT_SUMMARY => array(\n\t\t\t\tDBTableDefinition::RESULT_CAN_UPDATE => $canUpdateColumn\n\t\t\t),\n\t\t\tDBTableDefinition::PROPERTIES => $definitionResults\n\t\t);\n\t}",
"public function calculateValuation(): bool\n {\n return 0;\n }",
"public function has_changes() {\n\t\t\t$properties = array_keys(get_object_vars($this));\n\t\t\t$order = SalesOrderEdit::load($this->sessionid, $this->orderno);\n\n\t\t\tforeach ($properties as $property) {\n\t\t\t\tif ($this->$property != $order->$property) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"function is_float_problem() {\n $num1 = 2009010200.01;\n $num2 = 2009010200.02;\n\n return ((string)$num1 === (string)$num2 or $num1 === $num2 or $num2 <= (string)$num1);\n}",
"public function testSetAndRetrieveInteger(): void\n {\n $key = \"A test key\";\n $expected = 27;\n $this->testNotStrict->set($key, $expected);\n $actual = $this->testNotStrict->get($key);\n $this->assertEquals($expected, $actual);\n }",
"public static function calculateChangedValues(array $old, $new, $keys): array\n {\n $result = [];\n foreach ($keys as $key) {\n $oldValue = empty($old[$key]) ? '' : $old[$key];\n $newValue = empty($new[$key]) ? '' : $new[$key];\n if ($oldValue != $newValue) {\n $result[$key] = ['old' => $oldValue, 'new' => $newValue];\n }\n }\n return $result;\n }",
"public function renameKey($oldKey, $newKey, $domain = self::DEFAULT_DOMAIN)\n {\n /** @var Translation[] $translationValues */\n $translationValues = $this->findBy(\n [\n 'key' => $oldKey,\n 'domain' => $domain\n ]\n );\n $result = false;\n foreach ($translationValues as $translationValue) {\n $translationValue->setKey($newKey);\n $this->getEntityManager()->persist($translationValue);\n $result = true;\n }\n\n return $result;\n }",
"public function changedAndEnabled($key)\n {\n $changed = $this->hasChanged($key);\n\n return ($changed && $this->$key === true);\n }",
"public function validate()\n {\n return $_POST['formkey'] === $this->oldFormkey;\n }",
"public function calculateEquityValue(): bool\n {\n return true;\n }",
"public function isSameTendency() {\n \n if (false === isset($this->intRealHomeScore) || false === isset($this->intBetHomeScore)) {\n throw new \\BadMethodCallException(\"Real and bet results must be set\");\n }\n \n return \n ($this->intRealHomeScore < $this->intRealAwayScore && $this->intBetHomeScore < $this->intBetAwayScore) \n || ($this->intRealHomeScore > $this->intRealAwayScore && $this->intBetHomeScore > $this->intBetAwayScore) \n || ($this->intRealHomeScore === $this->intRealAwayScore && $this->intBetHomeScore === $this->intBetAwayScore);\n }",
"function cp_arrayIsSame($array1, $array2,$keys){\r\n\r\n foreach($keys as $key){\r\n if($array1[$key] != $array2[$key]){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}",
"function _fourD_analysis_validate_decimal_old( $d ) {\n \n if( is_numeric($d) ){\n \n $min = 0.0;\n $max = 1.0;\n $epsilon = 1e-11; // extra bit to satisfy equality check of a 1e-10 decimal precision\n \n if( $d > $min + $epsilon && $d < $max - $epsilon ){\n return true;\n }\n }\n return false;\n}",
"function compareByRecentIncrement ($a, $b) {\n\t\t\t\treturn $b[\"tracking\"][0][\"increment\"] - $a[\"tracking\"][0][\"increment\"];\n\t\t\t}",
"function df_is_int($v):bool {return is_numeric($v) && ($v == (int)$v);}",
"public function testAssertNotEqualsWithDelta() {\n\t\tself::assertNotEqualsWithDelta( 2.3, 3.5, 0.5 );\n\t}",
"protected function checkOffset($key){\r\n if(isset($this->_registry[$key]))\r\n return true;\r\n\r\n return false;\r\n }",
"protected final function _isValidFloat($key,$value){\n\n if(!is_numeric($value)){\n return $this->setError($key,\"`{$key}` must be numeric\");\n }//if\n\n if(!$this->_isBetweenMinAndMax($key,$value)){\n return false;\n }//if\n\n return true;\n\n }",
"function d2d_check_convert_int(&$x) {\n $y = intval($x);\n if ($x != strval($y)) {\n return FALSE;\n }\n else {\n $x = $y;\n return TRUE;\n }\n}",
"protected final function _isValidInt($key,$value){\n\n if(!is_numeric($value) || strpos($value,'.') !== false){\n return $this->setError($key,\"`{$key}` must be a integer\");\n }//if\n\n if(!$this->_isBetweenMinAndMax($key,$value)){\n return false;\n }//if\n\n return true;\n\n }",
"function _is_geometry_modified($old_slice, $new_slice) {\n $old_nodes_ids = array_keys($old_slice['nodes']);\n $new_nodes_ids = array_keys($new_slice['nodes']);\n if ($old_nodes_ids != $new_nodes_ids)\n return true;\n\n foreach ($new_slice['nodes'] as $node) {\n if (isset($node['action']))\n return true;\n }\n\n return false;\n }",
"private function compareConfiguration($existingConfiguration, $newConfiguration)\n {\n $overrides = [];\n \n foreach ($newConfiguration as $key => $value) {\n if (array_key_exists($key, $existingConfiguration) && $value !== $existingConfiguration[$key]) {\n $overrides[$key] = [\n 'current' => $existingConfiguration[$key],\n 'afterUpdate' => $this->cleanValue($value)\n ];\n }\n }\n \n if (count($overrides)) {\n $this->addError('Several values would be overridden. Check Details for a complete list.', $overrides);\n return false;\n }\n \n return true;\n }",
"function key_compare_func($a, $b) {\n if ($a === $b) {\n return 0;\n }\n return ($a > $b) ? 1 : -1;\n}",
"function wppb_check_serial_number_fix($newvalue, $oldvalue){\r\n\r\n\tif ( $newvalue == $oldvalue )\r\n\t\twppb_check_serial_number( $oldvalue, $newvalue );\r\n\r\n\treturn $newvalue;\r\n}",
"function is_numerically_indexed_array( $arr ){\n\t\t\n\t\tforeach($arr as $key=>$val){\n\t\t\tif( !is_numeric($key) ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function testKeyValueEquality()\n {\n $comparison = $this->parser->parse(\n 'benchmark: \"Foobar\"'\n );\n\n $this->assertEquals(\n new Comparison('$eq', 'benchmark', 'Foobar'),\n $comparison\n );\n }",
"function checkKey($keyValue,$keyArray,$deckArray) {\r\n // Count how many of each card are in our key array\r\n $valueCount = array_count_values($keyArray);\r\n if (array_key_exists($keyValue, $valueCount) == true) {\r\n $keyCount = $valueCount [$keyValue];\r\n $maxInDeck = $deckArray [$keyValue] [3];\r\n if ($keyCount > $maxInDeck) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n Else {\r\n return 2;\r\n }\r\n }",
"public function notEqual($num)\n {\n $num = $this->format($num);\n\n return $this->value != $num;\n }",
"protected function isUnchanged() {}",
"protected static function sortByKeyNumericCallback($a, $b)\n {\n // temp. setting elements with key and zero values, if missing in child array\n if (! array_key_exists(self::$sortKey, $a) || is_null($a[self::$sortKey])) {\n $a[self::$sortKey] = 0;\n }\n if (! array_key_exists(self::$sortKey, $b) || is_null($b[self::$sortKey])) {\n $b[self::$sortKey] = 0;\n }\n\n // sort order ascending\n if (self::$sortOrder == 'asc') {\n // return 0 if equals\n if ($a[self::$sortKey] == $b[self::$sortKey]) {\n return 0;\n // -1 if less, or 1 if greater\n // @TODO : using Php 7+'s new operators ??\n } else {\n return ((float) $b[self::$sortKey]) < ((float) $a[self::$sortKey]) ? 1 : - 1;\n }\n } elseif (self::$sortOrder == 'desc') { // or sort order descending\n // return 0 if equals\n if ($a[self::$sortKey] == $b[self::$sortKey]) {\n return 0;\n // 1 if less, or -1 if greater\n } else {\n return ((float) $b[self::$sortKey]) > ((float) $a[self::$sortKey]) ? 1 : - 1;\n }\n }\n }",
"private static function _update_item_meta($item_id, $meta_key, $meta_value, $unique, $prev_value='')\n\t{\n\t\t$meta_key = is_string($meta_key) ? trim($meta_key) : $meta_key; //field key: e.g 'matric_no'\n\t\t$meta_value = is_string($meta_value) ? trim($meta_value) : $meta_value; //field value\n\t\t$prev_value = isset($prev_value) ? $prev_value : '';\n\t\t$prev_value = is_string($prev_value) ? trim($prev_value) : $prev_value;\n\t\t\n\t\t//if( empty($meta_key) || empty($meta_value))\n\t\tif( empty($meta_key) || $meta_value == '' )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Compare existing value to new value if no prev value given and the key exists only once.\n\t\tif ( empty($prev_value) )\n\t\t{\n\t\t\t$old_value = ItemManager::get_item_data($item_id, $meta_key);\n\t\t\tif ( count($old_value) == 1 ) \n\t\t\t{ \n\t\t /*\n\t\t\t\tif(is_array($old_value))\n\t\t\t\t{\n\t\t\t\t\tif( isset($old_value['meta_value']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_value = $old_value['meta_value'];\n\t\t\t\t\t}\n\t\t\t\t\telseif( isset($old_value[0]) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_value = $old_value[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$compare_value = $old_value;\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t$compare_value = ( is_array($old_value) ? $old_value['meta_value'] : $old_value );\n\t\t\t\t\n\t\t\t\tif ( $compare_value === $meta_value ) //if key exists only once, then no need to duplicate same key with same value\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If meta doesn't exist, then and a new meta\n\t\tif ( ! ItemManager::item_meta_exists($item_id, $meta_key) )\n\t\t{\n\t\t\treturn self::_insert_item_meta($item_id, $meta_key, $meta_value, $unique);\n\t\t}\n\n\t\t$where_clause = array( 'item_id'=>$item_id, 'meta_key'=>$meta_key );\n\t\t\n\t\tif ( !empty( $prev_value ) ) \n\t\t{\n\t\t\t$prev_value = Util::is_scalar($prev_value) ? $prev_value : Util::stringify($prev_value);\n\t\t\t$where_clause['meta_value'] = $prev_value;\n\t\t}\n\t\t\n\t\t$meta_value = Util::is_scalar($meta_value) ? $meta_value : Util::stringify($meta_value);\n\t\treturn self::_get_db_object()->update_table_column(ItemManager::get_tables_prefix().\"item_meta\", 'meta_value', $meta_value, $where_clause);\n\t}",
"public function changed() {\n\t\t\tif (!$this->original_data) {\n\t\t\t\tthrow new Exception('call exists() before calling changed()');\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->last_change != $this->original_last_change ||\n\t\t\t $this->last_change_reason != $this->original_last_change_reason ||\n\t\t\t $this->lanes_affected != $this->original_lanes_affected ||\n\t\t\t $this->traffic_impact != $this->original_traffic_impact ||\n\t\t\t $this->reason != $this->original_reason) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn false;\n\t\t}",
"private function changelog_calculate_edit_diff () {\n\t\t//old object - checkboxes that are not present, set them as 0\n\t\tforeach($this->object_old as $k=>$v) {\n\t\t\tif(!isset($this->object_new[$k]) && $v==\"1\") {\n\t\t\t\t$this->object_new[$k] = 0;\n\t\t\t}\n\t\t}\n\t\tforeach ($this->object_new as $k=>$v) {\n\t\t\tif(!isset($this->object_old[$k]) && $v==\"1\") {\n\t\t\t\t$this->object_old[$k] = 0;\n\t\t\t}\n\t\t}\n\t\t// ip address - old needs to be transformed to dotted format\n\t\t$this->object_old['ip_addr'] = $this->Subnets->transform_address($this->object_old['ip_addr'], \"dotted\");\n\t\t$this->object_new['ip_addr'] = $this->Subnets->transform_address($this->object_new['ip_addr'], \"dotted\");\n\n\t\t// check each value\n\t\tforeach($this->object_new as $k=>$v) {\n\t\t\t//change\n\t\t\tif($this->object_old[$k]!=$v && ($this->object_old[$k] != str_replace(\"\\'\", \"'\", $v)))\t{\n\t\t\t\t//empty\n\t\t\t\tif(strlen(@$this->object_old[$k])==0)\t{ $this->object_old[$k] = \"NULL\"; }\n\t\t\t\tif(strlen(@$v)==0)\t\t\t\t\t\t{ $v = \"NULL\"; }\n\n\t\t\t\t//tag change\n\t\t\t\tif($k == 'state') \t\t\t\t{ $v = $this->changelog_format_tag_diff ($k, $v); }\n\t\t\t\t//section change\n\t\t\t\telseif($k == 'sectionIdNew') \t{ $v = $this->changelog_format_section_diff ($k, $v); }\n\t\t\t\t//master subnet change\n\t\t\t\telseif($k == \"masterSubnetId\") \t{ $v = $this->changelog_format_master_subnet_diff ($k, $v); }\n\t\t\t\t//device change\n\t\t\t\telseif($k == 'switch') \t\t\t{ $v = $this->changelog_format_device_diff ($k, $v); }\n\t\t\t\t//vlan\n\t\t\t\telseif($k == 'vlanId') \t\t\t{ $v = $this->changelog_format_vlan_diff ($k, $v); }\n\t\t\t\t//vrf\n\t\t\t\telseif($k == 'vrfId') \t\t\t{ $v = $this->changelog_format_vrf_diff ($k, $v); }\n\t\t\t\t//master section change\n\t\t\t\telseif($k == 'masterSection') \t{ $v = $this->changelog_format_master_section_diff ($k, $v); }\n\t\t\t\t//permission change\n\t\t\t\telseif($k == \"permissions\") \t{ $v = $this->changelog_format_permission_diff ($k, $v); }\n\t\t\t\t// make booleans\n\t\t\t\t$v = $this->changelog_make_booleans ($k, $v);\n\t\t\t\t//set log\n\t\t\t\tif ($k!==\"id\")\n\t\t\t\t$log[\"$k\"] = $this->object_old[$k].\" => $v\";\n\t\t\t}\n\t\t}\n\t\t// result\n\t\treturn $log;\n\t}",
"public function valid()\n {\n return $this->isCurrentKeyValid();\n }",
"function d2d_check_key_pair($public_key, $private_key) {\n $data = 'just a simple encryption / decryption test.';\n if (!@openssl_public_encrypt($data, $crypted, $public_key)) {\n \treturn FALSE;\n }\n if (!@openssl_private_decrypt($crypted, $decrypted, $private_key)) {\n return FALSE;\n }\n return $decrypted === $data;\n}",
"private static function unbaseX($key) {\n $int = 0;\n foreach (str_split(strrev($key)) as $i => $char) {\n $dec = array_search(ord($char), self::$chars62);\n $int = bcadd(bcmul($dec, bcpow(self::$range, $i)), $int);\n }\n return $int;\n }",
"public function valid()\n {\n return $this->key() < $this->filesize;\n }",
"public static function isNumericallyIndexed(array $values): bool\n {\n if (empty($values)) {\n return true;\n }\n\n reset($values);\n\n return is_int(key($values));\n }",
"public function isFixedPointNumber(): bool;",
"function check_vals($new, $old, $val, $data = [], $data_s = []) {\n\t$return = '';\n\tif(is_null($new)){\n\t\tif(is_array($data) && sizeof($data) > 0){\n\t\t\t$cond = array_search($old, $data);\n\t\t\tif($cond || (string)$cond == '0'){\n\t\t\t\t$return = $val;\n\t\t\t} else {\n\t\t\t\t$return = \"\";\n\t\t\t}\n\t\t} else {\n\t\t\tif($old){\n\t\t\t\t$return = $val;\n\t\t\t} else {\n\t\t\t\t$return = \"\";\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif(is_array($data) && sizeof($data) > 0){\n\t\t\tif(is_array($data_s) && sizeof($data_s) > 0){\n\t\t\t\t$temp = $data_s;\n\t\t\t} else {\n\t\t\t\t$temp = $data;\n\t\t\t}\n\t\t\t$cond = array_search($new, $temp);\n\t\t\tif($cond || (string)$cond == '0'){\n\t\t\t\t$return = $val;\n\t\t\t} else {\n\t\t\t\t$return = \"\";\n\t\t\t}\n\t\t} else {\n\t\t\tif($new){\n\t\t\t\t$return = $val;\n\t\t\t} else {\n\t\t\t\t$return = \"\";\n\t\t\t}\n\t\t}\n\t}\n\treturn $return;\n}",
"public function is_exact()\r\n {\r\n // False otherwise.\r\n return ($this->start == $this->end);\r\n }"
] | [
"0.7722886",
"0.60779005",
"0.545446",
"0.53319126",
"0.5328782",
"0.5290431",
"0.51420885",
"0.51365614",
"0.5067573",
"0.5048477",
"0.49768052",
"0.49618724",
"0.49539602",
"0.49462232",
"0.49450853",
"0.49256834",
"0.49012312",
"0.48968127",
"0.48750275",
"0.48686787",
"0.48509765",
"0.4843875",
"0.48128283",
"0.48067135",
"0.48013717",
"0.47966418",
"0.47873354",
"0.4781812",
"0.478039",
"0.4750325",
"0.47483805",
"0.47346747",
"0.4713978",
"0.47108546",
"0.47101578",
"0.47081694",
"0.47004363",
"0.46988872",
"0.46942097",
"0.46800163",
"0.46735698",
"0.4664209",
"0.46641782",
"0.4658171",
"0.46403277",
"0.46374926",
"0.46249926",
"0.4604387",
"0.45905",
"0.45822328",
"0.45729336",
"0.45587283",
"0.45586574",
"0.45534018",
"0.45534018",
"0.45534018",
"0.45534018",
"0.45469767",
"0.4542801",
"0.45424148",
"0.45356175",
"0.45306867",
"0.45298317",
"0.45288926",
"0.45139045",
"0.4503056",
"0.45004934",
"0.4499881",
"0.44937786",
"0.4493282",
"0.44902766",
"0.448727",
"0.44819185",
"0.44803175",
"0.4474374",
"0.44613874",
"0.44558084",
"0.44512954",
"0.4439189",
"0.4431899",
"0.4429305",
"0.44091305",
"0.440078",
"0.43935046",
"0.43931606",
"0.43912217",
"0.4386183",
"0.4376473",
"0.43671194",
"0.4359666",
"0.43583775",
"0.434776",
"0.43442997",
"0.43389875",
"0.4337681",
"0.4336868",
"0.43359372",
"0.4335925",
"0.4332985",
"0.43310988"
] | 0.72838795 | 1 |
Delete the model from the database. | public function delete()
{
if (is_null($this->fileName)) {
throw new Exception('No file name (fileName) defined on model.');
}
if ($this->exists) {
if ($this->fireModelEvent('deleting') === false) {
return false;
}
$this->performDeleteOnModel();
$this->exists = false;
// Once the model has been deleted, we will fire off the deleted event so that
// the developers may hook into post-delete operations. We will then return
// a boolean true as the delete is presumably successful on the database.
$this->fireModelEvent('deleted', false);
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function deleteModel(\\MPF\\Db\\Model $model);",
"public function delete(Model $model);",
"public function delete(Model $model);",
"public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }",
"public function delete(Model $model): void\n {\n $model->delete();\n }",
"public function delete($model);",
"public function delete(){\r\n\t\t$this->db->delete();\r\n\t}",
"public function delete()\n {\n $this->repository->delete($this->id);\n }",
"public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }",
"public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }",
"public function delete(Model $model)\n {\n $model->delete();\n }",
"public function deleted(Model $model)\n {\n Schema::dropIfExists($model->getBuilderTable());\n }",
"public function destroy()\n {\n return $this->model->delete();\n }",
"public function delete(Model $model)\n {\n }",
"public function deleteModel(Model &$model)\n {\n }",
"public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}",
"public function delete() {\r\n return $this->orm->delete();\r\n }",
"public function delete(Model $model)\n {\n // TODO: Implement delete() method.\n }",
"public function delete()\n {\n $conn = $this->getConnection();\n\n if (!isset($this->attributes->{$this->primaryKey})) {\n $trace = debug_backtrace()[0];\n throw new ModelException(\n 'No object has been loaded',\n 8000,\n $trace['file'],\n $trace['line']\n );\n }\n $key = $this->attributes->{$this->primaryKey};\n\n $bind = $this->getNamedParam();\n\n $statement = $this->getStatement();\n $statement->setWhere($this->primaryKey, '=', $bind);\n $statement->setBindings($bind, $key);\n\n $this->query = $statement->getDelete();\n $delete = $conn->prepare($this->query);\n\n return $this->execute($delete, $statement);\n }",
"public function deleting($model)\n\t{\n\t}",
"public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}",
"public function deleteModel($entity){\n $this->entityManager->remove($entity);\n $this->entityManager->flush();\n }",
"protected function performDeleteOnModel()\n {\n $this->newQuery()->delete($this->fileName);\n }",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }",
"public function delete(Identifiable $model);",
"public function deleteByModel(Model $model): bool;",
"public function deletedModel(Model &$model)\n {\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"protected function performDeleteOnModel()\n {\n $this->getApi()->{'delete'.ucfirst($this->getEntity())}(\n $this->{$this->primaryKey},\n array_merge(...array_values($this->getGlobalScopes()))\n );\n\n $this->exists = false;\n }",
"public function delete(Model $model): ?bool;",
"public function delete()\n {\n Contest::destroy($this->modelId);\n $this->modalConfirmDeleteVisible = false;\n $this->resetPage();\n }",
"public function delete(Model $model)\n {\n return $model->delete();\n }",
"public function destroy($id)\n {\n $model = KatApp::findOrFail($id);\n $model->delete();\n }",
"public function delete() {\n\t\tif (!$this->_loaded) {\n\t\t\tthrow new Kohana_Exception('Cannot delete :model model because it is not loaded.', array(':model' => $this->_object_name));\n\t\t}\n\t\t\n\t\tif ($this->_call_behaviors('trigger_before_delete') & ORM_Behavior::CHAIN_RETURN) {\n\t\t\treturn $this;\n\t\t}\t\t\n\t\t\n\t\t$return = parent::delete();\n\t\t\n\t\t$this->_call_behaviors('trigger_after_delete');\n\t\t\t\n\t\treturn $return;\n\t}",
"public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }",
"public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }",
"public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}",
"public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }",
"public function delete()\n\t{\n\t\tDatabase::query(\"\n\t\t\tDELETE FROM\n\t\t\t\t\". $this->tableName .\"\n\t\t\tWHERE\n\t\t\t\tid = '\". $this->id .\"'\n\t\t\");\n\t}",
"public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }",
"public function delete(Model $instance)\n {\n // TODO: Implement delete() method.\n }",
"public function destroy(IModel $target);",
"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 delete()\n {\n if (is_null($this->getKeyName())) {\n throw new Exception('No primary key defined on model.');\n }\n\n // If the model doesn't exist, there is nothing to delete so we'll just return\n // immediately and not do anything else. Otherwise, we will continue with a\n // deletion process on the model, firing the proper events, and so forth.\n if (!$this->exists) {\n return null;\n }\n\n if ($this->fireModelEvent('deleting') === false) {\n return false;\n }\n\n // Here, we'll touch the owning models, verifying these timestamps get updated\n // for the models. This will allow any caching to get broken on the parents\n // by the timestamp. Then we will go ahead and delete the model instance.\n $this->touchOwners();\n\n $this->performDeleteOnModel();\n\n // We'd like to remove all the versions associated with this model, but we need\n // to make sure the model wasn't soft deleted first.\n if (!$this->exists) {\n $this->versions()->delete();\n }\n\n // Once the model has been deleted, we will fire off the deleted event so that\n // the developers may hook into post-delete operations. We will then return\n // a boolean true as the delete is presumably successful on the database.\n $this->fireModelEvent('deleted', false);\n\n return true;\n }",
"function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}",
"public function destroy(Request $request, object $model): bool;",
"public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }",
"public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }",
"public function deleted($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n $model->unsearchable();\n }",
"public function delete(Model $parent);",
"public function delete($model)\n {\n $this->loadModel($model);\n\n return $this->activeModelInstance\n ? $this->activeModelInstance->delete()\n : null;\n }",
"public function delete()\n {\n // TODO: Implement delete() method.\n }",
"public function destroy(Model $model)\n {\n return $model->delete();\n }",
"public function delete($model)\n {\n $this->search->delete($model);\n }",
"public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }",
"public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }",
"public function testDestroy()\n {\n if ($this->skipBaseTests) $this->markTestSkipped('Skipping Base Tests');\n\n $item = $this->model->factory()->create();\n\n // Removes the dates for comparison\n $itemArray = $item->toArray();\n unset($itemArray['created_at']);\n unset($itemArray['updated_at']);\n\n // Check that the model is in the database\n $this->assertDatabaseHas($this->table, $itemArray);\n\n $response = $this->delete(\"{$this->baseUrl}/{$item->getKey()}\", [], ['FORCE_CONTENT_TYPE'=>'json'])\n ->assertStatus(200);\n\n // The model should not exist in the database now\n $this->assertDatabaseMissing($this->table, $itemArray);\n\n }",
"public function delete($id) {\n return $this->model->find($id)->delete();\n }",
"public function delete( One_Model $model )\n\t{\n\t\treturn null;\n\t}",
"public function delete(Iris_Model_Abstract $model) {\n return $this->find($model->id)->current()->delete();\n }",
"public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }",
"public function destroy(User $model);",
"public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function delete()\n {\n $database = cbSQLConnect::adminConnect('object');\n if (isset($database))\n {\n return ($database->SQLDelete(self::$table_name, 'id', $this->id));\n }\n }",
"public function delete($model) {\n $repositoryClass = get_class($this->_model);\n\n if (!($model instanceof $repositoryClass)) {\n throw new InvalidArgumentException(\"The model is not an instance of {$repositoryClass}.\");\n }\n\n return $model->delete();\n }",
"public function delete($id)\n\t{\n\t\t$model = $this->table->get($id);\n\t\t$this->table->delete($model);\n\n\t\t$this->app->response()->status(204);\n\t}",
"public function delete()\n\t{\n\t\tif ($this->data['id'])\n\t\t{\n\t\t\treturn $this->db->delete($this->table_name, array('id' => $this->data['id']));\n\t\t}\n\t}",
"public function deleteById(int $modelId): bool;",
"public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\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->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}",
"public function delete()\n { if (is_null($this->id))\n trigger_error(\"User::delete(): Attempt to delete a User object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM users WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT); \n $st->execute();\n \n $conn = null;\n }",
"public abstract function delete($model, $useTransaction);",
"protected function performDeleteOnModel()\n {\n $this->performCascadeDelete();\n parent::performDeleteOnModel();\n }",
"public final function delete() {\n }",
"public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }",
"public function delete()\n\t{\n\t\tif( !isset($this->attributes[static::$primaryKey]) || $this->attributes[static::$primaryKey] <= 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn DataBase::delete(\"DELETE FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $this->attributes[static::$primaryKey]);\n\t}",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function delete($id = null) {\n $model = $this->model->find($id);\n $model->delete();\n\n return $model;\n }",
"public function forceDeleted($model)\n {\n $this->deleted($model);\n }",
"public function delete() {\r\n $this->db->delete(\"assets_permissions\", $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"public function deleteDocument() {\n\n // should get instance of model and run delete-function\n\n // softdeletes-column is found inside database table\n\n return redirect('/home');\n }",
"public function deleted(Request $model)\n {\n $models = [\n 'engagement',\n 'address',\n ];\n\n foreach($models as $relation){\n $model->$relation()->delete();\n }\n }",
"public function delete()\n\t{\n\t\t//delete our cache.\n\t\tif ($this->useObjectCaching)\n\t\t\t$this->deleteCache();\n\t\t\n\t\treturn $this->deleteDb();\n\t}",
"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 delete() {\r\n\r\n\t\t// Does the Genre object have an ID?\r\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Genre::delete(): Attempt to delete an Genre object that does not have its ID property set.\", E_USER_ERROR );\r\n\r\n\t\t// Delete the Article\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$st = $conn->prepare ( \"DELETE FROM :table WHERE id = :id LIMIT 1\" );\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->execute();\r\n\t\t$conn = null;\r\n\t}",
"protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }",
"public function clearModels();",
"public function delete($model){\n\t\t// define que o comando só utilizará o 'id' do registro\n\t\t$valores = ['id'];\n\n\t\t// cria um comando sql para fazer a exclusão\n\t\t$sql = $this->geraSQL('delete', $valores);\n\n\t\t// cria uma instancia do banco e prepara um comando\t\t\n\t\t$pdo = Connection::getInstance()->prepare($sql);\n\n\t\t// define os valores de cada coluna\n\t\tforeach($valores as $valor)\n\t\t\t$pdo->bindValue(\":$valor\",$model->{'get'.ucfirst($valor)}());\n\n\t\t// executa o comando, se der certo retorna TRUE, se não, retorna FALSE\n\t\treturn $pdo->execute();\n\t}",
"public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }",
"public function delete(OrmModelInterface $model): bool\n {\n }",
"protected function performDestroy(Model $entity): void\n {\n $entity->delete();\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 }",
"public function actionDelete($id)\n { \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n \n try {\n $model = $this->findModel($id);\n \n $this->deshacer_renglones($model);\n\n $model->delete();\n \n $transaction->commit();\n \n return $this->redirect(['index']);\n\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n\n }",
"function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"function delete()\n {\n $this->_getConnection();\n if (false === $this->get($this->_data['id'])) {\n return false;\n }\n $this->preDelete();\n // Find the models linking to the current one through a foreign key.\n foreach ($this->_methods_list as $method=>$details) {\n if (is_array($details)) {\n // foreignkey\n $related = $this->$method();\n foreach ($related as $rel) {\n if ($details[0] == $this->_model\n and $rel->id == $this->_data['id']) {\n continue; // $rel == $this\n }\n // We do not really control if it can be deleted\n // as we can find many times the same to delete.\n $rel->delete();\n }\n } else {\n // manytomany\n $related = $this->$method();\n foreach ($related as $rel) {\n $this->delAssoc($rel);\n }\n }\n }\n $req = 'DELETE FROM `'.$this->_con->pfx.$this->_table.'` WHERE'.\"\\n\";\n $req .= '`id` = \\''.$this->_con->esc($this->_data['id']).'\\'';\n if (!$this->_con->execute($req)) {\n throw new Exception($this->_con->error());\n }\n $this->_reset();\n return true;\n }",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}"
] | [
"0.7884068",
"0.76663375",
"0.76663375",
"0.7511067",
"0.7430471",
"0.7379083",
"0.7269651",
"0.7253018",
"0.7249288",
"0.7198745",
"0.71976167",
"0.7179531",
"0.7151565",
"0.715066",
"0.7120851",
"0.7119418",
"0.71160567",
"0.7091822",
"0.7062709",
"0.70482004",
"0.70369965",
"0.7031499",
"0.7030043",
"0.7027424",
"0.697113",
"0.69638735",
"0.69270897",
"0.69269335",
"0.69138527",
"0.6890379",
"0.6824325",
"0.6818348",
"0.68133724",
"0.67851335",
"0.67790735",
"0.6758829",
"0.67498314",
"0.6747681",
"0.67467844",
"0.6736863",
"0.67173034",
"0.6706165",
"0.66943514",
"0.66845363",
"0.6677119",
"0.6663784",
"0.66636306",
"0.6646532",
"0.66083467",
"0.66081566",
"0.66060644",
"0.6604903",
"0.65730965",
"0.65727854",
"0.6569651",
"0.6559063",
"0.6558195",
"0.6515617",
"0.6506249",
"0.65047663",
"0.6489419",
"0.6485848",
"0.6479279",
"0.64726216",
"0.64390796",
"0.63925755",
"0.6389903",
"0.6388316",
"0.63755834",
"0.6371677",
"0.6371368",
"0.63674414",
"0.63671684",
"0.6354164",
"0.63502777",
"0.6338422",
"0.6331916",
"0.6331556",
"0.6322944",
"0.6315044",
"0.63132507",
"0.63077307",
"0.6300313",
"0.6298256",
"0.62894577",
"0.62891114",
"0.62836736",
"0.62792325",
"0.6278619",
"0.627387",
"0.62694347",
"0.62625134",
"0.62593454",
"0.6252009",
"0.6238389",
"0.62322295",
"0.6231221",
"0.6225947",
"0.6221986",
"0.6221986",
"0.6220931"
] | 0.0 | -1 |
Perform the actual delete query on this model instance. | protected function performDeleteOnModel()
{
$this->newQuery()->delete($this->fileName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }",
"public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }",
"public function delete() {\n $query = $this->queryBuilder->delete()->getQuery();\n return $this->query($query);\n }",
"public function delete()\n {\n $conn = $this->getConnection();\n\n if (!isset($this->attributes->{$this->primaryKey})) {\n $trace = debug_backtrace()[0];\n throw new ModelException(\n 'No object has been loaded',\n 8000,\n $trace['file'],\n $trace['line']\n );\n }\n $key = $this->attributes->{$this->primaryKey};\n\n $bind = $this->getNamedParam();\n\n $statement = $this->getStatement();\n $statement->setWhere($this->primaryKey, '=', $bind);\n $statement->setBindings($bind, $key);\n\n $this->query = $statement->getDelete();\n $delete = $conn->prepare($this->query);\n\n return $this->execute($delete, $statement);\n }",
"public function delete()\n {\n return static::queryBuilder()->delete()->where(array('id' => $this->{$this->_idField}))->execute();\n }",
"protected function performDeleteOnModel()\n {\n $this->getApi()->{'delete'.ucfirst($this->getEntity())}(\n $this->{$this->primaryKey},\n array_merge(...array_values($this->getGlobalScopes()))\n );\n\n $this->exists = false;\n }",
"public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }",
"public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }",
"public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }",
"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 }",
"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 }",
"public function delete() {\n global $db;\n $this->_predelete();\n $result = $db->query(\"DELETE FROM \".$this->table.\" WHERE \".$this->id_field.\"=?\", array($this->{$this->id_field}));\n $this->_postdelete($result);\n return $result;\n }",
"public function delete()\n {\n $this->repository->delete($this->id);\n }",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }",
"protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }",
"public function delete() {\n\n\t\t// Database\n\t\t$db = $this->db;\n\n\t\t// SQL code for deletion\n\t\t$sql = $this->sql_for_delete();\n\n\t\t// Deletion execution\n\t\treturn $db::execute($sql);\n\t}",
"public function delete()\n {\n return $this->query->batchDelete($this->filter);\n }",
"public function delete()\n {\n $this->_validateModifiable();\n\n $this->_getDataSource()->delete($this);\n }",
"public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }",
"public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}",
"function delete()\n {\n $this->_getConnection();\n if (false === $this->get($this->_data['id'])) {\n return false;\n }\n $this->preDelete();\n // Find the models linking to the current one through a foreign key.\n foreach ($this->_methods_list as $method=>$details) {\n if (is_array($details)) {\n // foreignkey\n $related = $this->$method();\n foreach ($related as $rel) {\n if ($details[0] == $this->_model\n and $rel->id == $this->_data['id']) {\n continue; // $rel == $this\n }\n // We do not really control if it can be deleted\n // as we can find many times the same to delete.\n $rel->delete();\n }\n } else {\n // manytomany\n $related = $this->$method();\n foreach ($related as $rel) {\n $this->delAssoc($rel);\n }\n }\n }\n $req = 'DELETE FROM `'.$this->_con->pfx.$this->_table.'` WHERE'.\"\\n\";\n $req .= '`id` = \\''.$this->_con->esc($this->_data['id']).'\\'';\n if (!$this->_con->execute($req)) {\n throw new Exception($this->_con->error());\n }\n $this->_reset();\n return true;\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }",
"public function delete() {\r\n return $this->orm->delete();\r\n }",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }",
"public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }",
"public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}",
"public function delete()\n {\n if (isset($this->onDelete)) {\n return call_user_func($this->onDelete, $this);\n }\n\n return $this->toBase()->delete();\n }",
"public function delete()\n {\n return $this->connection->delete($this->grammar->compileDelete($this));\n }",
"public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }",
"public function delete()\n\t{\n\t\tDatabase::query(\"\n\t\t\tDELETE FROM\n\t\t\t\t\". $this->tableName .\"\n\t\t\tWHERE\n\t\t\t\tid = '\". $this->id .\"'\n\t\t\");\n\t}",
"public function delete()\n {\n $table = self::getTable();\n $connection = new DataBaseConnection();\n $parameters = ['id' => $this->id];\n return $connection->delete($table, $parameters);\n }",
"public function delete()\n\t{\n\t\tif( !isset($this->attributes[static::$primaryKey]) || $this->attributes[static::$primaryKey] <= 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn DataBase::delete(\"DELETE FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $this->attributes[static::$primaryKey]);\n\t}",
"public function delete()\n {\n $query = ['collection' => $this->collection, 'filter' => $this->filter->toArray()];\n\n return $this->connection->delete($query, $options = []);\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 delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}",
"public function forceDelete()\n {\n return $this->query->delete();\n }",
"public function delete() {\n\t\tif ($this->exists) {\n\t\t\t$this->fire_event('deleting');\n\n\t\t\t$result = $this->query()->where(static::$key, '=', $this->get_key())->delete();\n\n\t\t\t$this->fire_event('deleted');\n\n\t\t\treturn $result;\n\t\t}\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 deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }",
"public function deleteAll()\n {\n return $this->model::query()->delete();\n }",
"public function delete(){\n $this->update(['deleted_by', Auth::user()->id]);\n return parent::delete();\n }",
"public function delete()\n {\n $database = cbSQLConnect::adminConnect('object');\n if (isset($database))\n {\n return ($database->SQLDelete(self::$table_name, 'id', $this->id));\n }\n }",
"function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}",
"public function delete()\n {\n return new QueryProxy('delete', $this);\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 delete()\n\t{\n\t\tif ($this->data['id'])\n\t\t{\n\t\t\treturn $this->db->delete($this->table_name, array('id' => $this->data['id']));\n\t\t}\n\t}",
"public final function delete() {\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 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 delete()\n {\n if (is_null($this->getKeyName())) {\n throw new Exception('No primary key defined on model.');\n }\n\n // If the model doesn't exist, there is nothing to delete so we'll just return\n // immediately and not do anything else. Otherwise, we will continue with a\n // deletion process on the model, firing the proper events, and so forth.\n if (!$this->exists) {\n return null;\n }\n\n if ($this->fireModelEvent('deleting') === false) {\n return false;\n }\n\n // Here, we'll touch the owning models, verifying these timestamps get updated\n // for the models. This will allow any caching to get broken on the parents\n // by the timestamp. Then we will go ahead and delete the model instance.\n $this->touchOwners();\n\n $this->performDeleteOnModel();\n\n // We'd like to remove all the versions associated with this model, but we need\n // to make sure the model wasn't soft deleted first.\n if (!$this->exists) {\n $this->versions()->delete();\n }\n\n // Once the model has been deleted, we will fire off the deleted event so that\n // the developers may hook into post-delete operations. We will then return\n // a boolean true as the delete is presumably successful on the database.\n $this->fireModelEvent('deleted', false);\n\n return true;\n }",
"function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }",
"public function delete()\n {\n $data = Comment::where(\"reply\", $this->id)->get();\n foreach ($data as $comment) {\n $comment->delete();\n }\n\n /**\n * Delete self\n */\n parent::delete();\n }",
"public abstract function delete($model, $useTransaction);",
"protected function performDeleteOnModel()\n {\n $this->performCascadeDelete();\n parent::performDeleteOnModel();\n }",
"public function Delete()\n\t\t{\n\t\t\t$this->deleted = new DateTime();\n\t\t\t$this->deletedby = User::GetCurrentUser();\n\t\t\t\n\t\t\t$connection = DatabaseConnection::GetConnection(\"default\");\n\t\t\treturn DatabaseAccess::Delete($this);\n\t\t}",
"public function DELETE() {\n #\n }",
"public function delete() {\n if(!isset($this->id)) {\n $error = 'We need an id to delete an object with this method, if you don\\'t have any, use the static remove instead';\n $line = \"delete(\".$propname.\") => \" . $error;\n $this->writeErrorLog($line);\n throw new \\Exception($error);\n } else {\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n $qb = $this::remove();\n $qb->where(['id' => $this->id])->make();\n return true;\n }\n }",
"public function delete()\n {\n try {\n parent::delete(null, $this->data['id']);\n } catch (Exception $e) {\n die('ERROR');\n }\n }",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"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 }",
"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 destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}",
"public function delete()\n {\n if (! $this->exists) {\n return false;\n }\n\n $this->exists = false;\n\n return $this->builder()->request($this->path, 'destroy', ...$this->ids());\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"public function delete(){\n global $db;\n $delete = $db->prepare('DELETE FROM posts WHERE id = :id');\n $delete->bindValue(':id', $this->_id, PDO::PARAM_INT);\n $delete->execute();\n }",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"public function delete()\n\t{\n\t\t$sql = $this->grammar->delete($this);\n\n\t\treturn $this->connection->query($sql, $this->bindings, $this->options);\n\t}",
"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 sql_for_delete() {\n\t\t// Check if model is writable\n\t\t$this->assertModelIsWritable();\n\n\t\t// Destination model\n\t\t$model = $this->model;\n\n\t\t// Cascade deletion calculation for model $model\n\t\tforeach ($model::metaGetRelationships() as $relationshipName => $relationship) {\n\t\t\t// Nexii tuples and children tuple deletion\n\t\t\tif (\n\t\t\t\t($relationship[\"type\"] == \"OneToMany\" or $relationship[\"type\"] == \"ManyToMany\") and\n\t\t\t\tisset($relationship[\"on_master_deletion\"]) and\n\t\t\t\t$relationship[\"on_master_deletion\"] == \"delete\"\n\t\t\t) {\n\t\t\t\t$this->addRelatedModel($relationshipName);\n\t\t\t}\n\t\t}\n\n\t\t// SQL code generation\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/delete/query.twig.sql\");\n\t\t$sql = $sqlT->render([\"query\" => $this]);\n\n\t\t// Return DELETE statement SQL code\n\t\treturn $sql;\n\t}",
"public final function delete() {\n\t\t$sql = \"\n\tDELETE FROM\n\t\t\" . $this->table . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute(array($this->{$this->primaryField}));\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}",
"public function delete()\n {\n $this->comments()->delete();\n return parent::delete();\n }",
"public function delete(){\n\t\t$kiwi_class = Model_Kiwi::get_classname( get_class($this) ); //returns User for Model_User\n\t\t$pcol = $this->kiwi_primary_key();\n\t\t$pk = $this->$pcol;\n\t\t$mc_key = static::kiwi_mc_key($kiwi_class, $pk);\n\t\tif (empty($pk))\n\t\tthrow new ActiveRecordException(\"Cannot delete, no primary key defined for: \" . $kiwi_class);\n\t\t//FIRST delete the key from memcache\n\t\tstatic::delete_from_memcache($mc_key, $kiwi_class);\n\t\t$return_status = false;\n\t\t//DO NOT DELETE - just soft delete\n\t\tif( Kohana::$config->load('gameconfig.mysql_hard_delete_disabled') &&\n\t\t\t\tin_array( Model_Kiwi::get_table_name($kiwi_class), ActiveRecord\\Model::$soft_delete_enabled_tables)\t){\n\t\t\tKohana::$log->add(Log::DEBUG, \"Mysql Deletes are disabled - using soft delete\");\n\t\t\t$return_status = $this->update_attribute(ActiveRecord\\Model::$soft_deleted_column, 1);\n\t\t}else{\n\t\t\t$return_status = static::table()->delete(array($pcol => $pk));\n\t\t}\n\t\treturn $return_status ;\n\t}",
"protected function delete() {\n\t}",
"public function delete()\n\t{\n\t\t// delete model\n\t\t$parentResult = parent::delete();\n\t\t\n\t\t// delete custom fields\n\t\tif ($parentResult) {\n\t\t\tCustomField::where([\n\t\t\t\tCustomField::PARENT_TYPE => get_class($this),\n\t\t\t\tCustomField::PARENT_ID => $this->id\n\t\t\t])->delete();\n\t\t}\n\t\t\n\t\treturn $parentResult;\n\t}",
"public function delete() {\n\t\t$args = func_get_args();\n\n\t\t// no argument, so delete current object\n\t\tif (empty($args))\n\t\t\treturn $this->db->where('id', $this->id)->delete($this->table);\n\n\t\t// argument given, so delete that object\n\t\treturn $this->db->where('id', $args[0])->delete($this->table);\n\t}",
"public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"public function delete()\n\t{\n\t \tif (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table))\n\t \t\tdie(Tools::displayError());\n\n\t\t$this->clearCache();\n\n\t\t/* Database deletion */\n\t\t$result = Db::getInstance()->Execute('DELETE FROM `'.pSQL($this->table).'` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id));\n\t\tif (!$result)\n\t\t\treturn false;\n\t\t\n\t\treturn $result;\n\t}",
"public function delete(Model $parent);",
"public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }",
"public function delete()\n\t{\n\t\t$sql = 'DELETE FROM ' . $this->sql_table . '\n\t\t\tWHERE ' . $this->sql_id_field . ' = ' . $this->{$this->sql_id_field};\n\t\t$this->db->sql_query($sql);\n\n\t\t// Unset the sql indentifier field\n\t\tunset($this->{$this->sql_id_field});\n\n\t\treturn $this->db->sql_affectedrows();\n\t}",
"public function destroy()\n {\n return $this->model->delete();\n }",
"public function delete(Identifiable $model);",
"public function delete()\r\n {\r\n $this->sql = 'DELETE FROM ' . $this->table .' '.$this->alias. ' '. $this->sql;\r\n $query = R::exec($this->sql, $this->params);\r\n $this->sql = null;\r\n $this->params = [];\r\n return $query;\r\n }",
"public function delete()\n\t{\n\t\t//delete our cache.\n\t\tif ($this->useObjectCaching)\n\t\t\t$this->deleteCache();\n\t\t\n\t\treturn $this->deleteDb();\n\t}",
"public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }",
"public function delete() {\n $sql = \"DELETE FROM archivos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos_tipos_contratos WHERE contrato_id=:contrato_id\";\n $args = array(\n \":contrato_id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n $sql = \"DELETE FROM contratos WHERE id=:id\";\n $args = array(\n \":id\" => $this->id\n );\n $stmt = $this->executeQuery($sql, $args);\n\n return !$stmt ? false : true;\n }",
"public function delete() {\n\n if (!$this->isUsed()) {\n // Database deletion\n $result = Db::getInstance()->delete($this->def['table'], '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n\n if (!$result) {\n return false;\n }\n\n // Database deletion for multilingual fields related to the object\n\n if (!empty($this->def['multilang'])) {\n Db::getInstance()->delete(bqSQL($this->def['table']) . '_lang', '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n }\n\n return $result;\n } else {\n return false;\n }\n\n }",
"public function delete(Model $model);",
"public function delete(Model $model);",
"public function deleting()\n {\n # code...\n }",
"protected function _delete()\n {\n $this->_deleteRows( $this->getServiceTurnaroundTimes() );\n $this->_deleteRows( $this->getServicePriceModifiers() );\n $this->_deleteRows( $this->getServiceSpeakerNumbers() );\n\n $clientServiceModel = new Application_Model_ClientService();\n $clientServiceModel->delete( 'service_id = ' . $this->id );\n\n $serviceGroupModel = new Application_Model_ServiceGroupService();\n $serviceGroupModel->delete( 'service_id = ' . $this->id );\n }",
"public function delete(){\n global $wpdb;\n $table_name = $wpdb->prefix.static::$_table;\n return $wpdb->delete($table_name,[$this->getPk()=>$this->getPkValue()]);\n }",
"public function delete()\n {\n // TODO: Implement delete() method.\n }",
"function delete() {\n\t\treturn $this->destroy();\n\n\t}",
"public function delete()\n {\n if ( !$this->loaded )\n $this->reload();\n\n $this->lock();\n\n try\n {\n $sql = \"DELETE FROM $this->_table_name\n WHERE\n $this->left_column >= $this->left\n AND $this->right_column <= $this->right\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n\n $this->delete_space($this->left, $this->size);\n }\n catch (PDOException $e)\n {\n $this->unlock();\n throw $e;\n }\n\n $this->unlock();\n }",
"public function delete() {\n\t\tif (!$this->_loaded) {\n\t\t\tthrow new Kohana_Exception('Cannot delete :model model because it is not loaded.', array(':model' => $this->_object_name));\n\t\t}\n\t\t\n\t\tif ($this->_call_behaviors('trigger_before_delete') & ORM_Behavior::CHAIN_RETURN) {\n\t\t\treturn $this;\n\t\t}\t\t\n\t\t\n\t\t$return = parent::delete();\n\t\t\n\t\t$this->_call_behaviors('trigger_after_delete');\n\t\t\t\n\t\treturn $return;\n\t}"
] | [
"0.71934223",
"0.71915287",
"0.7101852",
"0.7093625",
"0.7043724",
"0.7042221",
"0.704104",
"0.7027212",
"0.7018903",
"0.69623333",
"0.6957784",
"0.6942512",
"0.6935427",
"0.6882916",
"0.6881946",
"0.68719965",
"0.68640006",
"0.68636906",
"0.6856066",
"0.683373",
"0.68243545",
"0.68201315",
"0.68116736",
"0.6791809",
"0.6788342",
"0.6765153",
"0.67454505",
"0.67367333",
"0.6733435",
"0.6722345",
"0.6713796",
"0.66967934",
"0.6693243",
"0.6661054",
"0.6648093",
"0.6641741",
"0.6641543",
"0.6631551",
"0.66305417",
"0.6587503",
"0.6585378",
"0.6574982",
"0.6568589",
"0.6557338",
"0.6530808",
"0.6518367",
"0.6484554",
"0.6473014",
"0.64693385",
"0.64632595",
"0.6461915",
"0.6461313",
"0.6450971",
"0.6450125",
"0.64480555",
"0.64436954",
"0.64435637",
"0.64380103",
"0.64362925",
"0.64339715",
"0.64339715",
"0.64338464",
"0.6432787",
"0.64310986",
"0.6419615",
"0.6405135",
"0.6399322",
"0.6393517",
"0.63868904",
"0.6386439",
"0.6385204",
"0.6384109",
"0.63825655",
"0.6378059",
"0.6358241",
"0.63581353",
"0.6353878",
"0.6349722",
"0.6337477",
"0.6325552",
"0.63230455",
"0.6322967",
"0.6313506",
"0.63117564",
"0.6310553",
"0.63101596",
"0.6301153",
"0.6299213",
"0.6295696",
"0.6292562",
"0.6292225",
"0.6287832",
"0.6287832",
"0.62810546",
"0.627808",
"0.6273633",
"0.6273253",
"0.6268929",
"0.62583554",
"0.6256891"
] | 0.70006824 | 9 |
Create a new native event for handling beforeFetch(). | public static function fetching($callback)
{
static::registerModelEvent('fetching', $callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function preFetch(FetchEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"public function postFetch(FetchEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"public function setSourceFetchEvent(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Any::class);\n $this->writeOneof(62, $var);\n }",
"public function onEvent();",
"abstract function HookEvents();",
"public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }",
"abstract public function getEventName();",
"public function getEventDispatch();",
"abstract public function preAction(Event $event): Event;",
"public function getSourceFetchEvent()\n {\n return $this->readOneof(62);\n }",
"public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }",
"public function onBeforeMakeFeed($event) {\n\t\t$this->raiseEvent('onBeforeMakeFeed', $event);\n\t}",
"public function beforeHandle(CakeEvent $event) {\n\t\tparent::beforeHandle($event);\n\n\t\tif (!$this->_request()->is('api')) {\n\t\t\t$events = $this->implementedEvents();\n\t\t\t$eventManager = $this->_controller()->getEventManager();\n\t\t\tforeach (array_keys($events) as $name) {\n\t\t\t\tif ($name === 'Crud.beforeHandle') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$eventManager->detach($this, $name);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t$this->_checkRequestMethods();\n\t}",
"protected function preHandle(Event $ev) { return; }",
"public function createEvent()\n {\n return new Event();\n }",
"public function on($event, $callback){ }",
"function create_lds_event($indirec, $eventName, $eventABV, $eParent)\n\t{\n\t\t//throw new exception(\"create_lds_event - this function is not implemented\");\n\t}",
"abstract protected function handle($event);",
"protected function setEventName() {\n return NULL;\n }",
"public function onBeforeSave($event);",
"public function initializeFacebookEvent()\n {\n $this->trackingName = $this->ifVariableSet($this->parameters['tracking'],null);\n $this->numberGiftEarned = $this->ifVariableSet($this->parameters['numberGiftEarned'],0);\n $this->numberGiftSent = $this->ifVariableSet($this->parameters['numberGiftSent'],0);\n $this->numberGiftReceived = $this->ifVariableSet($this->parameters['numberGiftReceived'],0);\n $this->fbAccessToken = $this->ifVariableSet($this->userProfile['fbAccessToken'],0);\n $this->casinoUserId = $this->ifVariableSet($this->userProfile['casinoUserId'],0);\n $this->FBUserId = $this->ifVariableSet($this->userProfile['FBUserId'],0);\n $this->customEventsFields = array(\n '_appVersion' => urlencode('DIGIPRESENCE'),\n 'casinoUserId' => urlencode($this->casinoUserId),\n 'FBUserId' => urlencode($this->FBUserId),\n 'numberGiftSent' => urlencode($this->numberGiftSent),\n 'numberGiftReceived' => urlencode($this->numberGiftReceived),\n 'numberGiftEarned' => urlencode($this->numberGiftEarned),\n '_eventName' => urlencode($this->trackingName)\n );\n }",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"public function createEvents()\n {\n //\n\n return 'something';\n }",
"public function construct(CakeEvent $event) {\n\t\t$this->__startTime = time();\n\t}",
"public function __invoke(Event $event) {\n\n\t\t$entity = $event->getObject();\n\n\t\tif (!$entity instanceof Download) {\n\t\t\treturn;\n\t\t}\n\n\t\tGithubEntities::instance()->syncPackageDetails($entity);\n\t\tGithubEntities::instance()->syncReleases($entity);\n\t\tGithubEntities::instance()->setupWebhook($entity);\n\t}",
"public function testFetchEvent() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Fetch the events\n\t\t$total = 0;\n\t\t$events = $jsonpad->fetchEvents(1, null, null, $total);\n\t\t$this->assertInternalType(\"array\", $events);\n\t\t$this->assertGreaterThanOrEqual(1, $total);\n\t\t$this->assertInstanceOf(\"\\Jsonpad\\Resource\\Event\", $events[0]);\n\t\t\n\t\t// Fetch a single event\n\t\t$event = $jsonpad->fetchEvent($events[0]->getId());\n\t\t$this->assertSame($event->getId(), $events[0]->getId());\n\t}",
"public function testEventCallBackCreate()\n {\n }",
"protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }",
"public static function beforeSave($event)\r\n {\r\n }",
"#[Pure]\n public function __construct(EventBase $base, bool $initialize) {}",
"public static function __events () {\n \n }",
"public function __construct($event)\n {\n $this->event = $event;\n }",
"public function __construct($event)\n {\n $this->event = $event;\n }",
"public function getEventName() : String;",
"public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }",
"public function onBeforeMakeFeedDocumentPage($event) {\n\t\t$this->raiseEvent('onBeforeMakeFeedDocumentPage', $event);\n\t}",
"public function testEventCallBackGet()\n {\n }",
"function __construct($event) {\n $this->init($event);\n }",
"public function beforeDispatch(DispatchEvent $event);",
"private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }",
"public function _on($EventName, $Callback, $Priority = 0);",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function DoEvent($nEvent) {}",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n if ($this->isDirty('status') and $this->status === User::STATUS_ACTIVE) {\n $this->event_type = 'verify';\n }\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : self::URUID, // unregistered user id\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"#[Pure]\n public function __construct(EventBase $base, $fd, int $what, callable $cb, $arg = null) {}",
"public function testEventCallBackPatch()\n {\n }",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public function getEvent();",
"public function invokeEvent(Event $event);",
"public function event(): EventDispatcherInterface;",
"function event()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('event', $data)\n );\n $this->output($ret);\n }",
"public static function fetched($callback)\n {\n static::registerModelEvent('fetched', $callback);\n }",
"function ibase_set_event_handler($connection, $event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}",
"public function implementedEvents() {\n\t\treturn array(\n\t\t\t'Crud.initialize' => 'initialize'\n\t\t);\n\t}",
"public function kernelRequest(Event $event) {\n // \\Drupal::messenger()->addMessage('Event kernel.request thrown by Subscriber in module crm_awareness.', 'status', TRUE);\n }",
"public function onCreateClient(Event $event)\n {\n $version = \\Yii::getVersion();\n\n $clientConfig = $event['client']->getConfig();\n $commandParams = $clientConfig->get(Client::COMMAND_PARAMS) ?: array();\n $clientConfig->set(Client::COMMAND_PARAMS, array_merge_recursive($commandParams, array(\n UserAgentListener::OPTION => 'YII2/' . $version . ' YII2MOD/' . $version,\n )));\n }",
"public function __construct()\n {\n parent::__construct('BaseEvent');\n }",
"public function add_event_handler($event, $callback);",
"public static function init(array $data): EventCallbackRequestEvent\n {\n /** @var EventCallbackRequestEvent $obj */\n $obj = ObjectSerializer::deserialize(\n $data,\n EventCallbackRequestEvent::class,\n );\n\n return $obj;\n }",
"public function preActionToolbox($event) {\n\t}",
"public function getter_event_callback()\n\t{\n\t\treturn $this->event_callback = \"on\".$this->qualified_name;\n\t}",
"public function onEvent($event)\n\t{\n\t\tif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_BEFORE_INSERT)\n\t\t{\n\t\t\t/**\n\t\t\t * If document_id is set in the model the service will first try to pull \n\t\t\t * the document to update it. If it is unable to get the record \n\t\t\t * (it will be since this is an insert) it will do nothing and \n\t\t\t * the document will not be inserted.\n\t\t\t */\n\t\t\t$event->model->document_id = NULL;\n\t\t\t$result = $this->saveDocument($event->model);\n\t\t\t$event->model->document_id = $result->item->document_id;\n\t\t}\n\t\telseif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_UPDATE)\n\t\t{\n\t\t\t$this->saveDocument($event->model);\n\t\t}\n\t}",
"function _on_initialize()\n {\n $this->_request_data['content_topic'] = $this->_topic;\n\n /**\n * Prepare the request switch, which contains URL handlers for the component\n */\n\n // Handle /config\n $this->_request_switch['config'] = array\n (\n 'handler' => array('midcom_core_handler_configdm2', 'config'),\n 'schema' => 'config',\n 'fixed_args' => array('config'),\n );\n\n // Handle /\n $this->_request_switch['index'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_index', 'index'),\n );\n \n /* Crud for events */\n // Handle /create_event/<schema name>\n $this->_request_switch['create_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'create'),\n 'fixed_args' => array('create_event'),\n 'variable_args' => 1,\n );\n // Handle /view_event/<event_guid>\n $this->_request_switch['view_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'read'),\n 'fixed_args' => array('view_event'),\n 'variable_args' => 1,\n );\n // Handle /edit_event/<event_guid>\n $this->_request_switch['edit_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'update'),\n 'fixed_args' => array('edit_event'),\n 'variable_args' => 1,\n );\n // Handle /delete_event/<event_guid>\n $this->_request_switch['delete_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'delete'),\n 'fixed_args' => array('delete_event'),\n 'variable_args' => 1,\n );\n \n // /archive/between/<from date>/<to date> shows all events of selected week\n // in Archive mode, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-between'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'between'),\n 'fixed_args' => array('archive', 'between'),\n 'variable_args' => 2,\n );\n\n // /archive Main archive page\n $this->_request_switch['archive-welcome'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_archive', 'welcome'),\n 'fixed_args' => array('archive'),\n );\n\n // /archive/view/<event GUID> duplicate of the view handler for archive\n // operation, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-view'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'view'),\n 'fixed_args' => array('archive', 'view'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/trips/<count>\n $this->_request_switch['upcoming_trips'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'trips'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/meetings/<count>\n $this->_request_switch['upcoming_meetings'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'meetings'),\n 'variable_args' => 1,\n );\n \n /* Crud for location */\n // Handle /location/create/<schema name>\n $this->_request_switch['create_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'create'),\n 'fixed_args' => array('location', 'create'),\n 'variable_args' => 1,\n );\n // Handle /location/view/<location_guid>\n $this->_request_switch['view_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'view'),\n 'variable_args' => 1,\n );\n // Handle /location/dl_view/<location_guid>\n $this->_request_switch['view_location_dl'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'dl_view'),\n 'variable_args' => 1,\n );\n // Handle /location/edit/<location_guid>\n $this->_request_switch['edit_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'update'),\n 'fixed_args' => array('location', 'edit'),\n 'variable_args' => 1,\n );\n // Handle /location/delete/<location_guid>\n $this->_request_switch['delete_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'delete'),\n 'fixed_args' => array('location', 'delete'),\n 'variable_args' => 1,\n );\n \n // Handle /locations\n $this->_request_switch['locations'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'index'),\n 'fixed_args' => array('locations'),\n 'variable_args' => 0,\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-rss2'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n 'fixed_args' => array('rss.xml'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-rss2-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n\t 'fixed_args' => array('user', 'rss.xml'),\n\t );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('ical.ics'),\n );\n \n // / shows next N (configured number) meetings in RSS format\n $this->_request_switch['feed-ical-meetings'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('meetings','ical.ics'),\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical-trips'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('trips','ical.ics'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'ical.ics'),\n\t );\n \n\t // / shows next N (configured number) meetings in RSS format\n\t $this->_request_switch['feed-ical-meetings-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'meetings','ical.ics'),\n\t );\n \n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-trips-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'trips','ical.ics'),\n\t );\n \n $this->_request_switch['feeds'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'index'),\n 'fixed_args' => array('feeds'),\n );\n }",
"protected static function boot()\n {\n parent::boot();\n\n self::creating(function ($campaignEvent) {\n $campaignEvent->referer = refererUtil();\n $campaignEvent->ip = ipUtil();\n });\n }",
"function edit_event_load() {\n\n\t\tadd_filter( 'request', array( $this, 'sort_events' ) );\n\t}",
"function ibase_set_event_handler($event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n /*\r\n $event->beforeDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (DragConfig $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function testEventCallBackGetItem()\n {\n }",
"public static function events();",
"private function init_nopriv_event_listeners() {\n\t\t// add_action('wp_ajax_nopriv_example_action', [$this, 'example_function']);\n\t}",
"public function dispatchEvent($event);",
"public function __construct(NewMessageEvent $event)\n {\n $this->event = $event;\n }",
"protected function _loadEventClass() {\n\t\tApp::uses($this->plugin . 'Events', $this->plugin . '.Lib');\n\n\t\t$this->EventClass = $this->plugin . 'Events';\n\t\t$this->EventClass = new $this->EventClass();\n\t}",
"public static function convert($_event)\n {\n\n }",
"private function createinstallevent()\n {\n $cat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar/Events');\n\n $eventArray = array(\n 'title' => $this->__('PostCalendar Installed'),\n 'hometext' => ':text:' . $this->__('On this date, the PostCalendar module was installed. Thank you for trying PostCalendar! This event can be safely deleted if you wish.'),\n 'alldayevent' => true,\n 'eventstatus' => PostCalendar_Entity_CalendarEvent::APPROVED,\n 'sharing' => PostCalendar_Entity_CalendarEvent::SHARING_GLOBAL,\n 'website' => 'https://github.com/craigh/PostCalendar/wiki',\n 'categories' => array(\n 'Main' => $cat['id']));\n\n try {\n $event = new PostCalendar_Entity_CalendarEvent();\n $event->setFromArray($eventArray);\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n } catch (Exception $e) {\n return LogUtil::registerError($e->getMessage());\n }\n\n return true;\n }",
"function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}",
"public function event($event)\n {\n return $this->setProperty('event', $event);\n }",
"public function getEventSubscriber();",
"public function preProcess(ProcessEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"protected function postHandle(Event $ev) { return; }",
"function eventclass_offeraride()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"private function parserEventJson($jsonevent)\n {\n $event=null;\n //convert to php object\n $php_object = json_decode($jsonevent); \n if($php_object!=null){\n \n $event= new Event($php_object->CreatorId, $php_object->Title,$php_object->Venue,$php_object->privacy);\n $event->setCurrencyCountry($php_object->current_country);\n $event->setSearchableKeywords($php_object->search_keywords);\n $event->setFees($php_object->fees);\n $event->setCurrencyCountry( $php_object->current_country);\n $event->setCurrencyCountry( $php_object->current_country);\n $event->setDescription($php_object->Description);\n $event->setStartDate($php_object->StartDate);\n $event->setGoing($php_object->going); \n \n }\n \n return $event; \n }",
"public function onEvent(Event $event) {\n\t\tif ($this->runtimeContext) {\n\t\t\t$this->workflowActivity->onEvent($this->runtimeContext, $event);\n\t\t}\n\t}",
"public function postEventadd();",
"function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }",
"public function onNewDownload($event)\n\t{\n\t\t$this->raiseEvent('onNewDownload', $event);\n\t}",
"public function getEvent()\n {\n // Check for a new event on the current connection\n $buffer = '';\n do {\n $buffer .= fgets($this->socket, 512);\n } while (!empty($buffer) && !preg_match('/\\v+$/', $buffer));\n $buffer = trim($buffer);\n\n // If no new event was found, return NULL\n if (empty($buffer)) {\n return null;\n }\n\n // If the event has a prefix, extract it\n $prefix = '';\n if (substr($buffer, 0, 1) == ':') {\n $parts = explode(' ', $buffer, 3);\n $prefix = substr(array_shift($parts), 1);\n $buffer = implode(' ', $parts);\n }\n\n // Parse the command and arguments\n list($cmd, $args) = array_pad(explode(' ', $buffer, 2), 2, null);\n\n // Parse the server name or hostmask\n if (strpos($prefix, '@') === false) {\n $hostmask = new Phergie_Hostmask(\n null, null, $prefix\n );\n } else {\n $hostmask = Phergie_Hostmask::fromString($prefix);\n }\n\n // Parse the event arguments depending on the event type\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'names':\n case 'nick':\n case 'quit':\n case 'ping':\n case 'pong':\n case 'error':\n case 'part':\n $args = array_filter(array(ltrim($args, ':')));\n break;\n\n case 'privmsg':\n case 'notice':\n $args = $this->parseArguments($args, 2);\n list($source, $ctcp) = $args;\n if (substr($ctcp, 0, 1) === \"\\001\" && substr($ctcp, -1) === \"\\001\") {\n $ctcp = substr($ctcp, 1, -1);\n $reply = ($cmd == 'notice');\n list($cmd, $args) = array_pad(explode(' ', $ctcp, 2), 2, array());\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'version':\n case 'time':\n case 'finger':\n case 'ping':\n if ($reply) {\n $args = array($args);\n }\n break;\n case 'action':\n $args = array($source, $args);\n break;\n }\n }\n // This fixes the issue that seems to occur, but why does it?\n if (!is_array($args)) {\n $args = array($args);\n }\n break;\n\n case 'topic':\n case 'invite':\n case 'join':\n $args = $this->parseArguments($args, 2);\n break;\n\n case 'kick':\n case 'mode':\n $args = $this->parseArguments($args, 3);\n break;\n\n // Remove target and colon preceding description from responses\n default:\n $args = substr($args, strpos($args, ' ') + 2);\n break;\n }\n\n // Create, populate, and return an event object\n if (ctype_digit($cmd)) {\n $event = new Phergie_Event_Response;\n $event\n ->setCode($cmd)\n ->setDescription($args);\n } else {\n $event = new Phergie_Event_Request;\n $event\n ->setType($cmd)\n ->setArguments($args);\n $event->setHostmask($hostmask);\n }\n $event->setRawData($buffer);\n return $event;\n }",
"function submitted_events_create_event($submission) {\n\t// first determine if this is a walk or not\n\t$level = submitted_events_walk_level ( $submission );\n\tif ($level === 'Social' || $level === 'Other') {\n\t\tsubmitted_events_create_non_walk ( $submission, $level );\n\t} else {\n\t\tsubmitted_events_create_walk ( $submission, $level );\n\t}\n\t\n\t// Set eventgenerated to TRUE in the database\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\t$result = $wpdb->update ( $table_name, array (\n\t\t\t'eventgenerated' => 1 \n\t), array (\n\t\t\t'ID' => $submission->id \n\t), array (\n\t\t\t'%d' \n\t), array (\n\t\t\t'%d' \n\t) );\n\t// echo $submission->id . ' result = ' . $result;\n}",
"public static function event($event = null)\n {\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function __construct(Event $event)\n {\n $this->event = $event;\n }",
"public function handle($event)\n {\n \n }",
"private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}",
"private function loadEvent()\n {\n $api_event = $this->product->getWebUrlApi() . \"segments?_sort=id&_order=desc&_start=0&_end=26&is_displayed=1\";\n $api_event = $this->httpClient->get($api_event);\n $api_event = json_decode($api_event->getRawBody(), true);\n return $api_event;\n }",
"function on_start(){\n //$userID = $u->getUserID();\n \n //print \"runnin\";\n //$cartEventClassName = 'ScottcAffiliateRelation';\n //$cartEventClassPath = 'packages/scottc_affiliates/libraries/affiliate_relation.php';\n $eventClassName = 'AffiliateGateway';\n $eventClassPath = 'packages/affiliate_gateway/libraries/affiliate_gateway.php';\n \n define(\"ENABLE_APPLICATION_EVENTS\", true);\n \n Events::extend('on_start', $eventClassName, 'eventOnStart', $eventClassPath, $_GET);\n //Events::extend('on_page_view', 'AffiliateGateway', 'eventOnStart', 'packages/affiliate_gateway/libraries/affiliate_gateway.php');\n \n // if($_GET){\n // Loader::library('affiliate_relation',SCOTTECOMAFFILATESPACKAGEHANDLE);\n // $har = new ScottcAffiliateRelation($_GET);\n // }\n }",
"private function _initEvents()\n {\n $onOrder = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $sidx = $params['sidx'];\n\n switch (strtoupper($params['sord'])) {\n case 'DESC':\n $sord = Solarium_Query_Select::SORT_DESC;\n break;\n default:\n $sord = Solarium_Query_Select::SORT_ASC;\n break;\n }\n\n $query = $dataSource->getQuery();\n $query->clearSorts();\n $query->addSort($sidx, $sord);\n };\n\n $this->_onOrder = $onOrder;\n\n $onFilter = function(array $params, Pike_Grid_DataSource_Solarium $dataSource) {\n $solariumQueryHelper = new Solarium_Query_Helper();\n $filters = json_decode($params['filters']);\n\n $query = $dataSource->getQuery();\n $queryString = '';\n\n foreach ($filters->rules as $field) {\n if ('' != $field->data) {\n $queryString .= $field->field . ':'\n . $solariumQueryHelper->escapeTerm($field->data) . ' AND ';\n }\n }\n\n if ('' != $queryString) {\n $queryString = substr($queryString, 0, strlen($queryString) - 4);\n $query->setQuery($queryString);\n }\n };\n\n $this->_onFilter = $onFilter;\n }",
"public function preUpdate($entity, PreUpdateEventArgs $eventArgs);"
] | [
"0.6717409",
"0.61490804",
"0.5810147",
"0.56868744",
"0.5652805",
"0.55649334",
"0.5541097",
"0.5536042",
"0.552276",
"0.5460399",
"0.54015803",
"0.5361719",
"0.5311925",
"0.5267384",
"0.5264769",
"0.5233638",
"0.51955706",
"0.5192409",
"0.51699996",
"0.515664",
"0.5086662",
"0.5074839",
"0.5071565",
"0.5064882",
"0.50530815",
"0.50362545",
"0.5024041",
"0.5017288",
"0.50085",
"0.49747893",
"0.49636188",
"0.49610123",
"0.49610123",
"0.49566334",
"0.49556077",
"0.49546576",
"0.49542326",
"0.49438855",
"0.49337506",
"0.49288237",
"0.49251863",
"0.49141622",
"0.48940086",
"0.48812252",
"0.48590124",
"0.48481306",
"0.48409873",
"0.48195377",
"0.48058847",
"0.48030457",
"0.47996467",
"0.47938815",
"0.47879365",
"0.4780687",
"0.47595707",
"0.47418702",
"0.474084",
"0.47391397",
"0.47385955",
"0.47385553",
"0.47343832",
"0.47219262",
"0.47084707",
"0.47076362",
"0.47037426",
"0.47011763",
"0.47011316",
"0.46972528",
"0.46910357",
"0.46818346",
"0.4679132",
"0.4679082",
"0.4677207",
"0.46698952",
"0.46643838",
"0.4648509",
"0.4646763",
"0.46443525",
"0.4641049",
"0.4635142",
"0.46315068",
"0.4629609",
"0.4627357",
"0.462212",
"0.46181503",
"0.4617985",
"0.46161443",
"0.46055758",
"0.4603097",
"0.46028545",
"0.46028545",
"0.46028545",
"0.46028545",
"0.46028545",
"0.45956254",
"0.45940536",
"0.45862025",
"0.45806667",
"0.4578233",
"0.45607165"
] | 0.4739489 | 57 |
Create a new native event for handling afterFetch(). | public static function fetched($callback)
{
static::registerModelEvent('fetched', $callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function postFetch(FetchEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"public function preFetch(FetchEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"public function onEvent();",
"public function getEventDispatch();",
"public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }",
"abstract public function getEventName();",
"abstract function HookEvents();",
"public function on($event, $callback){ }",
"public function postEventDel();",
"public function postEventadd();",
"public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }",
"abstract protected function handle($event);",
"public function createEvent()\n {\n return new Event();\n }",
"public function DoEvent($nEvent) {}",
"public function onNewDownload($event)\n\t{\n\t\t$this->raiseEvent('onNewDownload', $event);\n\t}",
"public function setSourceFetchEvent(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Any::class);\n $this->writeOneof(62, $var);\n }",
"public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }",
"public function testEventCallBackGet()\n {\n }",
"protected function postHandle(Event $ev) { return; }",
"public function testFetchEvent() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Fetch the events\n\t\t$total = 0;\n\t\t$events = $jsonpad->fetchEvents(1, null, null, $total);\n\t\t$this->assertInternalType(\"array\", $events);\n\t\t$this->assertGreaterThanOrEqual(1, $total);\n\t\t$this->assertInstanceOf(\"\\Jsonpad\\Resource\\Event\", $events[0]);\n\t\t\n\t\t// Fetch a single event\n\t\t$event = $jsonpad->fetchEvent($events[0]->getId());\n\t\t$this->assertSame($event->getId(), $events[0]->getId());\n\t}",
"public function __invoke(Event $event) {\n\n\t\t$entity = $event->getObject();\n\n\t\tif (!$entity instanceof Download) {\n\t\t\treturn;\n\t\t}\n\n\t\tGithubEntities::instance()->syncPackageDetails($entity);\n\t\tGithubEntities::instance()->syncReleases($entity);\n\t\tGithubEntities::instance()->setupWebhook($entity);\n\t}",
"public function add_event_handler($event, $callback);",
"public function event(): EventDispatcherInterface;",
"protected function setEventName() {\n return NULL;\n }",
"public function testEventCallBackCreate()\n {\n }",
"public function createEvents()\n {\n //\n\n return 'something';\n }",
"public static function fetching($callback)\n {\n static::registerModelEvent('fetching', $callback);\n }",
"protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }",
"function Core_PostEvent( $eventName, &$object = null, $info = array() )\n{\n\t$notification = new Event_Notification($object, $eventName, $info);\n\tCore_ModuleManager::getInstance()->dispatcher->postNotification( $notification, true, false );\n}",
"public function getEventName() : String;",
"function event()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('event', $data)\n );\n $this->output($ret);\n }",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function testEventCallBackPatch()\n {\n }",
"public function _on($EventName, $Callback, $Priority = 0);",
"public function getter_event_callback()\n\t{\n\t\treturn $this->event_callback = \"on\".$this->qualified_name;\n\t}",
"public function invokeEvent(Event $event);",
"public abstract function emitEvent(EventDescriptor $descriptor);",
"public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"function ibase_set_event_handler($connection, $event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}",
"public static function postUpdate(Event $event)\n {\n self::$event = $event;\n self::downloadDatabases();\n }",
"public static function __events () {\n \n }",
"private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }",
"public function dispatchEvent($event);",
"public function getSourceFetchEvent()\n {\n return $this->readOneof(62);\n }",
"public function testEventCallBackGetItem()\n {\n }",
"public function onAfterMakeFeed($event) {\n\t\t$this->raiseEvent('onAfterMakeFeed', $event);\n\t}",
"public function getEvent();",
"public function eventcallback(){\n\n $data = self::validate_request($_POST['signed_request']);\n\n // CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); data after json_decode:' . print_r($data, true));\n /** example\n [issued_at] => 1442959000\n [user_id] => 10015\n [event] => logout\n [algorithm] => HMAC-SHA256\n */\n\n CakeLog::write(LOG_DEBUG, \"Received event from TrueNTH portal: ${data['event']}\");\n\n if ($data['event'] == 'logout'){\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); data[event] == \"logout\"');\n $sessionObj = new DatabaseSessionPlusUserId();\n $deleteResult = $sessionObj->deleteByUserId($data['user_id']);\n CakeLog::write(LOG_DEBUG, \"Event-triggered logout complete\");\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . \"(); just did logout, heres deleteResult: $deleteResult\");\n }\n //else CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); data[event] != \"logout\"');\n\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); done.');\n }",
"public function _do($EventName, IEvent $Event);",
"public function event() : DomainEvent {\n return $this->event;\n }",
"function create_lds_event($indirec, $eventName, $eventABV, $eParent)\n\t{\n\t\t//throw new exception(\"create_lds_event - this function is not implemented\");\n\t}",
"public static function events();",
"function submitted_events_create_event($submission) {\n\t// first determine if this is a walk or not\n\t$level = submitted_events_walk_level ( $submission );\n\tif ($level === 'Social' || $level === 'Other') {\n\t\tsubmitted_events_create_non_walk ( $submission, $level );\n\t} else {\n\t\tsubmitted_events_create_walk ( $submission, $level );\n\t}\n\t\n\t// Set eventgenerated to TRUE in the database\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\t$result = $wpdb->update ( $table_name, array (\n\t\t\t'eventgenerated' => 1 \n\t), array (\n\t\t\t'ID' => $submission->id \n\t), array (\n\t\t\t'%d' \n\t), array (\n\t\t\t'%d' \n\t) );\n\t// echo $submission->id . ' result = ' . $result;\n}",
"public function testFireEventWithInternalFiredEvent()\n {\n $eventManager = new EventManager;\n $event = 'foor.bar';\n $eventManager->listen(EventManager::FIRED, function ($newEvent) use ($event) {\n $this->assertEquals($newEvent, $event);\n });\n $eventManager->fire($event);\n }",
"public function getEventSubscriber();",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n if ($this->isDirty('status') and $this->status === User::STATUS_ACTIVE) {\n $this->event_type = 'verify';\n }\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : self::URUID, // unregistered user id\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"function ibase_set_event_handler($event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}",
"public function getEvent()\n {\n // Check for a new event on the current connection\n $buffer = '';\n do {\n $buffer .= fgets($this->socket, 512);\n } while (!empty($buffer) && !preg_match('/\\v+$/', $buffer));\n $buffer = trim($buffer);\n\n // If no new event was found, return NULL\n if (empty($buffer)) {\n return null;\n }\n\n // If the event has a prefix, extract it\n $prefix = '';\n if (substr($buffer, 0, 1) == ':') {\n $parts = explode(' ', $buffer, 3);\n $prefix = substr(array_shift($parts), 1);\n $buffer = implode(' ', $parts);\n }\n\n // Parse the command and arguments\n list($cmd, $args) = array_pad(explode(' ', $buffer, 2), 2, null);\n\n // Parse the server name or hostmask\n if (strpos($prefix, '@') === false) {\n $hostmask = new Phergie_Hostmask(\n null, null, $prefix\n );\n } else {\n $hostmask = Phergie_Hostmask::fromString($prefix);\n }\n\n // Parse the event arguments depending on the event type\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'names':\n case 'nick':\n case 'quit':\n case 'ping':\n case 'pong':\n case 'error':\n case 'part':\n $args = array_filter(array(ltrim($args, ':')));\n break;\n\n case 'privmsg':\n case 'notice':\n $args = $this->parseArguments($args, 2);\n list($source, $ctcp) = $args;\n if (substr($ctcp, 0, 1) === \"\\001\" && substr($ctcp, -1) === \"\\001\") {\n $ctcp = substr($ctcp, 1, -1);\n $reply = ($cmd == 'notice');\n list($cmd, $args) = array_pad(explode(' ', $ctcp, 2), 2, array());\n $cmd = strtolower($cmd);\n switch ($cmd) {\n case 'version':\n case 'time':\n case 'finger':\n case 'ping':\n if ($reply) {\n $args = array($args);\n }\n break;\n case 'action':\n $args = array($source, $args);\n break;\n }\n }\n // This fixes the issue that seems to occur, but why does it?\n if (!is_array($args)) {\n $args = array($args);\n }\n break;\n\n case 'topic':\n case 'invite':\n case 'join':\n $args = $this->parseArguments($args, 2);\n break;\n\n case 'kick':\n case 'mode':\n $args = $this->parseArguments($args, 3);\n break;\n\n // Remove target and colon preceding description from responses\n default:\n $args = substr($args, strpos($args, ' ') + 2);\n break;\n }\n\n // Create, populate, and return an event object\n if (ctype_digit($cmd)) {\n $event = new Phergie_Event_Response;\n $event\n ->setCode($cmd)\n ->setDescription($args);\n } else {\n $event = new Phergie_Event_Request;\n $event\n ->setType($cmd)\n ->setArguments($args);\n $event->setHostmask($hostmask);\n }\n $event->setRawData($buffer);\n return $event;\n }",
"public function __invoke(Event $event)\n {\n return $this->handleEvent($event);\n }",
"public function on($eventName, $callable);",
"public function on($eventName, $callable);",
"function event($event, $halt = false)\n {\n return app('events')->dispatch($event, $halt);\n }",
"function Piwik_PostEvent( $eventName, &$object = null, $info = array() )\n{\n\tPiwik_PluginsManager::getInstance()->dispatcher->post( $object, $eventName, $info, true, false );\n}",
"public function handle(Event $event): void;",
"public function event_joined()\r\n\t{\r\n\t\r\n\t}",
"public function handle($event)\n {\n \n }",
"public static function postInstall(Event $event)\n {\n self::$event = $event;\n self::downloadDatabases();\n }",
"public function afterDispatch(DispatchEvent $event);",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public function afterDispatch(MvcEvent $event) {\n\t}",
"private function createinstallevent()\n {\n $cat = CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/PostCalendar/Events');\n\n $eventArray = array(\n 'title' => $this->__('PostCalendar Installed'),\n 'hometext' => ':text:' . $this->__('On this date, the PostCalendar module was installed. Thank you for trying PostCalendar! This event can be safely deleted if you wish.'),\n 'alldayevent' => true,\n 'eventstatus' => PostCalendar_Entity_CalendarEvent::APPROVED,\n 'sharing' => PostCalendar_Entity_CalendarEvent::SHARING_GLOBAL,\n 'website' => 'https://github.com/craigh/PostCalendar/wiki',\n 'categories' => array(\n 'Main' => $cat['id']));\n\n try {\n $event = new PostCalendar_Entity_CalendarEvent();\n $event->setFromArray($eventArray);\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n } catch (Exception $e) {\n return LogUtil::registerError($e->getMessage());\n }\n\n return true;\n }",
"public function reactToOnAfterAction($event) { }",
"function event(): EventEmitter\n{\n return EventEmitter::getInstance();\n}",
"public function broadcastEvent(\\Montage\\Event\\Event $event);",
"abstract public function handle(AbstractEvent $event): void;",
"function event_buffer_set_callback($event, $readcb, $writecb, $errorcb, $arg = NULL)\n{\n}",
"public function event($event)\n {\n return $this->setProperty('event', $event);\n }",
"#[Pure]\n public function __construct(EventBase $base, $fd, int $what, callable $cb, $arg = null) {}",
"public function getOtherEvents();",
"public function testFetchEvents() {\n\t\t$jsonpad = parent::_getJsonpadInstance();\n\t\t\n\t\t// Fetch the events\n\t\t$total = 0;\n\t\t$events = $jsonpad->fetchEvents(1, null, null, $total);\n\t\t$this->assertInternalType(\"array\", $events);\n\t\t$this->assertGreaterThanOrEqual(1, $total);\n\t\t$this->assertInstanceOf(\"\\Jsonpad\\Resource\\Event\", $events[0]);\n\t}",
"private function event(): Event\n {\n if (!$this->event) {\n $this->event = new Event($this->eventMutex(), '');\n }\n\n return $this->event;\n }",
"public function awaitEntryAdded(ContextInterface $ctx): EntryAddedEvent;",
"public function updateEvent()\n {\n $result = $this->_signedResponse($this->vars->cal);\n\n if (!($kronolith_driver = $this->_getDriver($this->vars->cal)) ||\n !isset($this->vars->id)) {\n return $result;\n }\n\n try {\n $oevent = $kronolith_driver->getEvent($this->vars->id);\n } catch (Exception $e) {\n $GLOBALS['notification']->push($e, 'horde.error');\n return $result;\n }\n if (!$oevent) {\n $GLOBALS['notification']->push(_(\"The requested event was not found.\"), 'horde.error');\n return $result;\n } elseif (!$oevent->hasPermission(Horde_Perms::EDIT)) {\n $GLOBALS['notification']->push(_(\"You do not have permission to edit this event.\"), 'horde.warning');\n return $result;\n }\n\n $attributes = Horde_Serialize::unserialize($this->vars->att, Horde_Serialize::JSON);\n\n // If this is a recurring event, need to create an exception.\n if ($oevent->recurs()) {\n $this->_addException($oevent, $attributes);\n $event = $this->_copyEvent($oevent, null, $attributes);\n } else {\n $event = clone($oevent);\n }\n\n foreach ($attributes as $attribute => $value) {\n switch ($attribute) {\n case 'start':\n $newDate = new Horde_Date($value);\n $newDate->setTimezone($event->start->timezone);\n $event->start = clone($newDate);\n break;\n\n case 'end':\n $newDate = new Horde_Date($value);\n $newDate->setTimezone($event->end->timezone);\n $event->end = clone($newDate);\n if ($event->end->hour == 23 &&\n $event->end->min == 59 &&\n $event->end->sec == 59) {\n $event->end->mday++;\n $event->end->hour = $event->end->min = $event->end->sec = 0;\n }\n break;\n\n case 'offDays':\n $event->start->mday += $value;\n $event->end->mday += $value;\n break;\n\n case 'offMins':\n $event->start->min += $value;\n $event->end->min += $value;\n break;\n }\n }\n\n $result = $this->_saveEvent($event, ($oevent->recurs() ? $oevent : null), $attributes);\n if ($this->vars->u) {\n Kronolith::sendITipNotifications($event, $GLOBALS['notification'], Kronolith::ITIP_REQUEST);\n }\n\n return $result;\n }",
"public function onJSONEvent($event,$jsonArray);",
"public abstract function handleNotificationEvent(NotificationEvent $event);",
"public function event()\n {\n return $this->event;\n }",
"public static function event($event = null)\n {\n }",
"public function Events_Notification_post() { \n $data = $this->_post_args;\n try {\n $this->load->library(\"api/Event_lib\");\n $s = new Event_lib;\n $result = $s->Event_notification($data);\n }\n catch(Exception $e)\n {\n $response['result']['status'] = 'error';\n $response['result']['response']\t= $e->getMessage();\n $this->response($response, $e->getCode());\n }\n header(\"Access-Control-Allow-Origin: *\");\n $this->response($result[0], $result[1]);\n }",
"public function onAfterMakeFeedDocumentPage($event) {\n\t\t$this->raiseEvent('onAfterMakeFeedDocumentPage', $event);\n\t}",
"protected function fetch()\n {\n if (!$this->valid) {\n return;\n }\n\n if (!$this->initialized) {\n $this->initialize();\n }\n\n $this->valid = false;\n\n $callback = $this->fetchCallback;\n $callback($this);\n\n if (!$this->valid) {\n $this->dispose();\n }\n\n }",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n /*\r\n $event->beforeDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (DragConfig $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function until($event, $payload = []);",
"public function getEvent(): Event\n {\n return $this->mainEvent;\n }",
"abstract public function postAction(Event $event): void;",
"public static function convert($_event)\n {\n\n }",
"public function add_event($_data){\r\n\t\t$args=$this->create_args($_data);\r\n\t\treturn($this->execute('add_event',$args));\r\n\t}",
"public function getEvent(): EventInterface;",
"public final function on( $eventName, $eventCallback ) {\n\t\t\t\n\t\t\tif ( !is_string( $eventName ) ) {\n\t\t\t\n\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventName: string expected');\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\tif ( !strlen( $eventName ) ) {\n\t\t\t\n\t\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventName: expected non-empty string');\n\t\t\t\n\t\t\t\t} else {\n\t\t\t\n\t\t\t\t\tif ( !is_callable( $eventCallback ) ) {\n\t\t\t\n\t\t\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventCallback: callable expected' );\n\t\t\t\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$this->events[ $eventName ] = isset( $this->events[ $eventName ] ) \n\t\t\t\t\t\t\t? $this->events[ $eventName ] \n\t\t\t\t\t\t\t: [];\n\n\t\t\t\t\t\t$this->events[ $eventName ][] = [\n\t\t\t\t\t\t\t'once' => false,\n\t\t\t\t\t\t\t'callback' => $eventCallback,\n\t\t\t\t\t\t\t'fireId' => 0\n\t\t\t\t\t\t];\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}"
] | [
"0.66770947",
"0.5849421",
"0.5740588",
"0.559159",
"0.5548758",
"0.55205244",
"0.5416467",
"0.5381586",
"0.5381523",
"0.5378508",
"0.53685445",
"0.5274704",
"0.524929",
"0.52185845",
"0.5216299",
"0.52126694",
"0.517701",
"0.51655966",
"0.51477677",
"0.514372",
"0.51234084",
"0.5103483",
"0.51001054",
"0.50893146",
"0.5088885",
"0.5037608",
"0.5035551",
"0.5017773",
"0.49722293",
"0.49424264",
"0.49409786",
"0.4922192",
"0.49004483",
"0.4896866",
"0.48954004",
"0.48939708",
"0.48822868",
"0.48669887",
"0.48584569",
"0.4855923",
"0.48529166",
"0.4841192",
"0.48390603",
"0.48377296",
"0.48286918",
"0.4799543",
"0.4796053",
"0.47832575",
"0.47626612",
"0.47483435",
"0.4735854",
"0.47225338",
"0.47099915",
"0.47028655",
"0.46958944",
"0.46919376",
"0.46797103",
"0.46774843",
"0.46701148",
"0.4664853",
"0.46556056",
"0.4646411",
"0.4646411",
"0.46456316",
"0.4639378",
"0.4637173",
"0.4630975",
"0.46293154",
"0.46286893",
"0.46217465",
"0.46217346",
"0.46195465",
"0.46193317",
"0.46116158",
"0.4592374",
"0.45829493",
"0.45767403",
"0.45754164",
"0.45700312",
"0.4557692",
"0.45566404",
"0.45528063",
"0.45414746",
"0.45361462",
"0.4523912",
"0.45222798",
"0.4516657",
"0.45146105",
"0.45139262",
"0.45130083",
"0.45099634",
"0.449987",
"0.4490297",
"0.4485667",
"0.44822645",
"0.44777438",
"0.4476612",
"0.4474419",
"0.4471702",
"0.44711047"
] | 0.52568674 | 12 |
Register a saving model event with the dispatcher. | public static function saving($callback, $priority = 0)
{
static::registerModelEvent('saving', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saved($model)\n {\n }",
"public function saving($model)\n {\n }",
"public function saved(Request $model)\n {\n if($model->isDirty($model->getStatusFieldName())){\n $this->recordHistory($model);\n $this->fireStatusEvent($model);\n }\n # Propagade tier changes\n if($model->isDirty('tier_id')){\n event(new PropagadeTier($model));\n }\n }",
"public function saving($model)\n\t{\n\t}",
"public function saved($model)\n\t{\n\t}",
"public function onSaveEvent(Event $event)\n {\n $this->raiseEvent('onSaveEvent', $event);\n }",
"public static function saved($callback, $priority = 0)\n {\n static::registerModelEvent('saved', $callback, $priority);\n }",
"public function onAfterSave();",
"public static function saved(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n static::listen(ModelEvent::UPDATED, $listener, $priority);\n }",
"public function save($model);",
"public function save(Model $model): void;",
"public function onBeforeSave($event);",
"public function save(Identifiable $model);",
"public function save( Application_Model_Interface $model );",
"public static function saving(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n static::listen(ModelEvent::UPDATING, $listener, $priority);\n }",
"protected static function registerModelEvent($event, $callback, $priority = 0)\n {\n if (isset(static::$dispatcher)) {\n $name = get_called_class();\n\n static::$dispatcher->listen(\"halcyon.{$event}: {$name}\", $callback, $priority);\n }\n }",
"public static function saving($callback)\n {\n self::listenEvent('saving', $callback);\n }",
"public function onSaveEntry(SproutForms_OnSaveEntryEvent $event)\n\t{\n\t\t$this->raiseEvent('onSaveEntry', $event);\n\t}",
"public function registerSaveChangesEventHook(IEventHook $hook)\n {\n $this->saveChangesHooks[] = $hook;\n }",
"protected function saveTranslation()\n {\n if (Config::get('translation.disable_save_event')) {\n $dispatcher = self::getEventDispatcher();\n self::unsetEventDispatcher();\n $this->save();\n if (Config::get('translation.translation_events')) {\n $this->fireModelEvent('translated', false);\n }\n self::setEventDispatcher($dispatcher);\n }\n\n $this->save();\n $this->fireModelEvent('translated', false);\n }",
"public function onSaving(Step $step): void\n {\n }",
"abstract public function save(Model $model);",
"public function afterSave()\n {\n\n }",
"public function save(): void\n {\n $this->em->persist($this->model);\n $this->em->flush();\n }",
"protected static function bootEvent()\n {\n static::saving(function (Item $model) {\n if (is_null($model->getAttributeFromArray('quantity_per_bundle'))) {\n $model->quantity_per_bundle = $model->getDenominationRelationValue()->quantity_per_bundle;\n }\n\n if (!$model->is_order_custom_quantity) {\n $model->quantity = $model->countQuantityAttribute();\n }\n });\n }",
"public static function saved($callback)\n {\n self::listenEvent('saved', $callback);\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"protected function hook_afterSave(){}",
"function _save_post_hook()\n {\n }",
"public function postSave() {}",
"public function registerDocumentModelEvent(ModelEvent $event)\n {\n if (!$this->enabled) {\n return;\n }\n if ((!($dbEvents = $this->getConfigValue('database', 'array')))) {\n return;\n }\n if (!in_array($event->getAction(), $dbEvents)) {\n return;\n }\n\n $data = (object) [\n 'class' => $event->getCollectionClass()\n ];\n\n /** @var AuditTracking $audit */\n $audit = new $this->documentName();\n $audit->setAction($event->getAction());\n $audit->setType('collection');\n $audit->setData($data);\n $audit->setLocation($this->globalRequestLocation);\n $audit->setCollectionId($event->getCollectionId());\n $audit->setCollectionName($event->getCollectionName());\n $audit->setCreatedAt(new \\DateTime());\n\n $this->events[] = $audit;\n }",
"public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"public function crudSaved()\n {\n $this->fireModelEvent('crudSaved', false);\n }",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}",
"function after_save() {}",
"public function onSave()\n {\n if (! ($this->anonymous_submitter == null xor $this->submitter === null)) {\n throw new \\RuntimeException(\n 'Event entity submitter and anonymous_submitter properties: '\n .' one must be null and the other not-null'\n );\n }\n if (! $this->getSubmitter() && !$this->getAnonymousSubmitter()->getAnonymity()) {\n throw new \\RuntimeException(sprintf(\n 'The request submitter of type \"%s\" cannot be anonymous. This may be a bug in the application\\'s input validation',\n (string)$this->getAnonymousSubmitter()\n ));\n }\n if (! ($this->anonymous_judge === null xor $this->judge === null)) {\n $debug = \"\\nanonymous_judge: \" .(is_null($this->anonymous_judge) ? \"null\" : \"not null\");\n $debug .= \"\\nJudge: \" .(is_null($this->judge) ? \"null\" : \"not null\");\n throw new \\RuntimeException(\n 'Event entity judge and anonymous_judge properties: '\n .' one must be null and the other not-null. ' . $debug\n );\n }\n }",
"public function save($model, $value, $loaded);",
"public function saving(Step $step): void\n {\n $handler = $step->handler();\n\n // Ensures that updated model event is fired and\n // gives us the benefit of knowing when it was last saved.\n $step->setAttribute('saved_at', Carbon::now());\n\n $handler->onSaving($step);\n }",
"public function afterSave(){\n\t}",
"public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}",
"public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"public function afterSave($event)\n {\n if ($this->autosave && $this->owner instanceof ActiveRecord && !$this->owner->hasErrors()) {\n $this->saveGallery($this->owner);\n }\n }",
"protected function afterSave() {\n\n }",
"public function onBeforeSave();",
"public function getModelEvents();",
"public function save($model) {\n return parent::save($model);\n }",
"public function onSave()\n {\n // first, use the default onSave()\n $object = parent::onSave();\n \n // if the object has been saved\n// if ($object instanceof Voo)\n// {\n// // $source_file = 'tmp/'.$object->photo_path;\n// // $target_file = 'images/' . $object->photo_path;\n// // $finfo = new finfo(FILEINFO_MIME_TYPE);\n// \n// // if the user uploaded a source file\n// if (file_exists($source_file) AND $finfo->file($source_file) == 'image/png')\n// {\n// // move to the target directory\n// // rename($source_file, $target_file);\n// \n// try\n// {\n// TTransaction::open($this->database);\n// // update the photo_path\n// // $object->photo_path = 'images/'.$object->photo_path;\n// $object->store();\n// TTransaction::close();\n// }\n// catch (Exception $e) // in case of exception\n// {\n// new TMessage('error', '<b>Error</b> ' . $e->getMessage());\n// TTransaction::rollback();\n// }\n// }\n// }\n }",
"function onSave()\n {\n $object = parent::onSave();\n }",
"public static function boot()\n {\n parent::boot();\n\n static::saving(function ($model) {\n $model->slug = $model->id .'-'. str_slug($model->title);\n });\n }",
"public static function bootHasAttributeEvents()\n {\n // Event fired after a model has been successfully saved (inserted or updated) by Laravel\n static::saved(function($model) {\n $model->fireAttributeEvents();\n $model->callAttributeSavedMethods();\n });\n }",
"public function getDidSave() {}",
"public static function beforeSave($event)\r\n {\r\n }",
"protected function postSaveHook(BaseDatabaseModel $model, $validData = array())\n {\n return;\n }",
"public function post_save(){\n\n }",
"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 final function save() {\n }",
"public function onBeforeSaveEntry(SproutForms_OnBeforeSaveEntryEvent $event)\n\t{\n\t\t$this->raiseEvent('onBeforeSaveEntry', $event);\n\t}",
"public function save(Authenticatable $model);",
"function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}",
"function save(&$model);",
"public final function save()\n {\n }",
"public function afterSaveCommit(): void\n {\n }",
"public function onSaved()\n {\n $this->dispatch(new AssociateActivationRoles($this));\n }",
"public function save() {}",
"public function save() {}",
"public function storeModel(Model &$model)\n {\n }",
"protected function finishSave()\n {\n $this->fireModelEvent('saved', false);\n $this->syncOriginal();\n }",
"public function save() {}",
"public function saved(MActivityRule $model)\n\t{\n\t}",
"protected function _postSave()\r\n\t{\r\n\t}",
"protected function initializeSaveAction()\n {\n $propertyMappingConfiguration = $this->arguments['event']->getPropertyMappingConfiguration();\n $propertyMappingConfiguration->forProperty('date')->setTypeConverterOption('TYPO3\\\\CMS\\\\Extbase\\\\Property\\\\TypeConverter\\\\DateTimeConverter', \\TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd.m.y');\n $propertyMappingConfiguration->forProperty('fromTime')->setTypeConverter($this->objectManager->get('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter'))->setTypeConverterOption('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter', \\Visol\\Easyvote\\Property\\TypeConverter\\TimestampConverter::CONFIGURATION_DATE_FORMAT, 'H:i');\n }",
"public static function onSave($param)\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $data = (object) $param;\n \n $object = new CalendarEvent;\n $object->color = $data->color;\n $object->id = $data->id;\n $object->title = $data->title;\n $object->description = $data->description;\n $object->start_time = $data->start_date . ' ' . str_pad($data->start_hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($data->start_minute, 2, '0', STR_PAD_LEFT) . ':00';\n $object->end_time = $data->end_date . ' ' . str_pad($data->end_hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($data->end_minute, 2, '0', STR_PAD_LEFT) . ':00';\n \n $object->store(); // stores the object\n \n TTransaction::close(); // close the transaction\n \n TScript::create(\"Template.closeRightPanel()\");\n \n $posAction = new TAction(array('FullCalendarSplitView', 'onReload'));\n $posAction->setParameter('target_container', 'adianti_div_content');\n $posAction->setParameter('view', $data->view);\n $posAction->setParameter('date', $data->start_date);\n \n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"public function model_after_save(Jam_Model $model, Jam_Event_Data $data)\n\t{\n\t\t$model->is_just_frozen = FALSE;\n\t}",
"public function save()\n {\n // For V2.0\n }",
"protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }",
"public static function bootHasSlug()\n {\n static::saving(function ($model) {\n $model->addSlug();\n });\n }",
"public function bootSaving() {\n $this->setDynamicSlug ( 'name' );\n }",
"public function save()\n {\n }",
"public function save() {\n }",
"public function save() {\n }",
"protected function saving() {\n // This will get reimplemented by children when necessary\n }",
"public function save() {\n }",
"protected function onBeforeSave()\n {\n }",
"public function onSaved(Step $step): void\n {\n }",
"public static function save(AbstractModel $model)\n {\n (new Save())\n ->add($model)\n ->execute();\n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function persist()\n {\n\n $this->persistor->persist(\n $this->event,\n $this->relatedEntities,\n $this->eventRequest->getApplication(),\n $this->eventRequest->getAccount(),\n $this->eventRequest->getProduct(),\n $this->eventRequest->appendCustomer\n );\n\n }",
"public function saved($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n\n if (! $this->forceSaving && ! $model->searchIndexShouldBeUpdated()) {\n return;\n }\n\n if (! $model->shouldBeSearchable()) {\n if ($model->wasSearchableBeforeUpdate()) {\n $model->unsearchable();\n }\n\n return;\n }\n\n $model->searchable();\n }",
"public function saved($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n\n if (! $model->shouldBeSearchable()) {\n $model->unsearchable();\n\n return;\n }\n\n $model->searchable();\n }",
"public function saving(Model $model)\n {\n (new Slugger($model))->slug();\n }",
"abstract public static function saved($callback);",
"public function afterSave(Model $model, $created) {\n\t\tparent::afterSave($model, $created);\n\t}",
"public function save()\n {\n }",
"public function save()\n {\n }",
"public static function bootFiler()\n {\n static::saving(function ($model) {\n $model->upload($model);\n });\n }",
"function save()\n {\n }",
"function save()\n {\n }",
"public function beforeSave(Model $model) {\n\t\tparent::beforeSave($model);\n }",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }"
] | [
"0.6438325",
"0.6411021",
"0.6326963",
"0.6324801",
"0.63191456",
"0.6296617",
"0.6233157",
"0.6112213",
"0.60999864",
"0.6091059",
"0.60501283",
"0.6040872",
"0.6026271",
"0.6013151",
"0.6005255",
"0.59395146",
"0.5853004",
"0.5838897",
"0.57907546",
"0.5782817",
"0.57782614",
"0.5772433",
"0.5743631",
"0.57398665",
"0.5729582",
"0.57285243",
"0.57259077",
"0.57259077",
"0.57205546",
"0.57145196",
"0.5714032",
"0.57030404",
"0.5676936",
"0.56649655",
"0.5655876",
"0.56370765",
"0.56158483",
"0.5612988",
"0.5590527",
"0.55746377",
"0.5561843",
"0.5539911",
"0.55371547",
"0.55202883",
"0.55194014",
"0.54920936",
"0.548875",
"0.5478966",
"0.5469915",
"0.5460956",
"0.54174036",
"0.54120606",
"0.5410249",
"0.5397477",
"0.5395575",
"0.5353669",
"0.5350111",
"0.5349983",
"0.5345163",
"0.5338911",
"0.5335168",
"0.53077006",
"0.5306649",
"0.5291286",
"0.5278898",
"0.5278898",
"0.52777594",
"0.52775687",
"0.5277326",
"0.5271594",
"0.52713823",
"0.5267685",
"0.526532",
"0.52611107",
"0.52504826",
"0.5249312",
"0.52398926",
"0.5238603",
"0.52306074",
"0.52287525",
"0.52287525",
"0.5217033",
"0.52142584",
"0.5208108",
"0.5199686",
"0.5181231",
"0.51795006",
"0.5178896",
"0.516553",
"0.51597685",
"0.51391816",
"0.5124815",
"0.5118726",
"0.5111715",
"0.5111715",
"0.51113284",
"0.5108334",
"0.5108334",
"0.5107296",
"0.51025826"
] | 0.6145208 | 7 |
Register a saved model event with the dispatcher. | public static function saved($callback, $priority = 0)
{
static::registerModelEvent('saved', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function registerDocumentModelEvent(ModelEvent $event)\n {\n if (!$this->enabled) {\n return;\n }\n if ((!($dbEvents = $this->getConfigValue('database', 'array')))) {\n return;\n }\n if (!in_array($event->getAction(), $dbEvents)) {\n return;\n }\n\n $data = (object) [\n 'class' => $event->getCollectionClass()\n ];\n\n /** @var AuditTracking $audit */\n $audit = new $this->documentName();\n $audit->setAction($event->getAction());\n $audit->setType('collection');\n $audit->setData($data);\n $audit->setLocation($this->globalRequestLocation);\n $audit->setCollectionId($event->getCollectionId());\n $audit->setCollectionName($event->getCollectionName());\n $audit->setCreatedAt(new \\DateTime());\n\n $this->events[] = $audit;\n }",
"protected static function registerModelEvent($event, $callback, $priority = 0)\n {\n if (isset(static::$dispatcher)) {\n $name = get_called_class();\n\n static::$dispatcher->listen(\"halcyon.{$event}: {$name}\", $callback, $priority);\n }\n }",
"public function saved($model)\n {\n }",
"public function saved($model)\n\t{\n\t}",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}",
"public function saved(Request $model)\n {\n if($model->isDirty($model->getStatusFieldName())){\n $this->recordHistory($model);\n $this->fireStatusEvent($model);\n }\n # Propagade tier changes\n if($model->isDirty('tier_id')){\n event(new PropagadeTier($model));\n }\n }",
"protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }",
"public function getModelEvents();",
"public function onBeforeSave($event);",
"public static function saved(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n static::listen(ModelEvent::UPDATED, $listener, $priority);\n }",
"protected static function bootEvent()\n {\n static::saving(function (Item $model) {\n if (is_null($model->getAttributeFromArray('quantity_per_bundle'))) {\n $model->quantity_per_bundle = $model->getDenominationRelationValue()->quantity_per_bundle;\n }\n\n if (!$model->is_order_custom_quantity) {\n $model->quantity = $model->countQuantityAttribute();\n }\n });\n }",
"public function crudSaved()\n {\n $this->fireModelEvent('crudSaved', false);\n }",
"public function onAfterSave();",
"public function saving($model)\n\t{\n\t}",
"public function saving($model)\n {\n }",
"public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }",
"public function save($model);",
"public function save(Identifiable $model);",
"public function save(Model $model): void;",
"public function onSaveEvent(Event $event)\n {\n $this->raiseEvent('onSaveEvent', $event);\n }",
"public function registerSaveChangesEventHook(IEventHook $hook)\n {\n $this->saveChangesHooks[] = $hook;\n }",
"public function save( Application_Model_Interface $model );",
"public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}",
"public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }",
"public function onSaved()\n {\n $this->dispatch(new AssociateActivationRoles($this));\n }",
"protected function saveTranslation()\n {\n if (Config::get('translation.disable_save_event')) {\n $dispatcher = self::getEventDispatcher();\n self::unsetEventDispatcher();\n $this->save();\n if (Config::get('translation.translation_events')) {\n $this->fireModelEvent('translated', false);\n }\n self::setEventDispatcher($dispatcher);\n }\n\n $this->save();\n $this->fireModelEvent('translated', false);\n }",
"public static function bootHasAttributeEvents()\n {\n // Event fired after a model has been successfully saved (inserted or updated) by Laravel\n static::saved(function($model) {\n $model->fireAttributeEvents();\n $model->callAttributeSavedMethods();\n });\n }",
"public static function saved($callback)\n {\n self::listenEvent('saved', $callback);\n }",
"public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }",
"protected function fireModelEvent(Event $event)\n {\n static::getEventDispatcher()->fire($event);\n }",
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"public function save($model, $value, $loaded);",
"function _save_post_hook()\n {\n }",
"protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\n\t}",
"public static function saving($callback, $priority = 0)\n {\n static::registerModelEvent('saving', $callback, $priority);\n }",
"public function storeModel(Model &$model)\n {\n }",
"public function afterSave()\n {\n\n }",
"public function saved(MActivityRule $model)\n\t{\n\t}",
"function after_save() {}",
"public function onEvent($event)\n\t{\n\t\tif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_BEFORE_INSERT)\n\t\t{\n\t\t\t/**\n\t\t\t * If document_id is set in the model the service will first try to pull \n\t\t\t * the document to update it. If it is unable to get the record \n\t\t\t * (it will be since this is an insert) it will do nothing and \n\t\t\t * the document will not be inserted.\n\t\t\t */\n\t\t\t$event->model->document_id = NULL;\n\t\t\t$result = $this->saveDocument($event->model);\n\t\t\t$event->model->document_id = $result->item->document_id;\n\t\t}\n\t\telseif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_UPDATE)\n\t\t{\n\t\t\t$this->saveDocument($event->model);\n\t\t}\n\t}",
"public static function saving(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n static::listen(ModelEvent::UPDATING, $listener, $priority);\n }",
"public function storedModel(Model &$model)\n {\n }",
"protected function postSaveHook(BaseDatabaseModel $model, $validData = array())\n {\n return;\n }",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"public function save(): void\n {\n $this->em->persist($this->model);\n $this->em->flush();\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"protected function hook_afterSave(){}",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public static function boot()\n {\n self::saved(function (self $model) {\n $model->syncProductList();\n });\n\n parent::boot();\n }",
"public function onBeforeSave();",
"public static function bootNotifiesMentionees()\n\t{\n\t\tstatic::saved(function ($model) {\n\t\t\tdispatch(new NotifyMentioneesJob($model));\n\t\t});\n\t}",
"public static function boot()\n {\n parent::boot();\n\n static::saving(function ($model) {\n $model->slug = $model->id .'-'. str_slug($model->title);\n });\n }",
"public static function beforeSave($event)\r\n {\r\n }",
"public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"abstract public function save(Model $model);",
"public function postSave() {}",
"public static function onSave($param)\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $data = (object) $param;\n \n $object = new CalendarEvent;\n $object->color = $data->color;\n $object->id = $data->id;\n $object->title = $data->title;\n $object->description = $data->description;\n $object->start_time = $data->start_date . ' ' . str_pad($data->start_hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($data->start_minute, 2, '0', STR_PAD_LEFT) . ':00';\n $object->end_time = $data->end_date . ' ' . str_pad($data->end_hour, 2, '0', STR_PAD_LEFT) . ':' . str_pad($data->end_minute, 2, '0', STR_PAD_LEFT) . ':00';\n \n $object->store(); // stores the object\n \n TTransaction::close(); // close the transaction\n \n TScript::create(\"Template.closeRightPanel()\");\n \n $posAction = new TAction(array('FullCalendarSplitView', 'onReload'));\n $posAction->setParameter('target_container', 'adianti_div_content');\n $posAction->setParameter('view', $data->view);\n $posAction->setParameter('date', $data->start_date);\n \n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"function eventRegister($eventName, EventListener $listener);",
"public function afterSave(){\n\t}",
"private function registerEventStore() : void\n {\n $this->app->bind(IlluminateEventStore::class, function ($app) {\n $connection = $app->make(Connection::class);\n $serializer = $app->make(Serializer::class);\n $eventStoreTable = $app->config->get('event_sourcing.event_store_table');\n\n return new IlluminateEventStore(\n $connection,\n $serializer,\n $eventStoreTable\n // decorators (we could decorate the stream with account_id)\n );\n });\n\n $this->app->bind(\n EventStore::class,\n IlluminateEventStore::class\n );\n }",
"public function onSaved(Step $step): void\n {\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n $notification = self::find($model->id);\n broadcast(new SiteNotification($notification));\n });\n\n }",
"public function afterSave(Model $model, $created) {\n\t\tparent::afterSave($model, $created);\n\t}",
"public function onSaving(Step $step): void\n {\n }",
"public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}",
"protected function afterSave() {\n\n }",
"function onSave()\n {\n $object = parent::onSave();\n }",
"public function model_after_save(Jam_Model $model, Jam_Event_Data $data)\n\t{\n\t\t$model->is_just_frozen = FALSE;\n\t}",
"public function persist()\n {\n\n $this->persistor->persist(\n $this->event,\n $this->relatedEntities,\n $this->eventRequest->getApplication(),\n $this->eventRequest->getAccount(),\n $this->eventRequest->getProduct(),\n $this->eventRequest->appendCustomer\n );\n\n }",
"public function afterDispatch(DispatchEvent $event);",
"public function saved($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n\n if (! $model->shouldBeSearchable()) {\n $model->unsearchable();\n\n return;\n }\n\n $model->searchable();\n }",
"public function storeEvent($event)\n {\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n }",
"protected function initializeSaveAction()\n {\n $propertyMappingConfiguration = $this->arguments['event']->getPropertyMappingConfiguration();\n $propertyMappingConfiguration->forProperty('date')->setTypeConverterOption('TYPO3\\\\CMS\\\\Extbase\\\\Property\\\\TypeConverter\\\\DateTimeConverter', \\TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd.m.y');\n $propertyMappingConfiguration->forProperty('fromTime')->setTypeConverter($this->objectManager->get('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter'))->setTypeConverterOption('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter', \\Visol\\Easyvote\\Property\\TypeConverter\\TimestampConverter::CONFIGURATION_DATE_FORMAT, 'H:i');\n }",
"protected function collectModelEvent($event, $model)\n\t{\n\t\t$lastQuery = ($queryCount = count($this->queries)) ? $this->queries[$queryCount - 1] : null;\n\n\t\t$action = [\n\t\t\t'model' => $modelClass = get_class($model),\n\t\t\t'key' => $this->getModelKey($model),\n\t\t\t'action' => $event,\n\t\t\t'attributes' => $this->collectModelsRetrieved && $event == 'retrieved' ? $model->getOriginal() : [],\n\t\t\t'changes' => $this->collectModelsActions && method_exists($model, 'getChanges') ? $model->getChanges() : [],\n\t\t\t'time' => microtime(true) / 1000,\n\t\t\t'query' => $lastQuery ? $lastQuery['query'] : null,\n\t\t\t'duration' => $lastQuery ? $lastQuery['duration'] : null,\n\t\t\t'connection' => $lastQuery ? $lastQuery['connection'] : null,\n\t\t\t'trace' => null,\n\t\t\t'tags' => []\n\t\t];\n\n\t\tif ($lastQuery) $this->queries[$queryCount - 1]['model'] = $modelClass;\n\n\t\tif (! $this->passesFilters([ $action ], 'models-early')) return;\n\n\t\t$this->incrementModelsCount($action['action'], $action['model']);\n\n\t\tif (! $this->collectModelsActions) return;\n\t\tif (! $this->collectModelsRetrieved && $event == 'retrieved') return;\n\t\tif (! $this->passesFilters([ $action ], 'models')) return;\n\n\t\t$action['trace'] = (new Serializer)->trace(StackTrace::get()->resolveViewName());\n\n\t\t$this->modelsActions[] = $action;\n\t}",
"public function setModelDispatcher(ModelDispatcher $modelDispatcher)\n {\n $this->modelDispatcher = $modelDispatcher;\n }",
"public function subscribe($event)\n {\n $event->listen('eloquent.saved: Setting', 'App\\Observers\\SettingObserver@saved');\n }",
"public static function boot()\n {\n parent::boot();\n static::creating(function ($model) {\n $model->key = 'store_' . md5(Str::random(14) . time());\n });\n }",
"public static function bootHasSlug()\n {\n static::saving(function ($model) {\n $model->addSlug();\n });\n }",
"public function getDidSave() {}",
"public function post_save(){\n\n }",
"public function afterSave($event)\n {\n if ($this->autosave && $this->owner instanceof ActiveRecord && !$this->owner->hasErrors()) {\n $this->saveGallery($this->owner);\n }\n }",
"public function afterDispatch(MvcEvent $event) {\n\t}",
"public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'intercept_save_update_notification' ] );\n\t}",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n {\n $event->addNewData(self::EVENT_MATCH_RESULT_KEY, TRUE);\n switch ($event->getEntity()) {\n case Mage_Catalog_Model_Product::ENTITY:\n $this->_registerCatalogProductEvent($event);\n break;\n case Mage_Catalog_Model_Category::ENTITY:\n $this->_registerCatalogCategoryEvent($event);\n break;\n case Mage_Catalog_Model_Convert_Adapter_Product::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n case Mage_Core_Model_Config_Data::ENTITY:\n $stores = TRUE;\n if ($event->getDataObject()->getScope() == 'stores') {\n $stores = array($event->getDataObject()->getScopeId());\n } else if ($event->getDataObject()->getScope() == 'websites') {\n $stores = Mage::app()->getWebsite($event->getDataObject()->getScopeId())->getStoreIds();\n }\n if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsUpdate)) {\n $event->addNewData('algoliasearch_update_settings', $stores);\n } else if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsReindex)) {\n $event->addNewData('algoliasearch_reindex_all', $stores);\n }\n break;\n case Mage_Core_Model_Store::ENTITY:\n case Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY:\n case Mage_Core_Model_Store_Group::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n }\n }",
"protected function on_new_model_generated(Jelly_Model $model)\n\t{\n\t\t// Nothing here but subclasses can implement...\n\t}",
"public function save($model) {\n return parent::save($model);\n }",
"public static function saved($event) {\n\n\t\t$account = $event->getSubject();\n\t\t$new = $event['new'];\n\n\t}",
"public function saved($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n\n if (! $this->forceSaving && ! $model->searchIndexShouldBeUpdated()) {\n return;\n }\n\n if (! $model->shouldBeSearchable()) {\n if ($model->wasSearchableBeforeUpdate()) {\n $model->unsearchable();\n }\n\n return;\n }\n\n $model->searchable();\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"public function postSave()\n {\n // check if the model already exists\n if ((!isset($this->revisionEnabled) || $this->revisionEnabled)) {\n // if it does, it means we're updating\n\n $changes_to_record = $this->changedRevisionableFields();\n\n $revisions = array();\n\n foreach ($changes_to_record as $key => $change) {\n\n $revisions[] = array(\n 'revisionable_type' => get_class($this),\n 'revisionable_id' => $this->getKey(),\n 'key' => $key,\n 'old_value' => array_get($this->originalData, $key),\n 'new_value' => $this->updatedData[$key],\n 'user_id' => $this->getSystemUserId(),\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime(),\n 'activity_id' => $this->getActivityId()\n );\n }\n\n if (count($revisions) > 0) {\n $revision = new Revision();\n \\DB::table($revision->getTable())->insert($revisions);\n }\n\n }\n\n }",
"public static function synced ($callback, $priority = 0) {\n static::registerModelEvent('synced', $callback, $priority);\n }",
"public function onSaveEntry(SproutForms_OnSaveEntryEvent $event)\n\t{\n\t\t$this->raiseEvent('onSaveEntry', $event);\n\t}",
"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 }",
"protected function save_instance() {\n\t\twponion_callback( 'wponion_' . $this->module . '_registry', array( &$this ) );\n\t}",
"private function dispatchModelEvent($action, $collection)\n {\n if (!($this->repository instanceof DocumentRepository)) {\n return;\n }\n if (!method_exists($collection, 'getId')) {\n return;\n }\n\n $event = new ModelEvent();\n $event->setCollectionId($collection->getId());\n $event->setActionByDispatchName($action);\n $event->setCollectionName($this->repository->getClassMetadata()->getCollection());\n $event->setCollectionClass($this->repository->getClassName());\n $event->setCollection($collection);\n\n $this->eventDispatcher->dispatch($event, $action);\n }",
"public function onManagerSaved(ManagerSaved $event)\n {\n // No need to do this when migrating with artisan or when log out\n if (!\\App::runningInConsole() && ($this->request->route()->getName() != \"logout\")) {\n\n // If this is an update request:\n if (is_object($this->request->route('manager'))) {\n\n //reset the manager's ip addresses and authorized work locations lists\n $event->manager->ipAddresses()->detach();\n if (!$event->manager->company_wide_authority) {\n $event->manager->workLocations()->detach();\n }\n\n // Update the authority of the manager\n $this->authorityAsssignation($event->manager->managerAuthority);\n\n } else { // If this is an make new request\n\n // Assign a new authority for the new manager\n $authority = new \\App\\ManagerAuthority();\n $authority->manager()->associate($event->manager);\n $this->authorityAsssignation($authority);\n\n }\n\n // Associate the new ip addresses list\n $ip_array = preg_split('/\\s+/', $this->request->input('ip_address'));\n foreach ($ip_array as $address) {\n $event->manager->ipAddresses()->attach(IpAddress::firstOrCreate(['value' => $address]));\n }\n\n // In case this manager does not have the company wide authority, associate the authorized work locations list\n if (!$event->manager->company_wide_authority) {\n $event->manager->workLocations()->attach($this->request->input('authorized_work_locations'));\n }\n }\n }",
"public function onSave()\n {\n if (! ($this->anonymous_submitter == null xor $this->submitter === null)) {\n throw new \\RuntimeException(\n 'Event entity submitter and anonymous_submitter properties: '\n .' one must be null and the other not-null'\n );\n }\n if (! $this->getSubmitter() && !$this->getAnonymousSubmitter()->getAnonymity()) {\n throw new \\RuntimeException(sprintf(\n 'The request submitter of type \"%s\" cannot be anonymous. This may be a bug in the application\\'s input validation',\n (string)$this->getAnonymousSubmitter()\n ));\n }\n if (! ($this->anonymous_judge === null xor $this->judge === null)) {\n $debug = \"\\nanonymous_judge: \" .(is_null($this->anonymous_judge) ? \"null\" : \"not null\");\n $debug .= \"\\nJudge: \" .(is_null($this->judge) ? \"null\" : \"not null\");\n throw new \\RuntimeException(\n 'Event entity judge and anonymous_judge properties: '\n .' one must be null and the other not-null. ' . $debug\n );\n }\n }",
"public function boot()\n {\n Location::saved(function ($location) {\n if ($location->original['home'] != $location->attributes['home']) { //if record has changed\n event(new LocationHomeStateChanged($location));\n }\n });\n\n Location::saved(function ($location) {\n //comparing dates so the carbon comparison is used\n if (Carbon::createFromTimestamp($location->original['last_movement'])->ne(Carbon::createFromTimestamp($location->attributes['last_movement']))) { //if record has changed\n event(new LocationLastMovementChanged($location));\n }\n });\n }",
"public function onModelDeleted($model)\r\n {\r\n $this->onModelSaved($model);\r\n }"
] | [
"0.62092125",
"0.61309016",
"0.6070825",
"0.60432816",
"0.59615713",
"0.5932077",
"0.5797198",
"0.5778074",
"0.570524",
"0.5701168",
"0.5624102",
"0.55844367",
"0.5566649",
"0.5544086",
"0.552783",
"0.5470068",
"0.54608333",
"0.54426664",
"0.5440202",
"0.54366744",
"0.54315394",
"0.5430406",
"0.5409721",
"0.5378611",
"0.53504676",
"0.532446",
"0.5310911",
"0.5282484",
"0.5252917",
"0.5233423",
"0.5232993",
"0.5224459",
"0.52242684",
"0.5207997",
"0.52062666",
"0.51999354",
"0.51922584",
"0.51870555",
"0.5184709",
"0.51824445",
"0.51769626",
"0.5167503",
"0.5163497",
"0.51630986",
"0.5161421",
"0.51448065",
"0.51448065",
"0.5129574",
"0.5123017",
"0.51170015",
"0.5103807",
"0.5099364",
"0.50937814",
"0.50901747",
"0.50688547",
"0.50628793",
"0.5052507",
"0.5046244",
"0.50399035",
"0.50338143",
"0.50249165",
"0.5020741",
"0.50166345",
"0.5011141",
"0.5010625",
"0.4998962",
"0.49832186",
"0.49726713",
"0.4963415",
"0.49502605",
"0.4950079",
"0.49471563",
"0.49399236",
"0.49307674",
"0.49289957",
"0.4927903",
"0.492723",
"0.49242172",
"0.49087793",
"0.49087667",
"0.4908707",
"0.4894273",
"0.48870182",
"0.48781407",
"0.4871394",
"0.486717",
"0.48592296",
"0.4858099",
"0.4855762",
"0.48501748",
"0.48472875",
"0.48394337",
"0.48388487",
"0.4836861",
"0.4826171",
"0.48231968",
"0.4822018",
"0.48184618",
"0.4817678",
"0.48171163"
] | 0.5833526 | 6 |
Register an updating model event with the dispatcher. | public static function updating($callback, $priority = 0)
{
static::registerModelEvent('updating', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updated($model)\n {\n }",
"public function updated(Registration $model)\n {\n if($model->isDirty('email')){\n # Fire the events\n $this->fireStatusEvents($model);\n }\n }",
"public function updating($model)\n\t{\n\t}",
"public function updatedModel(Model &$model)\n {\n }",
"public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"public static function updated($callback, $priority = 0)\n {\n static::registerModelEvent('updated', $callback, $priority);\n }",
"public function getModelEvents();",
"abstract protected function updateModel();",
"public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }",
"public static function updated(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::UPDATED, $listener, $priority);\n }",
"public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}",
"public function update(RegistrationPostUpdatedEvent $event): void\n {\n }",
"public function updateModel(Model &$model)\n {\n }",
"function onModelUpdated($object, $data){\n // $object is the object with the updated data\n // A Ticket was updated\n if(get_class($object) === \"Ticket\"){\n $ticket = $object;\n // Authenticate to Trello\n $config = $this->getConfig();\n $client = new Client();\n $client->authenticate($config->get('trello_api_key'), $config->get('trello_api_token'), Client::AUTH_URL_CLIENT_ID);\n\n // If the status was updated\n if(isset($data['dirty']['status_id'])){\n // $data['dirty']['status_id'] - is the old status id\n // $ticket->getStatusId(); is the new status id\n\n // Matching the status in OSTicket to a List in Trello\n $trelloCardId = TrelloPlugin::getTrelloCardId($ticket, $client, $config);\n $trelloListId = TrelloPlugin::getTrelloListId($ticket->getStatusId(), $client, $config);\n if(!empty($trelloCardId) && !empty($trelloListId)){\n // Updating the list/status in Trello\n $client->cards()->setList($trelloCardId, $trelloListId);\n }\n }\n }\n }",
"public function updated(ProgramLocation $model)\n {\n $contactInformation = [\n 'contact_name',\n 'contact_email',\n 'contact_phone',\n ];\n\n if($model->isDirty($contactInformation)){\n event (new UpdatedContactInformation($model));\n }\n }",
"function update($unique_id, $model)\n {\n }",
"public function update($model) :bool;",
"function update($field, $value, $model)\n {\n }",
"public function updated(Auditable $model)\n {\n // Ignore the updated event when restoring\n if (!static::$restoring) {\n Auditor::execute($model->setAuditEvent('updated'));\n }\n }",
"protected function fireModelEvent(Event $event)\n {\n static::getEventDispatcher()->fire($event);\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"public function update(Model $model, array $attributes);",
"public function onUpdate();",
"public function onUpdate();",
"public function onUpdate();",
"public function updated(Dispatch $dispatch)\n {\n //\n }",
"public static function updating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::UPDATING, $listener, $priority);\n }",
"function update(){\n\t\t$this->model->update();\n\t}",
"public static function postUpdate(Event $event){\n $io = $event->getIO();\n $io->write(\"postUpdate event triggered.\");\n }",
"public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }",
"public function update($id, Model $model);",
"public function updated(MActivityRule $model)\n\t{\n\t}",
"public function update(TokenUpdateResponseModel $responseModel): ViewModel;",
"public function onUpdate(Event $e)\n {\n /* @var $post \\Blog\\Entity\\PostInterface */\n $post = $e->getParam('post');\n $instance = $post->getInstance();\n\n if ($post->getId() === null) {\n $this->getAliasManager()->flush($post);\n }\n\n $url = $this->getAliasManager()->getRouter()->assemble(\n ['post' => $post->getId()],\n ['name' => 'blog/post/view']\n );\n\n $this->getAliasManager()->autoAlias('blogPost', $url, $post, $instance);\n }",
"public function updating()\n {\n # code...\n }",
"public function update(Request $request, object $model): bool;",
"public static function updating($callback)\n {\n self::listenEvent('updating', $callback);\n }",
"protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\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 static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }",
"abstract public function update(&$sender, $arg);",
"public function updateAction()\n {\n }",
"public function updating(MActivityRule $model)\n\t{\n\t}",
"public function actionUpdate() {}",
"public function actionUpdate() {}",
"public function update(User $model);",
"public function postUpdate(Model $model, $entry) {\n $modelName = $model->getName();\n $id = $entry->getId();\n\n if (isset($this->preUpdateFields[$modelName][$id])) {\n $preUpdateFields = $this->preUpdateFields[$modelName][$id];\n\n unset($this->preUpdateFields[$modelName][$id]);\n if (!$this->preUpdateFields[$modelName]) {\n unset($this->preUpdateFields[$modelName]);\n }\n if (!$this->preUpdateFields) {\n unset($this->preUpdateFields);\n }\n } else {\n $preUpdateFields = null;\n }\n\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n $logModel->logUpdate($model, $entry, $preUpdateFields);\n }",
"protected function onUpdate(): Update\r\n {\r\n }",
"public function update()\n {\n # code...\n }",
"public function updating(Model $model)\n {\n if(Schema::hasColumn($model->getTable(), \"updated_by\")) {\n $model->updated_by = Auth::user()->id;\n }\n if(Schema::hasColumn($model->getTable(), \"updated_at\")) {\n $model->updated_at = date('Y-m-d h:i:s');\n }\n }",
"public function update () {\n\n }",
"public static function updated($callback)\n {\n self::listenEvent('updated', $callback);\n }",
"public function testUpdateObserver() {\n\t\t$this->testSave();\n\t\t/** @var \\arConnector $observerConnector */\n\t\t$observerConnector = Mockery::namedMock(\"observerConnectorMock\", \\arConnector::class);\n\n\t\t\\arConnectorMap::register(new BucketContainer(), $observerConnector);\n\n\t\t// Observer is updated after tasks are added.\n\t\t$observerConnector->shouldReceive(\"read\")->once()->andReturn(1);\n\t\t$observerConnector->shouldReceive(\"update\")->once()->andReturn(true);\n\n\t\t$this->persistence->setConnector($observerConnector);\n\t\t$this->persistence->updateBucket($this->bucket);\n\t}",
"public function update() {\r\n }",
"public function actionUpdate($name, $model = null)\n\t{\n\t\treturn parent::actionUpdate($name, $model = null);\n\t}",
"public function doUpdate() {\n\t\ttry {\n\t\t\tcall_user_func_array( $this->doUpdateFunction, $this->arguments );\n\t\t} catch ( Exception $ex ) {\n\t\t\t$this->exceptionHandler->handleException( $ex, 'data-update-failed',\n\t\t\t\t'A data update callback triggered an exception' );\n\t\t}\n\t}",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"protected function updateAction()\n {\n }",
"public function update()\r\n {\r\n //\r\n }",
"public function update(){\n\n }",
"public function update(){\n\n }",
"public function after_update() {}",
"protected static function registerModelEvent($event, $callback, $priority = 0)\n {\n if (isset(static::$dispatcher)) {\n $name = get_called_class();\n\n static::$dispatcher->listen(\"halcyon.{$event}: {$name}\", $callback, $priority);\n }\n }",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function update()\n {\n\n }",
"public function update()\n {\n\n }",
"public function update()\n {\n //\n }",
"public function update()\n {\n //\n }",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"public function _get_update_callback()\n {\n }",
"function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }",
"public function actionUpdate($id)\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n \n\t\t$model=$this->loadModel($id);\n\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\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['Event']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t));\n\t}",
"public function update(Request $request, _modelName_ $_modelEntry_)\n {\n $_modelEntry_->update($request->all());\n return [\n \"status\" => 1,\n \"data\" => $_modelEntry_->makeHidden($this->hidden),\n \"msg\" => \"_modelName_ updated successfully\"\n ];\n }",
"public function update(Identifiable $model, array $newAttributes);",
"public function update(){\n\n\t\t/* set method */\n\t\t$this->request_method = 'update';\n\t\t\t\t\n\t\t/* check for a model id */\n\t\tif( ! $this->id) {\n\t\t\t$this->set_error( 10, 'No model id in request, cant update' );\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t/* read the data received from backbone */\n\t\t$this->parse_model_request();\n\n\t\tif($this->get_errors())\n\t\t\treturn;\n\t\t\t\t\t\n\t\t/* get the parsed post data from request */\n\t\t$item_data = $this->parsed_model_request;\n\t\t \t\t\t \t\n\t\t/* insert database */\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\n\t\t\t/* posts */\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t\t$post = $item_data['post'];\n\t\t\t\t\n\t\t\t\t/* privileg check */ //improve this for coded api calls, like when setting up bootstrap data (for reading it is no problem any way, because this check is only made for update and create and delete)\n\t\t\t\tif( $this->properties->access == \"loggedin\" && ! current_user_can('edit_post', $this->id)) { \n\t\t\t\t\t$this->set_error( 11, 'no user privileges to update the item on server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$result = wp_update_post( $post );\n\t\t\t\t\n\t\t\t\t/* maybe an error while updating */\n\t\t\t\tif( ! $result) {\n\t\t\t\t\t$this->set_error( 12, 'updating the item failed on the server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* geting the id means update was a success */\n\t\t\t\t$updated_id = $result;\n\t\t\t\t\n\t\t\t\t/* save custom data, this only method does all the magic, \n\t\t\t\tdetails must be specified in the custom package handlers */\n\t\t\t\t$this->_action_custom_package_data( $updated_id, $item_data);\t\n\t\t\t\t\n\t\t\t\t/* set a clean response */\n\t\t\t\t$this->parse_model_response($updated_id);\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t/* comment */\n\t\t\tcase('comment'):\n\t\t\t\t$comment = $item_data['comment'];\n\t\t\t\t\n\t\t\t\t/* comment updateding is not supported */\n\t\t\t\t$this->set_error( 13, 'comments cant be updated!' );\n\t\t\t\t\treturn; \n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t//@TODO\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$new_id = $this->id;\n\t\t\t\t$this->_action_custom_package_data( $new_id, $item_data);\t\t\t\t\t\n\t\t\t\t$this->parse_model_response($new_id);\t\t\n\t\t\tbreak;\n\t\t}\n do_action('bb-wp-api_after_update', $updated_id, $this->properties, $this );\n\t\n\t}",
"public function testUpdateModelSet()\n {\n }",
"public abstract function update();",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->idevents));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function update() {\n parent::update();\n }",
"public function update(Request $request, FormModel $formModel)\n {\n //\n }",
"public function update()\n {\n }",
"public function updated(Item $item)\n {\n event(new ItemUpdated($item));\n }"
] | [
"0.6720222",
"0.6386654",
"0.6356044",
"0.59835356",
"0.59458",
"0.58643824",
"0.5845092",
"0.58243775",
"0.5740627",
"0.5693835",
"0.56709296",
"0.5657369",
"0.5653719",
"0.56264603",
"0.56129426",
"0.55962783",
"0.55836976",
"0.5575376",
"0.55735725",
"0.5547792",
"0.5537175",
"0.5537175",
"0.5537175",
"0.5537175",
"0.5537175",
"0.5537175",
"0.5537175",
"0.5525619",
"0.5514177",
"0.54851776",
"0.54851776",
"0.54851776",
"0.543622",
"0.5377619",
"0.5375662",
"0.53715974",
"0.5362132",
"0.5354777",
"0.53541064",
"0.533151",
"0.53086936",
"0.5304037",
"0.5303587",
"0.5296067",
"0.5292211",
"0.52883667",
"0.5257133",
"0.5238631",
"0.52246344",
"0.5197994",
"0.5190328",
"0.5190328",
"0.5179627",
"0.5171798",
"0.51703995",
"0.51641786",
"0.51630133",
"0.51552397",
"0.5142502",
"0.51340777",
"0.51322794",
"0.5124094",
"0.51161206",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5113133",
"0.5106087",
"0.5097471",
"0.5092824",
"0.5092824",
"0.50901544",
"0.5089501",
"0.50814915",
"0.5075316",
"0.5075316",
"0.5061259",
"0.5061259",
"0.5057964",
"0.50521153",
"0.5051979",
"0.50510484",
"0.50484145",
"0.50350976",
"0.50271124",
"0.50269073",
"0.50206506",
"0.50021774",
"0.49982965",
"0.4995297",
"0.49896798",
"0.498179"
] | 0.5768684 | 8 |
Register an updated model event with the dispatcher. | public static function updated($callback, $priority = 0)
{
static::registerModelEvent('updated', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updated($model)\n {\n }",
"public function updated(Registration $model)\n {\n if($model->isDirty('email')){\n # Fire the events\n $this->fireStatusEvents($model);\n }\n }",
"public function getModelEvents();",
"public function updatedModel(Model &$model)\n {\n }",
"protected function fireModelEvent(Event $event)\n {\n static::getEventDispatcher()->fire($event);\n }",
"public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }",
"public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"public function updating($model)\n\t{\n\t}",
"abstract protected function updateModel();",
"public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }",
"public function updated(ProgramLocation $model)\n {\n $contactInformation = [\n 'contact_name',\n 'contact_email',\n 'contact_phone',\n ];\n\n if($model->isDirty($contactInformation)){\n event (new UpdatedContactInformation($model));\n }\n }",
"public function updated(Dispatch $dispatch)\n {\n //\n }",
"public function updated(Auditable $model)\n {\n // Ignore the updated event when restoring\n if (!static::$restoring) {\n Auditor::execute($model->setAuditEvent('updated'));\n }\n }",
"public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"public function updateModel(Model &$model)\n {\n }",
"protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\n\t}",
"public function update(RegistrationPostUpdatedEvent $event): void\n {\n }",
"public function updated(MActivityRule $model)\n\t{\n\t}",
"public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}",
"public static function updated(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::UPDATED, $listener, $priority);\n }",
"function onModelUpdated($object, $data){\n // $object is the object with the updated data\n // A Ticket was updated\n if(get_class($object) === \"Ticket\"){\n $ticket = $object;\n // Authenticate to Trello\n $config = $this->getConfig();\n $client = new Client();\n $client->authenticate($config->get('trello_api_key'), $config->get('trello_api_token'), Client::AUTH_URL_CLIENT_ID);\n\n // If the status was updated\n if(isset($data['dirty']['status_id'])){\n // $data['dirty']['status_id'] - is the old status id\n // $ticket->getStatusId(); is the new status id\n\n // Matching the status in OSTicket to a List in Trello\n $trelloCardId = TrelloPlugin::getTrelloCardId($ticket, $client, $config);\n $trelloListId = TrelloPlugin::getTrelloListId($ticket->getStatusId(), $client, $config);\n if(!empty($trelloCardId) && !empty($trelloListId)){\n // Updating the list/status in Trello\n $client->cards()->setList($trelloCardId, $trelloListId);\n }\n }\n }\n }",
"public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }",
"protected static function registerModelEvent($event, $callback, $priority = 0)\n {\n if (isset(static::$dispatcher)) {\n $name = get_called_class();\n\n static::$dispatcher->listen(\"halcyon.{$event}: {$name}\", $callback, $priority);\n }\n }",
"public function notify($type, \\Phalcon\\Mvc\\CollectionInterface $model){ }",
"function update($unique_id, $model)\n {\n }",
"public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"public function registerDocumentModelEvent(ModelEvent $event)\n {\n if (!$this->enabled) {\n return;\n }\n if ((!($dbEvents = $this->getConfigValue('database', 'array')))) {\n return;\n }\n if (!in_array($event->getAction(), $dbEvents)) {\n return;\n }\n\n $data = (object) [\n 'class' => $event->getCollectionClass()\n ];\n\n /** @var AuditTracking $audit */\n $audit = new $this->documentName();\n $audit->setAction($event->getAction());\n $audit->setType('collection');\n $audit->setData($data);\n $audit->setLocation($this->globalRequestLocation);\n $audit->setCollectionId($event->getCollectionId());\n $audit->setCollectionName($event->getCollectionName());\n $audit->setCreatedAt(new \\DateTime());\n\n $this->events[] = $audit;\n }",
"function update(){\n\t\t$this->model->update();\n\t}",
"public function onAfterStructure() {\n $this->events->fire('updateModel_afterStructure', $this);\n }",
"public function onEvent($event)\n\t{\n\t\tif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_BEFORE_INSERT)\n\t\t{\n\t\t\t/**\n\t\t\t * If document_id is set in the model the service will first try to pull \n\t\t\t * the document to update it. If it is unable to get the record \n\t\t\t * (it will be since this is an insert) it will do nothing and \n\t\t\t * the document will not be inserted.\n\t\t\t */\n\t\t\t$event->model->document_id = NULL;\n\t\t\t$result = $this->saveDocument($event->model);\n\t\t\t$event->model->document_id = $result->item->document_id;\n\t\t}\n\t\telseif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_UPDATE)\n\t\t{\n\t\t\t$this->saveDocument($event->model);\n\t\t}\n\t}",
"public function after_update() {}",
"public function onUpdate();",
"public function onUpdate();",
"public function onUpdate();",
"public function setModelDispatcher(ModelDispatcher $modelDispatcher)\n {\n $this->modelDispatcher = $modelDispatcher;\n }",
"public function update($model) :bool;",
"protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }",
"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 static function postUpdate(Event $event){\n $io = $event->getIO();\n $io->write(\"postUpdate event triggered.\");\n }",
"public function saved(Request $model)\n {\n if($model->isDirty($model->getStatusFieldName())){\n $this->recordHistory($model);\n $this->fireStatusEvent($model);\n }\n # Propagade tier changes\n if($model->isDirty('tier_id')){\n event(new PropagadeTier($model));\n }\n }",
"protected static function bootEvent()\n {\n static::saving(function (Item $model) {\n if (is_null($model->getAttributeFromArray('quantity_per_bundle'))) {\n $model->quantity_per_bundle = $model->getDenominationRelationValue()->quantity_per_bundle;\n }\n\n if (!$model->is_order_custom_quantity) {\n $model->quantity = $model->countQuantityAttribute();\n }\n });\n }",
"function model_run_upgrades($event, $type, $details) {\n\t$model_upgrade_version = elgg_get_plugin_setting('upgrade_version', 'models');\n\n\tif (!$model_upgrade_version) {\n\t\t // When upgrading, check if the ElggModel class has been registered as this\n\t\t // was added in Elgg 1.8\n\t\tif (!update_subtype('object', 'model', 'ElggModel')) {\n\t\t\tadd_subtype('object', 'model', 'ElggModel');\n\t\t}\n\n\t\telgg_set_plugin_setting('upgrade_version', 1, 'models');\n\t}\n}",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}",
"protected function registerEloquentObservers()\n {\n App\\User::observe(Observers\\UserObserver::class);\n }",
"public static function updating($callback, $priority = 0)\n {\n static::registerModelEvent('updating', $callback, $priority);\n }",
"function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }",
"public function update(TokenUpdateResponseModel $responseModel): ViewModel;",
"public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }",
"public static function bootHasAttributeEvents()\n {\n // Event fired after a model has been successfully saved (inserted or updated) by Laravel\n static::saved(function($model) {\n $model->fireAttributeEvents();\n $model->callAttributeSavedMethods();\n });\n }",
"function update($field, $value, $model)\n {\n }",
"public function update(Model $model, array $attributes);",
"public function saved($model)\n\t{\n\t}",
"public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}",
"function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }",
"private function dispatchModelEvent($action, $collection)\n {\n if (!($this->repository instanceof DocumentRepository)) {\n return;\n }\n if (!method_exists($collection, 'getId')) {\n return;\n }\n\n $event = new ModelEvent();\n $event->setCollectionId($collection->getId());\n $event->setActionByDispatchName($action);\n $event->setCollectionName($this->repository->getClassMetadata()->getCollection());\n $event->setCollectionClass($this->repository->getClassName());\n $event->setCollection($collection);\n\n $this->eventDispatcher->dispatch($event, $action);\n }",
"public function updating(MActivityRule $model)\n\t{\n\t}",
"public function notify(string $type, \\Phalcon\\Mvc\\ModelInterface $model)\n {\n }",
"public function postUpdate(Model $model, $entry) {\n $modelName = $model->getName();\n $id = $entry->getId();\n\n if (isset($this->preUpdateFields[$modelName][$id])) {\n $preUpdateFields = $this->preUpdateFields[$modelName][$id];\n\n unset($this->preUpdateFields[$modelName][$id]);\n if (!$this->preUpdateFields[$modelName]) {\n unset($this->preUpdateFields[$modelName]);\n }\n if (!$this->preUpdateFields) {\n unset($this->preUpdateFields);\n }\n } else {\n $preUpdateFields = null;\n }\n\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n $logModel->logUpdate($model, $entry, $preUpdateFields);\n }",
"protected function preUpdate( ModelInterface &$model ) {\n }",
"final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }",
"public function notify()\r\n {\r\n foreach( $this->observers as $observer )\r\n $observer->update( $this );\r\n\r\n }",
"public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }",
"public function setModelEndpoint($model);",
"public function setEvent(MvcEvent $event)\n\t{\n\t\t$this->viewModel = $event->getViewModel();\n\t}",
"public static function bootNotifiesMentionees()\n\t{\n\t\tstatic::saved(function ($model) {\n\t\t\tdispatch(new NotifyMentioneesJob($model));\n\t\t});\n\t}",
"abstract public function apply(Event $event) : Model;",
"public function testUpdateModelSet()\n {\n }",
"public function setEventDispatcher(IlluminateDispatcher $events)\n\t{\n\t\t$this->neoeloquent->setEventDispatcher(\\App::make(Dispatcher::class));\n\t}",
"public function afterDispatch(MvcEvent $event) {\n\t}",
"public static function boot()\n {\n self::saved(function (self $model) {\n $model->syncProductList();\n });\n\n parent::boot();\n }",
"protected function collectModelEvent($event, $model)\n\t{\n\t\t$lastQuery = ($queryCount = count($this->queries)) ? $this->queries[$queryCount - 1] : null;\n\n\t\t$action = [\n\t\t\t'model' => $modelClass = get_class($model),\n\t\t\t'key' => $this->getModelKey($model),\n\t\t\t'action' => $event,\n\t\t\t'attributes' => $this->collectModelsRetrieved && $event == 'retrieved' ? $model->getOriginal() : [],\n\t\t\t'changes' => $this->collectModelsActions && method_exists($model, 'getChanges') ? $model->getChanges() : [],\n\t\t\t'time' => microtime(true) / 1000,\n\t\t\t'query' => $lastQuery ? $lastQuery['query'] : null,\n\t\t\t'duration' => $lastQuery ? $lastQuery['duration'] : null,\n\t\t\t'connection' => $lastQuery ? $lastQuery['connection'] : null,\n\t\t\t'trace' => null,\n\t\t\t'tags' => []\n\t\t];\n\n\t\tif ($lastQuery) $this->queries[$queryCount - 1]['model'] = $modelClass;\n\n\t\tif (! $this->passesFilters([ $action ], 'models-early')) return;\n\n\t\t$this->incrementModelsCount($action['action'], $action['model']);\n\n\t\tif (! $this->collectModelsActions) return;\n\t\tif (! $this->collectModelsRetrieved && $event == 'retrieved') return;\n\t\tif (! $this->passesFilters([ $action ], 'models')) return;\n\n\t\t$action['trace'] = (new Serializer)->trace(StackTrace::get()->resolveViewName());\n\n\t\t$this->modelsActions[] = $action;\n\t}",
"function after_update() {}",
"public function update () {\n\n }",
"public function notify()\n {\n foreach ($this->_observers as $observer) {\n $observer->update($this);\n }\n }",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n $notification = self::find($model->id);\n broadcast(new SiteNotification($notification));\n });\n\n }",
"public function saved($model)\n {\n }",
"public function update() {\r\n\t\t$this->getMapper()->update($this);\r\n\t}",
"public function testUpdateObserver() {\n\t\t$this->testSave();\n\t\t/** @var \\arConnector $observerConnector */\n\t\t$observerConnector = Mockery::namedMock(\"observerConnectorMock\", \\arConnector::class);\n\n\t\t\\arConnectorMap::register(new BucketContainer(), $observerConnector);\n\n\t\t// Observer is updated after tasks are added.\n\t\t$observerConnector->shouldReceive(\"read\")->once()->andReturn(1);\n\t\t$observerConnector->shouldReceive(\"update\")->once()->andReturn(true);\n\n\t\t$this->persistence->setConnector($observerConnector);\n\t\t$this->persistence->updateBucket($this->bucket);\n\t}",
"public function notify()\n\t{\n\t\tforeach ($this->observers as $obs)\n\t\t{\n\t\t\t$obs->update($this);\n\t\t}\n\t}",
"public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}",
"public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"abstract protected function updateResponse(Model $data);",
"public static function updated($callback)\n {\n self::listenEvent('updated', $callback);\n }",
"public function updated(Officer $model)\n {\n $logs = $this->updateLog('Officer', ['name' => $model->getOriginal('name')] ,['name' => $model->name], auth()->user()->email);\n Log::create($logs);\n }",
"public function update()\n {\n # code...\n }",
"public function update() {\r\n }",
"protected function emitPackageStatesUpdated(): void\n {\n if ($this->bootstrap === null) {\n return;\n }\n\n if ($this->dispatcher === null) {\n $this->dispatcher = $this->bootstrap->getEarlyInstance(Dispatcher::class);\n }\n\n $this->dispatcher->dispatch(self::class, 'packageStatesUpdated');\n }",
"public static function updating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::UPDATING, $listener, $priority);\n }",
"public function update() {\n parent::update();\n }",
"public function update()\r\n {\r\n //\r\n }",
"protected function beforeUpdateResponse(Model &$data)\n {\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }",
"public function update(Request $request, Event $event)\n {\n //\n }"
] | [
"0.6448649",
"0.63448995",
"0.6059758",
"0.6022907",
"0.59118193",
"0.58293307",
"0.5804914",
"0.56540054",
"0.56285477",
"0.5523784",
"0.5517744",
"0.55161154",
"0.55095506",
"0.54950744",
"0.5493297",
"0.54638153",
"0.5446909",
"0.5382243",
"0.5380946",
"0.53730845",
"0.53491384",
"0.53349596",
"0.5334643",
"0.5330832",
"0.5318052",
"0.53131926",
"0.52542955",
"0.5243331",
"0.51850235",
"0.51791817",
"0.5117587",
"0.511728",
"0.51095307",
"0.51095307",
"0.51095307",
"0.5095522",
"0.5093838",
"0.50913227",
"0.50809836",
"0.50649416",
"0.506406",
"0.5047446",
"0.50447714",
"0.5041766",
"0.50321394",
"0.50279015",
"0.50096583",
"0.5009419",
"0.5006378",
"0.5006162",
"0.49740672",
"0.49704835",
"0.49568048",
"0.4955663",
"0.49490324",
"0.4917505",
"0.49170333",
"0.48991522",
"0.48976392",
"0.4895904",
"0.48935825",
"0.48871434",
"0.48787147",
"0.4878249",
"0.48751998",
"0.48718286",
"0.4861049",
"0.48605826",
"0.48513144",
"0.48466453",
"0.4846595",
"0.48464608",
"0.48442078",
"0.48384583",
"0.48362416",
"0.48288685",
"0.48178062",
"0.48142695",
"0.4813568",
"0.481127",
"0.48061058",
"0.48059237",
"0.47985",
"0.47957218",
"0.47949153",
"0.47917888",
"0.47782153",
"0.47744745",
"0.4772448",
"0.47677264",
"0.47622025",
"0.4761281",
"0.47576204",
"0.47516018",
"0.4747804",
"0.4747804",
"0.4747804",
"0.4747804",
"0.4747804",
"0.4747804"
] | 0.5525456 | 9 |
Register a creating model event with the dispatcher. | public static function creating($callback, $priority = 0)
{
static::registerModelEvent('creating', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }",
"public function created(ContractType $model)\n {\n\n }",
"public function registerDocumentModelEvent(ModelEvent $event)\n {\n if (!$this->enabled) {\n return;\n }\n if ((!($dbEvents = $this->getConfigValue('database', 'array')))) {\n return;\n }\n if (!in_array($event->getAction(), $dbEvents)) {\n return;\n }\n\n $data = (object) [\n 'class' => $event->getCollectionClass()\n ];\n\n /** @var AuditTracking $audit */\n $audit = new $this->documentName();\n $audit->setAction($event->getAction());\n $audit->setType('collection');\n $audit->setData($data);\n $audit->setLocation($this->globalRequestLocation);\n $audit->setCollectionId($event->getCollectionId());\n $audit->setCollectionName($event->getCollectionName());\n $audit->setCreatedAt(new \\DateTime());\n\n $this->events[] = $audit;\n }",
"public function getModelEvents();",
"protected static function registerModelEvent($event, $callback, $priority = 0)\n {\n if (isset(static::$dispatcher)) {\n $name = get_called_class();\n\n static::$dispatcher->listen(\"halcyon.{$event}: {$name}\", $callback, $priority);\n }\n }",
"public function created($model)\n {\n }",
"public function create(RegistrationPostCreatedEvent $event): void\n {\n }",
"public function creating($model)\n\t{\n\t}",
"function create($model)\n {\n }",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }",
"public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', '事件<'. $model->title .'>添加成功! ');\n return $this->redirect(['index']);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model->loadDefaultValues(),\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n\n\t\t$model=new Event;\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\n\t\t$attr = array(); \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['Event']))\n\t\t{\n\t\t if(isset($_POST['Event']['attributes']))\n\t\t {\n\t\t $attr = $_POST['Event']['attributes'];\n\t\t }\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save()) {\n\t\t\t\t$this->addAttributes($attr, $model);\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('create',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t\t));\n\t\t}\n\t}",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n $notification = self::find($model->id);\n broadcast(new SiteNotification($notification));\n });\n\n }",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n /*\r\n $event->beforeDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (DragConfig $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function createModel()\n {\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Event;\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['Event']))\n\t\t{\t\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\t\n\t\t\t$model->created_on = new CDbExpression('NOW()');\n\t\t\t$model->created_by=Yii::app()->user->id;\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('view', 'id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::uuid1()->toString();\n });\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function($model) {\n $model->reference = $model->generateReference();\n });\n }",
"public function create(): void\n {\n $this->register();\n }",
"public function create()\n {\n return view ('event.create');\n }",
"protected function createModel()\n {\n $model = new EventProcessingSubLeafModel();\n $model->instantEvent->attachHandler(function(){\n $this->model->output = \"instant\";\n });\n $model->delayedEvent->attachHandler(function(){\n $this->runBeforeRender(function(){\n $this->model->output = \"delayed\";\n });\n });\n return $model;\n }",
"public function create(Model $model);",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->id = (string) Uuid::generate(4);\n });\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Events;\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->event_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"protected static function boot()\n {\n parent::boot();\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName()).\n */\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n \n return true;\n });\n }",
"public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }",
"function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n if ($this->isDirty('status') and $this->status === User::STATUS_ACTIVE) {\n $this->event_type = 'verify';\n }\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : self::URUID, // unregistered user id\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public static function created($callback, $priority = 0)\n {\n static::registerModelEvent('created', $callback, $priority);\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->uuid = (string) Uuid::generate(4);\n });\n }",
"public function create()\n {\n return view(\"Event::create\");\n }",
"public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->id = (string)Uuid::generate(4);\n });\n }",
"function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->uuid = uuid();\n });\n }",
"public static function boot()\n {\n parent::boot();\n static::creating(function ($model) {\n $model->key = 'store_' . md5(Str::random(14) . time());\n });\n }",
"public function create()\n\t{\n\t\t// handled by backbone routes\n\t}",
"public function createEvent()\n {\n return new Event();\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(\n function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n }\n );\n }",
"protected function on_new_model_generated(Jelly_Model $model)\n\t{\n\t\t// Nothing here but subclasses can implement...\n\t}",
"public function create(Request $request)\n {\n $data = $request->all();\n $event = Event::make($data);\n $event->user_id = Auth::user()->id;\n $event->save();\n }",
"public static function boot()\n\t{\n\t\tparent::boot();\n\t\tself::creating(function ($model) {\n\t\t\t$model->uuid = (string) \\Webpatser\\Uuid\\Uuid::generate(4);\n\t\t});\n\t}",
"public static function boot(){\n parent::boot();\n self::creating(function ($model){\n $model->uuid = (string) Str::uuid();\n });\n }",
"protected static function booting()\n {\n static::creating(function ($model) {\n if (!$model->pub_date) {\n $model->pub_date = Carbon::now()->toDateString();\n }\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n self::creating(function ($model) {\n $model->uid = (string) Str::uuid();\n });\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function(self $model)\n {\n $model->setCreatedAt($model->freshTimestamp());\n\n return true;\n });\n }",
"public function create()\n {\n return view('events::create_event');\n }",
"public function creating(Model $model): void\n {\n $model->setAttribute($model->getKeyName(), Uuid::uuid4());\n }",
"public function creating(ContractType $model)\n {\n # Set Current User as Creator\n $model->setAttribute('creator', $model->getAttribute('creator') ?: $this->getUserId() );\n }",
"public static function bootHasUuid() {\n\n $self = new self;\n\n $self->initializeHasUuid();\n\n if ( ! is_string($self->attachEvent) ) {\n\n return;\n }\n\n\t\tstatic::{$self->attachEvent}(function($model) use ($self) {\n \n if ( $self::$disbaleUuidGeneration ) {\n\n return;\n }\n \n $uuidFieldName = $self->getUuidFieldName();\n\n if ( ! $self->canHaveUuid($model->getTable(), $uuidFieldName) ) {\n\n return;\n }\n \n $model->{$uuidFieldName} ?: $model->{$uuidFieldName} = $self->generateUuid();\n\n if ( in_array($self->attachEvent, $self->saveActionForEvents) ) {\n\n method_exists($self, 'saveQuietly') ? $model->saveQuietly() : $model->saveModelQuietly();\n }\n });\n\t}",
"protected static function boot() {\n\t\tparent::boot();\n\n\t\tstatic::creating(function ($model) {\n\t\t\tif (empty($model->{$model->getKeyName()})) {\n\t\t\t\t$model->{$model->getKeyName()} = Uuid::generate()->string;\n\t\t\t}\n\t\t});\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n Event::dispatch(new UserCreated($model));\n });\n }",
"public function createEvents()\n {\n //\n\n return 'something';\n }",
"public function create()\n {\n return view('events.createevent');\n }",
"public static function boot()\n\t{\n\t\tparent::boot();\n\n self::creating(function($model){\n\t\t\tif(empty($model->user_id)){\n\t\t\t\t$model->user_id = Auth::user()->id;\n\t\t\t}\n $model->code = uniqid();\n $model->slug = static::generateUniqueSlug($model->name);\n\t\t\tif(empty($model->status_id)){\n \t$model->status_id = Status::getStatusForNewProject()->id;\n\t\t\t}\n });\n }",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}",
"protected static function boot() {\n\t\tparent::boot(); /**\n\t\t * Attach to the 'creating' Model Event to provide a UUID\n\t\t * for the `id` field (provided by $model->getKeyName())\n\t\t */\n\t\tstatic::creating(function ($model) {\n\n\t\t\t$model->{$model->getKeyName()} = (string) 'cus_' . $model->generateKey();\n\t\t\t$model->user_id = (isset($model->attributes['user_id'])) ? $model->attributes['user_id'] : $model->getUserId();\n\t\t});\n\t}",
"public function create()\n {\n return view('event.create');\n }",
"public function create()\n {\n return view('event.create');\n }",
"public function create()\n {\n return view('event.create');\n }",
"public function create()\n {\n return view('event.create');\n }",
"public function created(MActivityRule $model)\n\t{\n\t}",
"public static function bootSystemTrait()\n {\n static::creating(function ($model) {\n if (self::$set_uuid) {\n $model->uuid = Uuid::uuid1()->toString() . '-' . hexdec(uniqid());\n }\n\n if (self::$set_author && auth()->check()) {\n $model->author_id = auth()->user()->id;\n }\n });\n }",
"public function create()\n {\n return view('event');\n }",
"public function created(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('created'));\n }",
"public function create($modelData);",
"function on_creation() {\n $this->init();\n }",
"function eventRegister($eventName, EventListener $listener);",
"public function creating(Model $model)\n {\n $model->uuid = Uuid::uuid4()->toString();\n }",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}",
"public function creating(Model $model)\n {\n $model->{$model->getKeyName()} = Uuid::uuid4()->toString();\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->generateReferralCode();\n $model->generateConfirmationCode();\n $model->setUserLogin();\n $model->getUserIP();\n $model->setRegistrationDate();\n });\n }",
"public function create()\n {\n // return view('events.create');\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->code = (string)ShortUuid::uuid4();\n });\n }",
"public function create()\n {\n return view('admin.event.create');\n }",
"public function create()\n {\n return view('admin.event.create');\n }",
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"protected function __construct()\n {\n parent::__construct(\n 'Event',\n array(\n TextField::create(\n 'title',\n array(\n 'mandatory' => true,\n )\n ),\n TextareaField::create(\n 'description',\n array(\n 'use_markdown' => true,\n )\n ),\n TextField::create(\n 'date',\n array()\n ),\n ReferenceField::create(\n 'guest_lists',\n array(\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\Guestlist\\\\GuestlistModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'title',\n ),\n ),\n )\n ),\n ReferenceField::create(\n 'assignee',\n array(\n 'max' => 1,\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\User\\\\UserModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'username',\n ),\n ),\n )\n ),\n KeyValueField::create(\n 'meta',\n array(\n 'constraints' => array(\n 'value_type' => 'dynamic',\n ),\n )\n ),\n AggregateField::create(\n 'workflowTicket',\n array(\n 'modules' => array(\n '\\\\Honeybee\\\\Domain\\\\Event\\\\WorkflowTicketModule',\n ),\n )\n ),\n ),\n array(\n 'prefix' => 'event',\n 'identifier_field' => 'identifier',\n 'slugPattern' => 'event-{shortId}',\n )\n );\n }",
"protected static function boot()\n {\n parent::boot();\n\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName())\n */\n static::creating(function ($model) {\n static::setUuidAttributes($model); // @codeCoverageIgnore\n });\n }",
"public function postEventadd();",
"public function create()\n {\n return view('event::create');\n }",
"public function create()\n {\n return view(\"admin.event_create\")->with([\n\n ]);\n }",
"function after_create() {}",
"public static function boot()\n {\n parent::boot();\n\n // log customer creation\n self::created(function($model){\n UserLog::log($model->id, UserLogEvent::EVENT_CUSTOMER_ADDED, $model->id);\n });\n }",
"public function actionCreate()\n {\n //read the post input (use this technique if you have no post variable name):\n\t\t$post = file_get_contents(\"php://input\");\n\n\t\t//decode json post input as php array:\n\t\t$data = CJSON::decode($post, true);\n\n\t\t//Event is a Yii model:\n\t\t$evento = new Evento();\n\n\t\t//load json data into model:\n\t\t$evento->attributes = $data;\n\n\t\t//this is for responding to the client:\n\t\t$response = array();\n\n\t\t//save model, if that fails, get its validation errors:\n\t\tif ($evento->save() == false) {\n\t\t\t$response['success'] = false;\n\t\t\t$response['errors'] = $evento->errors;\n\t\t} else {\n\t\t\t$response['success'] = true;\n\n\t\t\t//respond with the saved contact in case the model/db changed any values\n\t\t\t//$response['evento'] = $evento; \n\t\t}\n\n\t\t//respond with json content type:\n\t\theader('Content-type:application/json');\n\n\n\t\t//encode the response as json:\n\t\techo CJSON::encode($response);\n\n\t\texit();\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::addGlobalScope(new OrderByCreateScope);\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"public function store(CreateEventRequest $request)\n {\n \n $event = Event::create(\n $request->validated()\n );\n\n\n return response()->json([\n 'event' => $event\n ], 201);\n }",
"public static function bootOwnedTrait() {\n\t\tstatic::registerModelEvent('creating', function($model){\n\t\t\tif(empty($model->user_id)) {\n\t\t\t\t$model->user_id = user('id');\n\t\t\t}\n\t\t});\n\t}",
"public static function create_type() {\n\t\tregister_post_type(\n\t\t\tself::TYPE,\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => 'Events',\n\t\t\t\t\t'singular_name' => 'Event',\n\t\t\t\t\t'add_new_item' => 'Add new event',\n\t\t\t\t\t'not_found' => 'No events found',\n\t\t\t\t),\n\t\t\t\t'public' => true,\n\t\t\t\t'supports' => array( 'title' ),\n\t\t\t)\n\t\t);\n\t}",
"public function create()\n\t{\n\t\treturn view('events.create');\n\t}",
"public static function boot() : void\n {\n parent::boot();\n\n static::creating(function ($model) {\n // This is necessary because on \\Illuminate\\Database\\Eloquent\\Model::performInsert\n // will not check for $this->getIncrementing() but directly for $this->incrementing\n $model->incrementing = false;\n $uuidVersion = (!empty($model->uuidVersion) ? $model->uuidVersion : 4); // defaults to 4\n $uuid = Uuid::generate($uuidVersion);\n $model->attributes[$model->getKeyName()] = $uuid->string;\n\n $model->attributes['visibility'] = isset($model->attributes['visibility'])\n ? $model->attributes['visibility']\n : Visibility::SHARED;\n }, 0);\n\n static::addGlobalScope(new JournalPrivacyScope);\n }",
"protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }"
] | [
"0.62676495",
"0.60582256",
"0.59932345",
"0.59654623",
"0.5920844",
"0.5899051",
"0.5807854",
"0.58029044",
"0.57614404",
"0.5757084",
"0.5735723",
"0.57191336",
"0.567064",
"0.5658227",
"0.56124693",
"0.56108236",
"0.5609828",
"0.55951476",
"0.55862224",
"0.5584507",
"0.5558176",
"0.5552005",
"0.5541944",
"0.55178154",
"0.55039036",
"0.54931223",
"0.5492285",
"0.5485696",
"0.5478294",
"0.5464047",
"0.5436773",
"0.54349524",
"0.5396174",
"0.5382683",
"0.53792757",
"0.53771245",
"0.53760725",
"0.5374224",
"0.5369635",
"0.53671616",
"0.5366363",
"0.53522044",
"0.5349876",
"0.53485656",
"0.53415835",
"0.53226626",
"0.53127205",
"0.527646",
"0.52651834",
"0.5264878",
"0.526341",
"0.52552015",
"0.5250513",
"0.52265364",
"0.5213834",
"0.52030486",
"0.5201148",
"0.51993227",
"0.51987135",
"0.51950264",
"0.51946855",
"0.5177898",
"0.51660156",
"0.51548254",
"0.51510316",
"0.51378596",
"0.51378596",
"0.51378596",
"0.51378596",
"0.5136049",
"0.51270896",
"0.5124166",
"0.5110808",
"0.5098765",
"0.50975835",
"0.50963455",
"0.509588",
"0.5082989",
"0.5080763",
"0.50723106",
"0.50693667",
"0.50664127",
"0.5063967",
"0.5063967",
"0.5063756",
"0.5063583",
"0.50626653",
"0.5060869",
"0.5060216",
"0.5060155",
"0.50573397",
"0.50507003",
"0.5048853",
"0.5046465",
"0.5045905",
"0.50365025",
"0.50322276",
"0.503104",
"0.50263166",
"0.50234044"
] | 0.5438928 | 30 |
Register a created model event with the dispatcher. | public static function created($callback, $priority = 0)
{
static::registerModelEvent('created', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }",
"public function registerDocumentModelEvent(ModelEvent $event)\n {\n if (!$this->enabled) {\n return;\n }\n if ((!($dbEvents = $this->getConfigValue('database', 'array')))) {\n return;\n }\n if (!in_array($event->getAction(), $dbEvents)) {\n return;\n }\n\n $data = (object) [\n 'class' => $event->getCollectionClass()\n ];\n\n /** @var AuditTracking $audit */\n $audit = new $this->documentName();\n $audit->setAction($event->getAction());\n $audit->setType('collection');\n $audit->setData($data);\n $audit->setLocation($this->globalRequestLocation);\n $audit->setCollectionId($event->getCollectionId());\n $audit->setCollectionName($event->getCollectionName());\n $audit->setCreatedAt(new \\DateTime());\n\n $this->events[] = $audit;\n }",
"public function getModelEvents();",
"protected static function registerModelEvent($event, $callback, $priority = 0)\n {\n if (isset(static::$dispatcher)) {\n $name = get_called_class();\n\n static::$dispatcher->listen(\"halcyon.{$event}: {$name}\", $callback, $priority);\n }\n }",
"public function created($model)\n {\n }",
"public function created(ContractType $model)\n {\n\n }",
"public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }",
"private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n $notification = self::find($model->id);\n broadcast(new SiteNotification($notification));\n });\n\n }",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public function creating($model)\n\t{\n\t}",
"public static function boot()\n {\n parent::boot();\n self::creating(function($model) {\n $model->reference = $model->generateReference();\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::uuid1()->toString();\n });\n }",
"function create($model)\n {\n }",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"protected function on_new_model_generated(Jelly_Model $model)\n\t{\n\t\t// Nothing here but subclasses can implement...\n\t}",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n /*\r\n $event->beforeDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (DragConfig $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"protected function createModel()\n {\n $model = new EventProcessingSubLeafModel();\n $model->instantEvent->attachHandler(function(){\n $this->model->output = \"instant\";\n });\n $model->delayedEvent->attachHandler(function(){\n $this->runBeforeRender(function(){\n $this->model->output = \"delayed\";\n });\n });\n return $model;\n }",
"public function created(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('created'));\n }",
"protected static function boot()\n {\n parent::boot();\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName()).\n */\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n \n return true;\n });\n }",
"public function create(RegistrationPostCreatedEvent $event): void\n {\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->id = (string) Uuid::generate(4);\n });\n }",
"public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n if ($this->isDirty('status') and $this->status === User::STATUS_ACTIVE) {\n $this->event_type = 'verify';\n }\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : self::URUID, // unregistered user id\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }",
"public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', '事件<'. $model->title .'>添加成功! ');\n return $this->redirect(['index']);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model->loadDefaultValues(),\n ]);\n }\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n Event::dispatch(new UserCreated($model));\n });\n }",
"function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}",
"public function createModel()\n {\n }",
"public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}",
"public function created(MActivityRule $model)\n\t{\n\t}",
"public static function boot()\n {\n parent::boot();\n static::creating(function ($model) {\n $model->key = 'store_' . md5(Str::random(14) . time());\n });\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(\n function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n }\n );\n }",
"public function create(Model $model);",
"public function actionCreate()\n\t{\n\t\t$model=new Event;\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['Event']))\n\t\t{\t\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\t\n\t\t\t$model->created_on = new CDbExpression('NOW()');\n\t\t\t$model->created_by=Yii::app()->user->id;\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('view', 'id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"protected static function bootEvent()\n {\n static::saving(function (Item $model) {\n if (is_null($model->getAttributeFromArray('quantity_per_bundle'))) {\n $model->quantity_per_bundle = $model->getDenominationRelationValue()->quantity_per_bundle;\n }\n\n if (!$model->is_order_custom_quantity) {\n $model->quantity = $model->countQuantityAttribute();\n }\n });\n }",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}",
"function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}",
"public function created(AvItem $model)\n {\n\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->uuid = uuid();\n });\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->uuid = (string) Uuid::generate(4);\n });\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function ($model) {\n $model->id = (string)Uuid::generate(4);\n });\n }",
"public function add(Model $model) {\n $this->models[get_class($model)] = $model;\n }",
"protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function(self $model)\n {\n $model->setCreatedAt($model->freshTimestamp());\n\n return true;\n });\n }",
"function eventRegister($eventName, EventListener $listener);",
"public static function boot()\n {\n parent::boot();\n\n self::creating(function ($model) {\n $model->uid = (string) Str::uuid();\n });\n }",
"protected function fireModelEvent(Event $event)\n {\n static::getEventDispatcher()->fire($event);\n }",
"public function actionCreate()\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n\n\t\t$model=new Event;\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\n\t\t$attr = array(); \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['Event']))\n\t\t{\n\t\t if(isset($_POST['Event']['attributes']))\n\t\t {\n\t\t $attr = $_POST['Event']['attributes'];\n\t\t }\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save()) {\n\t\t\t\t$this->addAttributes($attr, $model);\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('create',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t\t));\n\t\t}\n\t}",
"public function postEventadd();",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"public function created($model)\n {\n $model->forum->update([\n 'latest_post_id' => $model->id,\n ]);\n }",
"function addModel(){\n\t\n\t}",
"public static function boot(){\n parent::boot();\n self::creating(function ($model){\n $model->uuid = (string) Str::uuid();\n });\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Events;\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->event_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n //Get the client model\n $client = $model->client;\n\n //Increment the number of plots\n $client->increment('plot_total');\n });\n }",
"public static function boot()\n {\n parent::boot();\n\n // log customer creation\n self::created(function($model){\n UserLog::log($model->id, UserLogEvent::EVENT_CUSTOMER_ADDED, $model->id);\n });\n }",
"public function create()\n {\n return view ('event.create');\n }",
"public static function bootOwnedTrait() {\n\t\tstatic::registerModelEvent('creating', function($model){\n\t\t\tif(empty($model->user_id)) {\n\t\t\t\t$model->user_id = user('id');\n\t\t\t}\n\t\t});\n\t}",
"public function creating(Model $model): void\n {\n $model->setAttribute($model->getKeyName(), Uuid::uuid4());\n }",
"protected static function booting()\n {\n static::creating(function ($model) {\n if (!$model->pub_date) {\n $model->pub_date = Carbon::now()->toDateString();\n }\n });\n }",
"protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n foreach (static::$handleableEvents as $event) {\r\n static::$event(function($model) use ($event) {\r\n /** @var Model $model */\r\n return $model->handleEvent($event);\r\n });\r\n }\r\n }",
"protected static function boot() {\n\t\tparent::boot(); /**\n\t\t * Attach to the 'creating' Model Event to provide a UUID\n\t\t * for the `id` field (provided by $model->getKeyName())\n\t\t */\n\t\tstatic::creating(function ($model) {\n\n\t\t\t$model->{$model->getKeyName()} = (string) 'cus_' . $model->generateKey();\n\t\t\t$model->user_id = (isset($model->attributes['user_id'])) ? $model->attributes['user_id'] : $model->getUserId();\n\t\t});\n\t}",
"protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }",
"protected static function boot() {\n\t\tparent::boot();\n\n\t\tstatic::creating(function ($model) {\n\t\t\tif (empty($model->{$model->getKeyName()})) {\n\t\t\t\t$model->{$model->getKeyName()} = Uuid::generate()->string;\n\t\t\t}\n\t\t});\n\t}",
"public function created(Brand $model)\n {\n\n }",
"public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}",
"protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }",
"public static function boot()\n\t{\n\t\tparent::boot();\n\t\tself::creating(function ($model) {\n\t\t\t$model->uuid = (string) \\Webpatser\\Uuid\\Uuid::generate(4);\n\t\t});\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName())\n */\n static::creating(function ($model) {\n static::setUuidAttributes($model); // @codeCoverageIgnore\n });\n }",
"public static function bootHasAttributeEvents()\n {\n // Event fired after a model has been successfully saved (inserted or updated) by Laravel\n static::saved(function($model) {\n $model->fireAttributeEvents();\n $model->callAttributeSavedMethods();\n });\n }",
"public static function bootHasUuid() {\n\n $self = new self;\n\n $self->initializeHasUuid();\n\n if ( ! is_string($self->attachEvent) ) {\n\n return;\n }\n\n\t\tstatic::{$self->attachEvent}(function($model) use ($self) {\n \n if ( $self::$disbaleUuidGeneration ) {\n\n return;\n }\n \n $uuidFieldName = $self->getUuidFieldName();\n\n if ( ! $self->canHaveUuid($model->getTable(), $uuidFieldName) ) {\n\n return;\n }\n \n $model->{$uuidFieldName} ?: $model->{$uuidFieldName} = $self->generateUuid();\n\n if ( in_array($self->attachEvent, $self->saveActionForEvents) ) {\n\n method_exists($self, 'saveQuietly') ? $model->saveQuietly() : $model->saveModelQuietly();\n }\n });\n\t}",
"public function createEvent()\n {\n return new Event();\n }",
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"public function createEvents()\n {\n //\n\n return 'something';\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->user_id = Helper::randString();\n $model->created_at = \\Carbon\\Carbon::now();\n });\n }",
"public function registerEvent($event, $object, $fn){\n\t\t$this->actions[$event][] = new \\OWeb\\manage\\events\\Event($object, $fn);\n\t}",
"public function created(ProgressionStatus $model)\n {\n\n }",
"public function create()\n {\n return view(\"Event::create\");\n }",
"public function creating(Model $model)\n {\n $model->uuid = Uuid::uuid4()->toString();\n }",
"function addEvent($event) {\n Event::addEvent($event);\n }",
"public function created(Model $comment)\n {\n $user = $comment->post->owner;\n\n $user->notify(new Notification($comment, 'comment_new_author'));\n }",
"function admin_add() {\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Event->create();\n\t\t\tif ($this->Event->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('This Event has been saved.');\n\t\t\t\t$this->redirect(array('action'=>'admin_index'),null,true);\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('This Event could not be saved. Please try again.');\n\t\t\t}\n\t\t}\n\t\t$tags = $this->Event->Tag->find('list');\n\t\t$this->set(compact('tags'));\n\t}",
"public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }",
"public static function boot()\n {\n parent::boot();\n\n self::created(function($model) {\n $name = $model[self::$name];\n\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'insert',\n 'dashboard_activity' => 'created a new '. self::$tableTitle,\n 'activity_desc' => 'created the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => $name,\n 'reference' => $model->id\n ]);\n });\n\n self::updating(function($model) {\n self::$oldModel = $model->fresh();\n });\n\n self::updated(function($model) {\n $name = $model[self::$name];\n $oldModel = self::$oldModel->toArray();\n foreach ($oldModel as $fieldName => $value) {\n if (in_array($fieldName, self::$unrelatedFields)) {\n continue;\n }\n\n $oldValue = $model[$fieldName];\n if ($oldValue != $value) {\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'update',\n 'dashboard_activity' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName],\n 'activity_desc' => 'updated the '. self::$tableTitle .' '. self::$logName[$fieldName] .' of '. $name .' from '. $oldValue .' to '. $value,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => $oldValue,\n 'new_value' => $value,\n 'reference' => $model->id\n ]);\n }\n }\n });\n\n self::deleted(function($model){\n $name = $model[self::$name];\n ActivityLog::create([\n 'log_by' => auth()->id(),\n 'activity_type' => 'delete',\n 'dashboard_activity' => 'deleted a '. self::$tableTitle,\n 'activity_desc' => 'deleted the '. self::$tableTitle .' '. $name,\n 'activity_date' => date(\"Y-m-d H:i:s\"),\n 'db_table' => $model->getTable(),\n 'old_value' => '',\n 'new_value' => '',\n 'reference' => $model->id\n ]);\n });\n\n // self::restored(function($model){\n // $name = $model[self::$name];\n // ActivityLog::create([\n // 'log_by' => auth()->id(),\n // 'activity_type' => 'restore',\n // 'dashboard_activity' => 'restore a '. self::$tableTitle,\n // 'activity_desc' => 'restore the '. self::$tableTitle .' '. $name,\n // 'activity_date' => date(\"Y-m-d H:i:s\"),\n // 'db_table' => $model->getTable(),\n // 'old_value' => '',\n // 'new_value' => '',\n // 'reference' => $model->id\n // ]);\n // });\n }",
"private function dispatchModelEvent($action, $collection)\n {\n if (!($this->repository instanceof DocumentRepository)) {\n return;\n }\n if (!method_exists($collection, 'getId')) {\n return;\n }\n\n $event = new ModelEvent();\n $event->setCollectionId($collection->getId());\n $event->setActionByDispatchName($action);\n $event->setCollectionName($this->repository->getClassMetadata()->getCollection());\n $event->setCollectionClass($this->repository->getClassName());\n $event->setCollection($collection);\n\n $this->eventDispatcher->dispatch($event, $action);\n }",
"public function setDispatcherEvents()\n\t{\n\t\t$this->dispatcher = (new Dispatcher())->register($this->routes);\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::addGlobalScope(new OrderByCreateScope);\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"public function creating(Model $model)\n {\n $model->{$model->getKeyName()} = Uuid::uuid4()->toString();\n }",
"public static function creating($callback, $priority = 0)\n {\n static::registerModelEvent('creating', $callback, $priority);\n }",
"public function creating(ContractType $model)\n {\n # Set Current User as Creator\n $model->setAttribute('creator', $model->getAttribute('creator') ?: $this->getUserId() );\n }",
"public function setModelDispatcher(ModelDispatcher $modelDispatcher)\n {\n $this->modelDispatcher = $modelDispatcher;\n }",
"public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }",
"public function create(): void\n {\n $this->register();\n }",
"public function notify($type, \\Phalcon\\Mvc\\CollectionInterface $model){ }",
"public function created(SecKillAppliesRegister $model)\n {\n if (isset($model->shop_id)) \n {\n $gm_id = \\ShopEM\\Models\\Shop::where('id',$model->shop_id)->value('gm_id');\n SecKillAppliesRegister::where('shop_id',$model->shop_id)->whereNotIn('gm_id',[$gm_id])->update(['gm_id'=>$gm_id]);\n }\n }"
] | [
"0.64774287",
"0.6262918",
"0.6113943",
"0.590242",
"0.588557",
"0.58444417",
"0.57075745",
"0.56597155",
"0.5632678",
"0.55553985",
"0.55182666",
"0.54296345",
"0.54230934",
"0.5360697",
"0.5326727",
"0.5304289",
"0.5304183",
"0.53002065",
"0.52833647",
"0.52793735",
"0.5263236",
"0.5256128",
"0.5253319",
"0.5252851",
"0.5240815",
"0.5233291",
"0.52016646",
"0.5201021",
"0.51985544",
"0.51978076",
"0.5186045",
"0.51767623",
"0.5161383",
"0.515745",
"0.51570547",
"0.5154415",
"0.5142871",
"0.5139978",
"0.51394105",
"0.51393056",
"0.5132778",
"0.5120913",
"0.51172966",
"0.51023287",
"0.5101717",
"0.51016665",
"0.5094111",
"0.50830364",
"0.5081642",
"0.50746423",
"0.5052084",
"0.5045956",
"0.50420135",
"0.5021077",
"0.50049806",
"0.5004163",
"0.5004087",
"0.49994683",
"0.4987709",
"0.49860755",
"0.4976435",
"0.4974006",
"0.49708232",
"0.4965312",
"0.49617293",
"0.4959204",
"0.49431217",
"0.49344757",
"0.4928558",
"0.49233848",
"0.4913754",
"0.49102446",
"0.49092078",
"0.4903775",
"0.49011984",
"0.4900443",
"0.48970032",
"0.48963192",
"0.4887195",
"0.488436",
"0.4877738",
"0.48759937",
"0.48734766",
"0.48616838",
"0.4860505",
"0.48597804",
"0.48555586",
"0.48538145",
"0.48538145",
"0.48493427",
"0.4848713",
"0.48484138",
"0.48457232",
"0.48450252",
"0.48428488",
"0.48412004",
"0.48395136",
"0.48388556",
"0.48347893",
"0.4833462"
] | 0.5302443 | 17 |
Register a deleting model event with the dispatcher. | public static function deleting($callback, $priority = 0)
{
static::registerModelEvent('deleting', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($event): void;",
"public function delete(RegistrationPostDeletedEvent $event): void\n {\n }",
"public function onModelDeleted($model)\r\n {\r\n $this->onModelSaved($model);\r\n }",
"public function delete(Identifiable $model);",
"public function delete($model);",
"public function onBeforeDelete();",
"public function deleting($model)\n\t{\n\t}",
"public function onAfterDelete();",
"public function deleted(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('deleted'));\n }",
"public function _postDelete()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"public function deletedModel(Model &$model)\n {\n }",
"public function delete(Model $model);",
"public function delete(Model $model);",
"public function _delete()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"protected function performDeleteOnModel()\n {\n $this->getApi()->{'delete'.ucfirst($this->getEntity())}(\n $this->{$this->primaryKey},\n array_merge(...array_values($this->getGlobalScopes()))\n );\n\n $this->exists = false;\n }",
"public function deleted(Dispatch $dispatch)\n {\n //\n }",
"public static function deleted($callback, $priority = 0)\n {\n static::registerModelEvent('deleted', $callback, $priority);\n }",
"public function delete() \n {\n DomainWatcher::addDeletedObject($this);\n }",
"public abstract function deleteModel(\\MPF\\Db\\Model $model);",
"public function deleted($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n\n if (! $model->wasSearchableBeforeDelete()) {\n return;\n }\n\n if ($this->usingSoftDeletes && $this->usesSoftDelete($model)) {\n $this->whileForcingUpdate(function () use ($model) {\n $this->saved($model);\n });\n } else {\n $model->unsearchable();\n }\n }",
"public function afterDelete($model) \r\n {\r\n $this->updateCounters($model);\r\n $this->foreignTableIDs = array();\r\n }",
"public function after_delete() {}",
"public function register_delete_callback( $callback );",
"protected function afterDelete()\n {\n }",
"protected function afterDelete()\r\n {\r\n }",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"public function delete(Model $model)\n {\n }",
"public function deleted(DemoModel $demoModel)\n {\n Log::info('demo 通过观察者监听模型事件' . json_encode($demoModel));\n }",
"public function deleted($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n $model->unsearchable();\n }",
"public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }",
"public static function forceDeleted($callback)\n {\n static::registerModelEvent('forceDeleted', $callback);\n }",
"public function forceDeleted($model)\n {\n $this->deleted($model);\n }",
"public function deleted(MActivityRule $model)\n\t{\n\t}",
"protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}",
"public function delete(){\r\n\t\t// Check for request forgeries\r\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\r\n\t\r\n\t\t// Get the model.\r\n\t\t$model = $this->getModel(\"ManageCompanyEvent\");\r\n\t\t$this->deleteEvents($model);\r\n\t\r\n\t\t$this->setRedirect('index.php?option=com_jbusinessdirectory&view='.$this->input->get('view'));\r\n\t}",
"public function deleted(Request $model)\n {\n $models = [\n 'engagement',\n 'address',\n ];\n\n foreach($models as $relation){\n $model->$relation()->delete();\n }\n }",
"protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }",
"protected function performDeleteOnModel()\n {\n $this->performCascadeDelete();\n parent::performDeleteOnModel();\n }",
"protected static function bootSoftDeleteRelated()\n {\n static::deleting(\n function ($model) {\n if (!empty($relations = $model->getRelations())) {\n foreach ($relations as $key => $value) {\n $model->{$key}()->delete();\n }\n }\n }\n );\n }",
"public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }",
"public function deleteAction() {\n \n }",
"protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }",
"public function postDelete(ModelLifecycleArguments $args)\n {\n $model = $args->getModel();\n if (false === $this->shouldProcess($model)) {\n return;\n }\n try {\n $this->getManager()->accountPushDelete($model);\n } catch (\\Exception $e) {\n if (true === $this->container->getParameter('kernel.debug')) {\n throw $e;\n }\n RequestUtility::notifyException($e);\n }\n }",
"public function deleted(Model $comment)\n {\n $user = $comment->post->owner;\n\n $user->notify(new Notification($comment, 'comment_delete_author'));\n }",
"function after_delete() {}",
"public function afterDelete(Model $model) {\n\t\t$this->__execute(call_user_func_array(array($this->_client, 'getCommand'), $this->__buildDeleteCommand($model)));\n\t}",
"public static function deleting($callback)\n {\n self::listenEvent('deleting', $callback);\n }",
"public function onRelationManageDelete()\n {\n $this->beforeAjax();\n\n /*\n * Multiple (has many, belongs to many)\n */\n if ($this->viewMode == 'multi') {\n if (($checkedIds = post('checked')) && is_array($checkedIds)) {\n foreach ($checkedIds as $relationId) {\n if (!$obj = $this->relationModel->find($relationId)) {\n continue;\n }\n\n $obj->delete();\n }\n }\n }\n /*\n * Single (belongs to, has one)\n */\n elseif ($this->viewMode == 'single') {\n $relatedModel = $this->viewModel;\n if ($relatedModel->exists) {\n $relatedModel->delete();\n }\n\n $this->viewWidget->setFormValues([]);\n $this->viewModel = $this->relationModel;\n }\n\n return $this->relationRefresh();\n }",
"function before_delete() {}",
"public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}",
"function OnAfterDeleteItem(){\n }",
"public function _event_before_delete() {\n\t\tstatic::$_delete['roles'] = $this->roles;\n\t}",
"public static function onAfterDelete(Main\\Event $event)\n\t{\n\t\t$reservationId = (int)$event->getParameter('id')['ID'];\n\t\tif ($reservationId > 0)\n\t\t{\n\t\t\tself::deleteProductReservationMap($reservationId);\n\t\t}\n\t}",
"public function onPreDeleteModel($event)\n {\n if ($this->_properties->sync->enabled) {\n $modelUri = $event->modelUri;\n\n require_once 'Erfurt/Sparql/SimpleQuery.php';\n $query = new Erfurt_Sparql_SimpleQuery();\n $query->setProloguePart('SELECT ?s');\n $query->addFrom($this->_syncModelUri);\n $query->setWherePart(\n 'WHERE {\n ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> .\n ?s <' . $this->_properties['targetModel'] . '> <' . $modelUri . '> .\n }'\n );\n\n $store = Erfurt_App::getInstance()->getStore();\n $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n foreach ($result as $row) {\n $store->deleteMatchingStatements($this->_syncModelUri, $row['s'], null, null, array('use_ac' => false));\n }\n }\n return true;\n }",
"public function hook_after_delete($id) {\n\n }",
"public function deleted($model)\n {\n $latestPost = $this->post->latestIn($model->forum_id)->first();\n\n $model->forum->update([\n 'latest_post_id' => ($latestPost == null) ? null : $latestPost->id,\n ]);\n }",
"protected function performDeleteOnModel()\n {\n $this->newQuery()->delete($this->fileName);\n }",
"public function deleteEvent($event)\n {\n $this->entityManager->remove($event);\n $this->entityManager->flush();\n }",
"public static function onAfterDelete(ORM\\Event $event): void\n\t{\n\t\tModel\\Price::clearSettings();\n\t}",
"function afterDelete(&$model) {\n\t\t$node = Set::extract($this->node($model), \"0.Node.id\");\n\t\tif (!empty($node)) {\n\t\t\t$model->Node->delete($node);\n\t\t}\n\t}",
"protected function preDelete( ModelInterface &$model ) {\n }",
"public static function bootTicketable()\n {\n static::deleted(function (self $model) {\n $model->bookings()->delete();\n });\n }",
"public function hook_before_delete($id) {\n\n }",
"public function forceDeleted(Dispatch $dispatch)\n {\n //\n }",
"public function deleteModel(Model &$model)\n {\n }",
"public function afterDelete(\\Model $model) {\n $this->__clearCacheModel($model);\n\n parent::afterDelete($model);\n }",
"public static function deleted(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::DELETED, $listener, $priority);\n }",
"public function delete() {\n\n $id = $this->uri->segment(4);\n $this->events_model->delete_event($id);\n redirect('admin/events');\n\n }",
"public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}",
"public function actionDelete() {}",
"public function actionDelete() {}",
"protected function afterDelete()\n {\n parent::afterDelete();\n //Comment::model()->deleteAll('post_id='.$this->id);\n VideoTag::model()->updateFrequency($this->tags, '');\n }",
"public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }",
"public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}",
"protected function handleDoDelete() {\n\t\t\tif ($this->verifyRequest('DELETE') && $this->verifyParams()) {\n\t\t\t\tif ($this->blnAuthenticated) {\n\t\t\t\t\tif ($intEventId = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3))) {\n\t\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\t\tif ($objUserEvent->loadById($intEventId) && $objUserEvent->count()) {\n\t\t\t\t\t\t\tif ($objUserEvent->current()->get('userid') == AppRegistry::get('UserLogin')->getUserId()) {\n\t\t\t\t\t\t\t\tif ($objUserEvent->destroy()) {\n\t\t\t\t\t\t\t\t\tCoreAlert::alert('The event was deleted successfully.');\n\t\t\t\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\t\t\t\t$this->intStatusCode = 200;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error deleting the event'));\n\t\t\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Invalid event permissions'));\n\t\t\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing event ID'));\n\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing or invalid authentication'));\n\t\t\t\t\t$this->error(401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}",
"function OnBeforeDeleteItem(){\n }",
"public function delete(Model $model)\n {\n // TODO: Implement delete() method.\n }",
"public function deleteAction() {\n parent::deleteAction();\n }",
"public function delete(Model $instance)\n {\n // TODO: Implement delete() method.\n }",
"public function deleteAction()\n {\n \n }",
"protected function beforeDelete()\n {\n }",
"public function deleteModel($entity){\n $this->entityManager->remove($entity);\n $this->entityManager->flush();\n }",
"public function onFieldDeleted($button) {}",
"public function deleteAction()\n {\n }",
"public function delete(){\n $this->probe_requests()->detach();\n\n // Delete the event itself\n $result = parent::delete();\n\n return $result;\n }",
"function onDelete()\n\t{\n\t\treturn $this->getLookupTable()->deleteKey($this->getValue());\n\t}",
"public static function deleted($callback)\n {\n self::listenEvent('deleted', $callback);\n }",
"public function postEventDel();",
"public function deleteAction()\n {\n $itemGroupRowId = $this->getRequest()->getParam('containerRowId');\n \n //get eventId of the event to be deleted\n $itemGroupId = $this->getRequest()->getParam('containerId');\n\n // get form\n $form = $this->_model->getForm('delete');\n \n //set form action\n //define form action\n $form->setAction($this->view->url(\n array(\n 'controller' => 'itemgrouprow',\n 'action' => 'delete',\n 'containerId' => $itemGroupId,\n 'containerRowId' => $itemGroupRowId,\n ),\n \n 'event'\n ));\n \n $this->processDelete(\n $form, \n 'msg_itemgrouprow_deleted',\n $this->view->url(\n array(\n 'controller' => 'itemgrouprow',\n 'action' => 'index',\n 'containerId' => $itemGroupId),\n 'event'\n ),\n $itemGroupRowId\n );\n }",
"public function afterDelete(&$id, Entity $entity) { }",
"public function onRemove();",
"function handleDeleteRelatedPerson(EventContext $context)\n {\n $program_item = $this->storeProgramItem();\n $program_item->removeRelatedPersonById(fmGetVar(\"related_person_id\"));\n RelatedPerson::deleteRelatedPerson(fmGetVar(\"related_person_id\"));\n $context->addActionMessage(\"Deleted 1 Related Person.\");\n $context->setForward(dirname(__FILE__) . \"/program_item_editor.php\");\n }",
"public function destroy(Request $request, object $model): bool;",
"public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}",
"function onDelete($param)\n {\n $key=$param['key'];\n \n // define duas acoes\n $action1 = new TAction(array($this, 'Delete'));\n \n // define os parametros de cada acao\n $action1->setParameter('key', $key);\n \n //encaminha a chave estrangeira\n $action1->setParameter('fk', filter_input(INPUT_GET, 'fk'));\n\n // exibe um dialogo ao usuario\n new TQuestion('Deseja realmente excluir o registro ?', $action1, $action2);\n }",
"public function undeleteAction(){\n\t}",
"public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }",
"public function deleteAction() {\n\t\tif(!isset($this->params['cancel'])) {\n\n\t\t\t// XXX: Maybe do some hook call validation here?\n\n\t\t\t// auto call the hooks for this module/action\n\t\t\tAPI::callHooks(self::$module, $this->action, 'controller', $this);\n\n\t\t\t// delete an entry\n\t\t\t$host = $this->_model->delete();\n\t\t}\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t}",
"public function handle($model, View $view)\n {\n if (is_array($model)) {\n Deed::whereIn('id', $model)\n ->update(['deleted_by' => auth()->user()->id]);\n Deed::destroy($model);\n } else {\n $model->update(['deleted_by' => auth()->user()->id]);\n $model->delete();\n }\n $this->view->emit('deedDeleted');\n $this->view->dispatchBrowserEvent('alert-emit', [\n 'alert' => 'success',\n 'message' => 'Acte(s) supprimé(s)!'\n ]);\n }"
] | [
"0.6984278",
"0.6961776",
"0.67035615",
"0.65241295",
"0.65158147",
"0.65027523",
"0.6490272",
"0.6429676",
"0.63552505",
"0.63378984",
"0.6317148",
"0.6308893",
"0.6308893",
"0.62908566",
"0.62884426",
"0.626652",
"0.6250017",
"0.62000376",
"0.61680466",
"0.61614186",
"0.6159404",
"0.6146488",
"0.613891",
"0.6127339",
"0.6116743",
"0.61020267",
"0.6102024",
"0.6097664",
"0.60904425",
"0.6088861",
"0.60747397",
"0.6031601",
"0.60191",
"0.5992262",
"0.59588397",
"0.5945473",
"0.59374315",
"0.5936803",
"0.5929845",
"0.59240556",
"0.58979464",
"0.58907014",
"0.5887894",
"0.5883856",
"0.5870804",
"0.5865148",
"0.5861629",
"0.585114",
"0.5848083",
"0.58464724",
"0.5843663",
"0.5841616",
"0.58267164",
"0.5802894",
"0.5800998",
"0.57913584",
"0.57885385",
"0.5788449",
"0.5787273",
"0.5775405",
"0.57725435",
"0.5772395",
"0.5757647",
"0.575761",
"0.57348233",
"0.573405",
"0.5730111",
"0.57279074",
"0.571742",
"0.57031363",
"0.56990755",
"0.56990755",
"0.56922406",
"0.5688118",
"0.568789",
"0.56830823",
"0.5674831",
"0.56680775",
"0.56634873",
"0.56568027",
"0.5656288",
"0.5648927",
"0.56480104",
"0.5640835",
"0.5629502",
"0.56282514",
"0.562328",
"0.5618769",
"0.56082153",
"0.55996436",
"0.5591192",
"0.5586359",
"0.55837077",
"0.55804336",
"0.55760545",
"0.55759126",
"0.5575525",
"0.5567359",
"0.55672735",
"0.5564586"
] | 0.6220237 | 17 |
Register a deleted model event with the dispatcher. | public static function deleted($callback, $priority = 0)
{
static::registerModelEvent('deleted', $callback, $priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onModelDeleted($model)\r\n {\r\n $this->onModelSaved($model);\r\n }",
"public function delete(RegistrationPostDeletedEvent $event): void\n {\n }",
"public function onBeforeDelete();",
"public function deleted(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('deleted'));\n }",
"public function onAfterDelete();",
"public function delete($event): void;",
"public function deleted(Dispatch $dispatch)\n {\n //\n }",
"public function _postDelete()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"public function delete() \n {\n DomainWatcher::addDeletedObject($this);\n }",
"public static function forceDeleted($callback)\n {\n static::registerModelEvent('forceDeleted', $callback);\n }",
"public function deletedModel(Model &$model)\n {\n }",
"public function deleted(DemoModel $demoModel)\n {\n Log::info('demo 通过观察者监听模型事件' . json_encode($demoModel));\n }",
"public function deleted($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n\n if (! $model->wasSearchableBeforeDelete()) {\n return;\n }\n\n if ($this->usingSoftDeletes && $this->usesSoftDelete($model)) {\n $this->whileForcingUpdate(function () use ($model) {\n $this->saved($model);\n });\n } else {\n $model->unsearchable();\n }\n }",
"public function _delete()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"protected function afterDelete()\n {\n }",
"public function after_delete() {}",
"protected function afterDelete()\r\n {\r\n }",
"public static function deleted($callback)\n {\n self::listenEvent('deleted', $callback);\n }",
"public function deleted($model)\n {\n if (static::syncingDisabledFor($model)) {\n return;\n }\n $model->unsearchable();\n }",
"public function forceDeleted($model)\n {\n $this->deleted($model);\n }",
"public function afterDelete($model) \r\n {\r\n $this->updateCounters($model);\r\n $this->foreignTableIDs = array();\r\n }",
"public function delete(Identifiable $model);",
"public function _event_before_delete() {\n\t\tstatic::$_delete['roles'] = $this->roles;\n\t}",
"protected function onDeleted()\n {\n return true;\n }",
"public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}",
"public function forceDeleted(Dispatch $dispatch)\n {\n //\n }",
"public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}",
"public function deleted(MActivityRule $model)\n\t{\n\t}",
"public function deleted() {\n // TODO Implement this\n }",
"public function deleted(Model $comment)\n {\n $user = $comment->post->owner;\n\n $user->notify(new Notification($comment, 'comment_delete_author'));\n }",
"public static function deleted(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::DELETED, $listener, $priority);\n }",
"function after_delete() {}",
"abstract public static function deleted($callback);",
"protected function _postDelete() {}",
"public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}",
"protected function _postDelete() {}",
"protected function performDeleteOnModel()\n {\n $this->getApi()->{'delete'.ucfirst($this->getEntity())}(\n $this->{$this->primaryKey},\n array_merge(...array_values($this->getGlobalScopes()))\n );\n\n $this->exists = false;\n }",
"function before_delete() {}",
"public function register_delete_callback( $callback );",
"public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }",
"public function deleted(EntryInterface $entry)\n {\n //$this->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }",
"protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}",
"public static function deleting($callback, $priority = 0)\n {\n static::registerModelEvent('deleting', $callback, $priority);\n }",
"function OnAfterDeleteItem(){\n }",
"public function delete($model);",
"protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }",
"public function deleting($model)\n\t{\n\t}",
"protected function preDelete( ModelInterface &$model ) {\n }",
"protected function beforeDelete()\n {\n }",
"public function hook_before_delete($id) {\n\n }",
"public function onPreDeleteModel($event)\n {\n if ($this->_properties->sync->enabled) {\n $modelUri = $event->modelUri;\n\n require_once 'Erfurt/Sparql/SimpleQuery.php';\n $query = new Erfurt_Sparql_SimpleQuery();\n $query->setProloguePart('SELECT ?s');\n $query->addFrom($this->_syncModelUri);\n $query->setWherePart(\n 'WHERE {\n ?s <' . EF_RDF_TYPE . '> <' . $this->_properties['syncConfigClass'] . '> .\n ?s <' . $this->_properties['targetModel'] . '> <' . $modelUri . '> .\n }'\n );\n\n $store = Erfurt_App::getInstance()->getStore();\n $result = $store->sparqlQuery($query, array('use_ac' => false));\n\n foreach ($result as $row) {\n $store->deleteMatchingStatements($this->_syncModelUri, $row['s'], null, null, array('use_ac' => false));\n }\n }\n return true;\n }",
"protected static function bootSoftDeleteRelated()\n {\n static::deleting(\n function ($model) {\n if (!empty($relations = $model->getRelations())) {\n foreach ($relations as $key => $value) {\n $model->{$key}()->delete();\n }\n }\n }\n );\n }",
"public function deleted($model)\n {\n $latestPost = $this->post->latestIn($model->forum_id)->first();\n\n $model->forum->update([\n 'latest_post_id' => ($latestPost == null) ? null : $latestPost->id,\n ]);\n }",
"protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }",
"public function deleted(Officer $model)\n {\n $logs = $this->deleteLog('Officer', ['name' => $model->name], auth()->user()->email);\n Log::create($logs);\n }",
"function OnBeforeDeleteItem(){\n }",
"public function onFieldDeleted($button) {}",
"public function hook_after_delete($id) {\n\n }",
"public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }",
"public function postDelete(ModelLifecycleArguments $args)\n {\n $model = $args->getModel();\n if (false === $this->shouldProcess($model)) {\n return;\n }\n try {\n $this->getManager()->accountPushDelete($model);\n } catch (\\Exception $e) {\n if (true === $this->container->getParameter('kernel.debug')) {\n throw $e;\n }\n RequestUtility::notifyException($e);\n }\n }",
"public static function deleted($event) {\n\n\t\t$account = $event->getSubject();\n\n\t}",
"public function onAfterDelete()\n {\n parent::onAfterDelete();\n $this->createAudit($this->owner->toMap());\n }",
"public function afterDeleteCommit(): void\n {\n }",
"function onDelete()\n\t{\n\t\treturn $this->getLookupTable()->deleteKey($this->getValue());\n\t}",
"public function delete(Model $model);",
"public function delete(Model $model);",
"public function ___deleted(Saveable $item) { \n\t\t$this->log(\"Deleted\", $item);\n\t}",
"public function afterDelete(\\Model $model) {\n $this->__clearCacheModel($model);\n\n parent::afterDelete($model);\n }",
"public static function bootTicketable()\n {\n static::deleted(function (self $model) {\n $model->bookings()->delete();\n });\n }",
"public abstract function deleteModel(\\MPF\\Db\\Model $model);",
"protected function afterDelete()\n {\n parent::afterDelete();\n //Comment::model()->deleteAll('post_id='.$this->id);\n VideoTag::model()->updateFrequency($this->tags, '');\n }",
"protected function performDeleteOnModel()\n {\n $this->performCascadeDelete();\n parent::performDeleteOnModel();\n }",
"public function deleted(EntryInterface $entry)\n {\n $this->commands->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }",
"public function onRemove();",
"public function onAfterDelete()\n {\n if (!$this->owner->ID) {\n return;\n }\n\n // Force SearchUpdater to mark this record as dirty\n // Note: Some extensions require entire hierarchy passed to augmentWrite()\n $manipulation = array();\n foreach (ClassInfo::ancestry($this->owner) as $class) {\n if (!is_subclass_of($class, DataObject::class)) {\n continue;\n }\n\n $tableName = DataObject::getSchema()->tableName($class);\n $manipulation[$tableName] = array(\n 'fields' => array(),\n 'id' => $this->owner->ID,\n 'class' => $class,\n // Note: 'delete' command not actually handled by manipulations,\n // but added so that SearchUpdater can detect the deletion\n 'command' => 'delete'\n );\n }\n\n $this->owner->extend('augmentWrite', $manipulation);\n\n SearchUpdater::handle_manipulation($manipulation);\n }",
"public function afterDelete(Model $model) {\n\t\t$this->__execute(call_user_func_array(array($this->_client, 'getCommand'), $this->__buildDeleteCommand($model)));\n\t}",
"function afterDelete(&$model) {\n\t\t$node = Set::extract($this->node($model), \"0.Node.id\");\n\t\tif (!empty($node)) {\n\t\t\t$model->Node->delete($node);\n\t\t}\n\t}",
"public function delete(){\n $this->probe_requests()->detach();\n\n // Delete the event itself\n $result = parent::delete();\n\n return $result;\n }",
"public function afterDelete(&$id, Entity $entity) { }",
"public static function onAfterDelete(ORM\\Event $event): void\n\t{\n\t\tModel\\Price::clearSettings();\n\t}",
"public function handleDeleted(Deleted $event): void\n {\n $entity = $event->entity();\n\n $this->scheduleRemovingOldDocuments($entity);\n\n $this->elasticsearchManager->commit();\n }",
"protected function afterDelete()\n {\n parent::afterDelete();\n Tag::model()->updateFrequency($this->tags, '');\n }",
"public function deleted(Request $model)\n {\n $models = [\n 'engagement',\n 'address',\n ];\n\n foreach($models as $relation){\n $model->$relation()->delete();\n }\n }",
"public function postEventDel();",
"protected function performDeleteOnModel()\n {\n $this->newQuery()->delete($this->fileName);\n }",
"public static function onAfterDelete(Main\\Event $event)\n\t{\n\t\t$reservationId = (int)$event->getParameter('id')['ID'];\n\t\tif ($reservationId > 0)\n\t\t{\n\t\t\tself::deleteProductReservationMap($reservationId);\n\t\t}\n\t}",
"public function deleted(EntryInterface $entry)\n {\n if (!$entry->isForceDeleting()) {\n event(new UserWasDeleted($entry));\n }\n\n parent::deleted($entry);\n }",
"public function onBeforeDelete()\n {\n parent::onBeforeDelete();\n \n $proxied = $this->getProxiedObject();\n \n // Core SS types are decorated so we know we can call this\n $isCoreType = in_array($proxied->getField('ClassName'), $this->acService->ssCoreTypes());\n if($isCoreType && $proxied->canDeleteOnBlockDelete()) {\n $proxied->delete();\n }\n }",
"public function deleted($model)\n\t{\n\t\t$errors\t\t\t\t\t= new MessageBag;\n\n\t\t//1. check employee doesn't have schedule on the day\n\t\tif($model->calendar()->count())\n\t\t{\n\t\t\t$logs\t\t\t\t= \\App\\Models\\Log::ondate($model->on->format('Y-m-d'))->JoinPersonHasNoScheduleOn($model->on)->joinworkfrompersonon($model->on)->groupby('logs.person_id')->first();\n\n\t\t\tif($logs->count())\n\t\t\t{\n\t\t\t\tforeach ($logs as $key => $value) \n\t\t\t\t{\n\t\t\t\t\t//update schedule \n\t\t\t\t\t$value->created_by \t\t= $model->created_by;\n\n\t\t\t\t\tif(!$value->save())\n\t\t\t\t\t{\n\t\t\t\t\t\t$errors->add('Log', $value->getError());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n if($errors->count())\n {\n\t\t\t$model['errors']\t= $errors;\n\n \treturn false;\n }\n\n return true;\n\t}",
"public function deleted(Contract $contract)\n {\n //\n }",
"public function deleted(Vehicle $vehicle)\n {\n //\n }",
"public function hook_before_delete($id) {\n\t //Your code here\n\n\t }",
"public function hook_before_delete($id) {\n\t //Your code here\n\n\t }",
"public function hook_before_delete($id) {\n\t //Your code here\n\n\t }",
"public function deleted(EntryInterface $entry)\n {\n parent::deleted($entry);\n\n $this->dispatch(new DumpPages());\n }",
"protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll('photo_id='.$this->id);\n\t\tTag::model()->updateFrequency($this->tags, '');\n\t}",
"public static function deleting($callback)\n {\n self::listenEvent('deleting', $callback);\n }",
"public function delete(Model $model)\n {\n }",
"protected function postDeleteHook($object) { }",
"public function delete(){\r\n\t\t// Check for request forgeries\r\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\r\n\t\r\n\t\t// Get the model.\r\n\t\t$model = $this->getModel(\"ManageCompanyEvent\");\r\n\t\t$this->deleteEvents($model);\r\n\t\r\n\t\t$this->setRedirect('index.php?option=com_jbusinessdirectory&view='.$this->input->get('view'));\r\n\t}"
] | [
"0.6865375",
"0.6831504",
"0.6692741",
"0.6684159",
"0.65676033",
"0.65424883",
"0.64742965",
"0.6440437",
"0.64119697",
"0.638705",
"0.63845944",
"0.6310099",
"0.6307518",
"0.62501717",
"0.62064314",
"0.62049645",
"0.6196612",
"0.61641777",
"0.61305994",
"0.61250633",
"0.6088409",
"0.60759753",
"0.6024248",
"0.60167205",
"0.60141",
"0.59840935",
"0.59799135",
"0.59609985",
"0.59553945",
"0.59534407",
"0.5948136",
"0.5927855",
"0.5919175",
"0.59152585",
"0.59151006",
"0.5914985",
"0.5905924",
"0.59027785",
"0.58890504",
"0.58579755",
"0.5842904",
"0.5835998",
"0.5834008",
"0.5833331",
"0.5833309",
"0.5822983",
"0.581253",
"0.5803565",
"0.5796645",
"0.57817054",
"0.57811993",
"0.5774046",
"0.5766802",
"0.5765617",
"0.57597417",
"0.5756746",
"0.572965",
"0.5726575",
"0.5712514",
"0.5689531",
"0.5682314",
"0.5677404",
"0.56581086",
"0.5649527",
"0.5644212",
"0.5644212",
"0.5631707",
"0.562866",
"0.5621664",
"0.5619784",
"0.5619116",
"0.56180716",
"0.5614021",
"0.56123817",
"0.5603422",
"0.5592069",
"0.5579417",
"0.557161",
"0.5569905",
"0.55663913",
"0.5563265",
"0.5555144",
"0.5542912",
"0.5542628",
"0.5534463",
"0.5534375",
"0.5531721",
"0.5525018",
"0.55235666",
"0.5514443",
"0.55130816",
"0.55112034",
"0.55112034",
"0.55112034",
"0.55103743",
"0.5508383",
"0.55082744",
"0.5507921",
"0.5504858",
"0.5504787"
] | 0.6556022 | 5 |
Remove all of the event listeners for the model. | public static function flushEventListeners()
{
if (!isset(static::$dispatcher)) {
return;
}
$instance = new static;
foreach ($instance->getObservableEvents() as $event) {
static::$dispatcher->forget("halcyon.{$event}: ".get_called_class());
}
static::$eventsBooted = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clearListeners()\n {\n $this->listeners = array();\n }",
"protected function flushModelEventListeners()\n {\n foreach (get_declared_classes() as $class) {\n if ($class == 'October\\Rain\\Database\\Pivot') {\n continue;\n }\n\n $reflectClass = new ReflectionClass($class);\n if (\n !$reflectClass->isInstantiable() ||\n !$reflectClass->isSubclassOf('October\\Rain\\Database\\Model') ||\n $reflectClass->isSubclassOf('October\\Rain\\Database\\Pivot')\n ) {\n continue;\n }\n\n $class::flushEventListeners();\n }\n\n ActiveRecord::flushEventListeners();\n }",
"public function clearListeners(string $event): void;",
"protected function _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }",
"public function truncateEventClosures(): void\n {\n $this->listeners = [];\n }",
"public function removeAllListeners($eventName);",
"public static function refreshListeners(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Reset event listeners on all models\n\t\t\tforeach (TestSettings::$modelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t\tforeach (TestSettings::$seededModelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t}\n\t}",
"public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }",
"protected function _unsubscribeFromEngineEvents()\n {\n $events = array(\n Streamwide_Engine_Events_Event::SDP,\n Streamwide_Engine_Events_Event::CHILD,\n Streamwide_Engine_Events_Event::OKMOVED,\n Streamwide_Engine_Events_Event::MOVED,\n Streamwide_Engine_Events_Event::FAILMOVED\n );\n \n $controller = $this->getController();\n foreach ( $events as $event ) {\n $controller->removeEventListener( $event, array( 'callback' => array( $this, 'onSignalReceived' ) ) );\n }\n }",
"public function clearEvents()\n {\n $this->recorded = [];\n }",
"public function clear(): void\n {\n $this->eventRegistry->dequeueEvents();\n }",
"private function uninstallEvents()\n {\n $this->load->model('setting/event');\n $this->model_setting_event->deleteEvent('payment_mundipagg');\n }",
"public function unsetEventDispatcher()\n {\n $this->events = null;\n }",
"public function remove_all_hook() {\n\t\tremove_action( 'all', [ $this, 'wrap_hook_callbacks' ] );\n\t}",
"public static function offAll()\n {\n self::$_events = [];\n self::$_eventWildcards = [];\n }",
"public function clearEvents()\n\t{\n\t\t$this->collEvents = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::deleting(function ($model) {\n $model->roles()->detach();\n $model->routes()->detach();\n $model->actions()->detach();\n });\n }",
"public function detach(EventManagerInterface $events)\r\n {\r\n foreach ($this->listeners as $index => $listener) {\r\n if ($events->detach($listener)) {\r\n unset($this->listeners[$index]);\r\n }\r\n }\r\n }",
"public function removeParseListeners(): void\n {\n $this->parseListeners = [];\n }",
"public function reset() {\n $this->_events->reset();\n }",
"public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($listener[$index]);\n }\n }\n }",
"public static function removeAllListeners(string $event) : void\n {\n if (Event::hasListeners($event)) {\n unset(Event::$listeners[$event]);\n }\n }",
"public function detach(EventManagerInterface $events)\n {\n array_walk($this->listeners, array($events,'detach'));\n $this->listeners = array();\n }",
"public function detach(): void\n\t{\n\t\t$this->events->detach($this->type, $this->hook);\n\t}",
"protected function forgetAddedModels()\n {\n $this->quantities = $this->modelPopulators = [];\n }",
"public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }",
"public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }",
"public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }",
"public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }",
"protected static function booted(): void\n {\n static::deleting(function (Model $model) {\n $model->removeAllImages();\n });\n }",
"public function getModelEvents();",
"protected static function boot()\n {\n \tparent::boot();\n\n \tstatic::deleting(function($model) {\n \t\t$model->attributes()->sync([]);\n \t});\n }",
"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 clearAllCommand()\n {\n $this->eventRepository->removeAll();\n $this->eventSourceRepository->removeAll();\n }",
"public function clearRecordedEvents()\n {\n $this->events = [];\n }",
"public static function clearAllHandlers(): void\n {\n foreach (self::registeredSignals() as $signal) {\n self::clearHandlers($signal);\n }\n }",
"public function detachAll() {}",
"public function clear()\n {\n $this->events = [];\n return $this;\n }",
"public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $i => $listener) {\n if ($events->getSharedManager()->detach(MainProcessor::EVENT_MANAGER_ID, $listener)) {\n unset($this->listeners[$i]);\n }\n }\n }",
"function UnInstallEvents()\n\t{\n\t}",
"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 detach(EventCollection $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }",
"public static function boot()\n {\n static::deleting(function ($lessonPlan)\n {\n $lessonPlan->tags()->detach();\n\n \n foreach ($lessonPlan->activities as $activity) {\n $activity->delete();\n }\n \n });\n }",
"public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::deleting(function($model) {\n $model->categories()->detach();\n $model->attributes()->detach();\n\n // Delete product images\n $disk = 'uploads';\n\n foreach ($model->images as $image) {\n // Delete image from disk\n\n Storage::disk($disk)->delete($image->name);\n\n\n // Delete image from db\n $image->delete();\n }\n });\n }",
"static public function deleteHandlers()\n\t{\n\t\tself::$handlers = array();\n\t}",
"public function stop(): void\n {\n $this->entityManager->getEventManager()->removeEventListener($this->initializeEvents, $this);\n }",
"public function removeListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events)) {\n\t\t\tstatic::$events[$event] = [];\n\t\t} else {\n\t\t\tforeach (static::$events as $evt => $events)\n\t\t\t\tstatic::$events[$evt] = [];\n\t\t}\n\t}",
"public function removeAll()\n {\n foreach ($this->findAll() as $object) {\n $this->remove($object);\n }\n }",
"public function setEventHandlers()\n {\n Event::on(Menu::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n });\n \n // Set eventhandlers for the 'MenuItem' model\n Event::on(MenuItem::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n }); \n }",
"public function erase_history()\n {\n $this->_event_history = [];\n }",
"public function remove($listener);",
"public function destroy()\n {\n $this->stop();\n $this->setupListeners();\n }",
"public function unsetAll() {\n\t\tparent::unsetAll();\n\t}",
"public function releaseEvents();",
"public function releaseEvents();",
"public static function boot()\n {\n parent::boot();\n\n //delete your related models here, for example\n static::deleting(function($video)\n {\n foreach($video->videoImage as $image)\n {\n $image->delete();\n } \n\n foreach($video->userHistory as $history)\n {\n $history->delete();\n } \n\n foreach($video->userRating as $rating)\n {\n $rating->delete();\n } \n\n foreach($video->userWishlist as $wishlist)\n {\n $wishlist->delete();\n } \n });\t\n\n }",
"private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }",
"public function onRemove();",
"public static function clearCache()\n {\n static::$eventMap = [];\n \\Cache::forget(static::EVENT_CACHE_KEY);\n }",
"public static function clearCache()\n {\n static::$eventMap = [];\n \\Cache::forget(static::EVENT_CACHE_KEY);\n }",
"public function clearModels();",
"public function clear()\n {\n $this->connection->del($this->key);\n\n if ($this->on_change) {\n call_user_func($this->on_change, []);\n }\n\n if ($this->on_clear) {\n call_user_func($this->on_clear, []);\n }\n }",
"public static function boot()\n {\n parent::boot();\n\n //Bindando o deleting para remover as relationships\n static::deleting(function ($model) {\n DeleteModelHelper::deleteRelationships($model);\n });\n }",
"public function __destruct()\n\t{\n\t\tif (static::$instance != NULL)\n\t\t\tstatic::$instance = NULL;\n\t\tforeach (static::$events as $event => $events)\n\t\t\tstatic::$events[$event] = [];\n\t}",
"public function detachShared(SharedEventManagerInterface $events)\n\t\t{\n\t\t\tforeach ($this->listeners as $index => $listener) {\n\t\t\t if ($events->detach($index, $listener)) {\n\t\t\t\t unset($this->listeners[$index]);\n\t\t\t }\n\t\t }\n\t\t}",
"public function stopListeningForEvents()\n\t\t{\n\n\t\t\t// Initialize the crontab manager if this has not been done before\n\t\t\tif(is_null($this->CronManager)) $this->CronManager = new ssh2_crontab_manager();\n\n\t\t\t// Stop cronjob to call $this-->captureSongHistory()\n\t\t\t$this->CronManager->remove_cronjob(\"checkTimeEventExecutionNeeds\");\n\n\t\t\t// Write status to the config\n\t\t\t$this->data['config']['mod_time__checkTimeEventExecutionNeedsCron'] = \"disabled\";\n\t\t\t$this->writeConfFile($this->data['config'], true);\n\n\t\t}",
"public function detach(EventManagerInterface $eventManager)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($eventManager->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }",
"public function unsetEventTypes(): void\n {\n $this->eventTypes = [];\n }",
"public function detach(EventManagerInterface $events)\n {\n $sharedManager = $events->getSharedManager();\n\n foreach ($this->listeners as $index => $listeners) {\n if ($listeners === $this) {\n continue;\n }\n\n if ($listeners instanceof ListenerAggregateInterface) {\n $listeners->detach($events);\n }\n\n $events->detach($listeners);\n }\n\n /** @var array $sharedListeners */\n foreach ($this->sharedListeners as $id => $sharedListeners) {\n foreach ($sharedListeners as $index => $listener) {\n if ($listener === $this) {\n continue;\n }\n\n if ($listener instanceof ListenerAggregateInterface) {\n $listener->detach($events);\n }\n\n $sharedManager->detach($listener, $id);\n }\n }\n }",
"public function uninstall() {\n $this->helper_pricealert->deleteTables();\n $this->__deleteEvents();\n }",
"public function detachShared(SharedEventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $callback) {\n if ($events->detach('', $callback)) {\n unset($this->listeners[$index]);\n }\n }\n }",
"public function removeAll() {\n\t\t$this->addedObjects = new \\SplObjectStorage();\n\t\tforeach ($this->findAll() as $object) {\n\t\t\t$this->remove($object);\n\t\t}\n\t}",
"public static function loadListeners()\n {\n $manager = self::instance();\n $plugins = Plugin::loaded();\n\n foreach ($plugins as $plugin) {\n $events = Plugin::getData($plugin, 'events')->getArrayCopy();\n foreach ($events as $name => $config) {\n if (is_numeric($name)) {\n $name = $config;\n $config = [];\n }\n\n $class = App::className($name, 'Event');\n $config = (array) $config;\n\n if ($class !== false) {\n $listener = new $class($config);\n $manager->on($listener, $config);\n }\n }\n }\n }",
"public static function boot()\n\t{\n\t\tparent::boot();\n\n\t\t// Setup event bindings...\n\t\tOrder::deleted( function($order)\n\t\t{\n\t\t\tDB::table('history')->where('historable_id', '=', $order->id)->where('historable_type', '=', 'Order')->delete();\n\t\t});\n\t}",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n foreach (static::$handleableEvents as $event) {\r\n static::$event(function($model) use ($event) {\r\n /** @var Model $model */\r\n return $model->handleEvent($event);\r\n });\r\n }\r\n }",
"public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}",
"public final function destroy_all()\n {\n }",
"public function clearEtablissementEvents()\n {\n $this->collEtablissementEvents = null; // important to set this to null since that means it is uninitialized\n $this->collEtablissementEventsPartial = null;\n\n return $this;\n }",
"public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }",
"public function unregister()\n {\n $previousHandlers = $this->previousHandlers;\n\n foreach ($previousHandlers as $signal => $handler) {\n if (is_null($handler)) {\n pcntl_signal($signal, SIG_DFL);\n\n unset($previousHandlers[$signal]);\n }\n }\n\n $this->setHandlers($previousHandlers);\n }",
"public function cleanup(Model $model) {\n parent::cleanup($model);\n }",
"public function removeNotifications()\n {\n foreach ($this->notifications as $notification) {\n $notification->delete();\n }\n }",
"public function tearDown() {\n\t\tparent::tearDown();\n\t\tunset($this->Event, $this->EventClass);\n\t\tunset($this->ObjectEvent, $this->ControllerEvent, $this->ModelEvent, $this->ViewtEvent);\n\t\tunset($this->ModelObject, $this->ViewObject, $this->ControllerObject);\n\t}",
"public static function bootTicketable()\n {\n static::deleted(function (self $model) {\n $model->bookings()->delete();\n });\n }",
"public function __destruct()\n {\n\tunset($this->model);\n }",
"protected static function bootFavoritable()\n {\n static::deleting(function ($model){\n $model->favorites->each(function ($favorite){\n $favorite->delete();\n });\n });\n }",
"public static function unsetEventDispatcher()\n {\n static::$dispatcher = null;\n }",
"public static function bootNotificable()\n {\n if (static::$removeNotificationsOnDelete) {\n static::deleting(function ($model) {\n $model->removeNotifications();\n });\n }\n }",
"public function deleteAllDependents() {\n\t\t$this->dependents = array();\n\t}",
"public function getSubscribedEvents()\n {\n return [\n Events::postFlush,\n Events::preRemove\n ];\n }",
"public function remove_hooks()\n {\n }",
"public function remove_hooks()\n {\n }",
"public function remove($event, $listener);",
"public function removeEventSubscriber(IEventSubscriber $subscriber);",
"public function removeValidation() {\n\n\t\t$fields = $this->getFields();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$field->clearValidationRules();\n\t\t}\n\t}",
"public function boot(): void\n {\n foreach ($this->observers as $model => $observer) {\n foreach ($observer as $item) {\n $model::observe($item);\n }\n }\n\n foreach ($this->listen as $event => $listeners) {\n foreach (array_unique($listeners, SORT_REGULAR) as $listener) {\n Event::listen($event, $listener);\n }\n }\n }",
"protected function removeHelperActionsAfterSend(): void\n {\n $this->removeFailedListeners();\n $this->restoreCharsetForMailer();\n $this->restoreLocaleForMailer();\n $this->removeFilterFromForMailer();\n }",
"public function getSubscribedEvents()\n {\n return [\n 'postPersist',\n 'postUpdate',\n 'preRemove',\n ];\n }"
] | [
"0.72185004",
"0.7038131",
"0.6562188",
"0.6499303",
"0.62880194",
"0.62850404",
"0.62729406",
"0.62289345",
"0.6173481",
"0.6137445",
"0.6128501",
"0.60808",
"0.6031795",
"0.5940962",
"0.5936264",
"0.5921797",
"0.5897268",
"0.58515596",
"0.5838792",
"0.57996774",
"0.5750365",
"0.5726712",
"0.57180995",
"0.5710847",
"0.5693533",
"0.56841654",
"0.56841654",
"0.56841654",
"0.56841654",
"0.5678493",
"0.5668922",
"0.56284964",
"0.56115186",
"0.560323",
"0.558557",
"0.5570619",
"0.55571526",
"0.5543737",
"0.55293804",
"0.55260336",
"0.5514855",
"0.5479862",
"0.5472393",
"0.5463931",
"0.5461835",
"0.54572296",
"0.54461086",
"0.54257256",
"0.5420663",
"0.54181504",
"0.53484154",
"0.53344065",
"0.5322129",
"0.5318394",
"0.53065807",
"0.53065807",
"0.530306",
"0.5265005",
"0.5263827",
"0.52548647",
"0.52548647",
"0.52442837",
"0.5242754",
"0.5228071",
"0.52202797",
"0.5213366",
"0.5209657",
"0.5208934",
"0.5207437",
"0.519556",
"0.5194415",
"0.5193321",
"0.51880777",
"0.5175418",
"0.5166829",
"0.51551974",
"0.5153299",
"0.51319844",
"0.5129419",
"0.51222026",
"0.5120077",
"0.5116197",
"0.51142746",
"0.5104317",
"0.50916195",
"0.50816095",
"0.50782037",
"0.5078162",
"0.50776595",
"0.5077163",
"0.5073989",
"0.5064625",
"0.5043582",
"0.5043582",
"0.5041765",
"0.5028956",
"0.50272363",
"0.50209963",
"0.5012699",
"0.50074255"
] | 0.6484137 | 4 |
Register a model event with the dispatcher. | protected static function registerModelEvent($event, $callback, $priority = 0)
{
if (isset(static::$dispatcher)) {
$name = get_called_class();
static::$dispatcher->listen("halcyon.{$event}: {$name}", $callback, $priority);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModelEvents();",
"public function registerDocumentModelEvent(ModelEvent $event)\n {\n if (!$this->enabled) {\n return;\n }\n if ((!($dbEvents = $this->getConfigValue('database', 'array')))) {\n return;\n }\n if (!in_array($event->getAction(), $dbEvents)) {\n return;\n }\n\n $data = (object) [\n 'class' => $event->getCollectionClass()\n ];\n\n /** @var AuditTracking $audit */\n $audit = new $this->documentName();\n $audit->setAction($event->getAction());\n $audit->setType('collection');\n $audit->setData($data);\n $audit->setLocation($this->globalRequestLocation);\n $audit->setCollectionId($event->getCollectionId());\n $audit->setCollectionName($event->getCollectionName());\n $audit->setCreatedAt(new \\DateTime());\n\n $this->events[] = $audit;\n }",
"public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }",
"protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\n\t}",
"protected function fireModelEvent(Event $event)\n {\n static::getEventDispatcher()->fire($event);\n }",
"protected function onModelCreated()\n {\n if ($this->addLeaf != null) {\n $this->addLeaf->setName(\"Add\");\n $this->model->addLeaf = $this->addLeaf;\n }\n\n // Hook up the event handler that returns a selection item for a given model.\n $this->model->getItemForModelEvent->attachHandler(function(Model $model){\n return $this->makeItemForValue($model->getUniqueIdentifier());\n });\n\n parent::onModelCreated();\n }",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n\t{\n\t\tif ($event->getEntity() == Asm_Solr_Model_Cms_Page::ENTITY\n\t\t\t&& $event->getType() == Mage_Index_Model_Event::TYPE_SAVE\n\t\t) {\n\t\t\t$event->setData('solr_update_page_id', $event->getDataObject()->getId());\n\t\t}\n\t}",
"function eventRegister($eventName, EventListener $listener);",
"public function setEvent(MvcEvent $event)\n\t{\n\t\t$this->viewModel = $event->getViewModel();\n\t}",
"public function setModelDispatcher(ModelDispatcher $modelDispatcher)\n {\n $this->modelDispatcher = $modelDispatcher;\n }",
"public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public function setModelEndpoint($model);",
"public static function bootBroadcastChanges()\n {\n static::created(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelCreated($model, $channel));\n });\n\n static::updated(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelChanged($model, $channel));\n });\n\n static::deleted(function ($model) {\n $channel = strtolower(class_basename(get_class($model)));\n event(new ModelTrashed($model, $channel));\n });\n }",
"public function setEventDispatcher(IlluminateDispatcher $events)\n\t{\n\t\t$this->neoeloquent->setEventDispatcher(\\App::make(Dispatcher::class));\n\t}",
"protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }",
"protected function registerModelBindings()\n {\n $this->app->bind(LogContract::class, Log::class);\n }",
"public function registerEvent(EventInterface $event);",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n $notification = self::find($model->id);\n broadcast(new SiteNotification($notification));\n });\n\n }",
"protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n foreach (static::$handleableEvents as $event) {\r\n static::$event(function($model) use ($event) {\r\n /** @var Model $model */\r\n return $model->handleEvent($event);\r\n });\r\n }\r\n }",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n {\n $event->addNewData(self::EVENT_MATCH_RESULT_KEY, TRUE);\n switch ($event->getEntity()) {\n case Mage_Catalog_Model_Product::ENTITY:\n $this->_registerCatalogProductEvent($event);\n break;\n case Mage_Catalog_Model_Category::ENTITY:\n $this->_registerCatalogCategoryEvent($event);\n break;\n case Mage_Catalog_Model_Convert_Adapter_Product::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n case Mage_Core_Model_Config_Data::ENTITY:\n $stores = TRUE;\n if ($event->getDataObject()->getScope() == 'stores') {\n $stores = array($event->getDataObject()->getScopeId());\n } else if ($event->getDataObject()->getScope() == 'websites') {\n $stores = Mage::app()->getWebsite($event->getDataObject()->getScopeId())->getStoreIds();\n }\n if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsUpdate)) {\n $event->addNewData('algoliasearch_update_settings', $stores);\n } else if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsReindex)) {\n $event->addNewData('algoliasearch_reindex_all', $stores);\n }\n break;\n case Mage_Core_Model_Store::ENTITY:\n case Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY:\n case Mage_Core_Model_Store_Group::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n }\n }",
"protected function collectModelEvent($event, $model)\n\t{\n\t\t$lastQuery = ($queryCount = count($this->queries)) ? $this->queries[$queryCount - 1] : null;\n\n\t\t$action = [\n\t\t\t'model' => $modelClass = get_class($model),\n\t\t\t'key' => $this->getModelKey($model),\n\t\t\t'action' => $event,\n\t\t\t'attributes' => $this->collectModelsRetrieved && $event == 'retrieved' ? $model->getOriginal() : [],\n\t\t\t'changes' => $this->collectModelsActions && method_exists($model, 'getChanges') ? $model->getChanges() : [],\n\t\t\t'time' => microtime(true) / 1000,\n\t\t\t'query' => $lastQuery ? $lastQuery['query'] : null,\n\t\t\t'duration' => $lastQuery ? $lastQuery['duration'] : null,\n\t\t\t'connection' => $lastQuery ? $lastQuery['connection'] : null,\n\t\t\t'trace' => null,\n\t\t\t'tags' => []\n\t\t];\n\n\t\tif ($lastQuery) $this->queries[$queryCount - 1]['model'] = $modelClass;\n\n\t\tif (! $this->passesFilters([ $action ], 'models-early')) return;\n\n\t\t$this->incrementModelsCount($action['action'], $action['model']);\n\n\t\tif (! $this->collectModelsActions) return;\n\t\tif (! $this->collectModelsRetrieved && $event == 'retrieved') return;\n\t\tif (! $this->passesFilters([ $action ], 'models')) return;\n\n\t\t$action['trace'] = (new Serializer)->trace(StackTrace::get()->resolveViewName());\n\n\t\t$this->modelsActions[] = $action;\n\t}",
"function addEvent($event) {\n Event::addEvent($event);\n }",
"public function add(Model $model) {\n $this->models[get_class($model)] = $model;\n }",
"protected static function bootEvent()\n {\n static::saving(function (Item $model) {\n if (is_null($model->getAttributeFromArray('quantity_per_bundle'))) {\n $model->quantity_per_bundle = $model->getDenominationRelationValue()->quantity_per_bundle;\n }\n\n if (!$model->is_order_custom_quantity) {\n $model->quantity = $model->countQuantityAttribute();\n }\n });\n }",
"public function register() : void\n {\n $this->registerDefaultEventSourcingBindings();\n $this->registerEventStore();\n }",
"private function registerEventStore() : void\n {\n $this->app->bind(IlluminateEventStore::class, function ($app) {\n $connection = $app->make(Connection::class);\n $serializer = $app->make(Serializer::class);\n $eventStoreTable = $app->config->get('event_sourcing.event_store_table');\n\n return new IlluminateEventStore(\n $connection,\n $serializer,\n $eventStoreTable\n // decorators (we could decorate the stream with account_id)\n );\n });\n\n $this->app->bind(\n EventStore::class,\n IlluminateEventStore::class\n );\n }",
"public function setEventDispatch(\\Montage\\Event\\Dispatch $dispatch);",
"private function dispatchModelEvent($action, $collection)\n {\n if (!($this->repository instanceof DocumentRepository)) {\n return;\n }\n if (!method_exists($collection, 'getId')) {\n return;\n }\n\n $event = new ModelEvent();\n $event->setCollectionId($collection->getId());\n $event->setActionByDispatchName($action);\n $event->setCollectionName($this->repository->getClassMetadata()->getCollection());\n $event->setCollectionClass($this->repository->getClassName());\n $event->setCollection($collection);\n\n $this->eventDispatcher->dispatch($event, $action);\n }",
"public function register(EventDispatcher $dispatcher)\n {\n $dispatcher->connect('core.exception', array($this, 'handle'));\n }",
"public function setDispatcherEvents()\n\t{\n\t\t$this->dispatcher = (new Dispatcher())->register($this->routes);\n\t}",
"protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"public function onEvent($event)\n\t{\n\t\tif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_BEFORE_INSERT)\n\t\t{\n\t\t\t/**\n\t\t\t * If document_id is set in the model the service will first try to pull \n\t\t\t * the document to update it. If it is unable to get the record \n\t\t\t * (it will be since this is an insert) it will do nothing and \n\t\t\t * the document will not be inserted.\n\t\t\t */\n\t\t\t$event->model->document_id = NULL;\n\t\t\t$result = $this->saveDocument($event->model);\n\t\t\t$event->model->document_id = $result->item->document_id;\n\t\t}\n\t\telseif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_UPDATE)\n\t\t{\n\t\t\t$this->saveDocument($event->model);\n\t\t}\n\t}",
"abstract public function apply(Event $event) : Model;",
"public function notify($type, \\Phalcon\\Mvc\\CollectionInterface $model){ }",
"protected function registerEloquentObservers()\n {\n App\\User::observe(Observers\\UserObserver::class);\n }",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n /*\r\n $event->beforeDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (DragConfig $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (DragConfig $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n {\n return $this;\n }",
"public function attach(IObservable_1 $model)\n\t{\n\t\t$model->attachObserver($this->delegate);\n\t}",
"public function register(): void\n {\n $eventManager = EventManager::getInstance();\n\n $this->discoverEvents();\n\n foreach ($this->getListeners() as $moduleName => $moduleEvents) {\n foreach ($moduleEvents as $eventName => $eventListeners) {\n foreach (array_unique($eventListeners) as $listener) {\n $eventManager->addEventHandler(\n $moduleName,\n $eventName,\n [$listener, 'handle']\n );\n }\n }\n }\n }",
"public function dispatchEvent($event);",
"protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }",
"public function registerEvents()\n {\n $this->subscribeEvent(\n 'Shopware_Controllers_Widgets_Emotion_AddElement',\n 'onEmotionAddElement'\n );\n\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Widgets_Campaign',\n 'extendsEmotionTemplates'\n );\n\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n\n /**\n * Subscribe to the post dispatch event of the emotion backend module to extend the components.\n */\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Emotion',\n 'onPostDispatchBackendEmotion'\n );\n }",
"public function afterDispatch(MvcEvent $event) {\n\t}",
"public function registerEvent($event, $object, $fn){\n\t\t$this->actions[$event][] = new \\OWeb\\manage\\events\\Event($object, $fn);\n\t}",
"public static function bootHasAttributeEvents()\n {\n // Event fired after a model has been successfully saved (inserted or updated) by Laravel\n static::saved(function($model) {\n $model->fireAttributeEvents();\n $model->callAttributeSavedMethods();\n });\n }",
"public function visitModel(ModelInterface $model)\n {\n foreach ($this->getEvents() as $event) {\n $model->getEventManager()->attach($event, [$this, 'onExecute']);\n }\n }",
"public static function register($modelName): void\n {\n if (!\\in_array($modelName, self::$smartObjectRegistry, true)) {\n self::$smartObjectRegistry[] = $modelName;\n }\n }",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"function setup(&$model) {\r\n\t\tif (!array_key_exists($model->name, $this->models)) {\r\n\t\t\t$this->models[$model->name] =& $model;\r\n\t\t}\r\n\t}",
"public function boot()\n {\n $this->registerModelObservers();\n }",
"protected function event($event)\n {\n if(isset($this->events)) {\n $this->events->dispatch($event);\n }\n }",
"function addModel(){\n\t\n\t}",
"public function addEvent($event){\n $this->events[]=$event;\n }",
"public function consumeModel(Model $model);",
"private function installEvents()\n {\n $this->load->model('setting/event');\n\n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/customer/editCustomer/after',\n 'extension/payment/mundipagg_events/onCustomerEdit'\n );\n \n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/address/addAddress/after',\n 'extension/payment/mundipagg_events/onAddressAdd'\n );\n }",
"public function prepareRootModel(MvcEvent $e)\n {\n if ('json' == $this->type) {\n $e->setViewModel(new JsonModel);\n } elseif ('feed' == $this->type) {\n $e->setViewModel(new FeedModel);\n } else {\n $e->setViewModel(new ViewModel);\n }\n }",
"private function registerDispatcher()\n\t{\n\t\t$abstract = 'Cerbero\\Workflow\\Wrappers\\DispatcherInterface';\n\n\t\t$this->app->bind($abstract, function($app)\n\t\t{\n\t\t\treturn $app['Cerbero\\Workflow\\Wrappers\\MarshalDispatcher'];\n\t\t});\n\t}",
"public function addEventSubscriber(IEventSubscriber $subscriber);",
"protected function fireFormEvent($event, Model $model)\n {\n return Event::until('form.'.$event, [$model]);\n }",
"protected static function boot()\n {\n parent::boot();\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName()).\n */\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n \n return true;\n });\n }",
"public function register()\n {\n $this->app['events']->listen('eloquent.saving*', function($model){\n if($model instanceof SluggableInterface)\n {\n Log::info('Slugging');\n $model->sluggify();\n }\n });\n }",
"public function setModel(Model $model);",
"public function initModel() {\n\t\t\tAppLoader::includeModel('UserEventModel');\n\t\t\t$objUserEvent = new UserEventModel();\n\t\t\treturn $objUserEvent;\n\t\t}",
"protected function registerEvents()\n {\n Category::observe($this->app->make(CategoryObserver::class));\n Content::observe($this->app->make(ContentObserver::class));\n\n return $this;\n }",
"protected function fireStatusEvents(Registration $model)\n {\n # if the Registration is not for HCP, we do not care\n if(!$model->is_hcp) return;\n # we have final state\n $next = $model->getAttribute($this->statusField);\n # Map the status to events and fire them all\n if ($event = array_get($this->statusEvents, $next)){\n event (new $event($model));\n }\n }",
"public function afterDispatch(DispatchEvent $event);",
"public function notify(string $type, \\Phalcon\\Mvc\\ModelInterface $model)\n {\n }",
"public function boot()\n {\n BelongsTo::setEventDispatcher($this->app['events']);\n HasMany::setEventDispatcher($this->app['events']);\n HasOne::setEventDispatcher($this->app['events']);\n MorphMany::setEventDispatcher($this->app['events']);\n MorphOne::setEventDispatcher($this->app['events']);\n MorphTo::setEventDispatcher($this->app['events']);\n }",
"public static function bootHasUuid() {\n\n $self = new self;\n\n $self->initializeHasUuid();\n\n if ( ! is_string($self->attachEvent) ) {\n\n return;\n }\n\n\t\tstatic::{$self->attachEvent}(function($model) use ($self) {\n \n if ( $self::$disbaleUuidGeneration ) {\n\n return;\n }\n \n $uuidFieldName = $self->getUuidFieldName();\n\n if ( ! $self->canHaveUuid($model->getTable(), $uuidFieldName) ) {\n\n return;\n }\n \n $model->{$uuidFieldName} ?: $model->{$uuidFieldName} = $self->generateUuid();\n\n if ( in_array($self->attachEvent, $self->saveActionForEvents) ) {\n\n method_exists($self, 'saveQuietly') ? $model->saveQuietly() : $model->saveModelQuietly();\n }\n });\n\t}",
"protected function registerActionComponentEloquent()\n {\n $this->app->bind('antares.component.action', function () {\n return new Action();\n });\n }",
"function __construct($model)\n {\n $this->model = $model;\n }",
"public function register(Doku_Event_Handler $controller)\n {\n $controller->register_hook('HTML_EDITFORM_OUTPUT', 'BEFORE', $this, '_edit_form'); // release Hogfather and below\n $controller->register_hook('FORM_EDIT_OUTPUT', 'BEFORE', $this, '_edit_form'); // release Igor and above\n\n $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, '_action_act_preprocess');\n $controller->register_hook('TPL_ACT_UNKNOWN', 'BEFORE', $this, '_tpl_act_changes');\n }",
"public function setModel(Model $model) : void\n {\n $this->model = $model;\n\n $this->fm = FunctionMap::loadFunctionMap();\n }",
"private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }",
"public function subscribe($event)\n {\n $event->listen('eloquent.saved: Setting', 'App\\Observers\\SettingObserver@saved');\n }",
"public function register()\n {\n $this->app->singleton(RouteEventRegister::class, function ($app) {\n return new RouteEventRegister;\n });\n }",
"protected function setReturnModel($model){\r\n array_push($this->models,$model);\r\n }",
"public function event(): EventDispatcherInterface;",
"public function broadcastEvent(\\Montage\\Event\\Event $event);",
"public static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::uuid1()->toString();\n });\n }",
"public function registerEvents(Container $container)\n {\n $container->singleton('events', function ($container) {\n return (new Dispatcher($container))->setQueueResolver(function () use ($container) {\n return $container->make(QueueFactoryContract::class);\n });\n });\n }",
"public function __construct(NotificationModel $model)\n {\n $this->model = $model;\n }",
"public function beforeDispatch(DispatchEvent $event);",
"protected static function boot()\n {\n parent::boot();\n\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = Uuid::generate()->string;\n });\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n Event::dispatch(new UserCreated($model));\n });\n }",
"protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }",
"public function register(Doku_Event_Handler $controller) {\n $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'handle_export_action');\n }",
"public function pushEvent($name)\n {\n $this->data['event'] = $name;\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::created(function ($model) {\n //Get the client model\n $client = $model->client;\n\n //Increment the number of plots\n $client->increment('plot_total');\n });\n }",
"public static function boot()\n {\n parent::boot();\n static::creating(function ($model) {\n $model->key = 'store_' . md5(Str::random(14) . time());\n });\n }",
"public function injectEventDispatcher(\\EssentialDots\\ExtbaseHijax\\Event\\Dispatcher $eventDispatcher) {\n\t\t$this->hijaxEventDispatcher = $eventDispatcher;\n\t}",
"protected function _subscribeToEngineEvents()\n {\n $controller = $this->getController();\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array(\n 'callback' => array( $this, 'onEndOfFax' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }",
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"public function subscribe($eventDispatcher) {\n // Listen to ArticlePrePersisttEvent emission\n // THis can be emitted thorugh event(new Arti..Event) helper method, or through $dipatchEvents array in any Model\n $eventDispatcher->listen(\n UserPrePersistEvent::class,\n 'App\\Listeners\\UserSubscriber@onPrePersist'\n\n );\n }",
"public function register( \\Aimeos\\MW\\Observer\\Publisher\\Iface $p );",
"public function addSubscriber(EventSubscriberInterface $subscriber);",
"protected function registerModelBindings()\n {\n $this->app->bind('AuzoToolsPermissionRegistrar', config('auzoTools.registrar'));\n $this->app->bind('GenerateAbilities', GenerateAbilities::class);\n }",
"public static function boot()\n {\n parent::boot();\n self::creating(function($model) {\n $model->reference = $model->generateReference();\n });\n }"
] | [
"0.6501016",
"0.6453853",
"0.60835004",
"0.60735255",
"0.6029853",
"0.56127524",
"0.55811983",
"0.5530698",
"0.54611063",
"0.5442325",
"0.54347765",
"0.5424129",
"0.5386761",
"0.53820634",
"0.53743255",
"0.53215265",
"0.5313584",
"0.5302551",
"0.5290838",
"0.5286662",
"0.528395",
"0.5282649",
"0.5241718",
"0.52376246",
"0.52330583",
"0.5231065",
"0.52095956",
"0.5189934",
"0.51724184",
"0.5128728",
"0.5124431",
"0.5112795",
"0.5091764",
"0.50799376",
"0.5054231",
"0.5022146",
"0.500798",
"0.5007486",
"0.49940854",
"0.49918038",
"0.4988375",
"0.49810007",
"0.49502364",
"0.49499485",
"0.4934697",
"0.49265283",
"0.4912176",
"0.49071205",
"0.4879276",
"0.48781106",
"0.48671103",
"0.4866141",
"0.4863002",
"0.4861372",
"0.4853852",
"0.4849318",
"0.48487672",
"0.48382893",
"0.48342595",
"0.48335585",
"0.48149434",
"0.47993106",
"0.47861642",
"0.47834006",
"0.477957",
"0.47686842",
"0.4754035",
"0.47516772",
"0.47507113",
"0.4747481",
"0.47454184",
"0.47424686",
"0.47415864",
"0.4738699",
"0.47330305",
"0.4730623",
"0.47277942",
"0.47261304",
"0.47191182",
"0.4716529",
"0.47095978",
"0.47069585",
"0.4705374",
"0.47011906",
"0.47008163",
"0.46875474",
"0.46874103",
"0.4684794",
"0.46836",
"0.46760342",
"0.46746182",
"0.46729705",
"0.4670053",
"0.46666345",
"0.46638516",
"0.46632826",
"0.46518913",
"0.46476585",
"0.46462965",
"0.46444675"
] | 0.6459546 | 1 |
Get the observable event names. | public function getObservableEvents()
{
return array_merge(
[
'creating', 'created', 'updating', 'updated',
'deleting', 'deleted', 'saving', 'saved',
'fetching', 'fetched'
],
$this->observables
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEventNames()\n {\n return array_keys($this->events);\n }",
"public function getEventNames(){\n return array($this->getEventName() => array($this,'handle'));\n }",
"public function getEventNames()/*# : array */;",
"public static function getEventNames()\n {\n return array(\n self::CREATE_CONNECTION,\n self::DEPLOY_COMMAND_COMPLETE,\n self::DEPLOY_RELEASE,\n self::DEPLOY_RELEASE_COMPLETE,\n self::DEPLOY_RELEASE_FAILED,\n self::GATHER_FACTS,\n self::GET_WORKSPACE,\n self::INITIALIZE,\n self::INSTALL_COMMAND_COMPLETE,\n self::INSTALL_RELEASE,\n self::INSTALL_RELEASE_COMPLETE,\n self::INSTALL_RELEASE_FAILED,\n self::LOG,\n self::PREPARE_DEPLOY_RELEASE,\n self::PREPARE_RELEASE,\n self::PREPARE_WORKSPACE,\n self::ROLLBACK_RELEASE,\n self::ROLLBACK_RELEASE_COMPLETE,\n self::ROLLBACK_RELEASE_FAILED,\n );\n }",
"public function getObservableEvents()\n {\n return array_merge(\n [\n 'retrieved', 'creating', 'created', 'updating', 'updated',\n 'saving', 'saved', 'restoring', 'restored', 'replicating',\n 'deleting', 'deleted', 'forceDeleted',\n ],\n static::getRelationshipObservables(),\n $this->observables,\n );\n }",
"public function getObservables()\n {\n return is_array($this->observables) ? array_merge($this->observables, $this->translationEvent) : $this->translationEvent;\n }",
"public function getCustomEventName();",
"protected function getRegisteredEvents() {\n $events = [];\n foreach ($this->loadMultiple() as $rules_config) {\n foreach ($rules_config->getEventNames() as $event_name) {\n $event_name = $this->eventManager->getEventBaseName($event_name);\n if (!isset($events[$event_name])) {\n $events[$event_name] = $event_name;\n }\n }\n }\n return $events;\n }",
"public static function getSubscribedEvents() {\n return [];\n }",
"function getEvents() {\n return [];\n }",
"public function events()\n {\n return $this->events;\n }",
"public function events()\n {\n return $this->events;\n }",
"public function getEvents();",
"public function getEvents();",
"public static function getEvents(): array\n {\n return is_array(static::$events) ? static::$events : [static::$events];\n }",
"public function getTriggeringEvents();",
"public function getName()\n {\n return $this->eventName;\n }",
"public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'rocket_buffer' => [\r\n\t\t\t\t[ 'extract_ie_conditionals', 1 ],\r\n\t\t\t\t[ 'inject_ie_conditionals', 34 ],\r\n\t\t\t],\r\n\t\t];\r\n\t}",
"public function getEventName()\n {\n return $this->event->name;\n }",
"public function getNames()\n {\n return $this->names;\n }",
"public function getNames() {\n return $this->_names;\n }",
"public function getNames() {}",
"public function getNames() {}",
"public function getNames() {}",
"public function getNames() {\n\t\treturn $this->names;\n\t}",
"public function getEvents()\n {\n return $this->eventListeners;\n }",
"public function getEvents()\n\t{\n\t\treturn $this->events;\n\t}",
"public function getNames();",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->_events;\n }",
"public function getNames() {\n return $this->names;\n }",
"public function getNames()\n {\n return $this->_name;\n }",
"public static function getSubscribedEvents(): array\n {\n return [\n LoginActionEvent::NAME => [\n ['flashLoginEvent', self::FLASH_MESSAGE_PRIORITY],\n ['afterLogin'],\n ]\n ];\n }",
"public function getEvents() {\n return $this->_events;\n }",
"protected static function getModelEventsToRecord()\n {\n if (isset(static::$modelEventsToRecord)) {\n return static::$modelEventsToRecord;\n }\n\n return ['created', 'updated', 'deleted'];\n }",
"function getEvents() {\n\n $events = ['new' => __('New change'),\n 'update' => __('Update of a change'),\n 'solved' => __('Change solved'),\n 'validation' => __('Validation request'),\n 'validation_answer' => __('Validation request answer'),\n 'closed' => __('Closure of a change'),\n 'delete' => __('Deleting a change')];\n\n $events = array_merge($events, parent::getEvents());\n asort($events);\n return $events;\n }",
"public static function getSubscribedEvents(): array\n {\n return [\n WsServerEvent::HANDSHAKE_SUCCESS => 'handshakeOk',\n WsServerEvent::MESSAGE_RECEIVE => 'messageReceive',\n WsServerEvent::CLOSE_BEFORE => 'messageReceive',\n ];\n }",
"public static function getSubscribedEvents()\n {\n return [\n KernelEvents::CONTROLLER => \"onKernelController\",\n KernelEvents::EXCEPTION => \"onKernelException\"\n ];\n }",
"public static function getEvents()\n {\n $events = parent::getEvents();\n $events[] = self::ON_FIRST_LOGIN;\n $events[] = self::ON_LOGIN;\n $events[] = self::ON_LOGOUT;\n $events[] = self::ON_PASSWORD_CHANGE;\n\n return $events;\n }",
"public function getOtherEvents();",
"public static function getSubscribedEvents()\n {\n return array(\n DefaultEvents::default_pre_index => 'onCustomListener',\n DefaultEvents::default_pre_index => 'onCustomListener',\n OtherEvents::other_pre_index => 'onCustomListener',\n OtherEvents::other_pox_index => 'onCustomListener'\n );\n }",
"static public function getSubscribedEvents()\n {\n return array(\n JobEventsMap::STATE_START => array('logJobEvent'),\n JobEventsMap::STATE_FAIL => array('logJobEvent'),\n JobEventsMap::STATE_ERROR => array('logJobEvent'),\n JobEventsMap::STATE_ADD => array('logJobEvent'),\n JobEventsMap::STATE_FINISH => array('logJobEvent'),\n \n WorkerEventsMap::WORKER_START => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_FINISH => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_ERROR => array('logWorkerEvent'),\n \n QueueEventsMap::QUEUE_LIST => array('logQueueListEvent'),\n QueueEventsMap::QUEUE_LOCK => array('logQueueLockEvent'),\n QueueEventsMap::QUEUE_UNLOCK => array('logQueueUnlockEvent'),\n \n QueueEventsMap::QUEUE_LOOKUP => array('logQueueLookupEvent'),\n QueueEventsMap::QUEUE_PURGE => array('logQueuePurgeEvent'),\n QueueEventsMap::QUEUE_PURGE_ACTIVITY => array('logQueuePurgeActivityEvent'),\n QueueEventsMap::QUEUE_QUERY_ACTIVITY => array('logQueueQueryActivityEvent'),\n \n QueueEventsMap::QUEUE_REC => array('logQueueReceiveEvent'),\n QueueEventsMap::QUEUE_REMOVE => array('logQueueRemoveEvent'),\n QueueEventsMap::QUEUE_SENT => array('logQueueSendEvent'),\n \n \n MonitoringEventsMap::MONITOR_COMMIT => array('logMonitorCommitEvent'),\n MonitoringEventsMap::MONITOR_LOCK => array('logMonitorLockEvent'),\n MonitoringEventsMap::MONITOR_QUERY => array('logMonitorQueryEvent'),\n MonitoringEventsMap::MONITOR_RUN => array('logMonitorRunEvent')\n );\n }",
"public static function getPropertyNames() {\n\t\treturn self::$PROPERTY_NAMES;\n\t}",
"public static function getPropertyNames() {\n\t\treturn self::$PROPERTY_NAMES;\n\t}",
"public static function getPropertyNames() {\n\t\treturn self::$PROPERTY_NAMES;\n\t}",
"public static function getSubscribedEvents()\n {\n return array(\n Constants::OMNIPAY_REQUEST_BEFORE_SEND => array('onOmnipayRequestBeforeSend', self::PRIORITY),\n Constants::OMNIPAY_RESPONSE_SUCCESS => array('onOmnipayResponseSuccess', self::PRIORITY),\n Constants::OMNIPAY_REQUEST_ERROR => array('onOmnipayRequestError', self::PRIORITY),\n );\n }",
"public function getEventName()\n {\n return $this->eventName;\n }",
"public function getEventName()\n {\n return $this->eventName;\n }",
"public function get_names()\n {\n }",
"public static function getSubscribedEvents()\n {\n return [NotificationEvent::NAME => ['handleNotificationEvent', self::getPriority()]];\n }",
"public function contains (EventObserver $observer):array {\r\n $name=$observer->eventName();\r\n if (is_string($name))$name=[$name];\r\n $outname=[];\r\n foreach ($name as $v){\r\n foreach ($this->storage[$v]??[] as $ob){\r\n if($ob[0]===$observer)$outname[]=$v;\r\n }\r\n }\r\n return $outname;\r\n }",
"abstract protected function get_event_name();",
"public function getEvents() { return $this->_events; }",
"public function getEventName() {\n\t\treturn ($this->eventName);\n\t}",
"public function getNames()\n\t{\n\t\t$this->__reset();\n\t\treturn $this->_elementNames;\n\t}",
"public function names()\n {\n $names = [];\n foreach ($this->items as $item) {\n $names[] = $item->getName();\n }\n\n return $names;\n }",
"public static function registeredSignals(): array\n {\n return array_keys(self::$callbacks);\n }",
"public static function getSubscribedEvents()\n {\n return [\n KernelEvents::VIEW => ['onKernelView', 30],\n KernelEvents::RESPONSE => ['onKernelResponse', 30],\n ];\n }",
"public static function getSubscribedEvents();",
"public static function getSubscribedEvents();",
"public function getSystemEvents()\n {\n return $this->systemEvents;\n }",
"public function getEventHandlers($name)\n\t{\n\t\tif(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset($this->_e[$name]))\n\t\t\t\t$this->_e[$name]=new TPriorityList;\n\t\t\treturn $this->_e[$name];\n\t\t}\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset(self::$_ue[$name]))\n\t\t\t\tself::$_ue[$name]=new TPriorityList;\n\t\t\treturn self::$_ue[$name];\n\t\t}\n\t\telse if($this->_m!==null&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t{\n\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->hasEvent($name))\n\t\t\t\t\treturn $behavior->getEventHandlers($name);\n\t\t\t}\n\t\t}\n\t\tthrow new TInvalidOperationException('component_event_undefined',get_class($this),$name);\n\t}",
"public static function getSubscribedEvents()\n {\n return [\n //Step 4:Classname::ConstantName or event name 'kernel.request' => 'functionameyouliketocall' - onKernelRequest()\n KernelEvents::REQUEST => 'onKernelRequest',\n ];\n }",
"public function getName()\n {\n return \"event\";\n }",
"public static function _getPropertyNames(): array\n {\n return [\n 'traveler',\n 'watcher',\n 'distance',\n ];\n }",
"public static function eventSubscriptions() : iterable;",
"public function getNames()\n {\n return array_keys((array) $this->_prefNames);\n }",
"public function name()\n {\n return 'events';\n }",
"public function getCompatibleEvents()\n {\n return array(\n TaskModel::EVENT_MOVE_COLUMN,\n );\n }",
"public static function getSubscribedEvents()\n {\n return [\n TheliaEvents::ORDER_UPDATE_STATUS => ['implementInvoice', 100]\n ];\n }",
"public function getEventNameAllowableValues()\n {\n return [\n self::EVENT_NAME_EMAIL_RECEIVED,\n self::EVENT_NAME_NEW_EMAIL,\n self::EVENT_NAME_NEW_CONTACT,\n self::EVENT_NAME_NEW_ATTACHMENT,\n self::EVENT_NAME_EMAIL_OPENED,\n self::EVENT_NAME_EMAIL_READ,\n self::EVENT_NAME_DELIVERY_STATUS,\n self::EVENT_NAME_BOUNCE,\n self::EVENT_NAME_BOUNCE_RECIPIENT,\n self::EVENT_NAME_NEW_SMS,\n ];\n }",
"public function getter_event_name()\n\t{\n\t\t$event = strtolower($this->qualified_name);\n\t\t\n\t\t$matches = [];\n\t\t\n\t\tif(preg_match(\"/numeric([0-9]{3})/\", $event, $matches))\n\t\t\t$event = $matches[1];\n\t\t\n\t\treturn $this->event_name = $event;\n\t}",
"public function getSubscribedEvents()\n {\n return [\n Events::postFlush,\n Events::preRemove\n ];\n }",
"protected function getName()\n\t{\n\t\treturn 'event';\n\t}",
"public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n Events::preRemove,\n ];\n }",
"public function getEventName() : String;",
"public static function list_events()\n\t{\n\t\treturn cms_orm('CmsDatabaseEvent')->find_all(array('order' => 'module_name, event_name'));\n\t}",
"public function getEventHandlers($name)\r\n\t{\r\n\t\tif($this->hasEvent($name))\r\n\t\t{\r\n\t\t\t$name=strtolower($name);\r\n\t\t\tif(!isset($this->_e[$name]))\r\n\t\t\t\t$this->_e[$name]=new CList();\r\n\t\t\treturn $this->_e[$name];\r\n\t\t}\r\n\t}",
"public static function getSubscribedEvents(): array\n {\n return [\n KernelEvents::REQUEST => ['onKernelRequest', 110],\n KernelEvents::RESPONSE => ['onKernelResponse', 10],\n ];\n }",
"public static function _getPropertyNames(): array\n {\n return [\n 'name',\n ];\n }",
"public final static function getNames()\n {\n return array_keys(self::$schemas);\n }",
"public function getSubscribedEvents()\n {\n return [\n Events::postUpdate,\n Events::postPersist,\n Events::preRemove\n ];\n }",
"public function getListeners($eventName): array;",
"public function getSubscribedEvents(): array\n {\n return [\n Events::prePersist,\n Events::preUpdate,\n ];\n }",
"public function getControlNames();",
"public function getPropertyNames() {\n return $this->propertyNames;\n }",
"public static function getSubscribedEvents()\n {\n return array(\n GetFormDataControllerEvent::NAME => array(\n array('getFormDataNewsController')\n )\n );\n }",
"public static function getSubscribedEvents()\n {\n return [\n SetMessageStatusEvent::NAME => 'onSetMessageStatus',\n ];\n }",
"public function getNameList() {\n return $this->_get(1);\n }",
"public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n// Events::preUpdate,\n ];\n\n }",
"public function getSubscribedEvents(): array\n {\n return [\n Events::postLoad,\n Events::onFlush,\n Events::postFlush,\n ];\n }",
"protected static function recordableEvents()\n {\n if (isset(static::$recordableEvents)) {\n return static::$recordableEvents;\n }\n\n return ['created', 'updated', 'deleted'];\n }",
"public function menu_get_names()\n {\n return menu_get_names();\n }"
] | [
"0.80881095",
"0.76815116",
"0.72184455",
"0.7161904",
"0.6969799",
"0.6714642",
"0.6537803",
"0.62656206",
"0.6222253",
"0.6215524",
"0.61963713",
"0.61963713",
"0.6186284",
"0.6186284",
"0.6173764",
"0.61511827",
"0.60638374",
"0.604934",
"0.60394394",
"0.60286486",
"0.60248774",
"0.6011428",
"0.6011104",
"0.6011104",
"0.60056823",
"0.59993845",
"0.59885883",
"0.5979725",
"0.5975848",
"0.5975848",
"0.5975848",
"0.5975848",
"0.5975848",
"0.5975848",
"0.5975848",
"0.5975848",
"0.5960658",
"0.59548664",
"0.5947877",
"0.59318584",
"0.59141415",
"0.5908072",
"0.590307",
"0.5890883",
"0.5888159",
"0.58880436",
"0.5870593",
"0.586731",
"0.5864979",
"0.5858278",
"0.5858278",
"0.5858278",
"0.5849737",
"0.58406883",
"0.58406883",
"0.5832036",
"0.5826921",
"0.5816848",
"0.58144015",
"0.5811262",
"0.58106875",
"0.5789672",
"0.5789621",
"0.5777317",
"0.5775159",
"0.57727325",
"0.57727325",
"0.57685965",
"0.57673585",
"0.5765643",
"0.57655436",
"0.57642776",
"0.5761184",
"0.57524604",
"0.5750343",
"0.57495165",
"0.5748876",
"0.5747229",
"0.5745867",
"0.5742466",
"0.57345665",
"0.57336473",
"0.57308125",
"0.5728918",
"0.57273555",
"0.5722488",
"0.57169724",
"0.571695",
"0.5711938",
"0.5703384",
"0.5700556",
"0.569824",
"0.56944865",
"0.5694142",
"0.56896335",
"0.5684101",
"0.56829476",
"0.56812227",
"0.5680558",
"0.5674483"
] | 0.71322787 | 4 |
Set the observable event names. | public function setObservableEvents(array $observables)
{
$this->observables = $observables;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function event_names($users)\r\n\t{\r\n\t\t$this->names = array_merge($this->names, explode(' ', $users));\r\n\t}",
"public function getEventNames(){\n return array($this->getEventName() => array($this,'handle'));\n }",
"public function setNames($names) {\n $this->_names = $names;\n }",
"public function setNames($names) {}",
"public function setNames($names)\n {\n $this->names = $names;\n }",
"public function setNames(string $name)\n {\n if (is_string($name)){\n $this->_name = $name;\n }\n }",
"public function addObservableEvents($observables)\n {\n $observables = is_array($observables) ? $observables : func_get_args();\n\n $this->observables = array_unique(array_merge($this->observables, $observables));\n }",
"public function setEvents(array $events)\n\t{\n\t\t$this->events = $events;\n\t}",
"public function getEventNames()/*# : array */;",
"protected function setEvents()\n {\n foreach ($this->preloadList as $preload) {\n include_once XOOPS_ROOT_PATH . '/modules/' . $preload['module'] . '/preloads/' . $preload['file']. '.php';\n $class_name = ucfirst($preload['module'])\n . ($preload['file'] == 'preload' ? '' : ucfirst($preload['file']) )\n . 'Preload';\n if (!class_exists($class_name)) {\n continue;\n }\n $class_methods = get_class_methods($class_name);\n foreach ($class_methods as $method) {\n if (strpos($method, 'event') === 0) {\n $event_name = strtolower(str_replace('event', '', $method));\n $event= array($class_name, $method);\n $this->eventListeners[$event_name][] = $event;\n }\n }\n }\n }",
"public function setDispatcherEvents()\n\t{\n\t\t$this->dispatcher = (new Dispatcher())->register($this->routes);\n\t}",
"public function getEventNames()\n {\n return array_keys($this->events);\n }",
"public function set_key_names($keys) {\n\t\t$this->keys = $keys;\n\t}",
"public function assignNames($names);",
"protected static function events()\n {\n foreach (self::fetch('app/events', false) as $file) {\n Bus::need($file);\n }\n //\n Event::register();\n }",
"private function SetName() {\n $where = (!empty($this->eventoID) ? \"e.id != {$this->eventoID} AND \" : '');\n\n $query = $this->createQueryBuilder('e')\n ->where(\"{$where} e.titulo = :n\")\n ->setParameter('n', $this->data->getTitulo())\n ->getQuery();\n\n $resEvento = $query->getResult();\n if ($resEvento) {\n $this->data->setName($this->data->getName() . \"-\" . count($resEvento));\n }\n }",
"protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }",
"public function setEvents($events, $format = false)\n {\n $this->_events = $events;\n if ($format !== false)\n $this->_format = $format;\n ksort($this->_events);\n }",
"public function getObservableEvents()\n {\n return array_merge(\n [\n 'creating', 'created', 'updating', 'updated',\n 'deleting', 'deleted', 'saving', 'saved',\n 'fetching', 'fetched'\n ],\n $this->observables\n );\n }",
"public static function getEventNames()\n {\n return array(\n self::CREATE_CONNECTION,\n self::DEPLOY_COMMAND_COMPLETE,\n self::DEPLOY_RELEASE,\n self::DEPLOY_RELEASE_COMPLETE,\n self::DEPLOY_RELEASE_FAILED,\n self::GATHER_FACTS,\n self::GET_WORKSPACE,\n self::INITIALIZE,\n self::INSTALL_COMMAND_COMPLETE,\n self::INSTALL_RELEASE,\n self::INSTALL_RELEASE_COMPLETE,\n self::INSTALL_RELEASE_FAILED,\n self::LOG,\n self::PREPARE_DEPLOY_RELEASE,\n self::PREPARE_RELEASE,\n self::PREPARE_WORKSPACE,\n self::ROLLBACK_RELEASE,\n self::ROLLBACK_RELEASE_COMPLETE,\n self::ROLLBACK_RELEASE_FAILED,\n );\n }",
"public function setNameAll($name = NULL ){\n\t\t$this->nameAll = $name ? $name : \"Todo(a)s \".$this->name;\n\t}",
"public function setEventTypes(?array $eventTypes): void\n {\n $this->eventTypes['value'] = $eventTypes;\n }",
"public function define($events) {\n if(!is_array($events)) {\n $events = [$events];\n }\n\n array_walk($events, function($value) {\n $value = $this->formatEventName($value);\n });\n\n $this->definitions = array_unique(\n array_merge($this->definitions, $events)\n );\n }",
"public static function __events () {\n \n }",
"public function setDispatcher(Dispatcher $events): void\n {\n $this->events = $events;\n }",
"protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }",
"public function setCustomNames($names)\n\t{\n\t\t$this->all_options[\"views\"][\"default\"][\"custom_names\"] = $names;\n\t}",
"function setClassNames($names) {\r\n\t\t$this->setAttributeNS(self :: TEXT, 'text:class-names', $names);\r\n\t}",
"public function getCustomEventName();",
"public function setEventDispatcher(\\Illuminate\\Events\\Dispatcher $events)\n\t{\n\t\t$this->events = $events;\n\t}",
"public function SetParameterNames(array $_params)\r\n\t{\r\n\t\t$this->_paramNames = $this->_paramNames + $_params;\r\n\t}",
"protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }",
"public static function getSubscribedEvents()\n {\n return [\n 'console.command' => 'setTranslatorLocale',\n ];\n }",
"public function setEvents(array $events)\n {\n foreach ($events as $event) {\n $event->ensureStopped();\n }\n\n $this->data['events'] = $events;\n }",
"protected function getName()\n\t{\n\t\treturn 'event';\n\t}",
"private function registerDefaultEventSourcingBindings() : void\n {\n $this->app->bind(\n AggregateFactory::class,\n PublicConstructorAggregateFactory::class\n );\n\n $this->app->bind(\n Serializer::class,\n SimpleInterfaceSerializer::class\n );\n\n $this->app->singleton(\n EventBus::class,\n SimpleEventBus::class\n );\n }",
"function ibase_set_event_handler($event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}",
"public function setEventDispatcher(\\Leaps\\Events\\Dispatcher $events)\n {\n $this->events = $events;\n }",
"public function setEventDispatcher(Dispatcher $events)\n {\n $this->events = $events;\n }",
"public static function Set($sName, $fCallback){\n $oThis = self::CreateInstanceIfNotExists();\n $sName = strtolower(str_replace(array(\"/\", \"\\\\\", \"--\"), \"-\", $sName));//Bugfix\n $oThis->aEvents[$sName] = array(\"type\" => \"default\", \"func\" => $fCallback);\n }",
"public function name()\n {\n return 'events';\n }",
"public function setName($_name)\n {\n if (is_string($_name)) {\n \t$this->_name = $_name;\n }\n }",
"public function removeObservableEvents($observables)\n {\n $observables = is_array($observables) ? $observables : func_get_args();\n\n $this->observables = array_diff($this->observables, $observables);\n }",
"public function pushEvent($name)\n {\n $this->data['event'] = $name;\n }",
"static function getSubscribedEvents()\n {\n return array(\n FormEvents::PRE_SET_DATA => 'preSetData',\n );\n }",
"public static function setEventDispatcher($events){\n \\Illuminate\\Cache\\Repository::setEventDispatcher($events);\n }",
"public function setSetName($setname) {\r\n\t\t$this -> setname = $setname;\r\n\t}",
"public function listeners($eventName);",
"public function subscribe(): void\n {\n foreach (static::$eventHandlerMap as $eventName => $handler) {\n $this->events->listen($eventName, [$this, $handler]);\n }\n }",
"protected function setListeners()\n\t{\n\t\t$this->templates->listenEmitBasic('foreach', array($this, 'tpl_foreach'));\n\t\t$this->templates->listenEmitBasic('not-last', array($this, 'tpl_not_last'));\n\t}",
"private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }",
"public function setEventTitle($eventTitle)\n {\n $this->eventTitle = isset($eventTitle) ? $eventTitle : '';\n }",
"public static function getSubscribedEvents(): array\n {\n return [\n LoginActionEvent::NAME => [\n ['flashLoginEvent', self::FLASH_MESSAGE_PRIORITY],\n ['afterLogin'],\n ]\n ];\n }",
"public function getObservableEvents()\n {\n return array_merge(\n [\n 'retrieved', 'creating', 'created', 'updating', 'updated',\n 'saving', 'saved', 'restoring', 'restored', 'replicating',\n 'deleting', 'deleted', 'forceDeleted',\n ],\n static::getRelationshipObservables(),\n $this->observables,\n );\n }",
"function setHeadersNames($names){\n\t\t$this->headers=explode(\",\",$names);\n\t\tforeach($this->headers as &$header){\n\t\t\t$header=trim($header);\n\t\t}\n\t}",
"public function testSetName() {\r\n $this->assertInstanceOf('PM\\Main\\Event\\Action\\Emit', $this->_action->setName('test'));\r\n $this->assertEquals('test', $this->_action->getName());\r\n }",
"function ibase_set_event_handler($connection, $event_handler, $event_name1, $event_name2 = NULL, $_ = NULL)\n{\n}",
"public function setEventHandlers()\n {\n Event::on(Menu::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n });\n \n // Set eventhandlers for the 'MenuItem' model\n Event::on(MenuItem::className(), ActiveRecord::EVENT_AFTER_DELETE, function ($event) {\n \n // Delete the children\n if (!$event->sender->deleteChildren())\n throw new \\yii\\base\\Exception(Yii::t('app', 'There was an error while deleting this item'));\n }); \n }",
"public function onNick()\n {\n $nick = trim($this->event->getNick());\n $newNick = trim($this->event->getArgument(0));\n\n foreach ($this->store as $chan => $store) {\n if (isset($store[$nick])) {\n $this->store[$chan][$newNick] = $store[$nick];\n unset($this->store[$chan][$nick]);\n }\n }\n }",
"public function getter_event_name()\n\t{\n\t\t$event = strtolower($this->qualified_name);\n\t\t\n\t\t$matches = [];\n\t\t\n\t\tif(preg_match(\"/numeric([0-9]{3})/\", $event, $matches))\n\t\t\t$event = $matches[1];\n\t\t\n\t\treturn $this->event_name = $event;\n\t}",
"protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }",
"public static function getSubscribedEvents()\n {\n return [\n FormEvents::PRE_SET_DATA => 'onPreSetData',\n ];\n }",
"public static function getSubscribedEvents()\n {\n return [\n FormEvents::PRE_SET_DATA => 'onPreSetData',\n ];\n }",
"public function getName()\n {\n return \"event\";\n }",
"public function setEventName($value)\n {\n if (is_string($value) === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n if (trim($value) == '')\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n \n $this->eventName = $value;\n }",
"public function setEventName($value)\n {\n if (is_string($value) === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n if (trim($value) == '')\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n \n $this->eventName = $value;\n }",
"public function setName($name){\n $this->_name = $name;\n }",
"public static function boot(): void\n {\n foreach (['saved', 'deleted'] as $event) {\n static::$event(fn() => \\Cacher::countriesForHeader());\n }\n\n parent::boot();\n }",
"public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }",
"function setEventType()\n {\n $this->_eventType = 12;\n }",
"public function subscribe($events)\n {\n $events->listen(\n \\App\\Events\\Backend\\ClassName\\ClassNameCreated::class,\n 'App\\Listeners\\Backend\\ClassName\\ClassNameEventListener@onCreated'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\ClassName\\ClassNameDeleted::class,\n 'App\\Listeners\\Backend\\ClassName\\ClassNameEventListener@onDeleted'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\ClassName\\ClassNameermanentlyDeleted::class,\n 'App\\Listeners\\Backend\\ClassName\\ClassNameEventListener@onermanentlyDeleted'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\ClassName\\ClassNameRestored::class,\n 'App\\Listeners\\Backend\\ClassName\\ClassNameEventListener@onRestored'\n );\n\n $events->listen(\n \\App\\Events\\Backend\\ClassName\\ClassNameUpdated::class,\n 'App\\Listeners\\Backend\\ClassName\\ClassNameEventListener@onUpdated'\n );\n }",
"public static function bootLogsModelEvents()\n {\n if (property_exists(self::class, 'logModelEvents')) {\n foreach (self::$logModelEvents as $eventName) {\n static::$eventName(function ($model) use ($eventName) {\n $description = $eventName;\n\n if ($eventName == 'updating' || $eventName == 'updated') {\n if ($dirty = $model->getDirty()) {\n $changed = [];\n foreach ($dirty as $key => $value) {\n if (!self::shouldHideKey($key)) {\n if (self::shouldSanitizeKey($key)) {\n $changed[] = \"'$key': ***\";\n } else {\n $changed[] = \"'$key': [\" . ($model->original[$key] ?? '-') . \"]→[$value]\";\n }\n }\n }\n\n if ($changed) {\n $description .= ':' . implode(', ', $changed);\n }\n }\n }\n\n $model->logModelEvent($description);\n });\n }\n }\n }",
"private function setNames(){\n\t\t\n\t\t$timeName = date('mm-dd-Y_hh-mm', strtotime('now'));\n\t\t\n\t\tswitch ( str_replace(' ','',strtolower($this-company)) ){\n\t\t\t\t\n\t\t\tcase 'customsigncenter' || 'csc':\n\t\t\t\t$this->fname = $timeName.'$csc.xml';\n\t\t\t\t$this->nodeCalId = 'Custom Sign Center';\n\t\t\t\tbreak;\n\t\t\tcase 'outdoorimages' || 'outdoor':\n\t\t\t\t$this->fname = $timeName.'$out.xml';\n\t\t\t\t$this->nodeCalId = 'Outdoor Images';\n\t\t\t\tbreak;\n\t\t\tcase 'boyer' || 'boyersigns':\n\t\t\t\t$this->fname = $timeName.'$boy.xml';\n\t\t\t\t$this->nodeCalId = 'Boyer Signs';\n\t\t\t\tbreak;\n\t\t\tcase 'marionsigns' || 'marion':\n\t\t\t\t$this->fname = $timeName.'$mar.xml';\n\t\t\t\t$this->nodeCalId = 'Marion Signs';\n\t\t\t\tbreak;\n\t\t\tcase 'jgsigns' || 'jg' || 'jgsignservices':\n\t\t\t\t$this->fname = $timeName.'jg.xml';\n\t\t\t\t$this->nodeCalId = 'JG Signs';\n\t\t\tdefault: $this->status .= 'Fatal Error: Company name must be spelled like one of the following:<br>\n\t\t\t\t\t\t\t\t custom sign center, outdoor images, boyer signs, marion signs, jg signs.<br>\n\t\t\t\t\t\t\t\t Exiting.';\n\t\t\t\texit($this->status);\n\t\t}\t\t\n\t\t\n\t}",
"protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}",
"public static function getSubscribedEvents()\n\t{\n\t\treturn [\n\t\t\tFormEvents::PRE_SET_DATA => 'preSetData',\n\t\t];\n\t}",
"public static function events();",
"public function setName($x) {\n $this->name = $x;\n }",
"public function setName(?array $name): void\n {\n $this->name['value'] = $name;\n }",
"function defineHandlers(&$events) {\n /*\n * example handlers see: handlers/on_admin_sections.php and handlers/on_build_menu.php\n * \n */\n\n //$events->listen('on_build_menu', 'on_build_menu');\n //$events->listen('on_admin_sections', 'on_admin_sections');\n }",
"public function getObservables()\n {\n return is_array($this->observables) ? array_merge($this->observables, $this->translationEvent) : $this->translationEvent;\n }",
"public static function setEventDispatcher(Dispatcher $events)\n {\n }",
"public static function getSubscribedEvents()\n {\n return [\n SetMessageStatusEvent::NAME => 'onSetMessageStatus',\n ];\n }",
"public function setEvents(string $events): self\n {\n $this->options['events'] = $events;\n return $this;\n }",
"public function setEvents(string $events): self\n {\n $this->options['events'] = $events;\n return $this;\n }",
"function set_name($name) {\n $this->name = $name;\n }",
"public function attachEventListeners( Observable $observable )\n\t{\n\t\tforeach ( array( 'update', 'open', 'delete', 'after_delete', 'after_update', 'dispense' ) as $eventID ) {\n\t\t\t$observable->addEventListener( $eventID, $this );\n\t\t}\n\t}",
"public function listeners($event);",
"abstract protected function get_event_name();",
"public static function getSubscribedEvents()\n {\n return [\n //Step 4:Classname::ConstantName or event name 'kernel.request' => 'functionameyouliketocall' - onKernelRequest()\n KernelEvents::REQUEST => 'onKernelRequest',\n ];\n }",
"public function setName($x) { $this->name = $x; }",
"public static function getSubscribedEvents() {\n return array(\n KernelEvents::CONTROLLER => 'openDataFile'\n );\n }",
"public function setName($name) {\n\t\t$this->_name = $name;\n\t}",
"public function getEventHandlers($name)\n\t{\n\t\tif(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset($this->_e[$name]))\n\t\t\t\t$this->_e[$name]=new TPriorityList;\n\t\t\treturn $this->_e[$name];\n\t\t}\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset(self::$_ue[$name]))\n\t\t\t\tself::$_ue[$name]=new TPriorityList;\n\t\t\treturn self::$_ue[$name];\n\t\t}\n\t\telse if($this->_m!==null&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t{\n\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->hasEvent($name))\n\t\t\t\t\treturn $behavior->getEventHandlers($name);\n\t\t\t}\n\t\t}\n\t\tthrow new TInvalidOperationException('component_event_undefined',get_class($this),$name);\n\t}",
"public function send_events()\n {\n }",
"public function setName($name){\n $this->__set('name',$name);\n }",
"public function __construct($names) {\n $this->setNames($names);\n }",
"public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)\n {\n $pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);\n\n $this->setByPosition($pos, $value);\n }",
"public function name()\n {\n return 'event';\n }",
"public function setActionNames($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->action_names = $arr;\n\n return $this;\n }",
"public function name(): string\n {\n return 'event';\n }"
] | [
"0.6439292",
"0.605857",
"0.60171676",
"0.58845115",
"0.57914764",
"0.55273974",
"0.5494641",
"0.5484149",
"0.5345384",
"0.531082",
"0.52891016",
"0.5221481",
"0.5165873",
"0.5154284",
"0.5110506",
"0.5070509",
"0.5065553",
"0.50646555",
"0.5062642",
"0.50524145",
"0.5016903",
"0.50158656",
"0.50132537",
"0.49841696",
"0.49645197",
"0.4953805",
"0.49502254",
"0.4928251",
"0.49233887",
"0.48987153",
"0.48880067",
"0.48863876",
"0.48851976",
"0.48809546",
"0.48610264",
"0.48609298",
"0.48599175",
"0.4851036",
"0.48459056",
"0.4831619",
"0.48305193",
"0.48164558",
"0.48116496",
"0.4807205",
"0.4796185",
"0.47829875",
"0.47817516",
"0.4776347",
"0.4774714",
"0.4773091",
"0.47700408",
"0.47650552",
"0.47616467",
"0.47498873",
"0.47471005",
"0.47458795",
"0.47389972",
"0.47342998",
"0.47334683",
"0.4733079",
"0.47231066",
"0.47169372",
"0.47169372",
"0.47102284",
"0.4708783",
"0.4708783",
"0.47019997",
"0.47003654",
"0.46994406",
"0.46892858",
"0.4687234",
"0.46862373",
"0.4684537",
"0.46755624",
"0.4673592",
"0.4669547",
"0.4667454",
"0.4654893",
"0.46532318",
"0.4644372",
"0.46411145",
"0.46339425",
"0.46267325",
"0.46267325",
"0.46264204",
"0.4625621",
"0.46252155",
"0.462175",
"0.4619497",
"0.4617362",
"0.46089113",
"0.46078128",
"0.46066338",
"0.46011373",
"0.45949206",
"0.4592204",
"0.4590726",
"0.45907056",
"0.45893627",
"0.4582092"
] | 0.5525668 | 6 |
Add an observable event name. | public function addObservableEvents($observables)
{
$observables = is_array($observables) ? $observables : func_get_args();
$this->observables = array_unique(array_merge($this->observables, $observables));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pushEvent($name)\n {\n $this->data['event'] = $name;\n }",
"public function getCustomEventName();",
"public function name(): string\n {\n return 'event';\n }",
"protected function getName()\n\t{\n\t\treturn 'event';\n\t}",
"public function getName()\n {\n return \"event\";\n }",
"abstract protected function get_event_name();",
"public function name()\n {\n return 'event';\n }",
"public function getName()\n\t{\n\t\treturn 'Event';\n\t}",
"public function getter_event_name()\n\t{\n\t\t$event = strtolower($this->qualified_name);\n\t\t\n\t\t$matches = [];\n\t\t\n\t\tif(preg_match(\"/numeric([0-9]{3})/\", $event, $matches))\n\t\t\t$event = $matches[1];\n\t\t\n\t\treturn $this->event_name = $event;\n\t}",
"public function name()\n {\n return 'events';\n }",
"public static function hook($event_name, $fn) \n {\n $instance = self::get_instance();\n $instance->hooks[$event_name][] = $fn;\n }",
"public static function subscribe($name, $callback) {\n if (empty(self::$events[$name]))\n self::$events[$name] = array();\n // push the $callback onto the subscription stack\n array_push(self::$events[$name], $callback);\n }",
"public function addName($name) {\n $this->names[] = $name;\n }",
"public function getName()\n {\n return $this->eventName;\n }",
"public function getEventHandler($name)\n {\n return $this->alias . '::' . $name;\n }",
"public static function get_event_string_name($suffix='') {\n $class = get_called_class();\n $class = substr($class, strlen(__NAMESPACE__) + 1);\n return 'event_'.$class.$suffix;\n }",
"private function SetName() {\n $where = (!empty($this->eventoID) ? \"e.id != {$this->eventoID} AND \" : '');\n\n $query = $this->createQueryBuilder('e')\n ->where(\"{$where} e.titulo = :n\")\n ->setParameter('n', $this->data->getTitulo())\n ->getQuery();\n\n $resEvento = $query->getResult();\n if ($resEvento) {\n $this->data->setName($this->data->getName() . \"-\" . count($resEvento));\n }\n }",
"public function on($name, array $callback, $unique = FALSE)\r\n\t{\r\n\t\tif ( ! isset($this->observer_events[$name]))\r\n\t\t{\r\n\t\t\t// Create an empty event for undefined events\r\n\t\t\t$this->observer_events[$name] = array();\r\n\t\t}\r\n\t\telseif ($unique and in_array($callback, $this->observer_events[$name], TRUE))\r\n\t\t{\r\n\t\t\t// Event already exists\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t// Add the event\r\n\t\t$this->observer_events[$name][] = $callback;\r\n\r\n\t\treturn TRUE;\r\n\t}",
"function addEvent($event) {\n Event::addEvent($event);\n }",
"public function __construct($name, $event)\n {\n $this->name = $name;\n $this->event = $event;\n }",
"public function addEvent($event){\n $this->events[]=$event;\n }",
"public function getEventName()\n {\n return $this->event->name;\n }",
"public function getEventName() : String;",
"public function makeEventName()\n {\n if (!$this->getName()) return '';\n $evt = strtolower('status.' . ObjectUtil::getBaseNamespace($this->getFkey()) . '.' . ObjectUtil::basename($this->getFkey()) . '.' . $this->getName());\n //$evt = strtolower('status.' . ObjectUtil::basename($this->getFkey()) . '.' . $this->getName());\n return $evt;\n }",
"public function setNameAdd($name = NULL ){\n\t\t$this->nameAddNew = $name ? $name : \"Adicionar \".$this->name;\n\t}",
"public function eventSubscription(string $name)\n\t{\n\t\treturn new EventSubscription($this, $name);\n }",
"function eventRegister($eventName, EventListener $listener);",
"public function setEventName(String $eventName) : EventListenerInterface;",
"public static function register( $name, $callback )\n {\n if ( ! isset( self::$events[$name] ) )\n {\n self::$events[$name] = array( );\n }\n\n // Check if $callback is a function or an object\n if ( is_array( $callback ) )\n {\n list( $obj, $func ) = $callback;\n $callback = new Observer;\n $callback->obj = $obj;\n $callback->func = $func;\n }\n else\n {\n $obj = new Observer;\n $obj->func = $callback;\n $callback = $obj;\n }\n\n // Add the observer to the event\n self::$events[$name][] = $callback;\n }",
"public function dispatchEvent($name, Event $event = null);",
"public function add($name);",
"public function setName(string $expr) {\n $this->name = $expr;\n }",
"abstract public function getEventName();",
"public function create_event( $eventname )\n\t{\n\t\tCmsEvents::create_event($this->get_name(), $eventname);\n\t}",
"public function getEventNameAttribute()\n {\n if (is_object($this->event)) {\n return $this->event->name;\n };\n\n return null;\n }",
"public function getName()\n {\n return 'formEvent';\n }",
"public function addListener($event_name, $callback)\n {\n $event_name = $this->toInternalEventName($event_name);\n $this->eventListeners[$event_name][]=$callback;\n }",
"public function updateName($name) {\n $this->name = $name;\n\n // This triggers all attached observers\n $this->notify();\n }",
"public function get_event($name)\r\n\t{\r\n\t\treturn empty($this->observer_events[$name]) ? array() : $this->observer_events[$name];\r\n\t}",
"public static function get_name() {\n return get_string(self::get_event_string_name(), 'mod_reader');\n }",
"public function setName($x) {\n $this->name = $x;\n }",
"public function attachEventListeners( Observable $observable )\n\t{\n\t\tforeach ( array( 'update', 'open', 'delete', 'after_delete', 'after_update', 'dispense' ) as $eventID ) {\n\t\t\t$observable->addEventListener( $eventID, $this );\n\t\t}\n\t}",
"function addNameChange($from, $to)\r\n{\r\n\tglobal $A; // Activity object\r\n\t$A->changeName($from, $to);\r\n\r\n\tif (LACE_SHOW_NAME_CHANGE)\r\n\t{\r\n\t\t$message = array\r\n\t\t(\r\n\t\t\t'action' => true,\r\n\t\t\t'time' => time(),\r\n\t\t\t'name' => 'Lace',\r\n\t\t\t'text' => '<strong>'.$from.'</strong> is now <strong>'.$to.'</strong>',\r\n\t\t);\r\n\r\n\t\taddMessage($message);\r\n\t}\r\n}",
"function selectEventsWithName($name)\n{\n require_once(\"model/database.php\");\n $query = \"SELECT * FROM events WHERE events.name LIKE :name ;\";\n return executeQuerySelect($query, createBinds([[\":name\", $name]]));\n}",
"protected function getEventName()\n\t{\n\t\treturn is_null($this->event_name) ? get_class($this) : $this->event_name;\n\t}",
"public function nameCommand()\n {\n $userName = $this->getFromName();\n if (!empty($this->e->getParams())) {\n $newName = implode(' ', $this->e->getParams());\n $this->reply($userName . ' теперь известен как ' . $newName);\n } else {\n $newName = $userName;\n $this->reply($userName . ' теперь использует имя по-умолчанию');\n }\n $this->setUserName($this->getUserId(), $newName);\n }",
"public function on($name, $observer, array $config = array())\n {\n if (!isset($this->events[$name])) {\n $this->events[$name] = array();\n }\n\n if (Arr::get($config, 'prepend', false)) {\n Arr::unshift($this->events, $observer, $config);\n } else {\n $this->events[$name][$observer] = $config;\n }\n\n return $this;\n }",
"public function __add(string $name, $value) \n {\n if (!property_exists($this, $name)) \n {\n $this->{Path::toCamelCase($name)} = $value;\n }\n }",
"protected function buildEventName($event)\n {\n return join('.', $this->getTypes()).'.'.$event;\n }",
"public function add_event($type, $method_name)\n\t{\n\t\tif (!array_key_exists($type, $this->_events)) $this->_events[$type] = array();\n\t\t$this->_events[$type][] = $method_name;\n\t}",
"protected function toInternalEventName($event_name)\n {\n return strtolower(str_replace('.', '', $event_name));\n }",
"public static function observe( &$varname )\n\t\t{\n\t\t\t$this->observer_list[] =& $var;\n\t\t}",
"public function setName($x) { $this->name = $x; }",
"public function getEventName()\n {\n return $this->eventName;\n }",
"public function getEventName()\n {\n return $this->eventName;\n }",
"public static function add($type, $eventname, $callback){\n if(isset(self::$__events[$type])){\n if(!isset(self::$__events[$type][strtolower($eventname[0])][strtolower($eventname[1])])){\n $count = 0;\n }else{\n $count = count(self::$__events[$type][strtolower($eventname[0])][strtolower($eventname[1])]); \n }\n }else{\n $count = 0;\n }\n self::$__events[$type][strtolower($eventname[0])][strtolower($eventname[1])][$count] = $callback; \n }",
"public function eventPush($name, array $arguments = [])\n {\n return app('events')->push($this->getNamespacedEventName($name), $arguments);\n }",
"public function testDuplicateEventNameException()\n {\n $this->setExpectedException('Txiki\\Events\\EventException', 'Duplicate event name', 0);\n\n $this->event->on('event-name', function () {return true;});\n $this->event->on('event-name', function () {return true;});\n }",
"function Core_AddAction( $hookName, $function )\n{\n\tCore_ModuleManager::getInstance()->dispatcher->addObserver( $function, $hookName );\n}",
"public function add($name, $lambda) {\n $this->builders[$name] = $lambda;\n }",
"public function __get($name) {\n\t\tif ($name === 'event_name')\n\t\t\t$ret = $this->getEventName ();\n\t\telse\n\t\t\t$ret = $this->$name;\n\t\treturn $ret;\n\t}",
"public static function eventName(): string\n {\n }",
"public function add($name, \\Closure $code);",
"public function setInputName($name) {\n\t\t $this->inputName = $name;\n\t }",
"public function testEventNameException()\n {\n $this->setExpectedException('Txiki\\Events\\EventException', 'Event name is necesary', 0);\n\n $this->event->on();\n }",
"public function getNamespacedEventName($name)\n {\n $namespace = trim($this->namespacing(), '::');\n $namespace = ! empty($namespace) ? $namespace . '.' : '';\n return strtolower($namespace . $this->package . '.' . $name);\n }",
"public function remove($name = null)\r\n {\r\n if (null === $name) {\r\n $this->_events = array();\r\n } else {\r\n $name = strtolower($name);\r\n if (isset($this->_events[$name])) {\r\n unset($this->_events[$name]);\r\n }\r\n }\r\n\r\n return $this;\r\n }",
"public static function addTagToLog($name){\n\t\tself::$tag_log[] = $name;\n\t}",
"public function setCustomEventName(string $name): ParamsInterface;",
"public function addAlias( $name, $value )\n {\n $this->aliases[$name] = $value;\n }",
"public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}",
"public function event_names($users)\r\n\t{\r\n\t\t$this->names = array_merge($this->names, explode(' ', $users));\r\n\t}",
"public function setBindingMemberName($value);",
"private function makeDatasetEvent (string $event) : string {\n return 'dataset.' . $this->type() . '.' . $event;\n }",
"private function handleMoveCopy(MoveEvent $event)\n {\n $document = $event->getDocument();\n\n if (!$document instanceof AutoNameBehavior) {\n return;\n }\n\n $destId = $event->getDestId();\n $node = $this->registry->getNodeForDocument($document);\n $destNode = $this->nodeManager->find($destId);\n $nodeName = $this->resolver->resolveName($destNode, $node->getName());\n\n $event->setDestName($nodeName);\n }",
"public function getAttributeName()\n {\n return 'EventType';\n }",
"function set_name($name) {\n $this->name = $name;\n }",
"public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }",
"public function pushAnonymous(string $name): void\n {\n $this->anonymous[] = trim(strtolower($name));\n }",
"public function DoEvent($nEvent) {}",
"public function getEventNames(){\n return array($this->getEventName() => array($this,'handle'));\n }",
"public function getEventName() {\n\t\treturn ($this->eventName);\n\t}",
"public function getEventName()\n {\n return $this->translate->_('Lookup answers in previous survey with the same survey code in track.');\n }",
"public function registerProperty($name, callable $callable);",
"public function SetName ($name);",
"function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}",
"function set_name($name)\r\n {\r\n $this->set_default_property(self :: PROPERTY_NAME, $name);\r\n }",
"private function AddNameField()\n {\n $name = 'Name';\n $this->AddField(Input::Text($name, $this->user->GetName()));\n $this->SetRequired($name);\n $this->AddValidator($name, DatabaseCount::UniqueField($this->user, 'Name'));\n }",
"public function set_name($name);",
"function on($event, callable $callback, $once = false)\n {\n if (! is_string($event)) {\n throw new InvalidArgumentException('Event name must be in a string.');\n }\n $cb = empty($once) ? 'on' : 'once';\n foil('events')->$cb($event, $callback);\n }",
"public function setName($name){\n $this->_name = $name;\n }",
"public function subscribe($event)\n\t{\n\t\t$event->listen('stats.startedGame', 'MovBizz\\Statistics\\Stats@increaseStartedGames');\n\t\t$event->listen('stats.producedMovies', 'MovBizz\\Statistics\\Stats@increaseProducedMovies');\n\t\t$event->listen('stats.lotteryWinnings', 'MovBizz\\Statistics\\Stats@increaseLotteryWinnings');\n\t\t$event->listen('stats.drugUse', 'MovBizz\\Statistics\\Stats@increaseDrugUse');\n\t\t// money spent\n\t\t// money spent on ads\n\t\t// award winnings\n\t\t// money income\n\t\t// highest lottery win\n\t\t// highest income\n\t\t// highest costs\n\t}",
"public function handleRename(PersistEvent $event)\n {\n $document = $event->getDocument();\n $defaultLocale = $this->registry->getDefaultLocale();\n\n if (!$event->getOption('auto_name')\n || !$document instanceof AutoNameBehavior\n || $defaultLocale !== $event->getLocale()\n || !$event->hasNode()\n || $event->getNode()->isNew()\n ) {\n return;\n }\n\n $node = $event->getNode();\n $name = $this->getName($document, $event->getParentNode(), $node);\n\n if ($name === $node->getName()) {\n return;\n }\n\n $this->rename($event->getNode(), $name);\n }",
"function eventLink ( $id, $name ) {\n return \"<a class='e' href='\" . pathToRoot() . \"e.php?i=$id'>$name</a>\";\n}",
"protected function add($name, $value){\r\n $this->file->{\"$this->command\"}($this->handler, $name, $value);\r\n }",
"public function name($name)\n {\n return $this->setProperty('name', $name);\n }",
"public function name($name)\n {\n return $this->setProperty('name', $name);\n }",
"public function set_name( $name ) {\n\t\t$this->set_prop( 'name', $name );\n\t}",
"function set_name($name)\n {\n $this->set_default_property(self :: PROPERTY_NAME, $name);\n }",
"protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}"
] | [
"0.62884367",
"0.612888",
"0.5704643",
"0.5648721",
"0.56429285",
"0.5596596",
"0.54783595",
"0.54553276",
"0.5444087",
"0.5309349",
"0.5262376",
"0.52506554",
"0.5231878",
"0.5218101",
"0.5214587",
"0.5147239",
"0.5108691",
"0.5099752",
"0.5084807",
"0.507079",
"0.50598776",
"0.50576305",
"0.5042714",
"0.49687982",
"0.49687386",
"0.4959495",
"0.49511266",
"0.49031255",
"0.49025193",
"0.48889735",
"0.48861325",
"0.48550293",
"0.48433197",
"0.48311466",
"0.480554",
"0.47844568",
"0.4780161",
"0.47589317",
"0.47286108",
"0.4716918",
"0.47084704",
"0.46993545",
"0.46929362",
"0.46916842",
"0.46884733",
"0.468636",
"0.46706122",
"0.46667504",
"0.46597552",
"0.46544683",
"0.4652657",
"0.46521822",
"0.46510598",
"0.46445847",
"0.46445847",
"0.4643436",
"0.464208",
"0.46291965",
"0.46252057",
"0.4621103",
"0.4620747",
"0.45944032",
"0.45805696",
"0.45798793",
"0.45635888",
"0.45571697",
"0.4556945",
"0.45500606",
"0.45330748",
"0.4530418",
"0.45295975",
"0.45201653",
"0.4519535",
"0.4518034",
"0.45172328",
"0.45082834",
"0.4501523",
"0.44926873",
"0.44772986",
"0.4477136",
"0.44676545",
"0.44672424",
"0.44643807",
"0.44566745",
"0.44556996",
"0.44488704",
"0.4447617",
"0.4442896",
"0.44303915",
"0.44212475",
"0.4419431",
"0.4419106",
"0.44185576",
"0.44184646",
"0.44177234",
"0.4415617",
"0.4415617",
"0.44138312",
"0.44093046",
"0.44029096"
] | 0.47629637 | 37 |
Remove an observable event name. | public function removeObservableEvents($observables)
{
$observables = is_array($observables) ? $observables : func_get_args();
$this->observables = array_diff($this->observables, $observables);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeEvent($event);",
"public function remove($name = null)\r\n {\r\n if (null === $name) {\r\n $this->_events = array();\r\n } else {\r\n $name = strtolower($name);\r\n if (isset($this->_events[$name])) {\r\n unset($this->_events[$name]);\r\n }\r\n }\r\n\r\n return $this;\r\n }",
"public function off($name)\n {\n foreach ($this->events as $key => $events) {\n if (preg_match(\"/^$name$|$name\\.)/\", $key)) {\n unset($this->events[$key]);\n }\n }\n }",
"public function remove_event($eventname)\n\t{\n\t\tCmsEvents::remove_event($this->get_name(), $eventname);\n\t}",
"public function __unset($name);",
"public function remove(string $name);",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public function remove($name);",
"public static function Remove($name);",
"function eventUnRegister($eventName, $id);",
"public function __unset($_name);",
"function remove($name) {\n if (isset($this->data[$name])) {\n unset($this->data[$name]);\n }\n }",
"public static function remove($name)\n {\n static::getInstance()->offsetUnset($name);\n }",
"public function __unset(string $name) {\n\t\tunset($this->data[$name]);\n\t}",
"public function unbind(string $name): void;",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"public function __unset($name)\n {\n }",
"abstract protected function handle_unset($name);",
"public function remove(string $name): void;",
"public function off($name, $observer = null)\n {\n if (null === $observer) {\n unset($this->events[$name]);\n } else {\n unset($this->events[$name][$observer]);\n }\n\n return $this;\n }",
"public function __unset($name)\n {\n \tunset($this->_data[$name]);\n }",
"public function __unset($sName)\n {\n }",
"public function __unset($name)\n {\n $this->unset($name);\n }",
"public function removeElement( $name ) {\n\t\tunset( $this->data[ $name ] );\n\t}",
"function removeAction($name){\n\t\tunset( $this->actions[$name] );\n\t}",
"public function forget($event)\n {\n unset($this->listeners[$event], $this->sorted[$event]);\n }",
"function __unset($name)\n {\n $this->clear($name);\n }",
"public function __unset($name)\n {\n $this->unset();\n }",
"public function __unset(string $name): void\n {\n $this->propertyHandler->unset($name);\n }",
"public function __unset($name)\n\t{\n\t\tunset($this->getInstance()->$name);\n\t}",
"public function forget($event)\n {\n unset($this->listeners[$event]);\n }",
"public function __unset($name)\n {\n $this->varHolder->remove($name);\n }",
"public static function clear($event) {\n unset(static::$events[$event]);\n }",
"public function __unset($name)\n\t{\n\t\tif(method_exists($this,$setter='set'.$name))\n\t\t\t$this->$setter(null);\n\t\telse if(method_exists($this,$jssetter='setjs'.$name))\n\t\t\t$this->$jssetter(null);\n\t\telse if(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t\t$this->_e[strtolower($name)]->clear();\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t\t$this->getEventHandlers($name)->remove(array($this, $name));\n\t\telse if($this->_m!==null&&$this->_m->getCount()>0&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tif(isset($this->_m[$name]))\n\t\t\t\t$this->detachBehavior($name);\n\t\t\telse {\n\t\t\t\t$unset=0;\n\t\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t\t{\n\t\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())) {\n\t\t\t\t\t\tunset($behavior->$name);\n\t\t\t\t\t\t$unset++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!$unset&&method_exists($this,'get'.$name))\n\t\t\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t\t\t}\n\t\t} else if(method_exists($this,'get'.$name))\n\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t}",
"public function unset(string $name): void;",
"public function unset(string $name): void;",
"public function clearListeners(string $event): void;",
"public function __unset($name)\n {\n echo \"Unsetting '$name'<br>\";\n unset($this->data[$name]);\n }",
"public function off($event);",
"public function remove($event, $listener);",
"public function remove($name)\n {\n unset($this->values[$name]);\n\t}",
"function __unset( $name ) {\n\t\tunset( $this->$name );\n\t}",
"function __unset($name) {\n\t\tunset($this->object[$name]);\n\t}",
"private function __unset($name)\n {\n if (method_exists($this, ($method = 'unset_'.$name)))\n {\n $this->$method();\n }\n }",
"public function remove($name)\n\t{\n\t\t$this->set($name, null);\n\t}",
"public function __unset($name)\n {\n $this->var_holder->remove($name);\n }",
"function __unset($name)\n {\n unset($this->item[$name]);\n }",
"public function __unset( string $name ) {\n\t\t$this->data = array_diff_key( $this->data, [ $name => $this->data[ $name ] ] );\n\t}",
"public function removeNamedItem($name) { }",
"public function remove($name)\n {\n unset($this->bag[$name]);\n }",
"public function removeAttribute($name)\n {\n unset($_SESSION[$name]);\n }",
"public function removeAllListeners($eventName);",
"public static function removeAllListeners(string $event) : void\n {\n if (Event::hasListeners($event)) {\n unset(Event::$listeners[$event]);\n }\n }",
"public function remove_data($name)\n\t{\n\t\tunset($this->_data[$name]);\n\t}",
"public function removeFilter(string $name);",
"public function __unset($name) {\n\t\tunset($this->session[$name]);\n\t}",
"public static function remove_event( $module_name, $event_name )\n\t{\n\t\t$event = cms_orm('CmsDatabaseEvent')->find_by_module_name_and_event_name($module_name, $event_name);\n\t\tif ($event)\n\t\t{\n\t\t\t$event->delete();\n\t\t}\n\t}",
"public function removeAction(string $name)\n {\n // some logic\n }",
"abstract protected function propertyUnset($name);",
"public function offsetUnset($name)\n\t{\n\t\t$this->remove ( $name );\n\t}",
"public function removeEventSubscriber(IEventSubscriber $subscriber);",
"abstract public function removeItem($name);",
"public function removeAttribute($name)\n {\n unset($this->attributes[$name]);\n }",
"public function unRegisterWriteCallback($type, $name) {}",
"public function unsubscribe($commandName, CommandHandlerInterface $handler);",
"public function __unset($name)\n {\n if (array_key_exists($name, $this->_unsaved)) {\n // if changing property, remove relation model\n if (isset($this->_relationships[$name])) {\n unset($this->_relationships[$name]);\n }\n\n unset($this->_unsaved[$name]);\n }\n }",
"public final function __unset(string $name) : void\n {\n unset($this->attrs[$name]);\n }",
"function destroy($event) {\n $timers =& Timer::timers();\n unset($timers[$event]);\n }",
"public function __unset($name)\n {\n return $this->call('__unset', [$name]);\n }",
"public function clear($event);",
"public function unsetName(): void\n {\n $this->name = [];\n }",
"public function unsetName(): void\n {\n $this->name = [];\n }",
"public function unsetName(): void\n {\n $this->name = [];\n }",
"public function unsetName(): void\n {\n $this->name = [];\n }",
"static public function del($name) {}",
"public function delete($name)\n {\n unset($this->data[$name]);\n }",
"function unregister($event, $callback) {\n Event::unregister($event, $callback);\n }",
"public function remove($name)\n {\n foreach ((array) $name as $n) {\n unset($this->methods[$n]);\n }\n }",
"public function offsetUnset(mixed $name): void\n {\n $this->remove($name);\n }",
"public function getCustomEventName();",
"public function removeBehavior($name) {\n\t\t$this->Behaviors->unload($name);\n\t}",
"public function removeData($name)\n\t{\n\t\tif($this->data->offsetExists($name))\n\t\t\t$this->data->offsetUnset($name);\n\t}",
"public function removeFilter(string $name): void;",
"public function removeTag(string $name);",
"public function __unset($name)\n {\n if (array_key_exists($name, $this->_attributes)) {\n unset($this->_attributes[$name]);\n }\n }",
"public function unSubscribe()\n {\n }",
"public function __unset($name)\n {\n $vars = $this->vars();\n if (! isset($vars[$name])) {\n return;\n }\n unset($vars[$name]);\n }",
"public function remove_var ($a_name) {\n\t\t\n\t\tif ($this->loaded == 0) {\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\tunset($this->data[$a_name]);\n\t\t\n\t}",
"public function __unset($name)\n {\n return $this->removeParam($name);\n }",
"public function remove(string $name = '')\n {\n if ('' === $name) {\n unset($this->items);\n return;\n }\n \n if (isset($this->items[$name])) {\n unset($this->items[$name]);\n }\n }",
"public function __unset($name)\n {\n return $this->delete($this->uri, $name);\n }"
] | [
"0.6761382",
"0.65801764",
"0.65038204",
"0.6314531",
"0.62676185",
"0.61617386",
"0.6142246",
"0.6142246",
"0.6142246",
"0.6142246",
"0.6142246",
"0.6142246",
"0.61364895",
"0.6100873",
"0.60754365",
"0.59819597",
"0.5958885",
"0.59501183",
"0.59499377",
"0.5927891",
"0.5927891",
"0.5927891",
"0.5926926",
"0.5926926",
"0.5926926",
"0.59259534",
"0.59259534",
"0.5924531",
"0.59036976",
"0.5863987",
"0.58201325",
"0.58150566",
"0.5813316",
"0.579965",
"0.5797115",
"0.57963496",
"0.5794383",
"0.57681715",
"0.576446",
"0.5759138",
"0.57372147",
"0.5723645",
"0.5718478",
"0.5711561",
"0.56860584",
"0.56860584",
"0.5675944",
"0.56734365",
"0.5660883",
"0.5659309",
"0.56545526",
"0.563052",
"0.56271267",
"0.5625556",
"0.5609771",
"0.55914044",
"0.55903226",
"0.5573212",
"0.5563355",
"0.55627954",
"0.5543076",
"0.55099404",
"0.5506404",
"0.5504168",
"0.5486849",
"0.547766",
"0.54654855",
"0.5445742",
"0.54413515",
"0.54293704",
"0.5427686",
"0.5418364",
"0.5401877",
"0.5393838",
"0.5388106",
"0.5385534",
"0.5380529",
"0.53753024",
"0.5373311",
"0.536947",
"0.5362613",
"0.5362613",
"0.5362613",
"0.5362613",
"0.5352441",
"0.53485036",
"0.53478885",
"0.53317064",
"0.5319516",
"0.53192174",
"0.53187037",
"0.53155226",
"0.5305998",
"0.53016704",
"0.5291698",
"0.52915394",
"0.5282138",
"0.5256491",
"0.52477026",
"0.5244043",
"0.52439326"
] | 0.0 | -1 |
Update the model in the database. | public function update(array $attributes = [])
{
if (!$this->exists) {
return $this->newQuery()->update($attributes);
}
return $this->fill($attributes)->save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}",
"function update(){\n\t\t$this->model->update();\n\t}",
"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 }",
"abstract protected function updateModel();",
"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(){\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 db_update() {}",
"public function update()\n\t{\n\t\t$this->user->db_update();\n\t}",
"private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }",
"public function update()\n {\n return $this->save();\n }",
"public function testUpdateModelSet()\n {\n }",
"public function update() {\n\t\tTournamentDBClient::update($this);\n\t}",
"public function updated($model)\n {\n }",
"public function update($model) :bool;",
"public function update($id, Model $model);",
"public function updating($model)\n\t{\n\t}",
"public function update() {\r\n\t\t$this->getMapper()->update($this);\r\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 }",
"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 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 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 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( One_Model $model )\n\t{\n\t\treturn null;\n\t}",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }",
"public function update(Model $model, array $attributes);",
"public function update(){\n\n\t\t/* set method */\n\t\t$this->request_method = 'update';\n\t\t\t\t\n\t\t/* check for a model id */\n\t\tif( ! $this->id) {\n\t\t\t$this->set_error( 10, 'No model id in request, cant update' );\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t/* read the data received from backbone */\n\t\t$this->parse_model_request();\n\n\t\tif($this->get_errors())\n\t\t\treturn;\n\t\t\t\t\t\n\t\t/* get the parsed post data from request */\n\t\t$item_data = $this->parsed_model_request;\n\t\t \t\t\t \t\n\t\t/* insert database */\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\n\t\t\t/* posts */\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t\t$post = $item_data['post'];\n\t\t\t\t\n\t\t\t\t/* privileg check */ //improve this for coded api calls, like when setting up bootstrap data (for reading it is no problem any way, because this check is only made for update and create and delete)\n\t\t\t\tif( $this->properties->access == \"loggedin\" && ! current_user_can('edit_post', $this->id)) { \n\t\t\t\t\t$this->set_error( 11, 'no user privileges to update the item on server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$result = wp_update_post( $post );\n\t\t\t\t\n\t\t\t\t/* maybe an error while updating */\n\t\t\t\tif( ! $result) {\n\t\t\t\t\t$this->set_error( 12, 'updating the item failed on the server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* geting the id means update was a success */\n\t\t\t\t$updated_id = $result;\n\t\t\t\t\n\t\t\t\t/* save custom data, this only method does all the magic, \n\t\t\t\tdetails must be specified in the custom package handlers */\n\t\t\t\t$this->_action_custom_package_data( $updated_id, $item_data);\t\n\t\t\t\t\n\t\t\t\t/* set a clean response */\n\t\t\t\t$this->parse_model_response($updated_id);\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t/* comment */\n\t\t\tcase('comment'):\n\t\t\t\t$comment = $item_data['comment'];\n\t\t\t\t\n\t\t\t\t/* comment updateding is not supported */\n\t\t\t\t$this->set_error( 13, 'comments cant be updated!' );\n\t\t\t\t\treturn; \n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t//@TODO\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$new_id = $this->id;\n\t\t\t\t$this->_action_custom_package_data( $new_id, $item_data);\t\t\t\t\t\n\t\t\t\t$this->parse_model_response($new_id);\t\t\n\t\t\tbreak;\n\t\t}\n do_action('bb-wp-api_after_update', $updated_id, $this->properties, $this );\n\t\n\t}",
"protected function saveUpdate()\n {\n }",
"public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }",
"public function update()\n {\n }",
"public function update(User $model);",
"public function updateModel(Model &$model)\n {\n }",
"public function updateDB()\n {\n\n }",
"public function actionUpdate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n /*\r\n * Receive all the PUT parameters\r\n */\r\n parse_str(file_get_contents('php://input'), $put_params);\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>update</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model))\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n \r\n /*\r\n * assign PUT parameters to attributes\r\n */ \r\n foreach($put_params as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n *save the model\r\n */\r\n if($model->save()) {\r\n $this->_sendResponse(200, sprintf('The model <b>%s</b> with id <b>%s</b> has been updated.', $_GET['model'], $_GET['id']) );\r\n } else {\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't update model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n }",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function update()\n {\n $this->updateTemplates();\n $this->updateMappings();\n }",
"public function updatedModel(Model &$model)\n {\n }",
"public function update(Request $request, object $model): bool;",
"public function actionUpdate() {\n Yii::import('bootstrap.widgets.TbEditableSaver'); //or you can add import 'ext.editable.*' to config\n $es = new TbEditableSaver('Donneur'); // 'User' is classname of model to be updated\n $es->update();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n /*if (isset($_POST['pk'])) {\n $model = $this->loadModel($_POST['pk']);\n $model->first_name = $_POST['first_name'];\n $model->save();\n // $this->redirect(array('view', 'id' => $model->id));\n }\n\n /* $this->render('update', array(\n 'model' => $model,\n ));*/\n }",
"public function update(Model $model, Request $request): ?Model;",
"public function actionUpdate() {}",
"public function actionUpdate() {}",
"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{\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}",
"protected function update() {}",
"function update($unique_id, $model)\n {\n }",
"public function update()\r\n {\r\n \r\n }",
"public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }",
"public function update()\n {\n //\n }",
"public function update()\n {\n //\n }",
"public function processUpdate()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter updateModifyValidationRules\n $validationRules = $this->doFilter(\"updateModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter updateModifyValidationMessages\n $validationMessages = $this->doFilter(\"updateModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set initial configuration\n $Model->build($this->Model->getTable());\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter updateModifyRequest\n $this->Model = clone $Model;\n $parameters = $this->doFilter(\"updateModifyRequest\", $requestParameters);\n // Update record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($Model, $parameters) {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n });\n } else {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.update.success'));\n // Hook Filter updateModifyResponse\n $Response = $this->doFilter(\"updateModifyResponse\", $Response);\n $this->redirect($Response);\n }",
"public function actionUpdate()\n {\n $model = $this->loadModel();\n\n if (isset($_POST['User']))\n {\n $model->attributes = $_POST['User'];\n\n if ($model->save())\n {\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Данные обновлены!'));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }",
"public function actionUpdate() //update value from default page to DB\n {\n\n\n $model = $this->findModel($_POST['ExamRoomDetail']['rooms_detail_date'],\n $_POST['ExamRoomDetail']['rooms_detail_time'],\n $_POST['ExamRoomDetail']['rooms_id']\n );\n if(isset($_POST)) {\n $model->load(Yii::$app->request->post());\n $update = $model;\n $update->exam_room_status = $_POST['ExamRoomDetail']['exam_room_status'];\n $update->save();\n }\n\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}",
"function update(){\n session_start();\n $id=$_SESSION['id_alumno'];\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n \n unset($_SESSION['id_alumno']);\n $this->model->update(['id'=>$id,'nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n \n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n\n // $this->index();\n\n // if ($this->model->update(['id'=>$id,'nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono])) {\n // $alumno = new Alumnos();\n // $alumno->id=$id;\n // $alumno->nombre=$nombre;\n // $alumno->apellido=$apellido;\n // $alumno->telefono=$telefono;\n // $this->view->alumno=$alumno;\n // $this->render();\n\n\n // }else{\n // $this->view->render('errors/index');\n // }\n // $url= constant('URL').\"alumno\";\n // header(\"Location: $url\");\n }",
"public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function update() {\r\n\r\n\t}",
"public function update()\r\n {\r\n //\r\n }",
"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 update($data) {}",
"public function update($data) {}",
"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}",
"protected function _update()\n {\n \n }",
"protected function _update()\n {\n \n }",
"public function actionUpdate() {\n $json = file_get_contents('php://input'); //$GLOBALS['HTTP_RAW_POST_DATA'] is not preferred: http://www.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data\n $put_vars = CJSON::decode($json, true); //true means use associative array\n switch ($_GET['model']) {\n // Find respective model\n case 'Order':\n $model = Order::model()->findByPk($_GET['id']);\n break;\n case 'Users':\n $model = Users::model()->findByPk($_GET['id']);\n break;\n case 'Product':\n $model = Product::model()->findByPk($_GET['id']);\n break;\n case 'Vendor':\n $model = Vendor::model()->findByPk($_GET['id']);\n break;\n case 'FavoriteProduct':\n $model = FavoriteProduct::model()->findByPk($_GET['id']);\n break;\n case 'Rating':\n $model = Rating::model()->findByPk($_GET['id']);\n break;\n case 'Review':\n $model = Review::model()->findByPk($_GET['id']);\n break;\n case 'UserAddress':\n $model = UserAddress::model()->findByPk($_GET['id']);\n break;\n case 'OrderDetail':\n $model = OrderDetail::model()->findByPk($_GET['id']);\n break;\n default:\n $this->_sendResponse(0, sprintf('Error: Mode update is not implemented for model ', $_GET['model']));\n Yii::app()->end();\n }\n // Did we find the requested model? If not, raise an error\n if ($model === null)\n $this->_sendResponse(0, sprintf(\"Error: Didn't find any model with ID .\", $_GET['model'], $_GET['id']));\n\n // Try to assign PUT parameters to attributes\n unset($_POST['id']);\n foreach ($_POST as $var => $value) {\n // Does model have this attribute? If not, raise an error\n if ($model->hasAttribute($var))\n $model->$var = $value;\n else {\n $this->_sendResponse(0, sprintf('Parameter %s is not allowed for model ', $var, $_GET['model']));\n }\n }\n // Try to save the model\n if ($model->update())\n $this->_sendResponse(1, '', $model);\n else\n $this->_sendResponse(0, $msg);\n // prepare the error $msg\n // see actionCreate\n // ...\n }",
"public function update(){\n \n //Validate before updating\n $this->validate([\n 'title'=>'required',\n 'content'=>'required'\n ]);\n \n //Check if the specific record id is submited\n if($this->ids)\n {\n\n $post = Post::find($this->ids);\n\n $post->update([\n 'title' => $this->title,\n 'content' => $this->content,\n ]);\n \n //Set session flash message\n session()->flash('update','Post updated Successfully!');\n \n //Reset the input fields to empty\n $this->resetInputFields();\n \n //Emit To Close Modal after updating\n $this->emit('postUpdated');\n }\n }",
"public function update() {\r\n }",
"public function _update()\n {\n $this->updatedAt = new \\DateTime();\n }",
"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 }",
"function update_model($n,$o)\n {\n $query=$this->db2->query(\"UPDATE buses_model SET model='$n' WHERE model='$o' \");\n if($query)\n return 1;\n else\n return 0;\n }",
"public function updateDatabase(){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Get all of the columns in the database table\n\t\t$columns = static::$columns;\n\t\t//Because we dont want the ID to change, remove the ID from the database\n\t\tunset($columns[array_search('id', $columns)]);\n\t\t//If we had a timecreated and timeupdated column, we would unset the timecreated column here\n\n\t\t//Write an Update Query\n\t\t$query = \"UPDATE \" . static::$tableName . \" SET \";\n\t\t$updatecols = [];\n\t\tforeach ($columns as $column){\n\t\t\tarray_push($updatecols, $column . \"=:\" . $column);\n\t\t}\n\t\t$query .= implode(\",\", $updatecols);\n\t\t$query .= \" WHERE id =:id\";\n\t\t$statement = $db->prepare($query);\n\n\t\tforeach(static::$columns as $column){\n\t\t\t//Hash the password\n\t\t\tif($column === 'password'){\n\t\t\t\t$this->$column = password_hash($this->$column, PASSWORD_DEFAULT);\n\t\t\t}\n\t\t\t$statement->bindValue(\":\".$column, $this->$column);\n\t\t}\n\t\t$statement->execute();\n\t}",
"public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }",
"public function update()\n\t{\n\n\t}",
"public function update() {\r\n try {\r\n $type = get_object_vars($this->model);\r\n\r\n foreach ($type as $key => $value) {\r\n if (in_array($key, $this->validColumns)) {\r\n if(is_bool($value)) {\r\n $value = (int)$value;\r\n }\r\n $data[$key] = $value;\r\n }\r\n }\r\n\r\n $this->db->update(\"assets_permissions\", $data, $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }\r\n catch (Exception $e) {\r\n throw $e;\r\n }\r\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 testUpdate(): void { }",
"public function update()\n {\n update($this->id, $article);\n }",
"function update(array $values)\n{\n\tforeach ($this as $model) {\n\t\t$model->setValues($values);\n\t\t$model->save();\n\t}\n}",
"private function Update() {\n $Update = new Update;\n $Update->ExeUpdate(self::Entity, $this->Data, \"WHERE id = :id\", \"id={$this->Post}\");\n if ($Update->getResult()):\n $this->Error = [\"As informações de <b>contato</b> foram atualizadas com sucesso!\", WS_ACCEPT];\n $this->Result = true;\n endif;\n }",
"public function update()\n {\n\n }",
"public function update()\n {\n\n }",
"function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }",
"protected function update()\n\t{\n\t\t$this->autofill();\n\n\t\t$query = $this->connection->prepare (\"call UpdateProjectBooth (?, ?)\");\n\t\t$query->execute ([$this->fields['ID'], $this->fields['BoothID']]);\n\n\t\t$booth = $this->fields['BoothID'];\n\t\tunset ($this->fields['BoothID']);\n\n\t\tparent::update();\n\n\t\t$this->fields['BoothID'] = $booth;\n\n\t}",
"public function update()\n {\n # code...\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update($modelData) {\n// codigoCliente = ? ,\n// codigoPedido = ?, \n// monto = ? WHERE codigo = ?\"; \n// \n// $stmt = $this->mysql->getStmt($sql);\n// $stmt->bind_param(\"iidi\", $modelData['codigoCliente'], \n// $modelData['codigoPedido'], \n// $modelData['monto'],\n// $modelData['codigo']);\n// $stmt->execute();\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}",
"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{\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}",
"public function update() {\n \n }"
] | [
"0.822013",
"0.8215936",
"0.80111283",
"0.7817097",
"0.7592092",
"0.7171988",
"0.71149844",
"0.7064558",
"0.703368",
"0.7032866",
"0.7001174",
"0.6990207",
"0.69881356",
"0.6983201",
"0.69691366",
"0.6968232",
"0.69657665",
"0.68320507",
"0.6762098",
"0.6696608",
"0.6650795",
"0.6628972",
"0.66092104",
"0.6591783",
"0.65857977",
"0.6568213",
"0.65662616",
"0.6553707",
"0.65464664",
"0.65454304",
"0.6540622",
"0.65297455",
"0.65232813",
"0.6506409",
"0.64946234",
"0.64918447",
"0.64729863",
"0.64690816",
"0.6466153",
"0.6465925",
"0.6465925",
"0.64561224",
"0.6423457",
"0.64179593",
"0.64151573",
"0.63923365",
"0.6388105",
"0.638547",
"0.638547",
"0.6368874",
"0.6351739",
"0.63414365",
"0.63413876",
"0.63339186",
"0.6332879",
"0.63147455",
"0.63027173",
"0.63022876",
"0.63003176",
"0.62804496",
"0.62804496",
"0.6278095",
"0.6271077",
"0.6271077",
"0.6258377",
"0.62484545",
"0.6238828",
"0.62332296",
"0.6231109",
"0.6217414",
"0.6213685",
"0.6212606",
"0.62125754",
"0.6203822",
"0.6203616",
"0.6199628",
"0.61980087",
"0.6181201",
"0.6180451",
"0.61731267",
"0.61731267",
"0.61690336",
"0.6168755",
"0.61667407",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61651117",
"0.61647666",
"0.61592734",
"0.6155624",
"0.6128983",
"0.61258775"
] | 0.0 | -1 |
Save the model to the datasource. | public function save(array $options = null)
{
return $this->saveInternal(['force' => false] + (array) $options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save()\n {\n $this->_validateModifiable();\n\n if($this->isNew())\n {\n $this->_getDataSource()->create($this);\n }\n else\n {\n $this->_getDataSource()->update($this);\n }\n\n $this->_saveRelations();\n $this->_setNew(false);\n }",
"public function save(): void\n {\n $this->em->persist($this->model);\n $this->em->flush();\n }",
"public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }",
"public function save() {\r\n if ($this->model->getId()) {\r\n return $this->model->update();\r\n }\r\n return $this->create();\r\n }",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"public function save()\n {\n if ( !$this->unsaved ) {\n // either nothing has been changed, or data has not been loaded, so\n // do nothing by returning early\n return;\n }\n\n $this->write();\n $this->unsaved = false;\n }",
"public function save()\n \t{\n \t $this->getMapper()->save($this);\n \t}",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"public final function save() {\n }",
"public function save()\n {\n\n // generate all column's sql query\n $column_names = '';\n $column_values = '';\n foreach ($this->columns as $field_name => $column_obj)\n {\n if ($column_obj->columnName === null) {\n $column_names .= $field_name.', ';\n } else {\n $column_names .= $column_obj->columnName.', ';\n }\n $column_values .= $column_obj->generateValueForSQL().', ';\n }\n $column_names = substr($column_names, 0, -1);\n $column_values = substr($column_values, 0, -1);\n $this_table_name = $this->table_name;\n $this_id = $this->id;\n\n if ($this->id === 0) {\n // This object is not saved yet.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values);';\n // Execute query\n } else {\n // This object is on the DB.\n $query = 'INSERT INTO $this_table_name ($column_names) VALUES ($column_values) WHERE id=$this_id;';\n // Execute query\n }\n\n mysql_run_query($query);\n\n }",
"public function save()\n {\n }",
"public function save() {\n\t\treturn $this->data->save($this->collection);\n\t}",
"public function save($model);",
"function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}",
"public final function save()\n {\n }",
"private function saveModel() {\n $this->model->name = $this->request->name;\n $this->model->layout_header_in_first_column = $this->request->layout_header_in_first_column;\n $this->model->save();\n\n $toSync = [];\n foreach ($this->request->labels as $sequence => $label) {\n $toSync[$label['parameterId']] = ['label' => $label['label'], 'sequence' => $sequence];\n }\n\n $this->model->parameters()->sync($toSync);\n\n return response(['message' => trans('strings.modelExportSuccess'), 'synced' => $toSync]);\n }",
"public function save()\r\n {\r\n \r\n }",
"public function saving($model)\n\t{\n\t}",
"public function saving($model)\n {\n }",
"public function save(Model $model): void;",
"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()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }",
"function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}",
"public function save()\n\t{\n\t\tself::$db->model = $this;\n\t\t$boolean = $this->validate();\n\t\tif($boolean){\n\t\t\treturn self::$db->saveNow();\n\t\t}\n\t}",
"public function save()\n {\n return;\n }",
"public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }",
"public function save() {\n\t\t\t\n\t\t}",
"abstract public function save(Model $model);",
"public function save()\n {\n if ($conn = $this->_getConnection()) {\n $data = $this->getData();\n unset($data['user']);\n if ($this->id) {\n $fields = array();\n foreach ($data as $_field => $_value) {\n $fields[] = \"`{$_field}`='{$_value}'\";\n }\n $sql = \"UPDATE `{$this->_dbTable}` SET \" . implode(\",\", $fields) . \" WHERE `id`={$this->id};\";\n } else {\n $sql = \"INSERT INTO `{$this->_dbTable}` (`\" . implode('`,`', array_keys($data)) . \"`)\n VALUES('\" . implode(\"','\", $data) . \"');\";\n }\n $result = $conn->query($sql);\n app::log(array($sql, $result, $conn->errno, $conn->error)); //!!!!\n if ($conn->errno) {\n app::log('Error saving model \"' . $this->_modelName . '\" into DB with ID=' . $this->id, app::LOG_LEVEL_ERROR . \"\\n{$conn->errno} - {$conn->error}\");\n }\n if (!$this->id) {\n $this->id = $conn->insert_id;\n }\n }\n app::log($this->_data); //!!!!\n return $this;\n }",
"public function save()\n {\n // For V2.0\n }",
"public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }",
"public function save() {\n }",
"public function save() {\n }",
"public function saveModel() : int\n {\n return $this->save($this);\n }",
"public function save( Application_Model_Interface $model );",
"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 saved($model)\n {\n }",
"public function save() {\n }",
"public function saveSettings()\n {\n $this->store->save($this->data);\n }",
"protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}",
"public function save()\n {\n $this->checkModel();\n if (!is_null($this->profile)) $this->saved = $this->profile->save();\n }",
"public function save() {\n return $this->entity->save();\n }",
"public function store()\n {\n Log::debug(\"STORE MODEL: $this->request\");\n return $this->saveModel();\n }",
"public function saved($model)\n\t{\n\t}",
"public function save()\n\t{\n\t\t$input = $this->getDataArray();\n\t\treturn $this->modify( $input, FALSE );\n\t}",
"public function save()\n\t{\n\t\t$input = $this->getDataArray();\n\t\treturn $this->modify( $input, FALSE );\n\t}",
"public function save(Iris_Model_Abstract $model) {\n // Determine whether to insert or update model\n if(null === $model->id) {\n $model->id = $this->insert($model->toArray());\n\n } else {\n $this->update($model->toArray(), array(\"{$this->_primary} = ?\" => $model->id));\n }\n }",
"public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }",
"public function save()\n {\n \treturn FactoryAbastract::dao(get_class($this))->save($this);\n }",
"public function saveAction()\n {\n $form = $this->getForm();\n $form->setData($_POST);\n try {\n $valid = $form->isValid();\n } catch (\\Exception $e) {\n $valid = false;\n }\n if (!$valid)\n {\n $this->getSessionStorage()->fromArray(['form' => $form]);\n return $this->redirect()->toRoute($this->routeName, ['action' => 'edit']);\n }\n $modelName = $this->modelName;\n $model = new $modelName();\n $model->exchangeArray($this->getDataFromRequest());\n $this->sm->get($this->mainTableFactory)->save($model);\n return $this->redirect()->toRoute($this->routeName);\n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function save()\r\n {\r\n //\r\n }",
"public function save()\n {\n // If the model already exists in the database we can just update our record\n // that is already in this database using the current IDs in this \"where\"\n // clause to only update this model. Otherwise, we'll just insert them.\n if ($this->exists) {\n $saved = $this->isDirty() ? $this->performUpdate() : true;\n }\n\n // If the model is brand new, we'll insert it into our database and set the\n // ID attribute on the model to the value of the newly inserted row's ID\n // which is typically an auto-increment value managed by the database.\n else {\n $saved = $this->performInsert();\n }\n\n // If the model is successfully saved, we need to do a few more things once\n // that is done. We will call the \"saved\" method here to run any actions\n // we need to happen after a model gets successfully saved right here.\n if ($saved) {\n $this->syncOriginal();\n }\n\n return $saved;\n }",
"public function save() {\n $class = get_called_class();\n return $class::$objects->save($this);\n }",
"public function save()\n {\n // that is already in this database using the current IDs in this \"where\"\n // clause to only update this model. Otherwise, we'll just insert them.\n if ($this->exists) {\n $saved = $this->newBuilder()->where('_id', $this->convertToMongoId($this->attributes['_id']))->update($this->attributes);\n }\n // If the model is brand new, we'll insert it into our database and set the\n // ID attribute on the model to the value of the newly inserted row's ID\n // which is typically an auto-increment value managed by the database.\n else {\n $saved = $this->newBuilder()->insert($this->attributes);\n }\n\n // TODO: fill() attributes will new or updated values.\n\n return $saved;\n }",
"public function save($model) {\n return parent::save($model);\n }",
"function save(&$model);",
"public function saveData()\r\n {\r\n \r\n }",
"public function save(){\n\t\t// If primary key is set in model, run an update instead.\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\tif(isset($this->{$primaryKey})){\n\t\t\treturn $this->update();\n\t\t}\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 = array_map(fn($name) => ':'.$name, $fields);\n\t\t// Populate statement by imploding the arrays.\n\t\t$statement = $this->db->prepare('INSERT INTO ' . $tableName . ' ( ' . implode(', ', $fields) . ') VALUES (' . implode(', ', $params) . ')');\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\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 save() : bool {\n $this->getForm();\n $model = (array) $this;\n unset($model['id']);\n\n $colNames = implode(', ', array_keys($model));\n $colValues = ':' . str_replace(', ', ', :', $colNames);\n $arrBind = array_combine(explode(', ', $colValues), array_values($model));\n\n try {\n $db = new DbConnection();\n $db = $db->connect();\n $statement = $db->prepare(\"INSERT INTO \" . static::tableName() . \" (\" . $colNames . \")\n VALUES (\" . $colValues . \")\");\n\n foreach ($arrBind as $key => &$value) {\n $statement->bindParam($key, $value);\n }\n\n $result = $statement->execute();\n $db = null;\n } catch (PDOException $e) {\n $result = false;\n $e->getMessage(); // Only in dev mode\n }\n return $result;\n }",
"public function save()\n\t{\n\n\t}",
"public function saving(Dataset $dataset)\n {\n\n }",
"public function save()\n {\n }",
"public function save()\n {\n }",
"public function save()\n {\n $db = DatabaseUtil::db_connect($this->database);\n $db->query('update ' . $this->table . 'set ' . $this->column . ' = ' . $this->value . ' where ID=' . $this->ID);\n $db->close();\n }",
"public function save() {\n if ($this->loaded) {\n return $this->update();\n }else{\n return $this->create();\n }\n }",
"public function save()\n {\n $this->persist($this->state);\n }",
"public abstract function save();",
"public function save()\n {\n $this->setData(array(\n 'modified' => time(),\n 'modifiedReadable' => Zend_Date::now()->get(Zend_Date::ISO_8601)\n ));\n \n $unmappedData = $this->getBean()->asDeepArray(true);\n if(key_exists('_id', $unmappedData)) {\n unset($unmappedData['_id']);\n }\n\n if (!($id = $this->_save($unmappedData, $this->getId()))) {\n return false;\n }\n\n $this->_setId($id);\n \n return true;\n }",
"public function save(){\n }",
"function save() {\n $all_fields = ['id' => $this->id] + ['data' => JSON::encode($this->getData(true))];\n if($this->_just_created) {\n $ps = DB::connect(isset(self::$external_dsn)?self::$external_dsn:null)->prepare(\"\n insert into \".static::$table.\"(\".implode(\",\", array_keys($all_fields)).\")\n values (\".implode(\", \", array_map(function($field) {return \":$field\";}, array_keys($all_fields))).\")\n \");\n } else {\n $ps = DB::connect(isset(self::$external_dsn)?self::$external_dsn:null)->prepare(\"\n update \".static::$table.\"\n set \".implode(\", \", array_map(function($field) {return \"$field = :$field\";}, array_keys($all_fields))).\"\n where id = :id\n \");\n }\n foreach ($all_fields as $field => $value) {\n if (is_bool($value)) {\n $ps->bindValue($field, $value, \\PDO::PARAM_BOOL);\n } else {\n $ps->bindValue($field, $value);\n }\n }\n // Little cheat to get calculated data to be displayed in api call request\n $this->data = $this->getData();\n $ps->execute();\n $this->_just_created = false;\n return $this;\n }",
"public function save()\n {\n //\n }",
"protected function finishSave()\n {\n $this->fireModelEvent('saved', false);\n $this->syncOriginal();\n }",
"public function save()\n {\n return $this->edit($this->id, $this->data);\n }",
"public function save() {\n\n }",
"public function save()\n\t{\n\n\t\treturn parent::save();\n\t}",
"public function save() {\n if ($this->id) {\n return $this->update();\n } else {\n return $this->insert();\n }\n }",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();"
] | [
"0.7687302",
"0.70673543",
"0.70123863",
"0.6893411",
"0.67907876",
"0.6784066",
"0.6681013",
"0.6654158",
"0.6654158",
"0.66518784",
"0.66488343",
"0.66446275",
"0.6637515",
"0.6623977",
"0.6616314",
"0.6559563",
"0.6528818",
"0.65250874",
"0.6513197",
"0.65117586",
"0.65032494",
"0.6502274",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.6492845",
"0.64338714",
"0.6418599",
"0.6408634",
"0.6403082",
"0.6387453",
"0.637189",
"0.6364839",
"0.6355878",
"0.63516116",
"0.6350334",
"0.6344811",
"0.6344811",
"0.6316305",
"0.62991154",
"0.6296812",
"0.62896657",
"0.6289042",
"0.6276229",
"0.6265895",
"0.6263676",
"0.6238632",
"0.62376285",
"0.6225778",
"0.62252975",
"0.62252975",
"0.62210625",
"0.6216119",
"0.62067354",
"0.62042075",
"0.61634064",
"0.6159599",
"0.61376405",
"0.61306536",
"0.6119285",
"0.6117938",
"0.6115059",
"0.60979366",
"0.609751",
"0.60954124",
"0.60945547",
"0.60931265",
"0.60895014",
"0.60895014",
"0.6076775",
"0.607561",
"0.60648096",
"0.6062918",
"0.60592526",
"0.60559714",
"0.6048486",
"0.60480845",
"0.6003495",
"0.6002801",
"0.59952456",
"0.5993527",
"0.59917086",
"0.5990438",
"0.5990438",
"0.5990438",
"0.5990438",
"0.5990438"
] | 0.0 | -1 |
Finish processing on a successful save operation. | protected function finishSave(array $options)
{
$this->fireModelEvent('saved', false);
$this->mtime = $this->newQuery()->lastModified();
$this->syncOriginal();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function finishSave()\n {\n $this->fireModelEvent('saved', false);\n $this->syncOriginal();\n }",
"public final function save() {\n }",
"public function finish()\n {\n $this->status = 'finished';\n return $this->save();\n }",
"public final function save()\n {\n }",
"function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}",
"public function save()\n {\n if ( !$this->unsaved ) {\n // either nothing has been changed, or data has not been loaded, so\n // do nothing by returning early\n return;\n }\n\n $this->write();\n $this->unsaved = false;\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"public function finished() {\n $this->setFinishedAt(new MongoDate());\n $this->save();\n }",
"protected function afterSave()\n {\n return;\n }",
"public function save()\n\t{\n\t\tif ($this->loaded === FALSE)\n\t\t{\n\n\t\t}\n\t\treturn parent::save();\n\t}",
"public function save()\n {\n return;\n }",
"protected function _finalSave() {\n $res = $this->saveAssociated($this->tempData, array('deep' => true));\n\n if ($res === true)\n return array('success' => true);\n else{\n // @todo fetch all associed models errors\n $errors = '';\n return array('success' => false, 'message' => 'validation error', 'type' => 'error', 'errors' => $errors);\n }\n \n }",
"protected function _postSave()\r\n\t{\r\n\t}",
"protected function performPostSaveCallback()\n {\n // echo 'saved a record ...';\n return true;\n }",
"protected function saving() {\n // This will get reimplemented by children when necessary\n }",
"protected function callAfterSuccessfulSave()\n\t{\n\t\tforeach($this->editFields as $f)\n\t\t{\n\t\t\t$this->getControl($f, $this->id)->afterSuccessfulSave();\n\t\t}\n\t}",
"public function processAndComplete()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_COMPLETED;\n $this->withdrawal->save();\n }\n }",
"protected function _postSave($success, $exists) {}",
"protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}",
"private function executeAfterSave()\n {\n Logger::getInstance()->po_log(\"Excecute after save \". get_class($this));\n\n foreach ( $this->afterSave as $cb ) $cb->execute();\n\n // Una vez que termino de ejecutar, reseteo los cb's registrados.\n $this->afterSave = array();\n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function save()\n {\n return FALSE;\n }",
"public function save()\n {\n Logger::getInstance()->po_log(\"PO:save \" . get_class($this));\n\n if (!$this->validate(true)) return false;\n \n //Logger::getInstance()->po_log(\"PO:save post validate\");\n\n $this->executeBeforeSave();\n\n //Logger::getInstance()->on();\n try\n {\n //Logger::getInstance()->po_log(\"PO:save BEGIN\");\n $pm = PersistentManager::getInstance();\n $pm->withTransaction();\n $pm->save($this);\n $pm->commitTransaction();\n //Logger::getInstance()->po_log(\"PO:save COMMIT\");\n }\n catch(Exception $e)\n {\n // TODO: log de $e\n Logger::getInstance()->po_log(\"PO:save ROLLBACK \". $e->getMessage() .\" <pre>\". $e->getTraceAsString() .\"</pre>\");\n \n $pm->rollbackTransaction();\n return false;\n }\n //Logger::getInstance()->off();\n\n $this->executeAfterSave();\n \n // Validacion\n return true;\n }",
"protected function finish() {}",
"public function save()\n {\n return $this->processor->save();\n }",
"public function action_save()\n {\n // clear old reject info\n $this->setRejectInfo(null);\n\n if (isset($this->m_partial) && !empty($this->m_partial)) {\n $this->partial($this->m_partial);\n\n return;\n } else {\n $this->doSave();\n }\n }",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"protected function hook_afterSave(){}",
"public function save()\n {\n // For V2.0\n }",
"public function save()\n\t{\n\t\treturn false;\n\t}",
"public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }",
"protected function _afterSave()\n {\n $this->getCategoryInstance()->saveSalesrepRelation($this);\n\t\t$this->getRegionInstance()->saveSalesrepRelation($this);\n return parent::_afterSave();\n }",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"public function save()\n {\n }",
"protected function doAfterContainerSave() {\n if (!$this->isPersistent()) $this->origNodeId = $this->container->getPrimaryKey();\n \n if (!$this->lockStore) $this->endStore(true);\n \n $this->updateFromContainer();\n }",
"protected function _afterSave()\n {\n $this->getLinkInstance()->saveProductRelations($this);\n $this->getTypeInstance(true)->save($this);\n\n /**\n * Product Options\n */\n $this->getOptionInstance()->setProduct($this)\n ->saveOptions();\n\n return parent::_afterSave();\n }",
"public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }",
"public function afterSaveCommit(): void\n {\n }",
"private function save() {\n\t\t// Nur speichern, wenn nötig, also, wenn sich was geändert hat, also\n\t\t// wenn recompute gemacht wurde\n\t\tif ($this->need_recompute) {\n\t\t\tquery(\n\t\t\t\t\"INSERT INTO computed_maps SET world_id={$this->world_id}, \".\n\t\t\t\t\t\"map_id={$this->id}, \".\n\t\t\t\t\t\"time_computed=\".Time::get_t_now().\", \".\n\t\t\t\t\t\"insert_finished=0\"\n\t\t\t);\n\t\t\t$this->last_compute_id =\n\t\t\t\tmysql_result(query(\"SELECT LAST_INSERT_ID()\"),0);\n\t\t\t$this->last_compute_time = Time::get_t_now();\n\n\t\t\t$this->computed_map_data->save($this->last_compute_id);\n\t\t\t$this->computed_buildings_data->save($this->last_compute_id);\n\t\t\t$this->computed_tribes_data->save($this->last_compute_id);\n\t\t\t$this->computed_sector_data->save($this->last_compute_id);\n\t\t\t$this->moving_tribes_data->save();\n\n\t\t\t// TODO: ROLLBACK ON FAILURE\n\n\t\t\tquery(\n\t\t\t\t'UPDATE computed_maps SET insert_finished=1 '.\n\t\t\t\t'WHERE world_id='.$this->world_id.' AND map_id='.$this->id.' '.\n\t\t\t\t\t'AND compute_id='.$this->last_compute_id\n\t\t\t);\n\t\t}\n\t}",
"public function process() {\n $canSave = $this->beforeSet();\n if ($canSave !== true) {\n return $this->failure($canSave);\n }\n\n $this->object->set('menuindex', $this->getProperty('menuindex'));\n $this->object->set('template', $this->getProperty('template'));\n\n /* Run the beforeSave method and allow stoppage */\n $canSave = $this->beforeSave();\n if ($canSave !== true) {\n return $this->failure($canSave);\n }\n\n /* run object validation */\n if (!$this->object->validate()) {\n /** @var modValidator $validator */\n $validator = $this->object->getValidator();\n if ($validator->hasMessages()) {\n foreach ($validator->getMessages() as $message) {\n $this->addFieldError($message['field'],$this->modx->lexicon($message['message']));\n }\n }\n }\n\n /* run the before save event and allow stoppage */\n $preventSave = $this->fireBeforeSaveEvent();\n if (!empty($preventSave)) {\n return $this->failure($preventSave);\n }\n\n if ($this->saveObject() == false) {\n return $this->failure($this->modx->lexicon($this->objectType.'_err_save'));\n }\n $this->afterSave();\n $this->fireAfterSaveEvent();\n $this->logManagerAction();\n return $this->cleanup();\n }",
"public function save()\n\t{\n\n\t}",
"public function save_all() {\n\t\t$this->save_api();\n\t\t$this->save_field_map();\n\t\t$this->save_import();\n\t\t$this->save_requirement_set();\n\t}",
"public function save()\r\n {\r\n \r\n }",
"public function postSave($result) { }",
"public function afterSave(){\n\t}",
"protected function afterSave($res) {\n return;\n }",
"public function save() {\n\t\t\t\n\t\t}",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"private function saveResult()\n {\n if ($this->schedule) {\n $this->schedule->fill([\n 'result_state' => 1,\n 'finished' => 1,\n 'running' => 0,\n 'result_message' => $this->successMessage,\n ]);\n $this->schedule->save();\n }\n }",
"public function save() {\n\t\treturn $this->data->save($this->collection);\n\t}",
"public abstract function save();",
"protected function afterSave()\n {\n return parent::afterSave();\n if (!$this->order) $this->order = $this->id;\n $this->save(false);\n }",
"public function onAfterSave();",
"public function afterSave()\n {\n\n }",
"public function commit() {\r\n \r\n $this->validate();\r\n \r\n $data = array(\r\n \"category_id\" => $this->Category instanceof Category ? $this->Category->id : 10,\r\n \"title\" => $this->name,\r\n \"url\" => $this->url_file,\r\n \"filename\" => $this->filename,\r\n \"mime\" => $this->mime,\r\n \"description\" => $this->desc,\r\n \"date\" => $this->Date->format(\"Y-m-d h:i:s\"),\r\n \"hits\" => $this->hits,\r\n \"user_id\" => $this->user_id,\r\n \"filepath\" => $this->filepath,\r\n \"object_id\" => filter_var($this->object_id, FILTER_VALIDATE_INT) ? $this->object_id : 0,\r\n \"approved\" => $this->approved,\r\n \"active\" => $this->active,\r\n \"extra_data\" => json_encode($this->extra_data),\r\n \"url\" => $this->approved ? str_replace(dirname(dirname(__FILE__)), RP_PROTOCOL.\"://\" . RP_HOST, $this->filepath) : \"\"\r\n );\r\n \r\n /**\r\n * Commit the changes\r\n */\r\n \r\n if (empty($this->id)) {\r\n $data['active'] = 1;\r\n $data['category_id'] = $this->cat_id;\r\n $data['filesize'] = empty($this->filesize) ? 0 : $this->filesize; \r\n \r\n $this->db->insert(\"download_items\", $data);\r\n $this->id = $this->db->lastInsertId();\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n return $this->id;\r\n }\r\n \r\n $where = array(\r\n \"id = ?\" => $this->id\r\n );\r\n \r\n $this->db->update(\"download_items\", $data, $where);\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n }",
"public function commit()\n\t{\n\t\tforeach ($this->arrayItemsDeferred as $key => $item) {\n\t\t\tif($this->save($item) === true) {\n\t\t\t\tunset($this->arrayItemsDeferred[$key]);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function save() {\r\n $conn = GFSalsaConnector::instance();\r\n if ($conn) {\r\n $conn->saveObject($this->object, $this);\r\n }\r\n }",
"protected function postSave() {\n\t\treturn true;\n\t}",
"protected function afterSave() {\n\n }",
"protected function onAfterSave()\n {\n \t$this->saveSuccessful = true;\n\t\t\n\t\tif( $this->isNewStatusUpdate ){ \n \t$this->_sendNewStatusUpdateEmailToAdministrators();\n \t$this->_sendNewStatusUpdateEmailToUser();\n\t\t}\n }",
"function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}",
"public function save()\n {\n return false;\n }",
"public function complete()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_IN_PROGRESS) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_COMPLETED;\n $this->withdrawal->save();\n }\n }",
"public function save()\n {\n $this->checkModel();\n if (!is_null($this->profile)) $this->saved = $this->profile->save();\n }",
"public function saveAtShutdown()\n {\n $func = [\n $this,\n \"save\",\n ];\n register_shutdown_function($func, true);\n }",
"protected function saveTask() {}",
"public function save()\n {\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $blPresaveOrder = (bool) $oConfig->getConfigParam('blFCPOPresaveOrder');\n if ($blPresaveOrder === false || $this->isPayOnePaymentType() === false) {\n return parent::save();\n }\n\n if ($this->oxorder__oxshopid->value === false) {\n $oShop = $oConfig->getActiveShop();\n $this->oxorder__oxshopid = new oxField($oShop->getId());\n }\n\n if (( $blSave = oxBase::save())) {\n // saving order articles\n $oOrderArticles = $this->getOrderArticles();\n if ($oOrderArticles && count($oOrderArticles) > 0) {\n foreach ($oOrderArticles as $oOrderArticle) {\n $oOrderArticle->fcpoSetFinishingSave($this->_blFinishingSave);\n $oOrderArticle->save();\n }\n }\n }\n\n return $blSave;\n }",
"public function save()\n \t{\n \t $this->getMapper()->save($this);\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();",
"protected function afterSave(){\n /*\n * Link Complete,if you wanna the status can be changed anyway,\n * no matter it was complete or not,then coment's out this line: if ($this->progressstatus == 4) {\n */\n if ($this->progressstatus == 4) {\n $cptmodel = CampaignTask::model()->findByAttributes(array('campaign_id'=>$this->campaign_id));\n if ($cptmodel) {\n $cptmodel->setIsNewRecord(false);\n $cptmodel->setScenario('update');\n $pcount = Task::model()->countByAttributes(array('campaign_id'=>$this->campaign_id, 'progressstatus'=>4));\n $cptmodel->published_count = $pcount;\n if ($cptmodel->total_count > 0) {\n $cptmodel->percentage_done = round($cptmodel->published_count / $cptmodel->total_count, 3);\n }\n $cptmodel->save();\n }\n }\n\n return parent::afterSave();\n }",
"public function afterSave()\n {\n $this->unlinkOnSave();\n }",
"public final function save() {\n\t\t\treturn SERIA_Meta::save($this);\n\t\t}",
"public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"public function save()\n\t{\n\n\t\treturn parent::save();\n\t}",
"public function save() {\n return $this->entity->save();\n }",
"protected function save(): bool\n\t{\n\t\t$res = JobTable::update(\n\t\t\t$this->id,\n\t\t\t[\n\t\t\t\t'STATUS' => $this->status,\n\t\t\t\t'STATUS_MESSAGE' => $this->statusMessage,\n\t\t\t\t'STATE' => $this->state,\n\t\t\t\t'STEP' => $this->step,\n\t\t\t]\n\t\t);\n\n\t\treturn $res->isSuccess();\n\t}"
] | [
"0.79957986",
"0.69992757",
"0.6968752",
"0.6951618",
"0.690518",
"0.6836143",
"0.6771868",
"0.6771868",
"0.6759366",
"0.6671879",
"0.6656088",
"0.6648237",
"0.664154",
"0.6626604",
"0.66047215",
"0.65999305",
"0.6586653",
"0.6572289",
"0.6554298",
"0.6505385",
"0.6501422",
"0.6495807",
"0.6485188",
"0.64303195",
"0.64164233",
"0.64159036",
"0.6402485",
"0.6391605",
"0.6391605",
"0.63897324",
"0.63725",
"0.63701844",
"0.63435596",
"0.6335249",
"0.632709",
"0.6313929",
"0.63113075",
"0.63074195",
"0.6302537",
"0.62947863",
"0.6248358",
"0.6240606",
"0.6240332",
"0.6234157",
"0.6219347",
"0.6214603",
"0.6202418",
"0.62016743",
"0.6192613",
"0.6185014",
"0.61792374",
"0.61792374",
"0.61792374",
"0.61792374",
"0.61792374",
"0.6167968",
"0.6166906",
"0.6164642",
"0.61542153",
"0.6136962",
"0.61330634",
"0.61325246",
"0.6130268",
"0.6127649",
"0.61258894",
"0.61205894",
"0.6119055",
"0.61178637",
"0.6107876",
"0.60990745",
"0.60936576",
"0.6093039",
"0.60824305",
"0.6081",
"0.6075132",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6071568",
"0.6068792",
"0.606745",
"0.60645825",
"0.606445",
"0.60642445",
"0.60521376",
"0.60451365"
] | 0.62870497 | 40 |
Perform a model update operation. | protected function performUpdate(Builder $query, array $options = [])
{
$dirty = $this->getDirty();
if (count($dirty) > 0) {
// If the updating event returns false, we will cancel the update operation so
// developers can hook Validation systems into their models and cancel this
// operation if the model does not pass validation. Otherwise, we update.
if ($this->fireModelEvent('updating') === false) {
return false;
}
$dirty = $this->getDirty();
if (count($dirty) > 0) {
$numRows = $query->update($dirty);
$this->fireModelEvent('updated', false);
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update(){\n\t\t$this->model->update();\n\t}",
"public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}",
"abstract protected function updateModel();",
"public function update($model) :bool;",
"public function updating($model)\n\t{\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(Model $model, array $attributes);",
"public function update($id, Model $model);",
"public function updated($model)\n {\n }",
"protected function performUpdate()\n {\n // Once we have run the update operation, we will fire the \"updated\" event for\n // this model instance. This will allow developers to hook into these after\n // models are updated, giving them a chance to do any special processing.\n $dirty = $this->getDirty();\n\n if (count($dirty) > 0) {\n $updatedField = $this->getApi()->{'update'.ucfirst($this->getEntity())}($this->{$this->primaryKey}, $dirty);\n $this->fill($updatedField);\n $this->syncChanges();\n }\n\n return true;\n }",
"public function update(Request $request, object $model): bool;",
"public function actionUpdate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n /*\r\n * Receive all the PUT parameters\r\n */\r\n parse_str(file_get_contents('php://input'), $put_params);\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>update</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model))\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n \r\n /*\r\n * assign PUT parameters to attributes\r\n */ \r\n foreach($put_params as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n *save the model\r\n */\r\n if($model->save()) {\r\n $this->_sendResponse(200, sprintf('The model <b>%s</b> with id <b>%s</b> has been updated.', $_GET['model'], $_GET['id']) );\r\n } else {\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't update model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n }",
"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 }",
"public function actionUpdate() {\n $json = file_get_contents('php://input'); //$GLOBALS['HTTP_RAW_POST_DATA'] is not preferred: http://www.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data\n $put_vars = CJSON::decode($json, true); //true means use associative array\n switch ($_GET['model']) {\n // Find respective model\n case 'Order':\n $model = Order::model()->findByPk($_GET['id']);\n break;\n case 'Users':\n $model = Users::model()->findByPk($_GET['id']);\n break;\n case 'Product':\n $model = Product::model()->findByPk($_GET['id']);\n break;\n case 'Vendor':\n $model = Vendor::model()->findByPk($_GET['id']);\n break;\n case 'FavoriteProduct':\n $model = FavoriteProduct::model()->findByPk($_GET['id']);\n break;\n case 'Rating':\n $model = Rating::model()->findByPk($_GET['id']);\n break;\n case 'Review':\n $model = Review::model()->findByPk($_GET['id']);\n break;\n case 'UserAddress':\n $model = UserAddress::model()->findByPk($_GET['id']);\n break;\n case 'OrderDetail':\n $model = OrderDetail::model()->findByPk($_GET['id']);\n break;\n default:\n $this->_sendResponse(0, sprintf('Error: Mode update is not implemented for model ', $_GET['model']));\n Yii::app()->end();\n }\n // Did we find the requested model? If not, raise an error\n if ($model === null)\n $this->_sendResponse(0, sprintf(\"Error: Didn't find any model with ID .\", $_GET['model'], $_GET['id']));\n\n // Try to assign PUT parameters to attributes\n unset($_POST['id']);\n foreach ($_POST as $var => $value) {\n // Does model have this attribute? If not, raise an error\n if ($model->hasAttribute($var))\n $model->$var = $value;\n else {\n $this->_sendResponse(0, sprintf('Parameter %s is not allowed for model ', $var, $_GET['model']));\n }\n }\n // Try to save the model\n if ($model->update())\n $this->_sendResponse(1, '', $model);\n else\n $this->_sendResponse(0, $msg);\n // prepare the error $msg\n // see actionCreate\n // ...\n }",
"public function update(User $model);",
"public function actionUpdate() {}",
"public function actionUpdate() {}",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }",
"public function update()\n {\n return $this->save();\n }",
"public abstract function update($object);",
"public function testUpdate(): void { }",
"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 updateModel(Model &$model)\n {\n }",
"public function update($entity);",
"public function update($entity);",
"public function processUpdate()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter updateModifyValidationRules\n $validationRules = $this->doFilter(\"updateModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter updateModifyValidationMessages\n $validationMessages = $this->doFilter(\"updateModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set initial configuration\n $Model->build($this->Model->getTable());\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter updateModifyRequest\n $this->Model = clone $Model;\n $parameters = $this->doFilter(\"updateModifyRequest\", $requestParameters);\n // Update record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($Model, $parameters) {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n });\n } else {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.update.success'));\n // Hook Filter updateModifyResponse\n $Response = $this->doFilter(\"updateModifyResponse\", $Response);\n $this->redirect($Response);\n }",
"public function actionUpdate($id) {\n\n $put_var = array();\n parse_str(file_get_contents('php://input'), $put_var);\n\n foreach ($put_var as $data) {\n $json = CJSON::decode($data, true);\n }\n\n $model = $this->loadModel($id);\n\n foreach ($json as $var => $value) {\n // Does model have this attribute? If not, raise an error\n if ($model->hasAttribute($var)) {\n $model->$var = $value;\n }\n }\n\n if ($model->save()){\n echo json_encode(array(\n \"success\" => true,\n \"data\" => array(\n \"id\" => $model->id,\n )\n ));\n }\n\t}",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function update(array $data, Model $model)\n {\n return $model->update($data);\n }",
"public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }",
"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}",
"function update($field, $value, $model)\n {\n }",
"public function updatedModel(Model &$model)\n {\n }",
"public function update() {\r\n\t\t$this->getMapper()->update($this);\r\n\t}",
"public function update( One_Model $model )\n\t{\n\t\treturn null;\n\t}",
"function update($unique_id, $model)\n {\n }",
"public function update(Model $model, array $data = [])\n {\n $this->setModelData($model, $data);\n\n return $this->save($model);\n }",
"public function update($record);",
"public function update(){\n\n\t\t/* set method */\n\t\t$this->request_method = 'update';\n\t\t\t\t\n\t\t/* check for a model id */\n\t\tif( ! $this->id) {\n\t\t\t$this->set_error( 10, 'No model id in request, cant update' );\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t/* read the data received from backbone */\n\t\t$this->parse_model_request();\n\n\t\tif($this->get_errors())\n\t\t\treturn;\n\t\t\t\t\t\n\t\t/* get the parsed post data from request */\n\t\t$item_data = $this->parsed_model_request;\n\t\t \t\t\t \t\n\t\t/* insert database */\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\n\t\t\t/* posts */\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t\t$post = $item_data['post'];\n\t\t\t\t\n\t\t\t\t/* privileg check */ //improve this for coded api calls, like when setting up bootstrap data (for reading it is no problem any way, because this check is only made for update and create and delete)\n\t\t\t\tif( $this->properties->access == \"loggedin\" && ! current_user_can('edit_post', $this->id)) { \n\t\t\t\t\t$this->set_error( 11, 'no user privileges to update the item on server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$result = wp_update_post( $post );\n\t\t\t\t\n\t\t\t\t/* maybe an error while updating */\n\t\t\t\tif( ! $result) {\n\t\t\t\t\t$this->set_error( 12, 'updating the item failed on the server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* geting the id means update was a success */\n\t\t\t\t$updated_id = $result;\n\t\t\t\t\n\t\t\t\t/* save custom data, this only method does all the magic, \n\t\t\t\tdetails must be specified in the custom package handlers */\n\t\t\t\t$this->_action_custom_package_data( $updated_id, $item_data);\t\n\t\t\t\t\n\t\t\t\t/* set a clean response */\n\t\t\t\t$this->parse_model_response($updated_id);\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t/* comment */\n\t\t\tcase('comment'):\n\t\t\t\t$comment = $item_data['comment'];\n\t\t\t\t\n\t\t\t\t/* comment updateding is not supported */\n\t\t\t\t$this->set_error( 13, 'comments cant be updated!' );\n\t\t\t\t\treturn; \n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t//@TODO\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$new_id = $this->id;\n\t\t\t\t$this->_action_custom_package_data( $new_id, $item_data);\t\t\t\t\t\n\t\t\t\t$this->parse_model_response($new_id);\t\t\n\t\t\tbreak;\n\t\t}\n do_action('bb-wp-api_after_update', $updated_id, $this->properties, $this );\n\t\n\t}",
"public function update(Entity $entity);",
"public function update($model, array $data)\n {\n return $this->persist($data, $model);\n }",
"public function update();",
"public function update();",
"public function update();",
"public function update();",
"public function actionUpdate() {\n Yii::import('bootstrap.widgets.TbEditableSaver'); //or you can add import 'ext.editable.*' to config\n $es = new TbEditableSaver('Donneur'); // 'User' is classname of model to be updated\n $es->update();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n /*if (isset($_POST['pk'])) {\n $model = $this->loadModel($_POST['pk']);\n $model->first_name = $_POST['first_name'];\n $model->save();\n // $this->redirect(array('view', 'id' => $model->id));\n }\n\n /* $this->render('update', array(\n 'model' => $model,\n ));*/\n }",
"public function update( array $params );",
"public function update()\n {\n # code...\n }",
"public function update() {\n $this->post->update($this->post_params());\n\n if ($this->post->is_valid()) {\n $flash = ['notice' => 'Saved Successfully'];\n } else {\n $flash = ['error' => $this->post->errors_as_string()];\n }\n\n redirect('/backend/posts/edit', $flash, ['id' => $this->post->id]);\n }",
"public function update($id, $input)\n {\n $this->model = $this->getRowByPK($id);\n return $this->save($this->model, $input);\n }",
"public function actionUpdate()\n {\n $model = $this->loadModel();\n\n if (isset($_POST['User']))\n {\n $model->attributes = $_POST['User'];\n\n if ($model->save())\n {\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Данные обновлены!'));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function testUpdateModelSet()\n {\n }",
"protected function performUpdate() {}",
"public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }",
"public function Do_update_Example1(){\n\n\t}",
"public function actionUpdate($id)\n\t\t{\n\t\t\t\t$model = $this->findModel($id);\n\n\t\t\t\t$model->scenario = 'safeEdit';\n\n\t\t\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t\t\t\t$this->calculateFormula($model);\n\n\t\t\t\t\t\tYii::$app->session->setFlash('success', 'The record was updated.');\n\n\t\t\t\t\t\treturn $this->redirect(['view', 'id' => $model->order_id]);\n\t\t\t\t} else {\n\t\t\t\t\t\treturn $this->render('update', [\n\t\t\t\t\t\t\t\t'model' => $model,\n\t\t\t\t\t\t\t\t'subData' => $this->subData\n\t\t\t\t\t\t]);\n\t\t\t\t}\n\t\t}",
"public function update()\n {\n if (Entry::canCreateOrEdit() === false) {\n return Redirect::route('entry.index')\n ->withMessage(\"Sorry, the competition has now started and entries cannot be changed.\");\n }\n\n $input = Input::all();\n\n $validator = Validator::make($input, Entry::$prediction_rules, Entry::$prediction_rules_messages);\n\n if ($validator->fails()) {\n return Redirect::route('entry.edit')\n ->withInput()\n ->withErrors($validator);\n }\n \n $entry = $this->getEntry();\n\n if ($entry) {\n\n $entry->update($input);\n $entry->save();\n\n foreach($entry->matchPredictions as $match_prediction) {\n $field = \"match_prediction_$match_prediction->id\";\n if (Input::has($field)) {\n $match_prediction->result = Input::get($field);\n $match_prediction->save();\n }\n }\n }\n\n return Redirect::route('entry.index');\n }",
"public function update()\n {\n //\n }",
"public function update()\n {\n //\n }",
"public function update()\r\n {\r\n //\r\n }",
"public function update($data,$model=false){\n\n if(is_array($data)){\n $data=(array_key_exists(0,$data)) ? $data[0] : $data;\n return $this->allMethodProcess(function() use($data,$model){\n return $this->querySqlFormatter->getUpdateQueryFormatter($data,['where'=>$this->where,'execute'=>$this->execute,\n 'model'=>$this->subClassOf,'bool'=>$this->bool,'detail'=>$model]);\n },\"no--autoscope\");\n\n }\n\n }",
"public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"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(int $id, array $attributes): Model;",
"public function update()\n {\n }",
"public function update()\n\t{\n\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n return $this->modify($model);\n }",
"public function Update($data) {\n\n }",
"public function update(Identifiable $model, array $newAttributes);",
"public function update()\n\t{\n\t\t$this->user->db_update();\n\t}",
"public function update() {\r\n }",
"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 abstract function update();",
"public function update($id, $input);",
"public function update(OrmModelInterface $model): bool\n {\n }",
"public function update(Model $model, Request $request): ?Model;",
"public function update($attributes)\n {\n return $this->model->update($attributes);\n }",
"public function update() {\r\n\r\n\t}",
"public function update()\n {\n\n }",
"public function update()\n {\n\n }",
"public function update(IModel $target, array $values, $primary);",
"public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}",
"public function db_update() {}",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update($id);",
"public function update($id);",
"public function update()\r\n {\r\n \r\n }"
] | [
"0.7764393",
"0.76994836",
"0.7650558",
"0.7601129",
"0.7513205",
"0.75078285",
"0.7452994",
"0.74213344",
"0.7367324",
"0.72897035",
"0.72132003",
"0.71370524",
"0.7030996",
"0.70020926",
"0.6963688",
"0.6922468",
"0.6922468",
"0.69050246",
"0.6845271",
"0.6845271",
"0.67659056",
"0.6758224",
"0.675358",
"0.6722192",
"0.67073274",
"0.6695104",
"0.66835284",
"0.66835284",
"0.6671071",
"0.665912",
"0.665596",
"0.6648629",
"0.66365725",
"0.6636275",
"0.66358846",
"0.66353124",
"0.66348374",
"0.66125536",
"0.66119784",
"0.66064066",
"0.6597219",
"0.65940136",
"0.65748143",
"0.65737903",
"0.6568064",
"0.6568064",
"0.6568064",
"0.6568064",
"0.6559682",
"0.6559498",
"0.65514135",
"0.6547936",
"0.6541805",
"0.653863",
"0.653579",
"0.6531992",
"0.65287286",
"0.6527321",
"0.65264183",
"0.65011114",
"0.6495666",
"0.6495666",
"0.6488185",
"0.6476652",
"0.6476556",
"0.64706135",
"0.64642847",
"0.6453651",
"0.6434632",
"0.6433603",
"0.64311606",
"0.6419989",
"0.64179915",
"0.64098644",
"0.6406534",
"0.64065135",
"0.6405941",
"0.64032537",
"0.63978535",
"0.63964105",
"0.63894737",
"0.6388324",
"0.6388324",
"0.6386341",
"0.63831145",
"0.6382937",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.63790554",
"0.6376666",
"0.6376666",
"0.6374827"
] | 0.0 | -1 |
Perform a model insert operation. | protected function performInsert(Builder $query, array $options = [])
{
if ($this->fireModelEvent('creating') === false) {
return false;
}
// Ensure the settings attribute is passed through so this distinction
// is recognised, mainly by the processor.
$attributes = $this->attributesToArray();
$query->insert($attributes);
// We will go ahead and set the exists property to true, so that it is set when
// the created event is fired, just in case the developer tries to update it
// during the event. This will allow them to do so and run an update here.
$this->exists = true;
$this->fireModelEvent('created', false);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\n\t}",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"protected function saveInsert()\n {\n }",
"public function insert() {\n \n }",
"public function insert()\n {\n $this->id = insert($this);\n }",
"public function insert()\n {\n # code...\n }",
"public function insert( One_Model $model )\n\t{\n\t\treturn null;\n\t}",
"public function insert()\n {\n }",
"public function insert()\n {\n }",
"public function insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \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 static function insert()\n {\n }",
"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 insert(){\n\n }",
"public function insert(DataObject $entity){\n }",
"public function insert_() {\n\n\n\t\t\t$podcast = Model\\Podcast::get_instance();\n\n\t\t}",
"public function insert(IModel $target, array $values);",
"public function insert(stubObject $entity);",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"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 abstract function insert();",
"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\t{\n\t}",
"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 function insert($model){\n\t\t$campos = $this->camposInsert;\n\t\t// cria um comando INSERT com os as colunas definidas em $camposInsert\n\t\t$sql = $this->geraSQL('insert', $campos);\n\t\ttry {\n\t\t\t// cria uma instancia do banco e prepara um comando\n\t\t\t$pdo = Connection::getInstance()->prepare($sql);\n\n\t\t\t$vals = null;\n\t\t\t// define os valores de cada coluna\n\t\t\tforeach($campos as $valor)\n\t\t\t\t$vals[\":$valor\"] = $model->{'get'.ucfirst($valor)}();\n\t\t\t// executa o comando\n\t\t\t$pdo->execute($vals);\n\n\t\t\t// se houver erros retorne o texto do erro, caso contrário retorne o id que foi inserido\n\t\t\tif($pdo->errorInfo()[2] != false){\n\t\t\t\t// return $pdo->errorInfo()[2];\n\t\t\t\treturn -1;\n\t\t\t}else {\n\t\t\t\treturn Connection::getInstance()->lastInsertId();\n\t\t\t}\n\t\t}catch (PDOException $ex){\n\t\t\tprint $ex->getMessage();\n\t\t}\n\t}",
"public abstract function Insert();",
"public function Do_insert_Example1(){\n\n\t}",
"public function insert(DataObject $insertObject, Database_Config $databaseConfig = NULL);",
"public function insert($data);",
"public function insert($runValidation = true, $attributes = null)\n {\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}",
"abstract public function insert();",
"public function _insert()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\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 }",
"public static function Insert(){\r\n }",
"public function insert() {\n\t\t$this->insert_user();\n\t}",
"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}",
"function insert(){\r\n $this->model->randomInsert();\r\n $this->index();\r\n }",
"public function insert($model) {\n\t\t$fields = implode('`, `', array_keys($model));\n\t\t$values = array_values($model);\n\t\t$query = \"INSERT INTO {$this->table_name} (`{$fields}`) VALUES (?)\";\n\n\t\t$result = $this->db->executeQuery($query, array($values), array(Connection::PARAM_INT_ARRAY));\n\t\treturn $result;\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()\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_entry()\r\n\t{\r\n\t\t$this->db->insert(\"email_workflow\", $this);\r\n\t}",
"public static function INSERT()\n {\n return new Streamwide_PHPUnit_Extensions_Database_Operation_Insert();\n }",
"public function insertProduct(Product $product);",
"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 save(){\n if($this->id == 0) {\n // Object is new and needs to be created\n return $this->insert();\n }\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 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 $products = [];\n \n // Add products to array\n $products[] = ['name' => 'Ball', 'price' => 2];\n $products[] = ['name' => 'Glove', 'price' => 20];\n \n // Insert products one by one\n foreach ($products as $product) {\n $result = $this->db->insert('products', $product);\n if ($result) {\n echo 'Inserted product: ' . $product['name'];\n } else {\n echo 'Problem inserting product: ' . $product['name'];\n }\n }\n }",
"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($entity){\n\t\ttry {\n\t\t\t$data = $entity->toArray();\n\t\t\t$this->callBehavior('beforeInsert',$data);\n\t\t\t$this->convertId($data);\n\t\t\t$result = $this->collection->insertOne($data);\n\t\t\t$data['_id'] = $result->getInsertedId();\n\t\t\t//$this->doIntegrateIn($data);\n\t\t\t$this->callBehavior('afterInsert',$data);\n\t\t} catch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"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() {\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($attributes);",
"public function insert($runValidation = true, $attributes = null)\r\n {\r\n if ($runValidation && !$this->validate($attributes)) {\r\n Yii::info('Model not inserted due to validation error.', __METHOD__);\r\n return false;\r\n }\r\n\r\n if (!$this->beforeSave(true)) {\r\n return false;\r\n }\r\n\r\n try {\r\n $values = $this->getDirtyAttributes();\r\n $connection = static::getDb();\r\n $request = $connection->newAddCommand(static::layoutName(), $values);\r\n\r\n foreach ($this->_globals as $fieldName => $fieldValue) {\r\n $request->setGlobal($fieldName, $fieldValue);\r\n }\r\n $result = $request->execute();\r\n $this->_recid = $result->getFirstRecord()->getRecordId();\r\n self::populateRecordFromFm($this, $result->getFirstRecord());\r\n\r\n $this->afterSave(true, $values);\r\n return true;\r\n } catch (\\Exception $e) {\r\n throw $e;\r\n }\r\n }",
"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}",
"public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }",
"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 store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"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($article);",
"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 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($post);",
"function insert()\n\t{\n\t\t$this->edit(true);\n\t}",
"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 $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono]);\n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n // $this->index();\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 insert($data)\r\n {\r\n \r\n }",
"public function insert(array $params);",
"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 inserir()\n {\n }",
"public function insert(array $raw): OrmModelInterface\n {\n }",
"public function run()\n {\n \t\tDB::table('models')->insert($models);\n }",
"public function insert($input) {\n\t\t//$input = data yang dikirim dari controller\n\t\treturn $this->db->insert('anggota', $input);\n\t}",
"public function _insert($data)\n {\n $this->insert($data);\n }",
"public function insert(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('uri_drone_insert')){\n $this->_app->notFound();\n }\n // do something here\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 insertTest()\n {\n $this->assertEquals(true, $this->object->insert('Ali','Khan',22,'A'));\n }",
"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 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(){\n $sql = \"INSERT INTO author(\n name,\n job,\n created_at\n )\n VALUES(\n 'tgedf', 'sdvsdv', NOW())\";\n return $this->pdo->exec($sql);\n\n }",
"public function insert( $objet);",
"function insert(){\n //Declarar variables para recibir los datos del formuario nuevo\n $nombre=$_POST['nombre'];\n $apellido=$_POST['apellido'];\n $telefono=$_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n $this->index();\n }",
"public function run()\n {\n $data = [\n [\n 'description' => 'Pop',\n 'value' => 5.00,\n 'merchant' => 1\n ],\n [\n 'description' => 'Burguer',\n 'value' => 25.00,\n 'merchant' => 2\n ]\n ];\n\n $this->table('products')\n ->insert($data)\n ->save();\n }",
"function insert($data)\n {\n $this->db->insert($this->table, $data);\n }",
"public static function insert($values) {\n\t\tif (!self::validateInsert($values)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//Check for collection\n\t\tif ($values['model'] == self::MODEL_COLLECTION) {\n\t\t\t$values['collection_id'] = $values['foreign_id'];\n\t\t}\n\n\t\t//Add to database\n\t\treturn parent::insertData(new self(), $values);\n\t}",
"public function insert() {\n return $this->getActionByName('Insert');\n }",
"function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}",
"public function insert() {\n\t\tif ( !$this->content || !$this->resource ) {\n\t\t\tthrow new UnexpectedValueException( \"Provide at least a comment, rating or tag and a resource.\" );\n\t\t}\n\t\tif ( empty( $this->smoValues[\"simple\"][\"dtreviewed\"] ) ) {\n\t\t\t$this->setParameter( \"dtreviewed\", date('c') );\n\t\t}\n\n\t\t$this->action = \"insert\";\n\t\t$this->createSmoRequest();\n\t\t$xmlVar = new SoapVar( \"<ns1:insertSMO>\".$this->smo.\"</ns1:insertSMO>\", XSD_ANYXML );\n\t\t$this->insertSMO( $xmlVar );\n\t\t$this->processResponse( $this->__getLastResponse() );\n\t}",
"function insert_model($data)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"INSERT INTO \". GARAGE_MODELS_TABLE .\" (make_id, model)\n\t\t\tVALUES ('\".$data['make_id'].\"', '\".$data['model'].\"')\";\n\n\t\tif(!$result = $db->sql_query($sql))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Insert New Make', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}",
"public function testSave_Insert()\n\t{\n\t\t$this->object->Save();\n\n\t\t$someObject = new object();\n\t\t$objectList = $someObject->GetList(array(array(\"objectId\", \">\", 0)));\n\t\t$this->assertEquals(1, sizeof($objectList));\n\t}",
"public function processInsert()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter insertModifyValidationRules\n $validationRules = $this->doFilter(\"insertModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter insertModifyValidationMessages\n $validationMessages = $this->doFilter(\"insertModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n if ($this->Request->ajax()) {\n // Send Response\n $JsonResponse = new JsonResponse($validator->errors(), 400);\n $JsonResponse->send();\n exit;\n } else {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set value for BLOB columns\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter insertModifyRequest\n $requestParameters = $this->doFilter(\"insertModifyRequest\", $requestParameters);\n // Insert record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($requestParameters) {\n $this->Model->dkCreate($requestParameters);\n // Hook Action insertAfterInsert\n $this->doHooks(\"insertAfterInsert\", array($this->Model));\n });\n } else {\n $this->Model->dkCreate($requestParameters);\n // Hook Action insertAfterInsert\n $this->doHooks(\"insertAfterInsert\", array($this->Model));\n }\n if ($this->Request->ajax()) {\n // Send Response\n $JsonResponse = new JsonResponse(trans('dkscaffolding.notification.insert.success'), 200);\n $JsonResponse = $this->doFilter(\"insertModifyResponse\", $JsonResponse);\n $JsonResponse->send();\n exit;\n } else {\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.insert.success'));\n // Hook Filter insertModifyResponse\n $Response = $this->doFilter(\"insertModifyResponse\", $Response);\n $this->redirect($Response);\n }\n }",
"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 }",
"protected function _insert()\n {\r\n $this->date_created = new Zend_Db_Expr(\"NOW()\");\r\n return parent::_insert();\n }",
"protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }",
"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 testInsertModelMethod()\r\n\t{\r\n\t\t$mongo = new \\MongoClient();\r\n\t\t$db = $mongo->test;\r\n\t\t$db->node->remove();\r\n\t\t\r\n\t\t\r\n\t\t$mongoDbAdapter = new MongoDbAdapter();\r\n\t\t$mongoDbAdapter->setUp(['db' => 'test']);\r\n\t\t\r\n\t\t$array = [\t\r\n\t\t\t\t'children' => null,\r\n\t\t\t\t'parents' => null,\r\n\t\t\t\t'type' => 'Model.TextModel', \r\n\t\t\t\t'_id' => new \\MongoId(),\r\n\t\t\t\t'tags' => [['name' => 'haus'],['name' => 'balkon']],\r\n\t\t\t\t'content' => 'text text text'];\r\n\t\t$textModel = new \\Model\\TextModel($array);\r\n\t\t\r\n\t\t$mongoDbAdapter->insertModel($textModel->toArray());\r\n\t\t\r\n\t\t$cursor = $db->node->find(['_id' => $array['_id']]);\r\n\t\t$dbArr =[];\r\n\t\tforeach($cursor as $ele)\r\n\t\t{\r\n\t\t\t$dbArr[] = $ele;\t\r\n\t\t}\r\n\t\t$textModel2 = new \\Model\\TextModel($dbArr[0]);\r\n\t\t$this->assertEquals($textModel2,$textModel);\r\n\t\t$this->assertEquals($textModel2->toArray(),$textModel->toArray());\r\n\t\t\r\n\t}",
"protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }"
] | [
"0.7666964",
"0.75712323",
"0.72754806",
"0.7135534",
"0.70756435",
"0.7072083",
"0.70537406",
"0.70509773",
"0.70509773",
"0.70383924",
"0.69955003",
"0.69955003",
"0.6954634",
"0.6888122",
"0.68806684",
"0.68710756",
"0.6864208",
"0.68539006",
"0.6850599",
"0.6836991",
"0.68347466",
"0.68266255",
"0.68049866",
"0.68006647",
"0.6797842",
"0.6754881",
"0.67503804",
"0.6716159",
"0.6715241",
"0.67109364",
"0.6694928",
"0.6690694",
"0.66480905",
"0.6643477",
"0.6637651",
"0.66292477",
"0.66276103",
"0.6622682",
"0.6615496",
"0.65925413",
"0.65454507",
"0.653103",
"0.6522045",
"0.6514914",
"0.6514351",
"0.6500235",
"0.6490803",
"0.6484333",
"0.64758575",
"0.64544755",
"0.6435258",
"0.64225227",
"0.6417219",
"0.6407035",
"0.6393094",
"0.6391162",
"0.6362138",
"0.6354607",
"0.6345295",
"0.63432115",
"0.6338269",
"0.63346195",
"0.63319415",
"0.63295805",
"0.63287026",
"0.6320782",
"0.63096017",
"0.6286361",
"0.6273258",
"0.62721574",
"0.6266041",
"0.62535375",
"0.62513256",
"0.6245663",
"0.62449336",
"0.6234369",
"0.62312824",
"0.62260497",
"0.6222408",
"0.62093514",
"0.62090385",
"0.61999804",
"0.61983764",
"0.6197014",
"0.61936826",
"0.61934346",
"0.6188552",
"0.61878324",
"0.6186221",
"0.6185461",
"0.61798",
"0.61793524",
"0.61793125",
"0.617441",
"0.61716396",
"0.616457",
"0.6154769",
"0.6150965",
"0.61466634",
"0.6135076",
"0.6130672"
] | 0.0 | -1 |
Fire the given event for the model. | protected function fireModelEvent($event, $halt = true)
{
if (!isset(static::$dispatcher)) {
return true;
}
// We will append the names of the class to the event to distinguish it from
// other model events that are fired, allowing us to listen on each model
// event set individually instead of catching event for all the models.
$event = "halcyon.{$event}: ".get_class($this);
$method = $halt ? 'until' : 'fire';
return static::$dispatcher->$method($event, $this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function fireModelEvent(Event $event)\n {\n static::getEventDispatcher()->fire($event);\n }",
"protected function fire_event($event) {\n\t\t$events = array(\"eloquent.{$event}\", \"eloquent.{$event}: \".get_class($this));\n\n\t\tEvent::fire($events, array($this));\n\t}",
"public function fireEvent($eventName) {}",
"protected function fireFormEvent($event, Model $model)\n {\n return Event::until('form.'.$event, [$model]);\n }",
"public function triggerEvent($eventId);",
"public function triggerEvent(TFW_Event $event){\n if(method_exists($this, $event->getAction()))\n call_user_func_array(array($this, $event->getAction()), $event->getArgs());\n }",
"public function triggerEvent($event, array $arguments = null);",
"public function invokeEvent(Event $event);",
"private function fireEvent($event)\n {\n foreach ($this->eventHandlers as $handler) {\n if ($handler['event'] === $event) {\n call_user_func($handler['handler']);\n }\n }\n }",
"abstract public function fire();",
"public function fire()\n {\n parent::fire();\n }",
"public function fire()\n {\n parent::fire();\n }",
"public function fireFieldTypeEvents($trigger);",
"public function dispatchEvent($event);",
"function trigger($event, $data=null) {\n return Event::trigger($event, $data);\n }",
"public function fire($event, $context = null);",
"public function getModelEvents();",
"abstract public function apply(Event $event) : Model;",
"public function trigger($data);",
"protected function fireEvent($event, $payload = null)\n {\n return event(\n new CakeEvent(\n 'model.' . static::class . '.' . $event,\n null,\n ['model' => $this, 'payload' => $payload]\n )\n );\n }",
"public function _do($EventName, IEvent $Event);",
"public function fire() {}",
"function fire($event)\n {\n if (! is_string($event)) {\n throw new InvalidArgumentException('Event name must be in a string.');\n }\n call_user_func_array([foil('events'), 'fire'], func_get_args());\n }",
"public function fireEvent($event)\n\t{\n\t\t$event = $this->getQualifiedEvent($event);\n\n\t\treturn $this->app['events']->fire($event, array($this));\n\t}",
"public static function FireEvent($farmid, Event $event)\r\n\t\t{\r\n\t\t\tif (!self::$observersSetuped)\r\n\t\t\t\tself::setupObservers();\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t$event->SetFarmID($farmid);\r\n\t\t\t\t\r\n\t\t\t\t// Notify class observers\r\n\t\t\t\tforeach (self::$EventObservers as $observer)\r\n\t\t\t\t{\r\n\t\t\t\t\t$observer->SetFarmID($farmid);\t\t\t\t\t\r\n\t\t\t\t\tLogger::getLogger(__CLASS__)->info(sprintf(\"Event %s. Observer: %s\", \"On{$event->GetName()}\", get_class($observer)));\r\n\t\t\t\t\tcall_user_func(array($observer, \"On{$event->GetName()}\"), $event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(Exception $e)\r\n\t\t\t{\r\n\t\t\t\tLogger::getLogger(__CLASS__)->fatal(\r\n\t\t\t\t\tsprintf(\"Exception thrown in Scalr::FireEvent(%s:%s, %s:%s): %s\",\r\n\t\t\t\t\t\t@get_class($observer),\r\n\t\t\t\t\t\t$event->GetName(),\r\n\t\t\t\t\t\t$e->getFile(),\r\n\t\t\t\t\t\t$e->getLine(),\r\n\t\t\t\t\t\t$e->getMessage()\t\r\n\t\t\t\t\t));\r\n\t\t\t\tthrow new Exception($e->getMessage());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// invoke StoreEvent method\r\n\t\t\t$reflect = new ReflectionMethod(\"Scalr\", \"StoreEvent\");\r\n\t\t\t$reflect->invoke(null, $farmid, $event);\r\n\t\t}",
"protected function event($event)\n {\n if(isset($this->events)) {\n $this->events->dispatch($event);\n }\n }",
"public function fireEvent($event)\n\t{\n\t\t// Fire the event\n\t\t$event = $this->getQualifiedEvent($event);\n\t\t$result = $this->app['events']->fire($event, array($this), true);\n\n\t\t// If the event returned a strict false, halt the task\n\t\tif ($result === false) {\n\t\t\t$this->halt();\n\t\t}\n\n\t\treturn $result !== false;\n\t}",
"protected function fireAttributeEvents()\n {\n foreach($this->getAttributeEvents() as $attributeValue => $classOrMethod) {\n [$attribute, $v] = explode(':', $attributeValue);\n\n // Skip if the attribute does not exist or if it has not been changed\n if(!array_key_exists($attribute, $this->attributes)) continue;\n if(!$this->isDirty($attribute)) continue;\n\n // Get the value of the attribute\n $value = $this->getAttributeValue($attribute);\n\n // Decide if we are to fire the event based on if the value matches the specified attribute event\n if($v === '*' // Any - always call no matter what the value is\n || $v === 'true' && $value === true // bool(true)\n || $v === 'false' && $value === false // bool(false)\n || is_numeric($v) && strpos($v, '.') !== false && $value === (float) $v // float\n || is_numeric($v) && $value === (int) $v // int\n || $v === $value\n ) {\n $this->fireModelEvent($attribute, false);\n }\n }\n }",
"public function triggerEvent(Webhook $webhook, $event);",
"public function raise($event){\r\n\r\n $parameters = [];\r\n\r\n // called like this: raise('event', param, param1, param2, ...)\r\n if(func_num_args() > 1){\r\n $event = func_get_arg(0);\r\n\r\n $tmpParameters = func_get_args();\r\n $parameters = array_splice($tmpParameters, 1);\r\n }\r\n\r\n if(isset($this->events[$event])){\r\n\r\n $listeners = $this->events[$event];\r\n\r\n foreach ($listeners as $listener){\r\n\r\n if($listener['static']){\r\n\r\n Components::callStaticMethod($listener['component'], $listener['method'], $parameters);\r\n\r\n }else{\r\n\r\n self::callNonStaticListener($listener, $parameters);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }",
"public function handle()\n {\n $this->fire();\n }",
"public function handle()\n {\n $this->fire();\n }",
"public function fire()\n {\n \n }",
"public function testFireEventWithInternalFiredEvent()\n {\n $eventManager = new EventManager;\n $event = 'foor.bar';\n $eventManager->listen(EventManager::FIRED, function ($newEvent) use ($event) {\n $this->assertEquals($newEvent, $event);\n });\n $eventManager->fire($event);\n }",
"public function triggerEvent($event) {\r\n\t\tif (!isset($this->eventListener[$event])) return void;\r\n\t\t\r\n\t\tforeach($this->eventListener[$event] as $listener) {\r\n\t\t\t$listener->listen($event);\r\n\t\t}\r\n\t}",
"public function trigger($event, array $args = array()) {\n\t\tif ( ($inst = $this->getInstance()) == null ) return;\n\n\t\t// TODO: IMPORTANT!\n\t\tif ( method_exists($inst, $event) ) {\n\t\t\treturn call_user_func_array(array($inst, $event), $args);\n\t\t}\n\t}",
"public function handle($event, $payload)\n {\n list($model) = $payload;\n\n // dd(app()->bound(Translation::class));\n // // Ignore\n // if (!app()->bound(Translation::class)) {\n // return true;\n // }\n\n // Get the action from the event name\n preg_match('#\\.(\\w+)#', $event, $matches);\n $action = $matches[1];\n\n // If there is matching callback method on the model, call it, passing\n // any additional event arguments to it\n $method = 'on'.Str::studly($action);\n \n if (method_exists($this, $method)) {\n return $this->$method($model);\n }\n }",
"public function trigger($type, $data){}",
"protected function _trigger($eventName, $data = array()) {\n\t\treturn $this->_crud()->trigger($eventName, $data);\n\t}",
"protected function notifyTo($model)\n {\n $data = [\n 'localDate' => $this->getLocalTime(),\n 'action' => $this->getAction(),\n 'actionObject' => $this->getActor($model),\n 'verb' => $this->getActivityVerb(),\n 'target' => $this->getObject(),\n ];\n Queue::push(NotifyTarget::create($data));\n return;\n }",
"protected function fireConnectionEvent($event)\n\t{\n\t\t$this->neoeloquent->fireConnectionEvent($event);\n\t}",
"public function DoEvent($nEvent) {}",
"public function onEvent($event)\n\t{\n\t\tif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_BEFORE_INSERT)\n\t\t{\n\t\t\t/**\n\t\t\t * If document_id is set in the model the service will first try to pull \n\t\t\t * the document to update it. If it is unable to get the record \n\t\t\t * (it will be since this is an insert) it will do nothing and \n\t\t\t * the document will not be inserted.\n\t\t\t */\n\t\t\t$event->model->document_id = NULL;\n\t\t\t$result = $this->saveDocument($event->model);\n\t\t\t$event->model->document_id = $result->item->document_id;\n\t\t}\n\t\telseif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_UPDATE)\n\t\t{\n\t\t\t$this->saveDocument($event->model);\n\t\t}\n\t}",
"public function event()\r\n {\r\n\r\n $event = new Event();\r\n $event->afterDelete = function (EyufScholar $model) {\r\n //User::deleteAll(['id' => $model->user_id]);\r\n };\r\n\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n /// Az::$app->App->eyuf->scholar->sendNotifyToAdmin($model);\r\n };\r\n /*\r\n $event->beforeDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterDelete = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterSave = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->beforeValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterValidate = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterRefresh = function (EyufScholar $model) {\r\n return null;\r\n };\r\n\r\n $event->afterFind = function (EyufScholar $model) {\r\n return null;\r\n };\r\n */\r\n return $event;\r\n\r\n }",
"public static function trigger($triggerName, $params = array()) {\n if (self::$_triggerDepth > self::MAX_TRIGGER_DEPTH) { // ...have we delved too deep?\n return;\n }\n\n $triggeredAt = time();\n\n if (isset($params['model']) &&\n (!is_object($params['model']) || (!($params['model'] instanceof X2Model)))) {\n // Invalid model provided\n return false;\n }\n\n // Communicate the event to third-party systems, if any\n ApiHook::runAll($triggerName, $params);\n\n // increment stack depth before doing anything that might call X2Flow::trigger()\n self::$_triggerDepth++;\n\n $flowAttributes = array('triggerType' => $triggerName, 'active' => 1);\n\n if (isset($params['model'])) {\n $flowAttributes['modelClass'] = get_class($params['model']);\n $params['modelClass'] = get_class($params['model']);\n }\n\n // if flow id is specified, only execute flow with specified id\n if (isset($params['flowId'])) {\n $flowAttributes['id'] = $params['flowId'];\n }\n\n $flows = CActiveRecord::model('X2Flow')->findAllByAttributes($flowAttributes);\n\n // collect information about trigger for the trigger log.\n $triggerInfo = array(\n 'triggerName' => Yii::t('studio', X2FlowItem::getTitle($triggerName))\n );\n if (isset($params['model']) && (is_subclass_of($params['model'], 'X2Model')) &&\n $params['model']->asa('LinkableBehavior')) {\n $triggerInfo['modelLink'] = Yii::t('studio', 'View record: ') . $params['model']->getLink();\n }\n \n // find all flows matching this trigger and modelClass\n $triggerLog;\n $flowTrace;\n $flowRetVal = null;\n foreach ($flows as &$flow) {\n $triggerLog = new TriggerLog();\n $triggerLog->triggeredAt = $triggeredAt;\n $triggerLog->flowId = $flow->id;\n $triggerLog->save();\n\n $flowRetArr = self::_executeFlow($flow, $params, null, $triggerLog->id);\n $flowTrace = $flowRetArr['trace'];\n $flowRetVal = (isset($flowRetArr['retVal'])) ? $flowRetArr['retVal'] : null;\n $flowRetVal = self::extractRetValFromTrace($flowTrace);\n\n // save log for triggered flow\n $triggerLog->triggerLog = CJSON::encode(array_merge(array($triggerInfo), array($flowTrace)));\n $triggerLog->save();\n }\n\n // this trigger call is done; decrement the stack depth\n self::$_triggerDepth--;\n return $flowRetVal;\n }",
"public function visitModel(ModelInterface $model)\n {\n foreach ($this->getEvents() as $event) {\n $model->getEventManager()->attach($event, [$this, 'onExecute']);\n }\n }",
"public function broadcastEvent(\\Montage\\Event\\Event $event);",
"function run() {\n $this->model->run();\n }",
"public function run($event) {\n }",
"public function run($event) {\n }",
"public function onRun($event)\n {\n $this->raiseEvent('onRun', $event);\n }",
"public static function fire($event_name, $params = NULL) \n {\n $instance = self::get_instance();\n\n if (array_key_exists($event_name, $instance->hooks)) \n {\n foreach ($instance->hooks[$event_name] as $fn) \n {\n if (is_array($fn) || is_string($fn))\n {\n call_user_func_array($fn, array(&$params));\n }\n }\n }\n }",
"public function Trigger() {\r\n $form_instance = $this->form_instance; \r\n // If the form is not using events\r\n if (!$form_instance->use_events) { return $this; }\r\n // Retrieve the events\r\n $events = $form_instance->events;\r\n // If there are no events\r\n if (!$events || !is_array($events)) { return $this; } \r\n // The passed and failed actions\r\n $actions_passed = array();\r\n $actions_failed = array();\r\n // Loop through each of the events\r\n foreach ($events as $k => $action_instance) {\r\n // If the action fails the check\r\n if (!$action_instance->Check()) { continue; } \r\n // Trigger the action\r\n $action_instance->Trigger();\r\n }\r\n // Return the object for chaining\r\n return $this;\r\n }",
"public function trigger($sender, $e) {\n if(is_null($this->start_time)) {\n $this->start_time = new \\DateTime;\n } else {\n $this->since_start = new \\DateTime;\n }\n $this->events[] = $e;\n $this->event_names[] = $e->name;\n if(!array_key_exists($e->name,$this->amounts)) {\n $this->amounts[$e->name] = 0;\n }\n \n $this->amounts[$e->name]++;\n $this->handle($e);\n }",
"protected function fireStatusEvents(Registration $model)\n {\n # if the Registration is not for HCP, we do not care\n if(!$model->is_hcp) return;\n # we have final state\n $next = $model->getAttribute($this->statusField);\n # Map the status to events and fire them all\n if ($event = array_get($this->statusEvents, $next)){\n event (new $event($model));\n }\n }",
"public function triggerEvent($event_name, $args = array())\n {\n if ($this->eventsEnabled) {\n $event_name = $this->toInternalEventName($event_name);\n if (isset($this->eventListeners[$event_name])) {\n foreach ($this->eventListeners[$event_name] as $event) {\n if (is_callable($event)) {\n call_user_func($event, $args);\n }\n }\n }\n }\n }",
"private function callEventMethod($eventName, $payload)\n {\n $method = 'handle' . studly_case($eventName);\n\n if (method_exists($this, $method)) {\n $this->{$method}($payload);\n } \n }",
"public function trigger($event, $args = array()) {\n $func = $this->option($event);\n \n // prepare special error stuff\n if($event == 'error') {\n \n // mark the submission as failed\n $this->error = true;\n \n // collect all error fields\n $this->errors = array_merge($this->missing, $this->invalid);\n \n } \n \n // check if the event is a function at all \n if(!is_a($func, 'Closure') && preg_match('/^default\\:/', $event)) {\n $event = str_replace('default:', '', $event); \n $func = $this->defaults($event);\n }\n \n if(is_a($func, 'Closure')) {\n \n // track all triggered events \n $this->triggered[$event] = array(\n 'name' => $event,\n 'func' => $func,\n 'args' => $args, \n 'time' => microtime()\n );\n\n // invoke the function\n $func($this, $args);\n\n }\n \n return false;\n\n }",
"public function fireEvent(string $eventName): bool;",
"public function triggerBeforeFind()\n {\n if (!$this->_beforeFindFired && $this->clause('action') === self::ACTION_READ) {\n /** @var \\Muffin\\Webservice\\Model\\Endpoint $endpoint */\n $endpoint = $this->getRepository();\n $this->_beforeFindFired = true;\n $endpoint->dispatchEvent('Model.beforeFind', [\n $this,\n new ArrayObject($this->_options),\n !$this->isEagerLoaded(),\n ]);\n }\n }",
"protected function triggerEvent(Event $event)\n {\n $this->log(\"Triggered Event [{$event->id}]\");\n\n /** @var Task[] $tasks */\n $tasks = $event->getTasks()->andWhere(['active' => true])->all();\n\n foreach ($tasks as $task) {\n $this->doTask($task);\n }\n\n $event->last_triggered_at = time();\n $event->save(false);\n\n $this->log(\"Tasks for Event [{$event->id}] done\");\n }",
"public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }",
"public function onEvent( $eventName, $bean )\n\t{\n\t\t$bean->$eventName();\n\t}",
"public function triggerEvent(Event $event, $eventName) {\n foreach ($this->delayedEventsRegistry->getDelays($eventName) as $delayedEventName => $delay){\n $this->queue->put($delayedEventName, $event, IntervalCalculator::convertDelayToInterval($delay));\n }\n }",
"function sendEvent( $event )\n {\n Event_Manager::notify( $event );\n }",
"public function fireSubscriptionEvent($event)\n {\n if ( ! isset(static::$dispatcher)) return true;\n \n // We will append the names of the class to the event to distinguish it from\n // other model events that are fired, allowing us to listen on each model\n // event set individually instead of catching event for all the models.\n $event = \"eloquent.{$event}: \".get_class($this);\n \n $args = array_merge(array($this), array_slice(func_get_args(), 1));\n \n return static::$dispatcher->fire($event, $args);\n }",
"public function executeModelAction(): void\n {\n $this->action = $this->executeModelActionLoad($this->action);\n\n $this->vp->set(function () {\n $this->jsSetButtonsState($this->loader, $this->step);\n $this->jsSetListState($this->loader, $this->step);\n $this->runSteps();\n });\n }",
"protected function listenToModelEvent($event)\n\t{\n\t\t$this->eventDispatcher->listen(\"eloquent.{$event}: *\", function ($model, $data = null) use ($event) {\n\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t$model = reset($data);\n\t\t\t}\n\n\t\t\t$this->collectModelEvent($event, $model);\n\t\t});\n\t}",
"abstract function fire($action, $args);",
"public function handle(Event $event)\n {\n Log::info('Event listener called', [\n 'event' => json_encode($event)\n ]);\n\n try {\n /**\n * Use the projection to calculate state\n */\n $newState = $this->merchantStatus->calculateState($event->getRootId());\n\n $status = UserActions::firstOrNew([\n 'root_id' => $event->getRootId(),\n ]);\n\n /**\n * Save the new state\n */\n $status->payload = json_encode($newState);\n $status->save();\n\n Log::info('Read model saved', [\n 'action' => __METHOD__,\n 'new_state' => $newState,\n 'user_id' => $event->getRootId(),\n ]);\n } catch (\\Exception $e) {\n Log::error('Fail to save read model', [\n 'action' => __METHOD__,\n 'error' => $e->getMessage(),\n 'user_id' => $event->getRootId(),\n ]);\n }\n }",
"public function fire($event, $args)\n {\n $onEvent = $this->getConfig('events.'.$event);\n\n if ($onEvent instanceof Closure) {\n $onEvent($args);\n }\n }",
"public function fire()\n\t{\n// event(new \\App\\Events\\UserArticlePost($article->id, $articleType, [])); \n event(new \\App\\Events\\UserArticleCollectionAdd($articleId=1, $userId=1, $collectionId=3));\n event(new \\App\\Events\\UserArticleCollectionRemove($articleId=1, $userId=1, $collectiionId=3));\n event(new \\App\\Events\\UserArticleCommentAdd($articleId=1, $userId=1, $commentId=3));\n event(new \\App\\Events\\UserArticleCommentAdd($articleId=1, $userId=1, $commentId=4));\n event(new \\App\\Events\\UserArticleCommentRemove($articleId=1, $userId=1, $commentId=3));\n event(new \\App\\Events\\UserArticlePost($articleId=2, $articleType=config('shilehui.article_type.normal'), $params=[]));\n event(new \\App\\Events\\UserArticlePost($articleId=3, $articleType=config('shilehui.article_type.club'), $params=[]));\n event(new \\App\\Events\\UserArticlePost($articleId=4, $articleType=config('shilehui.article_type.activity'), $params=[]));\n event(new \\App\\Events\\UserArticlePost($articleId=5, $articleType=config('shilehui.article_type.subject'), $params=[]));\n event(new \\App\\Events\\UserArticlePraiseAdd($articleId=1, $userId=1, $praiseId=1));\n event(new \\App\\Events\\UserArticlePraiseRemove($articleId=1, $userId=1, $praiseId=1));\n event(new \\App\\Events\\UserClubExit($clubId=1, $userId=1));\n event(new \\App\\Events\\UserClubJoin($clubId=1, $userId=1));\n event(new \\App\\Events\\UserFollow($followedId=1, $followingId=2, [ 'datetime' => \\Carbon\\Carbon::now()->toDatetimeString() ]));\n event(new \\App\\Events\\UserUnFollow($followedId=1, $followingId=2, [ 'datetime' => \\Carbon\\Carbon::now()->toDatetimeString() ]));\n event(new \\App\\Events\\UserFollow($followedId=1, $followingId=2, [ 'datetime' => \\Carbon\\Carbon::now()->toDatetimeString() ]));\n event(new \\App\\Events\\UserUnFollow($followedId=1, $followingId=2, [ 'datetime' => \\Carbon\\Carbon::now()->toDatetimeString() ]));\n\t}",
"public function dispatch($eventName, Event $event = null);",
"public function dispatch($eventName, Event $event = null);",
"public function dispatchEvent($name, Event $event = null);",
"public function trigger($hook) {\n }",
"public function raiseEvent($name,$event)\r\n\t{\r\n\t\t$name=strtolower($name);\r\n\t\tif(isset($this->_e[$name]))\r\n\t\t{\r\n\t\t\tforeach($this->_e[$name] as $handler)\r\n\t\t\t{\r\n\t\t\t\tif(is_string($handler))\r\n\t\t\t\t\tcall_user_func($handler,$event);\r\n\t\t\t\telseif(is_callable($handler,true))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(is_array($handler))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// an array: 0 - object, 1 - method name\r\n\t\t\t\t\t\tlist($object,$method)=$handler;\r\n\t\t\t\t\t\tif(is_string($object))\t// static method call\r\n\t\t\t\t\t\t\tcall_user_func($handler,$event);\r\n\t\t\t\t\t\telseif(method_exists($object,$method))\r\n\t\t\t\t\t\t\t$object->$method($event);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse // PHP 5.3: anonymous function\r\n\t\t\t\t\t\tcall_user_func($handler,$event);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// stop further handling if param.handled is set true\r\n\t\t\t\tif(($event instanceof Event) && $event->handled)\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function fire()\n {\n $this->handle();\n }",
"public function handle()\n {\n $time = $this->time->with('workOrder')->whereNull('time')->first();\n\n if(! is_null($time)) event(new TimeTic($time));\n }",
"public function handle(Event $event): void;",
"private function dispatchModelEvent($action, $collection)\n {\n if (!($this->repository instanceof DocumentRepository)) {\n return;\n }\n if (!method_exists($collection, 'getId')) {\n return;\n }\n\n $event = new ModelEvent();\n $event->setCollectionId($collection->getId());\n $event->setActionByDispatchName($action);\n $event->setCollectionName($this->repository->getClassMetadata()->getCollection());\n $event->setCollectionClass($this->repository->getClassName());\n $event->setCollection($collection);\n\n $this->eventDispatcher->dispatch($event, $action);\n }",
"public function apply($model);",
"public static function triggerEvent($eventName, $data = null)\n {\n if (empty(self::$registry[$eventName])) {\n return;\n }\n foreach (self::$registry[$eventName] as $observer) {\n call_user_func_array($observer, [$eventName, $data]);\n }\n }",
"public function handle($NotificationEventObj = null)\n {\n try\n {\n $this->model_arr = $NotificationEventObj->getModelArr();\n\n parent::handle($NotificationEventObj);\n }\n catch (ListenerException $e)\n {\n throw $e;\n }\n catch (Exception $e)\n {\n throw new ListenerException(__CLASS__ . ' Event ' . get_class($NotificationEventObj) . ' at ' . __FILE__ . ':' . __LINE__, 400, $e);\n }\n }",
"abstract protected function handle($event);",
"public function dispatch($event, $options);",
"public function callModel()\n {\n Artisan::call('lucy:model', $this->builder->getAttribute('model'));\n }",
"public function fire($name, $data=null)\n { \n if (empty($this->events[$name]))\n return;\n \n if (empty($data))\n $data = array(); \n \n if (!is_array($data)) \n $data = array($data);\n\n foreach ($this->events[$name] as $callback)\n call_user_func_array($callback, $data);\n \n return false; // so you can use this to return early for errors\n }",
"protected function fireEvent($event, $payload = [], $halt = true)\n {\n return event($event, $payload, $halt);\n }",
"public function change_event()\r\n\t{\r\n\t\t// get post data\r\n\t\t$data['post'] = $this->input->post();\r\n\t\t// update db\r\n\t\t$this->caifmodel->edit_event($data['post']);\t\r\n\t\t// redirect\r\n\t\tredirect(base_url().'events','location');\r\n\t}",
"public function fireMigrationEvent($event): void\n {\n // if ($this->events) {\n // $this->events->dispatch($event);\n // }\n }",
"public function onPerformTest(MauticEventTriggerContent $event)\n {\n if($event->getType() == MauticEventTriggerType::PERFORM_CUSTOM_FIELD_TEST)\n {\n $this->databaseModel->performCustomFieldTest();\n\t}\n }",
"public function trigger(string $event, ...$arguments): int;",
"protected function handle(DomainEventInterface $event) {\n\n\t\t$method = $this->getApplyMethodName($event);\n\n\t\tif ( ! method_exists($this, $method)) {\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->{$method}($event);\n\t}",
"public function eventMethod1()\n {\n // some code here...\n\n $this->notify(\"action1\");\n }",
"public function trigger($event, $object)\n {\n if ($this->_corked) {\n $this->_queue []= func_get_args();\n } else {\n foreach ((array) $event as $e) {\n $callbacks = $this->_callbacksFor($e);\n\n foreach($callbacks as $callback)\n call_user_func($callback, $e, $object);\n }\n\n if(isset($this->_upstream))\n $this->_upstream->trigger($event, $object);\n }\n\n return $this;\n }",
"public function fire()\n {\n $this->line(\"Start time: \" . (string)date('l jS \\of F Y h:i:s A'));\n $this->line(\"Loading all API Tables (Eventbrite, Eventful, Meetup) into main table...\");\n $this->line(\"Starting Eventbrite...\");\n $this->storeEventbriteEvents();\n $this->line(\"Eventbrite Done!\");\n $this->line(\"Skip Eventful and Meetup.\");\n // $this->line(\"Starting Eventful...\");\n // $this->storeEventfulEvents();\n // $this->line(\"Eventful Done!\");\n // $this->line(\"Starting Meetup...\");\n // $this->storeMeetupEvents();\n // $this->line(\"Meetup Done!\");\n $this->line(\"End time: \" . (string)date('l jS \\of F Y h:i:s A'));\n $this->info(\"Finished storing events\");\n }",
"public function retrieved(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('retrieved'));\n }",
"public function fireEventCancel($eventName) {}",
"public function fire()\n {\n CrawlerRequest::newTorIdentity();\n }"
] | [
"0.73562884",
"0.67179745",
"0.6574197",
"0.64441276",
"0.636817",
"0.6339298",
"0.6059989",
"0.5947686",
"0.58663374",
"0.5854746",
"0.58448344",
"0.58448344",
"0.57933116",
"0.57921153",
"0.57545984",
"0.5752188",
"0.5709562",
"0.56605446",
"0.5610619",
"0.5584932",
"0.55634576",
"0.5479241",
"0.5471067",
"0.54644096",
"0.54061306",
"0.5399941",
"0.53607315",
"0.5347032",
"0.5327724",
"0.5276785",
"0.5270057",
"0.5270057",
"0.52656955",
"0.52381",
"0.518425",
"0.5174934",
"0.51733506",
"0.5165522",
"0.51626486",
"0.5153312",
"0.5138534",
"0.5136476",
"0.5125171",
"0.5122529",
"0.51212555",
"0.5119565",
"0.5106998",
"0.50858825",
"0.5081544",
"0.5081544",
"0.50601214",
"0.505978",
"0.505591",
"0.5047904",
"0.5039878",
"0.50364023",
"0.50277984",
"0.50229913",
"0.5001884",
"0.4952133",
"0.49421218",
"0.49365786",
"0.49222994",
"0.4920634",
"0.49179295",
"0.49130917",
"0.49126118",
"0.49023587",
"0.49017492",
"0.48817554",
"0.4881092",
"0.48639625",
"0.48487303",
"0.48487303",
"0.48180354",
"0.48108706",
"0.48095384",
"0.48071995",
"0.480462",
"0.47947046",
"0.47820443",
"0.4778663",
"0.4761527",
"0.47579807",
"0.47542694",
"0.47539437",
"0.4744057",
"0.4737985",
"0.4736735",
"0.47338012",
"0.47306842",
"0.47292963",
"0.471278",
"0.46924222",
"0.46780825",
"0.46627268",
"0.46595764",
"0.46556544",
"0.46498576",
"0.46439067"
] | 0.57273823 | 16 |
Get a new query builder for the object | public function newQuery()
{
$datasource = $this->getDatasource();
$query = new Builder($datasource, $datasource->getPostProcessor());
return $query->setModel($this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createQueryBuilder ()\r\n {\r\n return new QueryBuilder($this);\r\n }",
"public function newQuery()\n {\n return new Builder($this->connection, $this->processor);\n }",
"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 newQuery() {\n return new Builder($this->connection);\n }",
"public function newQuery(): Builder\n {\n return new static($this->connection);\n }",
"public function newQueryBuilder()\n {\n return new Builder($this->config);\n }",
"public function createQueryBuilder()\n {\n return new QueryBuilder($this->db);\n }",
"protected function createQueryBuilder()\n {\n $builder = new QueryBuilder();\n return $builder;\n }",
"public function createQueryBuilder()\n {\n return new Query\\QueryBuilder($this);\n }",
"public function newQuery()\n {\n $builder = $this->newAlfrescoBuilder($this->getConnection());\n $builder->setModel($this);\n return $builder;\n }",
"public function getQuery(): Builder;",
"public function query()\n {\n return new \\Rubberband\\Elastic\\Laravel\\Query\\Builder($this);\n }",
"public function newQuery()\n {\n return new Builder($this->connection, $this->grammar, $this->processor);\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 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 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 QueryBuilder::$dataSource = true;\n\n return new QueryBuilder();\n }",
"public function queryBuilder()\n\t{\n\t\treturn \\ORM::for_table($this->table);\n\t}",
"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 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 query(): QueryBuilder;",
"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 }",
"protected function retrieveOrCreateQueryInstance()\n {\n return $this->queryBuilder ?? $this->queryBuilder = new $this->model();\n }",
"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 query()\n {\n return new SingleStoreBuilder($this);\n }",
"public function getQuery() : QueryBuilder\n {\n return $this->query;\n }",
"protected function query() {\n\t\treturn new Query($this);\n\t}",
"public function getQueryBuilder();",
"public function getQueryBuilder();",
"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 static function create()\n {\n return new QueryConfigurationBuilder();\n }",
"protected function newBaseQueryBuilder()\n {\n return $this->getConnection()->query();\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 createQuery() {\n\t\treturn $this->queryFactory->create($this->objectType);\n\t}",
"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 }",
"protected function createQuery()\n {\n return \\PropelQuery::from($this->class);\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 }",
"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 getQueryBuilder(){\n return $this->getDatabaseConnection()->createQueryBuilder();\n }",
"public function toBase() : QueryBuilder\n {\n return $this->applyScopes()->getQuery();\n }",
"protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return $connection->query();\n }",
"public function getQueryInstance()\n {\n return $this->queryBuilder;\n }",
"public static function query()\n {\n return (new static)->newQuery();\n }",
"public static function query()\n {\n return (new static)->newQuery();\n }",
"public function newEloquentBuilder($query);",
"public static function createQuery()\n\t{\n\t\treturn new ActiveQuery(['modelClass' => get_called_class()]);\n\t}",
"protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder($connection, $connection->getPostProcessor());\n }",
"public function getQueryBuilder(): SQLQueryBuilder;",
"public function getCollectionQuery(): Builder;",
"public function newEloquentBuilder($query)\n {\n return new QueryBuilder($query);\n }",
"public function query()\n {\n if ($model = $this->model) {\n return new $model();\n }\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 }",
"protected function newBaseQueryBuilder()\n {\n $conn = $this->getConnection();\n\n $grammar = $conn->getQueryGrammar();\n\n return new QueryBuilder($conn, $grammar, $conn->getPostProcessor());\n }",
"public function getDocumentBuilder()\n {\n return Document::query()\n ->where(function($query) {\n return $query->whereRaw($this->getExpandedQuery());\n });\n }",
"abstract protected function initQueryBuilder(): Builder;",
"public function newQuery()\n {\n return new self($this->connection, $this->processor);\n }",
"public function getQueryBuilder() {\n return $this->queryBuilder;\n }",
"public static function getQueryBuilder()\n {\n return self::getLink()->createQueryBuilder();\n }",
"public function getQueryBuilder()\n {\n return $this->objectManager\n ->getRepository(self::ENTITY_CLASS)\n ->createQueryBuilder(self::ENTITY_ALIAS);\n }",
"public function newQueryWithoutScopes(): Builder\n {\n return $this->newModelQuery();\n }",
"protected function newBuilder(): Builder\n {\n return $this->builder = $this->game_play->newQuery();\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 }",
"protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder(\n $connection,\n $connection->getQueryGrammar(),\n $connection->getPostProcessor()\n );\n }",
"public function query(): AppointmentQueryBuilder\n {\n return new AppointmentQueryBuilder($this->client);\n }",
"public function createQueryBuilder(): QueryBuilder\n {\n return new QueryBuilder($this->db, [\n 'separator' => \"\\n\"\n ]);\n }",
"public function getQueryBuilder()\n {\n if (null === $this->queryBuilder) {\n\n $queryBuilder = $this->generator->list->query_builder;\n\n if ( null !== $this->generator->list->query_builder\n && false !== $this->generator->list->query_builder\n && method_exists($this->getRepository(), $queryBuilder)) {\n $this->queryBuilder = $this->getRepository()->$queryBuilder();\n } else {\n $this->queryBuilder = $this->getRepository()->createQueryBuilder('e');\n }\n\n foreach ($this->sort as $field => $order) {\n $this->queryBuilder->addOrderBy('e.' . $field, $order);\n }\n\n $this->processFilters();\n\n }\n return $this->queryBuilder;\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 newModelQuery();",
"protected function newBaseQueryBuilder() {\n\n $connection = $this->getConnection();\n\n return new Builder(\n $connection, $connection->getQueryGrammar(), $connection->getPostProcessor()\n );\n }",
"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 }",
"public function query()\n {\n return (new Query($this))->entity($this->getEntityName());\n }",
"public function newQuery()\n {\n return $this->registerGlobalScopes($this->newQueryWithoutScopes());\n }",
"public function newQuery()\n {\n return $this->model->newQueryWithoutScopes();\n }",
"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(): Query\n {\n return new Query($this->getWebservice(), $this);\n }",
"public function getQueryBuilder()\n {\n return $this->qb;\n }",
"public function getQueryBuilder()\n {\n return $this->qb;\n }",
"public function newQuery()\n {\n return new self($this->connection, $this->grammar, $this->getProcessor());\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 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}",
"public function query(): ?Builder;",
"public function getResultQueryBuilder()\n {\n $qb = clone $this->queryBuilder;\n $this->_addSearch($qb);\n\n return $qb;\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 }",
"public function createStandardQueryBuilder()\n {\n return $this->createQueryBuilder()\n ->field('status')->notEqual(MultimediaObject::STATUS_PROTOTYPE)\n ->field('islive')->equals(false);\n }",
"public function buildQuery()\n {\n if (!$this->query) {\n $this->query = $this->getMapper()->buildAssociationQuery($this);\n }\n\n return clone $this->query;\n }",
"protected function toQuery()\n\t{\n\t\treturn $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder())->first();\n\t}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function getFindPublicQueryBuilder(): QueryBuilder;",
"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 }"
] | [
"0.8184689",
"0.80916274",
"0.8077217",
"0.8077217",
"0.8071451",
"0.8038002",
"0.80291265",
"0.79947925",
"0.79740125",
"0.795177",
"0.7896967",
"0.7871272",
"0.78519696",
"0.78504866",
"0.7844036",
"0.78192025",
"0.7756608",
"0.774299",
"0.774299",
"0.77364516",
"0.7735641",
"0.77195674",
"0.7671227",
"0.7664811",
"0.76337284",
"0.76306945",
"0.7533296",
"0.7525164",
"0.74949884",
"0.7493514",
"0.7452338",
"0.7452338",
"0.7434011",
"0.74081737",
"0.7383722",
"0.7378687",
"0.73711175",
"0.73613137",
"0.7353574",
"0.7352961",
"0.73227656",
"0.7281178",
"0.7272272",
"0.72613615",
"0.72604066",
"0.72509515",
"0.72509515",
"0.72399807",
"0.72289413",
"0.7223511",
"0.7177118",
"0.71760064",
"0.7169367",
"0.7154814",
"0.71506304",
"0.71340954",
"0.7106416",
"0.7105806",
"0.7103386",
"0.7080609",
"0.707799",
"0.7073592",
"0.7066835",
"0.70607775",
"0.7046285",
"0.7046285",
"0.7044771",
"0.70342773",
"0.70337594",
"0.7020197",
"0.7006281",
"0.70001847",
"0.6979649",
"0.6967143",
"0.694514",
"0.69122094",
"0.6895288",
"0.6872095",
"0.68712866",
"0.6857089",
"0.6857089",
"0.6849767",
"0.6834703",
"0.6828359",
"0.6823168",
"0.681927",
"0.68138796",
"0.68138796",
"0.68138796",
"0.68138796",
"0.68138796",
"0.68064904",
"0.6775844",
"0.67753464",
"0.6759124",
"0.6759124",
"0.6759124",
"0.6757552",
"0.67493826",
"0.6742856"
] | 0.8071898 | 4 |
Create a new Halcyon Collection instance. | public function newCollection(array $models = [])
{
return new Collection($models);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function collection()\n {\n return new Collection();\n }",
"public function __construct()\n {\n $this->_collection = new Collection();\n }",
"public function __construct(){\r\n\t\t$this->collection = new Collection();\r\n\t}",
"protected function createCollection()\n {\n return $this->_setUpNewNode(\n new Collection()\n );\n }",
"public function __construct()\n {\n self::$clients = new Collection();\n }",
"public function __construct()\n {\n $this->items = new Collection;\n }",
"public function __construct()\n {\n $this->items = new Collection;\n }",
"private function create_collection() {\n\n\t\treturn new MapCollection();\n\t}",
"public function __construct(Collection $collection)\n {\n $this->collection = $collection;\n }",
"public function _construct(){\n $this->KcsPoll = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->categories = new ArrayCollection();\n $this->families = new ArrayCollection();\n $this->types = new ArrayCollection();\n $this->designations = new ArrayCollection();\n $this->makes = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->postules = new ArrayCollection();\n $this->competences = new ArrayCollection();\n $this->habilitations = new ArrayCollection();\n }",
"protected function createCollection()\n {\n $model = $this->getModel();\n return $model->asCollection();\n }",
"public function __construct($collection) {\n\t\t\t$this->collection = $collection;\n\t\t}",
"public function __construct()\n {\n $this->categories = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->categories = new ArrayCollection();\n }",
"private function createCollection()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }",
"public function createCollection(CollectionCreateStruct $collectionCreateStruct, Block $block, string $collectionIdentifier): Collection;",
"public function __construct()\n {\n $this->movieCredits = new CreditsCollection\\MovieCredits();\n $this->tvCredits = new CreditsCollection\\TvCredits();\n $this->combinedCredits = new CreditsCollection\\CombinedCredits();\n $this->images = new Images();\n $this->changes = new GenericCollection();\n $this->externalIds = new ExternalIds();\n $this->knownFor = new GenericCollection();\n }",
"public function testCreateCollection()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"static function wrap($collection)\n {\n return new Collection($collection);\n }",
"public function __construct(Collection $config)\n {\n $this->config = $config;\n }",
"public function __construct() {\n $this->configs = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->tasks = new ArrayCollection();\n $this->comments = new ArrayCollection();\n $this->timeEntries = new ArrayCollection();\n }",
"public function __construct(&$collection)\n\t{\n\t\t// Set params\n\t\t$this->collection = $collection;\n\t}",
"public static function &collection($name)\n\t{\n\t\t$collection = null;\n\t\t$name = ucfirst($name);\n\t\t$class = self::COLLECTION_CLASS_PREFIX . $name;\n\t\t\n\t\tif(!class_exists($class) && is_file(COLLPATH . $name . EXT)) {\n\t\t\trequire COLLPATH . $name . EXT;\n\t\t}\n\t\t\n\t\tif(class_exists($class)) {\n\t\t\t$collection = new $class($name);\n\t\t\t\n\t\t\tif(!is_subclass_of($collection, self::COLLECTION_BASE_CLASS)) {\n\t\t\t\tthrow new BakedCarrotOrmException(\"Class $class is not subclass of \" . self::COLLECTION_BASE_CLASS);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$class_name = self::COLLECTION_BASE_CLASS;\n\t\t\t$collection = new $class_name($name);\n\t\t}\n\t\t\n\t\treturn $collection;\n\t}",
"public function __construct()\n {\n \t$this->cities = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->users = new ArrayCollection();\n }",
"public function __construct() {\n $this->bestellijn = new ArrayCollection();\n }",
"public function __construct(Collection $collection = null)\r\n {\r\n $this->collection = $collection ?: new Collection;\r\n }",
"public function __construct($collection)\n\t{\n\t\t// Assign params\n\t\t$this->collection = $collection;\n\n\t\t// Compile if needed\n\t\t$this->collection->compile();\n\t}",
"public function __construct()\n {\n $this->articles = new ArrayCollection();\n $this->commentaires = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->placas = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->spotWebcams = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->programs = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->programs = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->references = new ArrayCollection();\n }",
"public function createCollection()\n\t{\n\t\t$tag = $this->tag;\n\n\t\tif ($this->hasPaginator) {\n\t\t\t$tag = $this->tag->getCollection();\n\t\t}\n\n\t\t$this->tagCollection = new Collection(\n\t\t\t$tag, \n\t\t\tnew TagTransformer\n\t\t);\n\n\t\treturn $this;\n\t}",
"public function __construct()\n {\n $this->recepten = new ArrayCollection();\n }",
"public function createCollection($name) {}",
"public function collectionBuilder()\n {\n $emptyRobofile = new \\Robo\\Tasks;\n return CollectionBuilder::create($this->getContainer(), $emptyRobofile);\n }",
"public static function collection()\n {\n $jsoLoader = new JsonLoader(new ISO3166CountryFactory());\n\n return new Collection($jsoLoader->load(__DIR__.'/../data/iso3166.json'));\n }",
"public function __construct()\n {\n $this->questions = new ArrayCollection();\n $this->openids = new ArrayCollection();\n $this->createdAt = new \\DateTime();\n }",
"public function __construct()\n {\n $this->defendants = new ArrayCollection();\n $this->interpreterEvents = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->attachments = new ArrayCollection();\n $this->history = new ArrayCollection();\n }",
"public function collection(Collection $collection);",
"public function __construct() {\n $this->items = new ArrayCollection;\n $this->orderProducts = new ArrayCollection;\n $this->promotions = new ArrayCollection();\n\n }",
"public function Panier() \n {\n $this->CollProduit = new Collection;\n }",
"public function __construct()\n {\n $this->posts = new ArrayCollection();\n $this->parameters = new ArrayCollection();\n }",
"abstract protected function collectionLoader();",
"protected function getRouting_Loader_CollectionService()\n {\n $this->services['routing.loader.collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('routing.loader.yaml');\n\n return $instance;\n }",
"public function __construct(Collection $options)\n {\n $this->options = $options;\n }",
"protected function _getCollection()\n\t{\n\t\t//Check collection\n\t\tif($this->_collection)\n\t\t\treturn $this->_collection;\n\n\t\t//Get collection\n\t\t$this->_collection = new \\Framework\\Database\\Drivers\\Mongo\\CDatabaseModelCollection($this, $this->execute());\n\t\treturn $this->_collection;\n\t}",
"protected function createEmptyCollection(): Collection\n {\n /** @var Collection<TEntity> $emptyCollection */\n $emptyCollection = new Collection($this->db);\n return $emptyCollection;\n }",
"protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"public function newCollection(array $models = [])\n {\n return new KusikusiCollection($models);\n }",
"protected function makeData()\n {\n $Collection = new Collection();\n for($i = 0; $i < 35; $i++){\n $Collection->push([\n 'name' => $this->Faker->name,\n 'email' => $this->Faker->email,\n 'birthday' => $this->Faker->date,\n 'phone_number' => $this->Faker->phoneNumber,\n 'bio' => $this->Faker->text,\n ]);\n }\n\n return $Collection;\n }",
"protected function newCollection(array $data)\n {\n return new Collection($data);\n }",
"public function __construct($collections = array())\n {\n $this->setCollections($collections);\n }",
"public function __construct()\n {\n parent::__construct();\n $this->challenges = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }",
"public function __construct(Collection $collection)\n {\n foreach($collection->items as $collectionItem){\n $collectionItem->delete();\n }\n }",
"public function __construct()\n {\n $this->events = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->accounts = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->commentaires = new ArrayCollection();\n $this->photos = new ArrayCollection();\n }",
"public function __construct()\n {\n $this->genres = new Genres();\n $this->productionCompanies = new GenericCollection();\n $this->productionCountries = new GenericCollection();\n $this->spokenLanguages = new GenericCollection();\n $this->alternativeTitles = new GenericCollection();\n $this->changes = new GenericCollection();\n $this->credits = new CreditsCollection();\n $this->externalIds = new ExternalIds();\n $this->images = new Images();\n $this->keywords = new GenericCollection();\n $this->lists = new GenericCollection();\n $this->releases = new GenericCollection();\n $this->release_dates = new GenericCollection();\n $this->similar = new GenericCollection();\n $this->recommendations = new GenericCollection();\n $this->translations = new GenericCollection();\n $this->videos = new Videos();\n $this->watchProviders = new GenericCollection();\n }",
"protected function doInitialize()\n {\n $this->collection = new ArrayCollection();\n\n $this->stmtIniEntries = $this->dbal->prepare(\n 'SELECT i.name,' .\n ' ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' deprecated' .\n ' FROM bartlett_compatinfo_inientries i, bartlett_compatinfo_extensions e' .\n ' WHERE i.ext_name_fk = e.id AND i.name = :name COLLATE NOCASE'\n );\n\n $this->stmtTraits = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\"' .\n ' FROM bartlett_compatinfo_classes c, bartlett_compatinfo_extensions e' .\n ' WHERE c.ext_name_fk = e.id AND c.name = :name COLLATE NOCASE'\n );\n\n $this->stmtClasses = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\"' .\n ' FROM bartlett_compatinfo_classes c, bartlett_compatinfo_extensions e' .\n ' WHERE c.ext_name_fk = e.id AND c.name = :name COLLATE NOCASE'\n );\n\n $this->stmtInterfaces = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\"' .\n ' FROM bartlett_compatinfo_interfaces i, bartlett_compatinfo_extensions e' .\n ' WHERE i.ext_name_fk = e.id AND i.name = :name COLLATE NOCASE'\n );\n\n $this->stmtFunctions = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' parameters, php_excludes as \"php.excludes\",' .\n ' deprecated' .\n ' FROM bartlett_compatinfo_functions f, bartlett_compatinfo_extensions e' .\n ' WHERE f.ext_name_fk = e.id AND f.name = :name COLLATE NOCASE'\n );\n\n $this->stmtConstants = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' php_excludes as \"php.excludes\"' .\n ' FROM bartlett_compatinfo_constants c, bartlett_compatinfo_extensions e' .\n ' WHERE c.ext_name_fk = e.id AND c.name = :name COLLATE NOCASE'\n );\n\n $this->stmtMethods = $this->dbal->prepare(\n 'SELECT e.name as \"ext.name\", ext_min as \"ext.min\", ext_max as \"ext.max\",' .\n ' php_min as \"php.min\", php_max as \"php.max\",' .\n ' prototype, proto_since' .\n ' FROM bartlett_compatinfo_methods m, bartlett_compatinfo_extensions e' .\n ' WHERE m.ext_name_fk = e.id' .\n ' AND m.class_name = :class_name AND m.name = :name COLLATE NOCASE'\n );\n }",
"public function __construct()\n {\n $this->tags = new ArrayCollection();\n }",
"public function createFromCollection(Collection $collection)\n {\n $this->operator = new CollectionOperator($collection, $this->request);\n $this->prepare();\n\n return $this;\n }",
"public function __construct(array $response)\n {\n $this->recent = new CompanyCollection($response['recent']);\n\n $this->featured = new CompanyCollection($response['featured']);\n\n $this->featuredCovered = new CompanyCollection($response['featured_cover']);\n }",
"public function __construct() {\r\n $this->answers = new ArrayCollection();\r\n }",
"public function __construct()\n {\n $this->uuid = Uuid::uuid4()->toString();\n $this->createdDate = new \\DateTime();\n $this->items = new ArrayCollection();\n }",
"public function collection() {\n \t$db = $this->db;\n\t\t$sql = $this->sql();\n\t\t$rows = $db::execute($sql);\n\t\t$model = $this->model;\n\t\treturn new \\Collection($model::arrayFactoryFromRows($rows));\n\t}",
"public function __construct() {\n\t\t// creating a collection for storing menus\n\t\t$this->collection = new Collection ();\n\t}",
"public function __construct()\n {\n $this->children = new ArrayCollection();\n }",
"public function getCollection() ;",
"public function createCollection()\n\t{\n\t\t/** @var $collection \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection */\n\t\t$collection = $this->productCollectionFactory->create();\n\t\t$collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());\n\n\t\t$collection = $this->_addProductAttributesAndPrices($collection)\n\t\t\t->addStoreFilter()\n\t\t\t->setPageSize($this->getPageSize())\n\t\t\t->setCurPage($this->getRequest()->getParam(self::PAGE_VAR_NAME, 1));\n\n\t\t$conditions = $this->getConditions();\n\t\t$conditions->collectValidatedAttributes($collection);\n\t\t$this->sqlBuilder->attachConditionToCollection($collection, $conditions);\n\n\t\treturn $collection;\n\t}",
"public function newCollection(array $models = []): Collection\n {\n return new Collection($models);\n }",
"public function factory($collection)\n {\n if ($collection instanceof Collection) {\n $collectionName = $collection->getName();\n } else {\n $collectionName = $collection;\n }\n\n if (!isset($this->collections[$collectionName])) {\n if (!($collection instanceof Collection)) {\n $collection = Norm::createCollection(array(\n 'name' => $collection,\n 'connection' => $this,\n ));\n\n $this->applyHook('norm.after.factory', $collection);\n }\n\n $this->collections[$collectionName] = $collection;\n }\n\n return $this->collections[$collectionName];\n }",
"protected function _prepareCollection()\n {\n /** @var $collection ChazkiExpressCollection */\n $collection = $this->_collectionFactory->create();\n $collection->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"public function setLazy(bool $lazy): CollectionInterface\n {\n }",
"public function createCollection()\n\t{\n\t\t$ticket = $this->ticket;\n\n\t\tif ($this->hasPaginator) {\n\t\t\t$ticket = $this->ticket->getCollection();\n\t\t}\n\n\t\t$this->ticketCollection = new Collection(\n\t\t\t$ticket, \n\t\t\tnew TicketTransformer\n\t\t);\n\n\t\treturn $this;\n\t}",
"public function __construct()\n {\n $this->feeds = new ArrayCollection();\n }",
"public function __construct()\n\t{\n\t\t// creating a collection for storing menus\n\t\t$this->collection = new Collection();\n\t}",
"public function __construct()\n {\n $this->forumPostTb = new ArrayCollection;\n }",
"public function __construct()\n {\n $this->places = new ArrayCollection();\n $this->transitions = new ArrayCollection();\n }",
"public function setCollection()\n {\n $cl = $this->nameCollection;\n $this->collection = self::$database->$cl;\n }",
"public function getCollection();",
"public function getCollection();",
"public function getCollection();",
"public function getCollection();",
"public function __construct()\n {\n $this->itemPrices = new ArrayCollection();\n }",
"public static function getCollection($pCollection)\n {\n $fileName = strtolower($pCollection);\n $className = $fileName . CollectionInterface::APP_SUFFIX;\n\n if (Agl::isInitialized()) {\n $collectionPath = APP_PATH\n . Agl::APP_PHP_DIR\n . CollectionInterface::APP_PHP_DIR\n . DS\n . $fileName\n . Agl::PHP_EXT;\n\n if (is_readable($collectionPath)) {\n return self::getInstance($className, array($pCollection));\n } else {\n return new Collection($pCollection);\n }\n } else {\n return new Collection($pCollection);\n }\n }",
"public function newCollection(array $models = array())\n {\n return new Collection($models);\n }",
"protected function _createCollection()\n {\n return Mage::getModel('wishlist/item')->getCollection()\n ->setWebsiteId($this->_getCustomer()->getWebsiteId())\n ->setCustomerGroupId($this->_getCustomer()->getGroupId());\n }",
"public function getCollectionGenerator(): CollectionGenerator\n {\n return $this->generator ?? new CollectionGenerator(\n new CollectionSchema(),\n new Config(__DIR__, 'collection')\n );\n }",
"public function __construct() {\n $this->disciplinas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->tendencias = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->institucionalEstrategias = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->ofertas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->estrategiaCampos = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->eventos = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->encuestas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }",
"public function __construct()\n {\n $this->tickets = new ArrayCollection();\n }",
"public function __get($name)\n\t{\n\t\treturn new Collection($this, $name);\n\t}",
"public function newCollection(array $models = array())\n\t{\n\t\treturn new MyCollection($models);\n\t}",
"public function __construct()\n {\n parent::__construct();\n $this->createdUsers = new ArrayCollection();\n $this->createdDistributors = new ArrayCollection();\n $this->createdCompanies = new ArrayCollection();\n $this->createdManufacturer = new ArrayCollection();\n $this->createdSuppliers = new ArrayCollection();\n $this->createdTickets = new ArrayCollection();\n $this->assignedTickets = new ArrayCollection();\n $this->resolvedTickets = new ArrayCollection();\n $this->departments = new ArrayCollection();\n \n if (null == $this->createdAt)\n $this->createdAt = new DateTime();\n\n if (null == $this->updatedAt)\n $this->updatedAt = new DateTime();\n\n if (null == $this->plainPassword) {\n $this->plainPassword = substr\n (str_shuffle('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'), 0, 10);\n }\n\n }",
"protected function getAvatar_DriverCollectionService()\n {\n $this->services['avatar.driver_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('avatar.driver.gravatar');\n $instance->add('avatar.driver.local');\n $instance->add('avatar.driver.remote');\n $instance->add('avatar.driver.upload');\n\n return $instance;\n }"
] | [
"0.67218024",
"0.6527431",
"0.64319324",
"0.6352032",
"0.6318654",
"0.6270462",
"0.6270462",
"0.6236317",
"0.612738",
"0.6065921",
"0.60455143",
"0.59790784",
"0.5918718",
"0.59050906",
"0.587401",
"0.587401",
"0.5871156",
"0.5823667",
"0.58107066",
"0.5784722",
"0.5745203",
"0.5739264",
"0.56954396",
"0.5690038",
"0.5683276",
"0.5683184",
"0.5673527",
"0.56718165",
"0.56687003",
"0.5652827",
"0.56425023",
"0.5625766",
"0.56248987",
"0.5619952",
"0.5618709",
"0.5618709",
"0.56161916",
"0.55949426",
"0.5548196",
"0.554793",
"0.5541705",
"0.5517665",
"0.5514947",
"0.55085266",
"0.5501518",
"0.54887897",
"0.5478717",
"0.5467571",
"0.5458806",
"0.54555726",
"0.545094",
"0.54332036",
"0.5430192",
"0.54257184",
"0.5425274",
"0.541531",
"0.54127806",
"0.5404751",
"0.5402626",
"0.54015946",
"0.53880805",
"0.5383701",
"0.53812975",
"0.53798944",
"0.5377282",
"0.5373912",
"0.5371084",
"0.5370129",
"0.536795",
"0.53634435",
"0.5357794",
"0.5355441",
"0.5353394",
"0.53436685",
"0.5337886",
"0.53135216",
"0.53123915",
"0.5312095",
"0.5311249",
"0.5307358",
"0.5304584",
"0.5302101",
"0.5276439",
"0.5265317",
"0.5260035",
"0.5257096",
"0.5256334",
"0.5256334",
"0.5256334",
"0.5256334",
"0.5246738",
"0.52385443",
"0.5237878",
"0.5232562",
"0.52314913",
"0.5222386",
"0.5218683",
"0.5216422",
"0.5204485",
"0.5197975",
"0.5191239"
] | 0.0 | -1 |
Returns the base file name and extension. Applies a default extension, if none found. | public function getFileNameParts($fileName = null)
{
if ($fileName === null) {
$fileName = $this->fileName;
}
if (!strlen($extension = pathinfo($fileName, PATHINFO_EXTENSION))) {
$extension = $this->defaultExtension;
$baseFile = $fileName;
}
else {
$pos = strrpos($fileName, '.');
$baseFile = substr($fileName, 0, $pos);
}
return [$baseFile, $extension];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDefaultExtension(): string\n {\n return $this->defaultExtension;\n }",
"public function extension($filename, &$base = NULL) {\n\t\t$split = split('\\.', $filename);\n\t\t$last = '';\n\t\t$accum = '';\n\t\tforeach ($split as $str) {\n\t\t\tif ($last) {\n\t\t\t\t$accum .= $last . \".\";\n\t\t\t}\n\t\t\t$last = $str;\n\t\t}\n\t\t$base = $accum;\n\t\treturn strtoupper($last);\n\t}",
"public function getImageDefaultFileExtension(): string\n {\n return $this->imageDefaultFileExtension;\n }",
"abstract protected function getFileExtension();",
"abstract function getExtension(): string;",
"public function getFileExtension();",
"public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }",
"abstract public function getExtensionName();",
"function getFileNameWithExtension()\n {\n return $this->fileNameWithExt;\n }",
"public function getFileExtension(){\n\n if($this->isPhoto()){\n return \"jpg\";\n }\n\n if($this->isVideo()){\n return \"mp4\";\n }\n\n return \"bin\";\n\n }",
"public function getFileExtension() {\n\t\t$pathInfo = pathinfo($this->filename);\n\t\tif (!isset($pathInfo['extension'])) {\n\t\t\treturn '???';\n\t\t} else {\n\t\t\treturn $pathInfo['extension'];\n\t\t}\n\t}",
"public function getExtension() {\n\t\t\n\t\t$filename = $this->file['name'];\n\t\t\n\t\t$parts = explode('.', $filename);\n\t\t$extension = end($parts);\n\t\t\n\t\treturn strtolower($extension);\n\t\t\n\t}",
"function getExtension() ;",
"public function getExtension()\n {\n return substr(strrchr($this->getBasename(), '.'), 1);\n }",
"public function resolveExtension()\n {\n if (($pos = strrpos($this->path, '.')) !== false) {\n return substr($this->path, $pos + 1);\n }\n\n return '';\n }",
"public function getExtension() : string;",
"public function extension($default = null)\n {\n if (!$this->extension) {\n $this->extension = $default;\n }\n\n return $this->extension;\n }",
"function getExt($file) \n\t{\n\t\t$dot = strrpos($file, '.') + 1;\n\t\treturn substr($file, $dot);\n\t}",
"public abstract function getExtension();",
"public function getFileExtension(): string\n {\n return $this->fileExtension;\n }",
"public function getExtension();",
"public function getExtension();",
"public function getExtension();",
"function getTargetFileExtension() ;",
"function GetExt($file){\n return substr($file, strrpos($file,'.') + 1);\n}",
"protected function getExt(string $file, string $default = null): ?string\n {\n $pos = strrpos($file, '.');\n if (false !== $pos) {\n return strtolower(substr($file, $pos + 1));\n } else {\n return $default;\n }\n }",
"public function getExtension()\n {\n return $this->fileExtension;\n }",
"public function getExtension() {\n\t\treturn CFileHelper::getExtension($this->getName());\n\t}",
"public function getExtension()\n {\n return $this->file->getExtensionName();\n }",
"public function getExtension() {}",
"public function getExtension() {}",
"public function getExtension()\n {\n return $this->_path['extension'];\n }",
"public function getFileExtension()\n {\n return $this->fileExtension;\n }",
"public function getFileExtension()\n {\n return $this->fileExtension;\n }",
"public function getFileExtension()\n\t{\n\t\treturn $this->fileExtension;\n\t}",
"public function getExtensionName() {}",
"static public function getExtension($filename) {\r\n\t\t// 1. The \"explode/end\" approach\r\n\t\t//$ext = end(explode('.', $filename));\r\n\t\t// 2. The \"strrchr\" approach\r\n\t\t//$ext = substr(strrchr($filename, '.'), 1);\r\n\t\t// 3. The \"strrpos\" approach\r\n\t\t//$ext = substr($filename, strrpos($filename, '.') + 1);\r\n\t\t// 4. The \"preg_replace\" approach\r\n\t\t//$ext = preg_replace('/^.*\\.([^.]+)$/D', '$1', $filename);\r\n\t\t// 5. The \"pathinfo\" approach\r\n\t\t$ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n\t\t\r\n\t\t/*\r\n\t\t// OLD STYLE\r\n\t\t$i = strrpos($filename, \".\");\r\n\t\tif (!$i) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$l = strlen($filename) - $i;\r\n\t\t$ext = substr($filename, $i + 1, $l);\r\n\t\t*/\r\n\t\t\r\n\t\treturn strtolower($ext);\r\n\t}",
"public function extension() : string {\n return $this->file->extension;\n }",
"function getExtension($filename = null)\n{\n\tif($filename != '') {\n\t\treturn pathinfo($filename, PATHINFO_EXTENSION);\n\t}\n\treturn null;\n}",
"public function guessExtension();",
"public function getExtension(): string\n {\n return $this->extension;\n }",
"public function getExtension(): string\n {\n return $this->extension;\n }",
"function getext($in_file)\n{\n\tif (end(explode('.',$in_file)) != $in_file)\n\t{\n\t\treturn(strtolower(end(explode('.',$in_file))));\n\t}\n\treturn \"\";\n\t\n}",
"public function getExt()\n {\n $type = $this->getType();\n if ($type === 'style') {\n return 'css';\n } elseif ($type === 'script') {\n return 'js';\n } elseif ($type === 'image') {\n return pathinfo($this->getSourcePath(), PATHINFO_EXTENSION);\n }\n }",
"private function get_ext( $filename='' )\n\t{\n\t\treturn substr( $filename, strrpos( $filename, '.' ) + 1);\t\n\t}",
"public function getExtension(): string\n {\n return pathinfo($this->getRelativePath(), PATHINFO_EXTENSION);\n }",
"public function getExtension()\n {\n return $this->file['extension'];\n }",
"function file_ext($filename) {\n\t if( !preg_match('/./', $filename) ) return '';\n\t return preg_replace('/^.*./', '', $filename);\n\t}",
"public function get_file_extension () {\r\n\t\treturn $this->_file_extension;\r\n\t}",
"function getExt($filename){\n return strtolower(substr(strrchr($fileName, '.'), 1));\n}",
"public function getExtension() : string\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }",
"public function getFileExtension()\n {\n return $this->_fileExtension;\n }",
"public function basename($ext = true) {\n\t\t$basename = parent::get('basename'); \n\t\tif(!$ext) $basename = basename($basename, \".\" . $this->ext());\n\t\treturn $basename;\n\t}",
"public function getExtensionFromName()\n {\n $vars = explode('.', $this->getClientFilename());\n return strtolower(array_pop($vars));\n }",
"public function getExtension(): string\n {\n return pathinfo($this->getFilename(), PATHINFO_EXTENSION);\n }",
"function getExtension($filename) {\n\treturn substr(strrchr($filename,'.'),1);\n}",
"public function getFileExtension()\n {\n return $this->originalAsset->getFileExtension();\n }",
"public function getOriginalExtension(): string\n {\n return pathinfo($this->originalName, PATHINFO_EXTENSION);\n }",
"protected function determineTargetFileExtension() {}",
"private function getBaseName() {\n\t\treturn pathinfo( $this->getImportFilePath(), PATHINFO_FILENAME );\n\t\t;\n\t}",
"function ext_get( $filename ) {\n\n return strtolower( str_replace( '.', '', strrchr( $filename, '.' ) ) );\n\n }",
"public function getExtension(): string\n {\n return $this->getMeta()->getExtension();\n }",
"function file_get_extension($filename)\r\n\t{\r\n\t\treturn substr($filename, strrpos($filename, \".\") + 1, strlen($filename));\r\n\t}",
"public function getTargetFileExtension() {}",
"public function getTargetFileExtension() {}",
"function get_extension($file)\n{\n return substr(strrchr($file, '.'), 1);\n}",
"public function getExtension()\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }",
"public function getExtension()\n {\n return File::get_file_extension($this->getField('Name'));\n }",
"public function getExt()\n {\n $filename = $this->getPath(); \n return pathinfo($filename, PATHINFO_EXTENSION);\n }",
"private static function with_extension($file, $ext)\n {\n $info = pathinfo($file);\n if (empty($info['extension'])) {\n return \"{$file}.{$ext}\";\n }\n\n return $file;\n }",
"public function getExtension()\r\n {\r\n return pathinfo($this->filename, PATHINFO_EXTENSION);\r\n }",
"function file_extension($filename)\n\t\t{\n\t\t\t$fileparts = explode(\".\", $filename);\n\t\t\t$more_check = strpos(strtolower(end($fileparts)), '?');\n\t\t\tif ($more_check != false) {\n\t\t\t\t\n\t\t\t\treturn substr(strtolower(end($fileparts)),0, $more_check );\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\treturn strtolower(end($fileparts));\n\t\t}\n\t\t}",
"function get_file_extension($path, $leading_dot = false) {\n $filename = basename($path);\n $dot_offset = (boolean) $leading_dot ? 0 : 1;\n \n if( ($pos = strrpos($filename, '.')) !== false ) {\n return substr($filename, $pos + $dot_offset, strlen($filename));\n } // if\n \n return '';\n }",
"function getFileExtension($file)\n{\n $tmp = explode(\".\", $file);\n $extension = end($tmp);\n return $extension ? $extension : null;\n}",
"function file_ext($file) {\n return strtolower(pathinfo($file, PATHINFO_EXTENSION));\n }",
"public function getBasename()\n\t{\n\t\treturn $this->getFilename().'.'.$this->getExtension();\n\t}",
"function get_file_extension($file_name) \n{\n return substr(strrchr($file_name,'.'),1);\n}",
"public function extension()\n {\n return '';\n }",
"function get_file_extension($file) {\n $temp_vals = explode('.',$file);\n $file_ext = strtolower(rtrim(array_pop($temp_vals)));\n unset ($temp_vals);\n return ($file_ext);\n}",
"public function getExtension()\n\t{\n\t\treturn pathinfo($this->path, PATHINFO_EXTENSION);\n\t}",
"public function getExtension()\n\t{\n\t\treturn null;\n\t}",
"public function getExtension()\n\t{\n\t\treturn null;\n\t}",
"function getFileExtension($file, $withdot=false)\n{\n if($withdot)\n return strtolower(substr($file, strrpos($file,\".\")));\n else\n return strtolower(substr($file, strrpos($file,\".\")+1));\n}",
"public function get_extension()\n {\n }",
"public function getExtension($name) {}",
"private function getExt($file) {\n\n\t\t$info = pathinfo($file);\n\t\treturn $info['extension'];\n\t}",
"function get_file_extension($file){\n\t$tmp = explode('.',$file);\n\treturn strtolower(end($tmp)) ;\n}",
"function get_file_extension($file_name) {\n return substr(strrchr($file_name,'.'),1);\n}",
"public function getBaseName(): string;",
"function getFileExtension($fileName)\n{\n\t$pos = strrpos($fileName, \".\");\n\tif( $pos === FALSE ) \n\t\treturn \"\";\n\t\t\n\treturn substr($fileName, $pos + 1);\n}",
"public function extension($filePath);",
"public static function fromExtension(string $extension):string;",
"function get_file_extension($file_name) {\n if(empty($file_name) OR !is_string($file_name)) {\n return false;\n }\n return strtolower(substr(strrchr($file_name,'.'), 1));\n}",
"public function getExt(): string\n {\n return (string)$this->env['EXT'];\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 }",
"public function baseFile()\n\t{\n\t\treturn $this->baseFile;\n\t}",
"function wp_get_default_extension_for_mime_type($mime_type)\n {\n }",
"function get_file_extension($file_name) {\n\treturn substr(strrchr($file_name,'.'),1);\n }",
"function ext($filedata) {\r\n return strtolower(trim(strrchr($filedata['name'], '.'), '.'));\r\n }",
"public function getFileExtension()\n {\n return $this->getUserOS() == 'win' ? '.exe' : '';\n }",
"function getExtension($filename)\n{\n\t$info = pathinfo($filename);\n\treturn $info['extension'];\n}"
] | [
"0.74614495",
"0.7353801",
"0.7165537",
"0.7159991",
"0.71560484",
"0.710744",
"0.70692104",
"0.7060511",
"0.701692",
"0.69963354",
"0.69733214",
"0.69395614",
"0.6939132",
"0.6891156",
"0.68670905",
"0.6850086",
"0.68484116",
"0.684472",
"0.6822626",
"0.6804455",
"0.6802495",
"0.6802495",
"0.6802495",
"0.6800072",
"0.6782042",
"0.6777906",
"0.67646545",
"0.6756769",
"0.6746873",
"0.67402333",
"0.6739539",
"0.6729464",
"0.6702987",
"0.6702987",
"0.66958815",
"0.66896874",
"0.66800916",
"0.66588855",
"0.66501904",
"0.66464",
"0.66423374",
"0.66423374",
"0.6638948",
"0.66339344",
"0.66315806",
"0.662082",
"0.66188437",
"0.6614835",
"0.66138303",
"0.66125816",
"0.66025877",
"0.6601116",
"0.6590255",
"0.6573922",
"0.6570971",
"0.6559129",
"0.6558688",
"0.65440416",
"0.6537315",
"0.65343297",
"0.65325016",
"0.65300626",
"0.6515209",
"0.65018994",
"0.65006036",
"0.64911395",
"0.6489901",
"0.64886683",
"0.6466868",
"0.64599276",
"0.6458354",
"0.64532226",
"0.64463013",
"0.6442835",
"0.64426345",
"0.6436525",
"0.64241546",
"0.6423122",
"0.64169",
"0.6415006",
"0.6414543",
"0.6414543",
"0.63998044",
"0.6396352",
"0.63921285",
"0.6365921",
"0.63658845",
"0.63646996",
"0.63637096",
"0.6352987",
"0.63444877",
"0.63422936",
"0.6337456",
"0.6335604",
"0.63279253",
"0.6324126",
"0.6321948",
"0.6318591",
"0.63132083",
"0.6304068",
"0.6302962"
] | 0.0 | -1 |
Get the datasource for the model. | public function getDatasource()
{
return static::resolveDatasource($this->datasource);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }",
"public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}",
"public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}",
"public static function getDataSource()\n {\n return static::$_dataSource;\n }",
"public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }",
"function getDataSource() { return $this->_datasource; }",
"function getDataSource() {return $this->_datasource;}",
"public function getResourceDataSource()\n\t{\n\t\tif ($this->_resourceDataSource === null)\n\t\t{\n\t\t\t$this->_resourceDataSource = new Application_Model_ResourceMapper;\n\t\t}\n\t\t\n\t\treturn $this->_resourceDataSource;\n\t}",
"function readDataSource() {return $this->_datasource;}",
"public function getDatasourceName()\n {\n return $this->datasource;\n }",
"public function getDataSourceHandler()\n {\n return $this->DataSourceInstance->getDataSourceHandler();\n }",
"public function getDatasourceRepository()\n {\n return $this->datasourceRepository;\n }",
"protected function getActiveDatasource()\n {\n return $this->datasources[$this->activeDatasourceKey];\n }",
"public function getDatasources()\n {\n return $this->datasources;\n }",
"public function getDataSourceDefinition()\n {\n return $this->data_source_definition;\n }",
"public static function resolveDatasource($datasource = null)\n {\n return static::$resolver->datasource($datasource);\n }",
"public function getDataSourceView();",
"public function getRulesDatasource() {\n\t$model = new Doctrine(\n\t\t$this->aclRuleDao->createQueryBuilder('rule'));\n\treturn $model;\n }",
"public function getDataSourceType();",
"public function datasource() { \n return $this->HasMany('App\\Datasource');\n }",
"public function getDataSourcesList() {\n return $this->_get(1);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public static function getDataSourceKey()\n {\n return self::getConfig()->get('dataSourceKey');\n }",
"public function getDataSourcesList() {\n return $this->_get(8);\n }",
"public static function getDatasourceResolver()\n {\n return static::$resolver;\n }",
"public function getRoleDataSource()\n\t{\n\t\tif ($this->_roleDataSource === null)\n\t\t{\n\t\t\t$this->_roleDataSource = new Application_Model_RoleMapper;\n\t\t}\n\t\t\n\t\treturn $this->_roleDataSource;\n\t}",
"public function getDataSourceCollection(): SourceCollection {\n\n return $this->dataSourceCollection;\n\n }",
"public function getDataSourcesList() {\n return $this->_get(10);\n }",
"public static function dataSource($args)\n\t{\n\t\t$args = func_get_args();\n\t\treturn self::getConnection()->dataSource($args);\n\t}",
"public static function on($datasource = null)\n {\n // First we will just create a fresh instance of this model, and then we can\n // set the datasource on the model so that it is be used for the queries.\n $instance = new static;\n\n $instance->setDatasource($datasource);\n\n return $instance;\n }",
"protected function getModelConfiguration()\n {\n return app('sleeping_owl')->getModel(get_class($this->getModel()));\n }",
"protected function getDefaultDataSource() {\r\n return new \\Yourface\\NiftyGrid\\ArrayDataSource($this->data);\r\n }",
"public function getModel()\n {\n return $this->_model;\n }",
"protected function getDatasource(Source $source) {\n\t\t$datasource = $source->getDatasource();\n\t\tif (is_numeric($datasource)) {\n\t\t\t$datasource = $this->simu->getDatasourceById((int)$datasource);\n\t\t} else {\n\t\t\t$datasource = $this->simu->getDatasourceByName($datasource);\n\t\t}\n\t\treturn $datasource;\n\t}",
"public function getModel() {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getModel()\n {\n return $this->model;\n }",
"public function getAdapter()\n\t{\n\t\treturn $this->config['adapter'];\n\t}",
"public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }",
"public function getModel() {\n\t\treturn $this->_model;\n\t}",
"public static function getModel()\n {\n return self::$model;\n }",
"protected function _model() {\n\t\treturn $this->_container->model;\n\t}",
"public function fetchDataTableSource()\n { \n $dataTableConfig = [\n 'searchable' => [\n 'title' \n ]\n ];\n\n return SpecificationPreset::with([\n 'presetItem' => function($query) {\n $query->with('specification');\n }\n ])->dataTables($dataTableConfig)->toArray();\n }",
"protected function _getConfigModel()\n {\n if (!$this->hasConfigModel()) {\n $this->setConfigModel(Mage::getConfig());\n }\n\n return $this->getConfigModel();\n }",
"public function getModel() {\n\t\treturn $this->model;\n\t}",
"protected function _getModel() {\n\n\t\t$config = Configure::read('Leaflet.model');\n\n\t\tif (!is_array($config) && strpos($config, '.')) {\n\t\t\t$config = explode('.', $config);\n\t\t}\n\n\t\tif (is_array($config)) {\n\t\t\tlist($plugin, $model) = $config;\n\t\t} else {\n\t\t\t$model = $config;\n\t\t}\n\n\t\t$model = ClassRegistry::init((!empty($plugin) ? $plugin . '.' : '') . $model);\n\n\t\tif (!$model->hasMethod('_findPlots')) {\n\t\t\t$model->Behaviors->attach('Leaflet.Plottable');\n\t\t}\n\n\t\treturn $model;\n\t}",
"public function getDataSourceData(UiComponentInterface $component);",
"public function Source(){\n return $this->connection;\n }",
"protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }",
"protected function getAdapter()\n {\n return $this->getConnection()->getConnection();\n }",
"public function getModel(){\n\t\treturn $this->model;\n\t}",
"public function getAdapter(){\n return $this->sm->get('Zend\\Db\\Adapter\\Adapter');\n }",
"public function model()\n {\n return $this->resource;\n }",
"public function getModel()\n {\n\treturn $this->model;\n }",
"public function getResource()\n {\n return $this->dbh;\n }",
"public function getModel()\n {\n return $this->row->getModel();\n }",
"public function getModel()\n\t{\n\t\treturn $this->_model;\n\t}",
"public function getModel()\n\t{\n\t\treturn $this->_model;\n\t}",
"protected function getModel()\n {\n return App::make($this->getModelNamespace());\n }",
"public function getModel()\n {\n if (! $this->_model) {\n $this->_model = $this->createModel();\n }\n\n return $this->_model;\n }",
"public function model()\n {\n return $this->model;\n }",
"public function entity()\n {\n return $this->model;\n }",
"public function getDataProvider() {\n\t\tif (!$this->dataProvider) {\n\t\t\t/** @var Dispatcher $dispatcher */\n\t\t\t$dispatcher = $this->dispatcher ? $this->dispatcher : Dispatcher::getSharedDispatcher();\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Data Provider\n\t\t\t$dataProviderClass = 'Tx_' . $extension . '_Rest_DataProvider';\n\t\t\tif (!class_exists($dataProviderClass)) {\n\t\t\t\t$dataProviderClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\DataProvider';\n\t\t\t}\n\t\t\t// Get the specific builtin Data Provider\n\t\t\tif (!class_exists($dataProviderClass)) {\n\t\t\t\t$dataProviderClass = 'Cundd\\\\Rest\\\\DataProvider\\\\' . $extension . 'DataProvider';\n\t\t\t\t// Get the default Data Provider\n\t\t\t\tif (!class_exists($dataProviderClass)) {\n\t\t\t\t\t$dataProviderClass = 'Cundd\\\\Rest\\\\DataProvider\\\\DataProviderInterface';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->dataProvider = $this->get($dataProviderClass);\n\t\t}\n\t\treturn $this->dataProvider;\n\t}",
"public function getPrivilegeDataSource()\n\t{\n\t\tif ($this->_privilegeDataSource === null)\n\t\t{\n\t\t\t$this->_privilegeDataSource = new Application_Model_PrivilegeMapper;\n\t\t}\n\t\t\n\t\treturn $this->_privilegeDataSource;\n\t}",
"public function getModel() : Model\n {\n return $this->model;\n }",
"public function getModel()\n\t{\n\t\treturn $this->model;\n\t}",
"private function _getModel()\n {\n if (NULL === $this->_model) {\n $this->_model = new Model();\n }\n\n return $this->_model;\n }",
"protected function _getSource()\n {\n if (!$this->_source) {\n Mage::throwException(Mage::helper('importexport')->__('No source specified'));\n }\n return $this->_source;\n }",
"public function dataSource(Id $dataSource = null)\n {\n if(null === $dataSource)\n {\n return $this->child('dataSource');\n }\n return $this->child('dataSource', $dataSource);\n }",
"protected function _getSourceAdapter($sourceFile)\n {\n return Mage_ImportExport_Model_Import_Adapter::findAdapterFor($sourceFile);\n }",
"public function setDatasource($name)\n {\n $this->datasource = $name;\n\n return $this;\n }",
"public function getModel()\n {\n if (array_key_exists(\"model\", $this->_propDict)) {\n return $this->_propDict[\"model\"];\n } else {\n return null;\n }\n }",
"public function getModel()\n {\n if (array_key_exists(\"model\", $this->_propDict)) {\n return $this->_propDict[\"model\"];\n } else {\n return null;\n }\n }",
"private function getModel(): ParseDataProvider\n {\n return $this->model;\n }",
"public function getModelLocator()\n\t{\n\t\treturn $this->_modelLocator;\n\t}",
"public function getAdapter()\n {\n return $this->adapter;\n }",
"public function getAdapter()\n {\n return $this->adapter;\n }",
"public function getAdapter()\n {\n return $this->adapter;\n }",
"public function getAdapter()\n {\n return $this->adapter;\n }"
] | [
"0.81560904",
"0.7850819",
"0.7822307",
"0.7822307",
"0.75623393",
"0.75285554",
"0.74616975",
"0.7349357",
"0.73254824",
"0.70100415",
"0.6938118",
"0.6829179",
"0.6781077",
"0.66445446",
"0.6520051",
"0.6385831",
"0.63659734",
"0.63550323",
"0.62827635",
"0.628099",
"0.62531644",
"0.62103707",
"0.61985797",
"0.6080997",
"0.5922364",
"0.5922364",
"0.5922364",
"0.5922364",
"0.5905979",
"0.5867995",
"0.5820951",
"0.5815249",
"0.578982",
"0.572767",
"0.56805927",
"0.56651783",
"0.56641203",
"0.5642073",
"0.56060183",
"0.55790514",
"0.55548334",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.55416924",
"0.552318",
"0.55100197",
"0.55048776",
"0.5497656",
"0.5466404",
"0.54599154",
"0.54503506",
"0.54498446",
"0.5447495",
"0.54253536",
"0.5388475",
"0.53877926",
"0.53877926",
"0.5373496",
"0.53723836",
"0.5364542",
"0.5355733",
"0.53400546",
"0.53398365",
"0.53363687",
"0.53363687",
"0.53293234",
"0.5300523",
"0.52994365",
"0.5295206",
"0.527662",
"0.52754265",
"0.527266",
"0.5267893",
"0.5266913",
"0.52621174",
"0.52615666",
"0.52530986",
"0.5240126",
"0.52398723",
"0.52398723",
"0.5239401",
"0.5237034",
"0.52351713",
"0.52351713",
"0.52351713",
"0.52351713"
] | 0.7788266 | 4 |
Get the current datasource name for the model. | public function getDatasourceName()
{
return $this->datasource;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getDataSourceName() {\r\n // Example: Use a local SQLite3 database\r\n return 'sqlite:' . dirname(__FILE__) . '/counter.sqlite3';\r\n \r\n // Example use mySQL\r\n // return 'mysql:host=localhost;port=3306;dbname=demo';\r\n }",
"public static function getDataSourceKey()\n {\n return self::getConfig()->get('dataSourceKey');\n }",
"public function getDataSourceName()\n {\n return t(\"Test Data Source\");\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }",
"public function getModelName() {\n\t\treturn $this->getSourceName();\n\t}",
"public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }",
"public function getModelName()\n {\n return $this->getConfig()->modelName;\n }",
"public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }",
"public function getName()\r\n\t{\r\n\t\treturn $this->_modelName;\r\n\r\n\t}",
"public function getDataSourceDefinition()\n {\n return $this->data_source_definition;\n }",
"public function getModelName()\n {\n return $this->getModel()->name;\n }",
"public function getName()\n\t{\n\t\treturn $this->neoeloquent->getConfigOption('name');\n\t}",
"protected function getActiveDatasource()\n {\n return $this->datasources[$this->activeDatasourceKey];\n }",
"public function getModel()\n\t{\n\t\treturn $this->resource->name;\n\t}",
"public function getSourceName() {\n return $this->source;\n }",
"public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }",
"public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}",
"public function key()\n\t{\n\t\treturn $this->datasource->key();\n\t}",
"public function getName()\n {\n return empty($this->model->name) ? $this->id : $this->model->name;\n }",
"public function getModelName() : string\n {\n $config_key = 'scheduleable.repositories.' . snake_case(class_basename(static::class)) . '.model_class';\n return config($config_key);\n }",
"public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}",
"public function getConnectionName()\n {\n return config('profiler.storage.database.connection');\n }",
"public function getName()\n {\n return $this->dataProvider;\n }",
"public function getAdapterName()\n {\n return $this->adapterName;\n }",
"function getDataSource() { return $this->_datasource; }",
"public function getDataSourceType();",
"public function modelName(): string\n {\n return class_basename($this->model);\n }",
"public function getResourceName()\n {\n return static::$resource ?: strtolower($this->getEntityName());\n }",
"public function getModelName()\n {\n return self::$modelName;\n }",
"public function getConnectionName()\n {\n return $this->connectionName;\n }",
"public static function dataSourceName(string $project, string $dataSource): string\n {\n return self::getPathTemplate('dataSource')->render([\n 'project' => $project,\n 'data_source' => $dataSource,\n ]);\n }",
"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 static function getDataSource()\n {\n return static::$_dataSource;\n }",
"public function getConnectionName()\n {\n return config('telescope.storage.database.connection');\n }",
"function dbName()\n\t{\n\t\t$dsn = $this->dsnArray();\n\t\tif (empty($dsn))\n\t\t\treturn null;\n\t\treturn $dsn['dbname'];\n\t}",
"private function getModelName() : string\n {\n return collect(explode('\\\\', get_class($this)))->last();\n }",
"public function getConnectionName()\n {\n return $this->connection;\n }",
"public function getConnectionName()\n {\n return $this->connection;\n }",
"function getAdapterName();",
"public function getConnectionName()\n\t{\n\t\treturn empty($this->db_conn) ? $this->db_conn_name : $this->getConnection()->getName();\n\t}",
"function getDataSource() {return $this->_datasource;}",
"public function getName()\n {\n return $this->getConfig ( 'name' );\n }",
"public function getConnectionName()\n {\n return config('yotpo.database.connection') ?? $this->connection;\n }",
"public function Get_ConnectionName()\r\n\t{\r\n\t\treturn $this->_dbCatalog;\r\n\t}",
"public function getModelName();",
"private function getModelName()\n {\n $function = new \\ReflectionClass( $this->model ); \n return $function->getShortName();\n }",
"public function getClassName()\n {\n $adapter = $this->getAdapter();\n\n if ($adapter) {\n return $adapter;\n }\n\n $scheme = $this->dsn->scheme;\n\n return 'Cake\\Log\\Engine\\\\' . ucfirst($scheme) . 'Log';\n }",
"public static function getNameModel()\n {\n return Yii::t('app', 'My model');\n }",
"protected function getCrudName(): string\n {\n return strtolower(Str::plural(class_basename($this->option('model'))));\n }",
"protected function getModelName()\n {\n $fullyQualifiedClassName = substr(static::class, 0, -10); // \\App\\Repositories\\{name}Repository => \\App\\Repositories\\{name}\n $nameArray = explode('\\\\', $fullyQualifiedClassName); // [App, Repositories, {name}]\n return array_pop($nameArray); // {name}\n }",
"public function getModelName() ;",
"public function getConnectionName()\n {\n return config('google-ads-api.database.connection') ?? $this->connection;\n }",
"public function getName()\n {\n return $this->getConfig('name');\n }",
"public function getModel(): string\n {\n return $this->model;\n }",
"public function getModel(): string\n {\n return $this->model;\n }",
"public function getModel(): string\n {\n return $this->model;\n }",
"public function getDriverName()\n {\n return $this->getConfig('driver');\n }",
"public function getModelName()\n {\n if (!$name = $this->modelName) {\n $tableName = $this->getName();\n\n $modelNames = [];\n foreach (explode('_', $tableName) as $word) {\n $modelNames[] = ucfirst(Inflector::singularize($word));\n } //foreach\n $modelName = implode('', $modelNames);\n\n $this->setModelName($name = ucfirst($this->isReservedPHPWord($modelName) ? $tableName : $modelName));\n } // if\n\n return $name;\n }",
"public function getSource()\n {\n return 'tb_telco_config';\n }",
"public function getDatabaseName()\n {\n return $this->connection->getDatabase();\n }",
"public function getDbName()\n\t{\n\t\treturn $this->db_name;\n\t}",
"function dbName()\n{\n\treturn $this->drv->dbName();\n}",
"public function resourceLabel(): string\n {\n return $this->model->name;\n }",
"public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}",
"protected function modelClassName()\n {\n if (!$this->isValidModelName()) return null;\n\n return str_replace('{model}', $this->modelName, $this->modelPath);\n }",
"public function getConnectionName();",
"public function getConnectionName();",
"public function getConnectionName();",
"public static function getModelName() {\r\n\t\t\treturn static::ModelName;\r\n\t\t}",
"public function dbname() {\n return $this->db['dbname'];\n }",
"public function getName()\n {\n return $this->getAttributeModel()->getStoreLabel();\n }",
"protected function getShortModel(): string\n {\n return class_basename($this->option('model'));\n }",
"public function getModelId() {\n\t\treturn $this->getSourceId();\n\t}",
"public function getName() {\n\t\treturn $this->config->get('name');\n\t}",
"public function getConnectionName() {\n\t\treturn null;\n\t}",
"public function getDSN()\n {\n return $this->dsn;\n }",
"protected function get_model_name()\n {\n }",
"public function getDBName(){\n\n\t\treturn $this->_database;\n\t}",
"public function database_name()\n\t{\n\t\treturn $this->database_name;\n\t}",
"function get_name()\n {\n return $this->get_default_property(self :: PROPERTY_NAME);\n }",
"public function getSource()\n {\n return 'tb_resource';\n }",
"public function getNameAttribute(): string\n {\n return $this->config['name'];\n }",
"protected function getModelName()\n {\n return ucwords(str_singular(camel_case($this->meta['table'])));\n }",
"public static function defaultConnectionName(): string\n {\n $namespaceParts = explode('\\\\', static::class);\n $plugin = current(array_slice(array_reverse($namespaceParts), 3, 2));\n\n if ($plugin === 'App') {\n return 'webservice';\n }\n\n return Inflector::underscore($plugin);\n }",
"public function getName()\n {\n return $this->alias;\n }",
"public static function model(): string\n {\n return static::$model;\n }",
"public function getInstanceName()\n {\n return $this->instanceName;\n }",
"public function getInstanceName()\n {\n return $this->instanceName;\n }",
"Public Function getDSN() {\n\t\tIf($this->driver == 'sqlite' || $this->driver == 'sqlite2')\n\t\t\tReturn $this->driver.':'.$this->getDatabaseName();\n\t\tElseIf($this->driver == 'pgsql')\n\t\t\tReturn sprintf ( \"pgsql:dbname=%s;user=%s;password=%s;host=%s\",\n\t\t\t\t$this->getDatabaseName(), $this->getUsername(), $this->getPassword(), $this->getHostname() );\n\t\tElse Return $this->driver.':host='.$this->getHostname().';dbname='.$this->getDatabaseName();\n\t}",
"public function getSourceIdentifier(): ?string\n {\n return isset($this->configurationData['tableName'])\n ? $this->configurationData['tableName']\n : null;\n }",
"private function get_DB_name() {\n global $CFG;\n return $CFG->dbname;\n }",
"public static function getName(ModelInterface $model) : string\n {\n return strtolower($model->getSource());\n }",
"public function getDatabaseName()\n {\n return $this->databaseName;\n }",
"public function getDisplayNameSourceFieldConf(): string\n {\n if ($displayTitle = $this->getField('DisplayNameSourceFieldConf')) {\n return $displayTitle;\n }\n\n if ($this->ParentID) {\n return self::INHERIT;\n }\n\n return self::SINGULAR;\n }",
"function getName() {\n return $this->instance->getName();\n }",
"final public function getDBname() {\n \t\treturn $this->dbase;\n }",
"public function getResourceName()\n {\n return $this->resource_name;\n }",
"public function getDefaultConnectionName(): string\n {\n return $this->default;\n }"
] | [
"0.7160904",
"0.7128389",
"0.7120785",
"0.6970749",
"0.6970749",
"0.686984",
"0.6869673",
"0.6817336",
"0.67749864",
"0.6697576",
"0.65902865",
"0.64754593",
"0.64501506",
"0.644604",
"0.639903",
"0.63811195",
"0.6365092",
"0.63477874",
"0.634556",
"0.63448626",
"0.6340736",
"0.6334531",
"0.6331474",
"0.6273526",
"0.62717026",
"0.6256558",
"0.62561685",
"0.62508696",
"0.6246716",
"0.6193622",
"0.61921835",
"0.6142748",
"0.609615",
"0.6075131",
"0.6045887",
"0.6037138",
"0.6033096",
"0.60303783",
"0.6026925",
"0.6026925",
"0.6022095",
"0.6011549",
"0.60044104",
"0.6001887",
"0.5989223",
"0.5985304",
"0.5982428",
"0.5978374",
"0.59732926",
"0.59731203",
"0.5971836",
"0.59467643",
"0.59451586",
"0.5942497",
"0.5939139",
"0.5936898",
"0.5936898",
"0.5936898",
"0.59249437",
"0.59232706",
"0.592303",
"0.5915626",
"0.5915223",
"0.5914337",
"0.5910921",
"0.5893125",
"0.5889278",
"0.58850294",
"0.58850294",
"0.58850294",
"0.58849347",
"0.58808535",
"0.587668",
"0.5860364",
"0.58572596",
"0.5852461",
"0.5851492",
"0.58494884",
"0.5846583",
"0.5845445",
"0.5840546",
"0.5838928",
"0.58378285",
"0.58357465",
"0.582651",
"0.582219",
"0.5820742",
"0.582048",
"0.58175915",
"0.58175915",
"0.58141345",
"0.58103687",
"0.5808869",
"0.5806487",
"0.5803873",
"0.57937676",
"0.5792433",
"0.5790259",
"0.57879156",
"0.57859606"
] | 0.8409692 | 0 |
Set the datasource associated with the model. | public function setDatasource($name)
{
$this->datasource = $name;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDatasource($datasource)\n {\n $this->datasource = $datasource;\n }",
"public function setDatasource($datasource = NULL)\n {\n\n //If there are no datasource, set it to an empty array\n if($datasource === NULL)\n {\n $datasource = array();\n }\n\n //Wrap the array into an iterator\n if(is_array($datasource))\n {\n $datasource = new \\ArrayIterator($datasource);\n }\n\n //Validate\n if(!($datasource instanceof \\Traversable))\n {\n throw new \\InvalidArgumentException('Datasource must be either an array or \\\\Traversable');\n }\n\n //Save the datasource\n $this->datasource = $datasource;\n \n }",
"function SetDatasource($ds)\r\n\t{\r\n\t\t$this->Datasource = $ds;\r\n\t\r\n\t\t//$repeater_outer =& $this->FindControl(\"rptRows\");\r\n\t\t//$repeater_outer->SetDatasource($ds);\r\n\t}",
"protected function _useSourceDatasource() {\n\n // Instantiate source datasource if it's not already instantiated\n if (is_null($this->_externalNewsSourceDatasource)) {\n $this->_externalNewsSourceDatasource = new Datasource_Cms_ExternalNews_Source();\n }\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function setDataSource($ds) {\n $this->payload['ds'] = $ds ;\n }",
"function getDataSource() { return $this->_datasource; }",
"public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }",
"function getDataSource() {return $this->_datasource;}",
"public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}",
"public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}",
"public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }",
"public static function setDataSource(string $serverName, DataSource $dataSource): void\n {\n self::$dataSources[$serverName] = $dataSource;\n }",
"public function SetDataSource(SetDataSource $parameters)\n {\n return $this->__soapCall('SetDataSource', array($parameters));\n }",
"public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }",
"public function setDataSource(IDataSource $dataSource)\n\t{\n\t\t$this->dataSource = $dataSource;\n\t\t$this->paginator->itemCount = count($dataSource);\n\t\treturn $this;\n\t}",
"protected function _useCategoryDatasource() {\n\n // Instantiate category datasource if it's not already instantiated\n if (is_null($this->_externalNewsCategoryDatasource)) {\n $this->_externalNewsCategoryDatasource = new Datasource_Cms_ExternalNews_Category();\n }\n }",
"protected function _prepareDataSource()\n {\n $studentDbTable = new Admin_Db_Table_Student();\n $this->setDataSource($studentDbTable->dataGrid());\n }",
"protected function _useItemDatasource() {\n\n // Instantiate item datasource if it's not already instantiated\n if (is_null($this->_externalNewsItemDatasource)) {\n $this->_externalNewsItemDatasource = new Datasource_Cms_ExternalNews_Item();\n }\n }",
"public function dataSource(array $value)\n {\n return $this->setProperty('dataSource', $value);\n }",
"public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }",
"public function setDataSrc($src)\n {\n $this->_dataSrc = $src;\n }",
"public function datasource() { \n return $this->HasMany('App\\Datasource');\n }",
"protected function setModel(): void\n {\n $this->model = Location::class;\n }",
"public function setModelName($modelName) {\n\t\t$this->setSourceName($modelName);\n\t}",
"public function getResourceDataSource()\n\t{\n\t\tif ($this->_resourceDataSource === null)\n\t\t{\n\t\t\t$this->_resourceDataSource = new Application_Model_ResourceMapper;\n\t\t}\n\t\t\n\t\treturn $this->_resourceDataSource;\n\t}",
"public static function getDataSource()\n {\n return static::$_dataSource;\n }",
"public function getDatasourceName()\n {\n return $this->datasource;\n }",
"public function setSource($sSource)\n {\n parent::setSource($sSource);\n }",
"function setSource($source){\n if($this->memorize){\n if (isset($_GET[$this->skip_var])){\n $this->skip=$this->memorize('skip', (int)$_GET[$this->skip_var]);\n } else {\n $this->skip=(int)$this->recall('skip');\n }\n }else{\n $this->skip=@$_GET[$this->skip_var]+0;\n }\n\n // Start iterating early ($source = DSQL of model)\n if($source instanceof SQL_Model){\n $source = $source->_preexec();\n }\n\n if($source instanceof DB_dsql){\n $source->limit($this->ipp, $this->skip);\n $source->calcFoundRows();\n $this->source = $source;\n\n }elseif($source instanceof Model){\n $this->source = $source->setLimit($this->ipp,$this->skip);\n\n }else{\n // NOTE: no limiting enabled for unknown data source\n $this->source =& $source;\n }\n }",
"public function setSource( $url ) {\n\t\t$this->source = $url;\n\t}",
"public function dataBind(&$dataSource);",
"public function setSource(Model $source)\n {\n $this->source = $source;\n\n return $this;\n }",
"protected function setSource($source) {}",
"protected function _prepareDataSource()\n {\n $studentDbTable = new Admin_Db_Table_Student();\n $this->setDataSource($studentDbTable->getByClasses(array($this->_options->classesId)));\n }",
"private function createDataSource()\n {\n $this->debug(\"Creating data source\");\n $this->dataSource = DataSourceRepository::createDataSource(\n $this->config['datasource']['key'],\n $this->config['datasource']['title'],\n 'SYSTEM'\n );\n $this->dataSource->setDataSourceAttribute(\"manual_publish\", 0);\n $this->dataSource->setDataSourceAttribute(\"qa_flag\", 0);\n\n $this->log(\"Data source {$this->dataSource->title}({$this->dataSource->data_source_id}) created\");\n }",
"public function setSource($source);",
"public static function on($datasource = null)\n {\n // First we will just create a fresh instance of this model, and then we can\n // set the datasource on the model so that it is be used for the queries.\n $instance = new static;\n\n $instance->setDatasource($datasource);\n\n return $instance;\n }",
"public function setDataSource(\\Brainloop\\Soap\\ArrayType\\ArrayOfServiceDataroomUser $dataSource = null)\n {\n if (is_null($dataSource) || (is_array($dataSource) && empty($dataSource))) {\n unset($this->DataSource);\n } else {\n $this->DataSource = $dataSource;\n }\n return $this;\n }",
"public static function setDatasourceResolver(Resolver $resolver)\n {\n static::$resolver = $resolver;\n }",
"public function dataBind(&$dataSource)\n {\n if (is_object($dataSource) === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'parameter = dataSource');\n \n if (ObjectIntrospector::isA($dataSource, 'Popo'))\n $objSource = $dataSource->toDataSource();\n else\n $objSource = $dataSource;\n \n if (ObjectIntrospector::isExtending($objSource, 'KeyedCollectionBase') === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'parameter = dataSource');\n \n // First, update the controls that are member-wise bindable\n $controlNames = $this->getChildren()->getImplementingControlNames(true, 'IBindingTargetMember');\n \n foreach ($controlNames as $controlName)\n {\n $control = $this->getChildren()->getControl($controlName, true);\n \n if ($control->getIsBindable() && $objSource->keyExists($control->getBindingMemberName()))\n {\n $control->setValue($objSource->getValue($control->getBindingMemberName()));\n }\n }\n \n // Now, bind the event values in the model\n $eventTriggerControlNames = $this->getChildren()->getEventTriggerControlNames();\n \n foreach ($eventTriggerControlNames as $controlName)\n {\n $control = $this->getChildren()->getControl($controlName, true);\n $eventValueKey = Controller::PREFIX_EVENTVALUE . $control->getName() . \"_\" . $control->getEventName();\n if ($objSource->keyExists($eventValueKey))\n {\n $control->setEventValue($objSource->getValue($eventValueKey));\n }\n }\n }",
"public function setResourceDataSource(Application_Model_MapperAbstract $dataSource)\n\t{\n\t\t$this->_resourceDataSource = $dataSource;\n\t\t\n\t\treturn $this;\n\t}",
"public function SetDataSources(SetDataSources $parameters)\n {\n return $this->__soapCall('SetDataSources', array($parameters));\n }",
"public function setModelEndpoint($model);",
"public function setData() {\n\t\t$this->import($this->get());\n\t}",
"public function setSource($source) {\n $this->source = $source;\n }",
"public function setSource($source) {\n $this->source = $source;\n }",
"public function setModel(Celsus_Model $model) {\n\t\t$this->_model = $model;\n\t}",
"protected function setModel(): void\n {\n $this->model = SchedulerCellLock::class;\n }",
"function readDataSource() {return $this->_datasource;}",
"public function setModel(Model $model);",
"public function setDataConnection(){\n \n \n }",
"protected function setModel()\n {\n $class = 'Src\\Modules\\\\' . $this->module_name . '\\Models\\\\' . $this->class . 'Model';\n $this->model = new $class;\n $this->model->setModuleName( $this->module_name );\n $this->model->run();\n }",
"public function setSource($source)\n {\n $this->source = $source;\n }",
"public function setSource($source)\n {\n $this->source = $source;\n }",
"public function setSource($source)\n {\n $this->source = $source;\n }",
"public function setSource($source)\n {\n $this->source = $source;\n }",
"public function getDatasources()\n {\n return $this->datasources;\n }",
"public static function resolveDatasource($datasource = null)\n {\n return static::$resolver->datasource($datasource);\n }",
"public function attachDatasource(DatasourceNode $datasource)\n {\n $this->datasources[$datasource->getPrimaryKey()] = $datasource;\n }",
"public function dataSource(Id $dataSource = null)\n {\n if(null === $dataSource)\n {\n return $this->child('dataSource');\n }\n return $this->child('dataSource', $dataSource);\n }",
"public function registerDataSource(string $name, SourceInterface $dataSource): void {\n\n $this->dataSourceCollection->registerDataSource($name, $dataSource);\n\n }",
"public function getDatasourceRepository()\n {\n return $this->datasourceRepository;\n }",
"public function setDatabaseConfig()\n {\n $this->_databaseConfig = Core_Model_Config_Json::getModulesDatabaseConfig();\n\n $this->_type = $this->_databaseConfig['type'];\n $this->_host = $this->_databaseConfig['host'];\n $this->_name = $this->_databaseConfig['name'];\n $this->_user = $this->_databaseConfig['user'];\n $this->_pass = $this->_databaseConfig['pass'];\n }",
"public static function dataSource($args)\n\t{\n\t\t$args = func_get_args();\n\t\treturn self::getConnection()->dataSource($args);\n\t}",
"protected function setModel(): void\n {\n $this->model = PurchaseOrder::class;\n }",
"function setSource($source,$fields=null){\n\n // Set DSQL\n if($source instanceof \\DB_dsql){\n $this->dq=$source;\n return $this;\n }\n // SimpleXML and other objects\n if(is_object($source)){\n if($source instanceof \\Model) throw $this->exception('Use setModel() for Models');\n if($source instanceof \\Controller) throw $this->exception('Use setController() for Controllers');\n if($source instanceof \\Iterator){\n $this->iter=$source;\n return $this;\n }\n\n // Cast non-iterable objects into array\n $source=(array)$source;\n }\n\n // Set Array as a data source\n if(is_array($source)){\n $m=$this->setModel('Model',$fields);\n if(is_array(reset($source))){\n $m->setSource('Array',$source);\n }else{\n $m->setSource('ArrayAssoc',$source);\n }\n\n return $this;\n }\n\n // Set manually\n $this->dq=$this->api->db->dsql();\n $this->dq\n ->table($source)\n ->field($fields?:'*');\n\n return $this;\n }",
"public function setModel($model)\n {\n $this->model = $model;\n $this->query['index'] = $this->model->getIndex();\n }",
"public function getDataSourceDefinition()\n {\n return $this->data_source_definition;\n }",
"public function SetDataSourceByID(SetDataSourceByID $parameters)\n {\n return $this->__soapCall('SetDataSourceByID', array($parameters));\n }",
"public function setup()\n {\n $dataModel = eval(\"?>\" . file_get_contents( $this->getDataModelFilename() ));\n if($dataModel instanceof DataModelInterface) {\n $dataModel = new ProjectData($dataModel);\n }\n $this->getEngine()->bindData($dataModel);\n $this->getEngine()->activate();\n }",
"public function setModel($model)\n {\n $this->model = $model;\n }",
"public function setModel($model)\n {\n $this->model = $model;\n }",
"public function initialize()\n {\n $this->setSource('sources');\n\n $this->hasMany(\n 'id',\n UserLinkedSources::class,\n 'source_id',\n ['alias' => 'linkedSource']\n );\n }",
"public function setSourceClient($sourceClient);",
"public function setModel($model)\n {\n $this->model = $model;\n }",
"public function setModel($model)\n {\n $this->model = $model;\n }",
"public function setModel($model){\n\t\t// import model\n\t\tif (is_string($model)) {\n\t\t\t$config = array(\n\t\t\t\t'class'\t=> $model\n\t\t\t);\n\t\t\t$this->_model = Yii::createComponent($config);\n\t\t} else if (is_array($model)) {\n\t\t\t$this->_model = Yii::createComponent($model);\n\t\t} else {\n\t\t\t$this->_model = $model;\n\t\t}\n\t}",
"public function setModel($model)\r\n {\r\n //Complete this function and assign model to Class Property $model\r\n $this->model = $model;\r\n }",
"public static function setDsn(string $dsn): void {\r\n self::$dsn = $dsn;\r\n }",
"public function setModel(Model $model){\n\n $this->model = $model;\n $this->from = $model->getTable();\n \n }",
"public function getDataSourceView();",
"function setSource($inSource) {\n\t\tif ( $inSource ) {\n\t\t\tif ( is_string($inSource) ) {\n\t\t\t\t$oSource = new systemLogSource();\n\t\t\t\t$oSource->setSource($inSource, false);\n\t\t\t} elseif ( $inSource instanceof systemLogSource ) {\n\t\t\t\t$oSource = $inSource;\n\t\t\t} elseif ( is_array($inSource) && count($inSource) > 0 ) {\n\t\t\t\t$oSource = new systemLogSource();\n\t\t\t\tforeach ( $inSource as $source => $value ) {\n\t\t\t\t\t$oSource->setSource($source, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( $oSource instanceof systemLogSource ) {\n\t\t\t\t$this->_Source = $oSource;\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"public function setModel(System_Database_Base $model){\n $this->_model = $model;\n \n return $this;\n }",
"public function testRegisterDataSource()\n {\n // Start of user code DataSourcesRegistryTest.testregisterDataSource\n $dataSource = new TestDataSource();\n $dataSource->setName('test');\n DataSourcesRegistry::registerDataSource($dataSource);\n $this->assertEquals($dataSource, DataSourcesRegistry::getDataSource('test'));\n // End of user code\n }",
"public function _setProps() {\n $dataController = get_called_class();\n $dataController::_getMapper();\n $dataController::_getModel();\n }",
"public function set()\n {\n\t\tif ($this->model->state())\n $this->model->set();\n }",
"public function setUserSources($val)\n {\n $this->_propDict[\"userSources\"] = $val;\n return $this;\n }",
"public function setModelName($modelName)\n {\n $this->_modelName = $modelName;\n }",
"public function source($source)\n {\n $this->query = $source;\n }",
"public function setSource($source)\n {\n if (\\File::exists($source)) {\n $remoteSource = basename($source);\n\n \\Storage::disk('blueprints')->put($remoteSource, file_get_contents($source));\n\n $source = $remoteSource;\n }\n\n $this->resource->source = $source;\n }",
"public function testGettingClearDataSource()\n {\n $dataSource = new TestDataSource();\n $dataSource->setName('test');\n DataSourcesRegistry::registerDataSource($dataSource);\n DataSourcesRegistry::clearDataSource('test');\n DataSourcesRegistry::getDataSource('test');\n }",
"public function fromSource($source)\n {\n constraint_mustBeGreaterThan($source, DataModel_Definition::SOURCE_START);\n constraint_mustBeLessThan($source, DataModel_Definition::SOURCE_END);\n\n $this->source = $source;\n\n // update the cache that Datastore_MetaRecord holds\n $oDef = DataModel_Definitions::getIfExists($this->modelName);\n $oDef->setFieldSource($this, $source);\n }",
"public function fill($model, $setPrimaryKey = true) {\r\n if($setPrimaryKey)\r\n $this->primaryKey = $model->id;\r\n $this->attributes = [\r\n 'title' => $model->header1,\r\n 'content' => $model->text,\r\n ];\r\n }",
"private function detectDataSource()\n {\n $key = $this->config['datasource']['key'];\n $this->log(\"Detecting if there's a data source with key {$key}\");\n $this->dataSource = DataSource::where('key', $key)->get()->first();\n if (!$this->dataSource) {\n $this->info(\"No data source found. Proceeding to automatically create a data source\");\n $this->createDataSource();\n }\n\n $this->info(\"Importing to Data source {$this->dataSource->title}({$this->dataSource->data_source_id})...\");\n }"
] | [
"0.723123",
"0.6307001",
"0.62971985",
"0.62503946",
"0.61088884",
"0.61088884",
"0.60399896",
"0.60399896",
"0.60399896",
"0.60399896",
"0.60141534",
"0.5976137",
"0.5850964",
"0.58423",
"0.58054006",
"0.5754357",
"0.5696098",
"0.56102884",
"0.55735755",
"0.5534674",
"0.5522077",
"0.55050427",
"0.5465174",
"0.54414594",
"0.5440834",
"0.5439858",
"0.54300946",
"0.54205376",
"0.5337333",
"0.5332597",
"0.53035074",
"0.5275073",
"0.5264678",
"0.5238658",
"0.5235035",
"0.5233341",
"0.5225176",
"0.5221772",
"0.52115834",
"0.51789707",
"0.51497185",
"0.5134138",
"0.5129472",
"0.50419676",
"0.5041207",
"0.50377524",
"0.50309306",
"0.5015878",
"0.49938157",
"0.49769843",
"0.497227",
"0.497227",
"0.49718103",
"0.49716246",
"0.49563736",
"0.49405277",
"0.4905878",
"0.49058357",
"0.49043545",
"0.49043545",
"0.49043545",
"0.49043545",
"0.4900684",
"0.48694792",
"0.4863025",
"0.4830614",
"0.4827449",
"0.47679242",
"0.47657436",
"0.47622022",
"0.47522834",
"0.47475636",
"0.4740788",
"0.47363302",
"0.47286758",
"0.47180313",
"0.4713398",
"0.4713398",
"0.47034934",
"0.4698525",
"0.46968958",
"0.46968958",
"0.46670341",
"0.46576536",
"0.46572614",
"0.46531716",
"0.46497634",
"0.46209005",
"0.45939955",
"0.45851043",
"0.45844403",
"0.4583199",
"0.45797276",
"0.45794678",
"0.45762601",
"0.45706853",
"0.45568252",
"0.45544246",
"0.4553877",
"0.45485842"
] | 0.580316 | 15 |
Resolve a datasource instance. | public static function resolveDatasource($datasource = null)
{
return static::$resolver->datasource($datasource);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getDatasourceResolver()\n {\n return static::$resolver;\n }",
"public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }",
"public static function getConnectionResolver();",
"public static function getDataSource()\n {\n return static::$_dataSource;\n }",
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }",
"protected static function resolve_connection() {\n global $DB;\n\n switch ($DB->get_dbfamily()) {\n case 'mysql':\n return new mysql_connection($DB);\n default:\n throw new \\Exception('Unsupported database family: ' . $DB->get_dbfamily());\n }\n }",
"public function getConnectionResolver()\n {\n return $this->resolver;\n }",
"public function getResourceDataSource()\n\t{\n\t\tif ($this->_resourceDataSource === null)\n\t\t{\n\t\t\t$this->_resourceDataSource = new Application_Model_ResourceMapper;\n\t\t}\n\t\t\n\t\treturn $this->_resourceDataSource;\n\t}",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }",
"public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}",
"public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}",
"private function detectDataSource()\n {\n $key = $this->config['datasource']['key'];\n $this->log(\"Detecting if there's a data source with key {$key}\");\n $this->dataSource = DataSource::where('key', $key)->get()->first();\n if (!$this->dataSource) {\n $this->info(\"No data source found. Proceeding to automatically create a data source\");\n $this->createDataSource();\n }\n\n $this->info(\"Importing to Data source {$this->dataSource->title}({$this->dataSource->data_source_id})...\");\n }",
"function getDataSource() { return $this->_datasource; }",
"public static function dataSource($args)\n\t{\n\t\t$args = func_get_args();\n\t\treturn self::getConnection()->dataSource($args);\n\t}",
"function readDataSource() {return $this->_datasource;}",
"protected function _useSourceDatasource() {\n\n // Instantiate source datasource if it's not already instantiated\n if (is_null($this->_externalNewsSourceDatasource)) {\n $this->_externalNewsSourceDatasource = new Datasource_Cms_ExternalNews_Source();\n }\n }",
"public function resolveConnection() {\n if ( !is_null($this->redis) ) return $this->redis;\n\n $parameters = $this->parameters ?: getenv('REDIS_URL') ?: 'tcp://127.0.0.1/6379?database=0';\n\n $this->redis = new Client($parameters);\n\n return $this->redis;\n }",
"public static function setDatasourceResolver(Resolver $resolver)\n {\n static::$resolver = $resolver;\n }",
"protected function resolveFromConfigFile()\n {\n $config = null;\n\n if (file_exists($this->configFile)) {\n $config = require_once($this->configFile);\n }\n\n if ($config && $connectionString = $config['connection_string']) {\n static::setConnection(new PDO($connectionString));\n }\n }",
"public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }",
"function getDataSource() {return $this->_datasource;}",
"protected function getActiveDatasource()\n {\n return $this->datasources[$this->activeDatasourceKey];\n }",
"public static function getConnection()\n {\n if (self::$resource == false)\n {\n self::$resource = plexcel_new(self::getLdapConfig(), array());\n if ( !is_resource(self::$resource))\n {\n throw new sfException(\"Connection error\");\n }\n }\n return self::$resource ;\n }",
"public function getDatasourceRepository()\n {\n return $this->datasourceRepository;\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"protected function getDatasource(Source $source) {\n\t\t$datasource = $source->getDatasource();\n\t\tif (is_numeric($datasource)) {\n\t\t\t$datasource = $this->simu->getDatasourceById((int)$datasource);\n\t\t} else {\n\t\t\t$datasource = $this->simu->getDatasourceByName($datasource);\n\t\t}\n\t\treturn $datasource;\n\t}",
"protected function resolve($name)\n {\n $config = $this->getConfig($name);\n\n return $this->getConnector($config['driver'])->connect($config);\n }",
"public function resolve($resource, $type = null);",
"protected function getDatasourceForPath(string $path)\n {\n // Default to the last datasource provided\n $datasourceIndex = count($this->datasources) - 1;\n\n $isDeleted = false;\n\n foreach ($this->pathCache as $i => $paths) {\n if (isset($paths[$path])) {\n $datasourceIndex = $i;\n\n // Set isDeleted to the inverse of the the path's existance flag\n $isDeleted = !$paths[$path];\n\n // Break on first datasource that can handle the path\n break;\n }\n }\n\n if ($isDeleted) {\n throw new Exception(\"$path is deleted\");\n }\n\n $datasourceIndex = array_keys($this->datasources)[$datasourceIndex];\n\n return $this->datasources[$datasourceIndex];\n }",
"public static function getInstance($dsn=Settings::MASTER_DSN){\n if (!array_key_exists($dsn, self::$dsnConns)){\n self::$dsnConns[$dsn] = new PdoDatabaseConnection($dsn);\n }\n\n return self::$dsnConns[$dsn];\n }",
"public static function resolveConnection($connection = null);",
"public function resolve() {}",
"public function resolve()\n {\n if ($key = request('key', null)) {\n return RegistryObjectsRepository::getPublishedByKey($key);\n }\n\n if ($slug = request('slug', null)) {\n return RegistryObject::where('slug', $slug)->where('status', 'PUBLISHED')->get();\n }\n\n if ($title = request('title', null)) {\n return RegistryObject::where('title', $title)->where('status', 'PUBLISHED')->get();\n }\n\n return null;\n }",
"public function resolve($aliasOrTemplate);",
"public static function setConnectionResolver(Resolver $resolver);",
"public static function getInstance()\n\t{\n\n\t\t// Legacy fallback. Old code might still use $settings instead of $dsn.\n\t\tif (empty(self::$settings) === false && empty(self::$dsn) === true) {\n\n\t\t\tself::$dsn = &self::$settings;\n\n\t\t}\n\n\t\t// Check if DSN is empty.\n\t\tif (empty(self::$dsn) === true) {\n\n\t\t\tthrow new DatabaseException('No DSN values supplied');\n\n\t\t}\n\n\t\t// Check if database is missing from DSN.\n\t\tif (array_key_exists('database', self::$dsn) === false) {\n\n\t\t\tthrow new DatabaseException('Missing DSN value: database');\n\n\t\t}\n\n\t\t// Check if hostname is missing from DSN.\n\t\tif (array_key_exists('hostname', self::$dsn) === false) {\n\n\t\t\tthrow new DatabaseException('Missing DSN value: hostname');\n\n\t\t}\n\n\t\t// Check if username is missing from DSN.\n\t\tif (array_key_exists('username', self::$dsn) === false) {\n\n\t\t\tthrow new DatabaseException('Missing DSN value: username');\n\n\t\t}\n\n\t\t// Check if password is missing from DSN.\n\t\tif (array_key_exists('password', self::$dsn) === false) {\n\n\t\t\tthrow new DatabaseException('Missing DSN value: password');\n\n\t\t}\n\n\t\t// Generate an unique DSN key.\n\t\t$key = md5(serialize(self::$dsn));\n\t\t$ok = self::$instance instanceof Database;\n\n\t\t// Create a new instance if we don't have one.\n\t\tif (self::$instance === true || $ok === false || $key !== self::$connKey) {\n\n\t\t\tself::$connKey = $key;\n\t\t\tself::$instance = new self();\n\n\t\t}\n\n\t\treturn self::$instance;\n\n }",
"public function setDatasource($name)\n {\n $this->datasource = $name;\n\n return $this;\n }",
"public function resolve($resource);",
"public static function reg_data_source($ds_index, $ds_params)\n {\n return Core\\DataSources::Register($ds_index, $ds_params);\n }",
"abstract public function resolveById($id);",
"public function resolve();",
"public function resolve();",
"public static function unsetDatasourceResolver()\n {\n static::$resolver = null;\n }",
"public function testRegisterDataSource()\n {\n // Start of user code DataSourcesRegistryTest.testregisterDataSource\n $dataSource = new TestDataSource();\n $dataSource->setName('test');\n DataSourcesRegistry::registerDataSource($dataSource);\n $this->assertEquals($dataSource, DataSourcesRegistry::getDataSource('test'));\n // End of user code\n }",
"protected function _useCategoryDatasource() {\n\n // Instantiate category datasource if it's not already instantiated\n if (is_null($this->_externalNewsCategoryDatasource)) {\n $this->_externalNewsCategoryDatasource = new Datasource_Cms_ExternalNews_Category();\n }\n }",
"public static function getConnection($dsn) {\n\t\tif (isset(self::$_instances[$dsn]))\n\t\t\treturn self::$_instances[$dsn];\n\t\t$driver = false !== ($i = strpos($dsn, ':')) ? substr($dsn, 0, $i) : $dsn;\n\t\t$class = Doggy_Util_Inflector::doggyClassify('Doggy_Dba_Adapter_'.$driver);\n\t\tif(!class_exists($class) ){\n\t\t throw new Doggy_Dba_Exception('Unknow database adpater:'.$driver);\n\t\t}\n\t\treturn self::$_instances[$dsn] = new $class($dsn);\n\t}",
"public function getDataSourceDefinition()\n {\n return $this->data_source_definition;\n }",
"abstract public function resolve();",
"public function dataSource(Id $dataSource = null)\n {\n if(null === $dataSource)\n {\n return $this->child('dataSource');\n }\n return $this->child('dataSource', $dataSource);\n }",
"protected abstract function resolveService();",
"public static function resolve(...$args)\n {\n return container_resolve(static::class, $args);\n }",
"function connect($dataSource)\n{\n\tif (empty($dataSource)) {\n\t\tthrow new \\InvalidArgumentException('Invalid connection parameters.');\n\t}\n\n\tif(is_string($dataSource)) {\n\t\t$dsarray = $this->parseDsn($dataSource);\n\t}\n\telseif (is_array($dataSource) and array_key_exists ('driver', $dataSource)) {\n\t\t$dsarray = $dataSource;\n\t}\n\telse throw new \\InvalidArgumentException('Invalid connection parameters.');\n\t\n\t$this->dataSource = $dataSource;\t\n\n\t$drvname = pcl_ident($dsarray['driver']);\n\t\n\tif (strpos($drvname, 'pdo_') === 0) {\n\t\t$className = '\\\\pclib\\\\system\\\\database\\\\Pdo'.ucfirst(substr($drvname, 4)).'Driver';\n\t}\n\telse {\n\t\t$className = '\\\\pclib\\\\system\\\\database\\\\'.ucfirst($drvname).'Driver';\n\t}\n\n\tif (!class_exists($className)) {\n\t\tthrow new DatabaseException(\"Database driver '%s' not found.\", array($dsarray['driver']));\n\t}\n\n\t$this->drv = new $className;\n\t$this->drv->verboseErrors = in_array('develop', $this->config['pclib.errors']);\n\t$this->drv->forceReconnect = $this->forceReconnect;\n\t$this->drv->connect($dsarray);\n\tif ($dsarray['options']['charset']) $this->drv->codePage($dsarray['options']['charset']);\n}",
"protected function _initDbResource()\n {\n $registry = $this->getPluginResource('db');\n if (!$registry) {\n return;\n }\n\n //\n // options in configs/application\n $options = $registry->getOptions();\n\n if (array_key_exists('dsn', $options) && '' !== $options['dsn']) {\n $options['params'] = array_replace(\n $options['params'],\n $this->_parseDsn($options['dsn'])\n );\n }\n\n $registry->setOptions($options);\n }",
"public function getDataSourceType();",
"public static function on($datasource = null)\n {\n // First we will just create a fresh instance of this model, and then we can\n // set the datasource on the model so that it is be used for the queries.\n $instance = new static;\n\n $instance->setDatasource($datasource);\n\n return $instance;\n }",
"public function setDatasource($datasource)\n {\n $this->datasource = $datasource;\n }",
"private function createDataSource()\n {\n $this->debug(\"Creating data source\");\n $this->dataSource = DataSourceRepository::createDataSource(\n $this->config['datasource']['key'],\n $this->config['datasource']['title'],\n 'SYSTEM'\n );\n $this->dataSource->setDataSourceAttribute(\"manual_publish\", 0);\n $this->dataSource->setDataSourceAttribute(\"qa_flag\", 0);\n\n $this->log(\"Data source {$this->dataSource->title}({$this->dataSource->data_source_id}) created\");\n }",
"public function get($id) {\n if (!isset($this->properties()[$id])) {\n if (!$this->hasFallback()) {\n throw new \\Exception('No database configuration known for database requested with id ' . $id);\n }\n\n $id = 'default';\n }\n\n if (!isset($this->properties()[$id]['dsn'])) {\n throw new \\Exception('Missing dsn property in database configuration with id ' . $id);\n }\n\n return $this->properties()[$id];\n }",
"protected function fetchConfig($name)\n\t{\n\t\t$name = $name ?: $this->getDefaultConnection();\n\n\t\t// ensure that the resolver connection is set in the db config\n\t\t$resolverConnection = Config::get('database.resolver.connection');\n\t\tif (empty($this->app['config']['database.connections'][$resolverConnection]))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(\"Resolver connection [$resolverConnection] is not configured\");\n\t\t}\n\n\t\t// attempt to fetch the config for the given connection name\n\t\t$DbResolverConnection = new DbResolverConnection;\n\t\t$DbResolverConnection->setConnection(Config::get('database.resolver.connection'));\n\t\t$DbResolverConnection->setTable(Config::get('database.resolver.table.connection'));\n\n\t\t$fetch = $DbResolverConnection->newQuery()->find($name);\n\n\t\t// if we didnt fetch any configs, then bail\n\t\tif (is_null($fetch))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(\"Database connection [$name] not configured.\");\n\t\t}\n\n\t\t$config = [\n\t\t\t'driver' => $fetch->driver,\n\t\t\t'database' => $fetch->database,\n\t\t\t'username' => $fetch->username,\n\t\t\t'password' => $fetch->password,\n\t\t\t'charset' => $fetch->charset,\n\t\t\t'collation' => $fetch->collation,\n\t\t\t'prefix' => $fetch->prefix,\n\t\t];\n\n\t\tif ($fetch->driver === 'mysql' && $fetch->db_connection_hosts)\n\t\t{\n\t\t\t$config['read'] = [];\n\t\t\t$config['write'] = [];\n\n\t\t\tforeach ($fetch->db_connection_hosts as $host)\n\t\t\t{\n\t\t\t\tif ($host->writable)\n\t\t\t\t\t$config['write'][] = ['host' => $host->host];\n\t\t\t\telse\n\t\t\t\t\t$config['read'][] = ['host' => $host->host];\n\t\t\t}\n\n\t\t\tif (empty($config['write']))\n\t\t\t\tthrow new InvalidArgumentException('No hosts configured');\n\n\t\t\tif (empty($config['read']))\n\t\t\t\t$config['read'] = $config['write'];\n\t\t}\n\n\t\t$this->app['config']->set('database.connections.' . $name, $config);\n\n\t\treturn $this->app['config']['database.connections'][$name];\n\t}",
"function resolve_domain($domain, string $source_url = ICANNSectionManager::PSL_URL): Domain\n{\n static $manager;\n\n $manager = $manager ?? new ICANNSectionManager(new Cache(), new CurlHttpClient());\n\n return $manager->getRules($source_url)->resolve($domain);\n}",
"public function getDataSourceHandler()\n {\n return $this->DataSourceInstance->getDataSourceHandler();\n }",
"public function datasource() { \n return $this->HasMany('App\\Datasource');\n }",
"public function getConnection()\n {\n return $this->resolver->connection();\n }",
"public static function create(\n TechDivision_Properties_Properties $properties) {\n // load the connection type\n\t\t$type = $properties->getProperty(\n\t TechDivision_Util_DataSource::DB_CONNECT_TYPE\n\t );\n // if a connection type was set, validate it\n\t if (!empty($type)) {\n // validate the connection type\n \t if (!TechDivision_Util_AbstractDataSource::isValidType($type)) {\n \t throw new\n \t TechDivision_Util_Exceptions_InvalidConnectionTypeException(\n \t \t'Invalid connection type ' . $type . ' specified, use ' .\n \t \t'one of dedicated, master, slave or backup'\n \t );\n \t }\n\t } else {\n\t $type = TechDivision_Util_AbstractDataSource::DEDICATED;\n\t }\n // load the autocommit flag\n\t $autocommit = new TechDivision_Lang_String(\n\t $properties->getProperty(\n\t TechDivision_Util_DataSource::DB_CONNECT_AUTOCOMMIT\n\t )\n\t );\n // initialize and return the data source\n\t\treturn new TechDivision_Util_DataSource(\n\t\t $type,\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_NAME\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_HOST\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_PORT\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_DATABASE\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_DRIVER\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_USER\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_PASSWORD\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_ENCODING\n\t\t ),\n\t\t $properties->getProperty(\n\t\t TechDivision_Util_DataSource::DB_CONNECT_OPTIONS\n\t\t ),\n\t\t \tTechDivision_Lang_Boolean::valueOf($autocommit)->booleanValue()\n );\n }",
"public function resolver() {\n return $this->resolver;\n }",
"public function resolve(string $id, ContainerInterface $container);",
"protected function resolve($name)\n\t{\n\t\t$config = $this->getConfig($name);\n\n\t\tif (is_null($config)) {\n\t\t\tthrow new InvalidArgumentException(\"Language store [{$name}] is not defined.\");\n\t\t}\n\n\t\t$driverMethod = 'create'.ucfirst($config['driver']).'Driver';\n\n\t\tif (method_exists($this, $driverMethod)) {\n\t\t\treturn $this->{$driverMethod}($config);\n\t\t} else {\n\t\t\tthrow new InvalidArgumentException(\"Driver [{$config['driver']}] is not supported.\");\n\t\t}\n\t}",
"private function getStockResolverService(): ?StockResolverInterface\n {\n try {\n $stockResolver = $this->objectManager->get(StockResolverInterface::class);\n } catch (Throwable $e) {\n $stockResolver = null;\n }\n return $stockResolver;\n }",
"public static function getFromType($type, $params) {\n\t\t$class = implode('', array_map('ucfirst', explode('_', $type))).'DataSource';\n\t\tif(!class_exists($class)) return null;\n\t\t\n\t\treturn new $class($params);\n\t}",
"public static function instance() {\n if (static::$instance === null) {\n static::$instance = static::resolve_connection();\n }\n\n return static::$instance;\n }",
"protected function getEntityResolver()\n {\n return \\Yii::createObject('app\\modules\\queue\\components\\interfaces\\EntityResolverInterface');\n }",
"public function resolve(string $className): object;",
"public static function findOne( datasource\\connection $source = null, $properties )\n\t{\n\t\treturn static::findAll( $source, $properties, 1 );\n\t}",
"public function testRegisterNotNamedDataSource()\n {\n $dataSource = new TestDataSource();\n DataSourcesRegistry::registerDataSource($dataSource); \n }",
"public function resolve($toResolve);",
"protected function db()\n {\n $this->loadDb();\n\n return $this->resource;\n }",
"public function getDatasourceName()\n {\n return $this->datasource;\n }",
"protected function getConfigResolver()\n {\n if (is_null($this->configResolver) === false) {\n return $this->configResolver;\n }\n\n $resolver = new AttributesResolver();\n $resolver->setDefault('host', '0.0.0.0', 'string', true)\n ->setDefault('port', 4000, 'integer', true)\n ->setValidator('port', function ($value) {\n return $value >= 0;\n })\n ->setDefault('server_watch_ext', ['html'], 'array', true)\n ->setDefault('parsedown_activated', false, 'bool', true);\n\n $this->configResolver = $resolver;\n\n return $this->configResolver;\n }",
"public static function exists(string $datasource);",
"function &getInstance ()\n\t{\n\t\trequire_once ADODB_DIR .'adodb.inc.php';\n\t\trequire_once ADODB_DIR .'adodb-errorpear.inc.php';\n\n\t\t// create a new ADOdb instance\n\t\t$this->factory_instance = &ADONewConnection($this->dsn_string);\n\n\t\tif (FALSE !== $this->factory_instance)\n\t\t{\n\t\t\t// set associative fetch mode\n\t\t\t$this->factory_instance->setFetchMode(ADODB_FETCH_ASSOC);\n\n\t\t\t// returns AdodbDaoFactory instance\n\t\t\treturn $this;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error('DAO connection error on DSN '. $this->dsn_string);\n\t\t\treturn FALSE;\n\t\t}\n }",
"public function getConnection() {\n\t\t$db = Config::get('librarydirectory::database.default');\n return static::resolveConnection($db);\n }",
"public static function getInstance()\n\t{\n\t\tif (!self::$objInstance)\n\t\t{\n\t\t\t$filePath = __DIR__ . '/../../config/db.json';\n\n\t\t\tif (!file_exists($filePath))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Please create configuration file or make sure it's readable.\");\n\t\t\t}\n\n\t\t\t$configFile = json_decode(file_get_contents($filePath));\n\n\t\t\t$port = (isset($configFile->port)) ? ';port=' . $configFile->port : '';\n\t\t\t$dsn = $configFile->driver . ':host=' . $configFile->host . $port . ';dbname=' . $configFile->schema;\n\n\t\t\tself::$objInstance = new \\PDO($dsn, $configFile->username, $configFile->password);\n\t\t\tself::$objInstance->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t}\n\n\t\treturn self::$objInstance;\n\n\t}",
"public function setDataSource(IDataSource $dataSource)\n\t{\n\t\t$this->dataSource = $dataSource;\n\t\t$this->paginator->itemCount = count($dataSource);\n\t\treturn $this;\n\t}",
"public static function resolveAvailabilityUsing($resolver)\n {\n static::$availabilityResolver = $resolver;\n }",
"public function resolve($data);",
"protected function resolve($class)\n {\n if (isset($this->container)) {\n $instance = $this->container->make($class);\n\n $instance->setContainer($this->container);\n } else {\n $instance = new $class;\n }\n\n if (isset($this->command)) {\n $instance->setCommand($this->command);\n }\n\n return $instance;\n }",
"public function resolveTransformer()\n {\n if (\\is_string($this->resolver)) {\n return $this->container->make($this->resolver);\n } elseif (\\is_callable($this->resolver)) {\n return \\call_user_func($this->resolver, $this->container);\n } elseif (\\is_object($this->resolver)) {\n return $this->resolver;\n }\n\n throw new RuntimeException('Unable to resolve transformer binding.');\n }",
"public function get($name)\n {\n if (Shopware::VERSION !== '___VERSION___') {\n if (version_compare(Shopware::VERSION, '4.3.3', '<') && $name === 'dbal_connection') {\n return $this->get('models')->getConnection();\n }\n\n if (version_compare(Shopware::VERSION, '4.2.0', '<')) {\n if ($name === 'loader') {\n return $this->Application()->Loader();\n }\n\n $name = ucfirst($name);\n\n return $this->Application()->Bootstrap()->getResource($name);\n }\n }\n\n return parent::get($name);\n }",
"protected function find(AbstractBlock $block): ResolverInterface\n {\n $cache = $this->cache->load(MagewireCache::SECTION_RESOLVERS) ?: [];\n $resolver = $cache[$block->getCacheKey()] ?? false;\n\n if ($resolver) {\n try {\n return $this->get($resolver);\n } catch (NoSuchEntityException $exception) {\n $this->logger->info(\n sprintf('Magewire: Resolver \"%1s\" is no longer present. Retrying available resolvers.', $resolver)\n );\n }\n }\n\n $resolvers = array_filter($this->resolvers, function (ResolverInterface $resolver) use ($block) {\n return $resolver->complies($block);\n });\n\n // It's safe to say the first one can be used, or we use the layout fallback.\n $name = array_keys($resolvers)[0];\n $resolver = array_values($resolvers)[0];\n\n $cache[$block->getCacheKey()] = $name;\n $this->cache->saveResolvers($cache);\n\n return $resolver;\n }",
"protected function resolve($name)\n {\n $config = $this->getConfig($name);\n\n if (is_null($config)) {\n throw new \\InvalidArgumentException(\"QuickBooks connection [{$name}] is not defined.\");\n }\n\n return new QuickBooksConnection($name, $config);\n }",
"function startDBConnection() {\n $connectionObject = new DatabaseFactory();\n return $connectionObject->getConnection();\n}",
"function connect($dsn)\n\t{\n\t\t// Load database driver and create its instance.\n\t\t$parsed = DbSimple_Generic::parseDSN($dsn);\n\t\tif (!$parsed) {\n\t\t\t$dummy = null;\n\t\t\treturn $dummy;\n\t\t}\n\t\t$class = 'DbSimple_'.ucfirst($parsed['scheme']);\n\t\tif (!class_exists($class)) {\n\t\t\t$file = dirname(__FILE__).'/'.ucfirst($parsed['scheme']). \".php\";\n\t\t\tif (is_file($file)) {\n\t\t\t\trequire_once($file);\n\t\t\t} else {\n\t\t\t\ttrigger_error(\"Error loading database driver: no file $file\", E_USER_ERROR);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t$object = new $class($parsed);\n\t\tif (isset($parsed['ident_prefix'])) {\n\t\t\t$object->setIdentPrefix($parsed['ident_prefix']);\n\t\t}\n\t\t$object->setCachePrefix(md5(serialize($parsed['dsn'])));\n\t\treturn $object;\n\t}",
"protected static function resolveFacadeInstance ( $name )\n {\n if ( is_object ( $name ) )\n return $name;\n if ( isset ( static::$resolvedInstance [ $name ] ) )\n return static::$resolvedInstance [ $name ];\n \n return static::$resolvedInstance [ $name ] = static::$application [ $name ];\n }"
] | [
"0.6254908",
"0.5897958",
"0.5827101",
"0.5559807",
"0.55424845",
"0.55424845",
"0.551143",
"0.54690635",
"0.54495233",
"0.5303409",
"0.53020084",
"0.53020084",
"0.52671164",
"0.5264699",
"0.5243511",
"0.52429086",
"0.52256596",
"0.52160084",
"0.520504",
"0.509803",
"0.5086399",
"0.5079903",
"0.50712985",
"0.5047992",
"0.50440633",
"0.49935102",
"0.49082577",
"0.48936236",
"0.4840996",
"0.4840996",
"0.4840996",
"0.4840996",
"0.48163027",
"0.4802006",
"0.47887936",
"0.47611716",
"0.4758583",
"0.47508594",
"0.47323906",
"0.47299373",
"0.4729894",
"0.47169065",
"0.46960285",
"0.46846318",
"0.4638616",
"0.46329546",
"0.46308097",
"0.46255034",
"0.46255034",
"0.46244633",
"0.4624229",
"0.45986384",
"0.45928943",
"0.45917466",
"0.45873794",
"0.45847818",
"0.45814762",
"0.45812935",
"0.45769346",
"0.4571766",
"0.4570153",
"0.45665103",
"0.45556656",
"0.45417035",
"0.45181546",
"0.45053554",
"0.45006096",
"0.4500378",
"0.44579926",
"0.4455067",
"0.44544473",
"0.44469026",
"0.44440728",
"0.4442415",
"0.442963",
"0.44282752",
"0.44199464",
"0.4409389",
"0.44076946",
"0.44038457",
"0.44014734",
"0.43986514",
"0.43889785",
"0.43689948",
"0.43666366",
"0.43662855",
"0.43622127",
"0.4347199",
"0.4343759",
"0.4340683",
"0.43401068",
"0.43303087",
"0.43299466",
"0.43230897",
"0.431572",
"0.43137068",
"0.43060324",
"0.43002117",
"0.43000615",
"0.42999092"
] | 0.73382974 | 0 |
Get the datasource resolver instance. | public static function getDatasourceResolver()
{
return static::$resolver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public function getConnectionResolver()\n {\n return $this->resolver;\n }",
"public static function resolveDatasource($datasource = null)\n {\n return static::$resolver->datasource($datasource);\n }",
"public function resolver() {\n return $this->resolver;\n }",
"public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }",
"public static function getDataSource()\n {\n return static::$_dataSource;\n }",
"public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }",
"protected function getResolver()\n {\n return $this->container->get('sylius.cart_resolver');\n }",
"public function getResolver()\n {\n }",
"protected function getConfigResolver()\n {\n if (is_null($this->configResolver) === false) {\n return $this->configResolver;\n }\n\n $resolver = new AttributesResolver();\n $resolver->setDefault('host', '0.0.0.0', 'string', true)\n ->setDefault('port', 4000, 'integer', true)\n ->setValidator('port', function ($value) {\n return $value >= 0;\n })\n ->setDefault('server_watch_ext', ['html'], 'array', true)\n ->setDefault('parsedown_activated', false, 'bool', true);\n\n $this->configResolver = $resolver;\n\n return $this->configResolver;\n }",
"public function getDatasourceRepository()\n {\n return $this->datasourceRepository;\n }",
"public function getDataFetcherRegistrar()\n {\n if (! $this->fetcherRegistrar) {\n $this->fetcherRegistrar = app(DataFetcherRegistrar::class)->setSchema($this);\n }\n\n return $this->fetcherRegistrar;\n }",
"protected function getResolver()\n {\n $resolver = new AttributesResolver();\n $resolver->setDefault('name', '', 'string')\n ->setDefault('description', '', 'string')\n ->setDefault('author', '', 'string')\n ->setDefault('license', '', 'string');\n\n return $resolver;\n }",
"public static function getConnectionResolver();",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }",
"public function getResourceDataSource()\n\t{\n\t\tif ($this->_resourceDataSource === null)\n\t\t{\n\t\t\t$this->_resourceDataSource = new Application_Model_ResourceMapper;\n\t\t}\n\t\t\n\t\treturn $this->_resourceDataSource;\n\t}",
"public function getDataSourceHandler()\n {\n return $this->DataSourceInstance->getDataSourceHandler();\n }",
"public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}",
"protected function getEntityResolver()\n {\n return \\Yii::createObject('app\\modules\\queue\\components\\interfaces\\EntityResolverInterface');\n }",
"public static function getResolver($driver)\n {\n return static::$resolvers[$driver] ?? null;\n }",
"private function getStockResolverService(): ?StockResolverInterface\n {\n try {\n $stockResolver = $this->objectManager->get(StockResolverInterface::class);\n } catch (Throwable $e) {\n $stockResolver = null;\n }\n return $stockResolver;\n }",
"public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}",
"public function getDataLoaderRegistrar()\n {\n if (! $this->loaderRegistrar) {\n $this->loaderRegistrar = app(DataLoaderRegistrar::class)->setSchema($this);\n }\n\n return $this->loaderRegistrar;\n }",
"protected function getRouting_ResolverService()\n {\n return $this->services['routing.resolver'] = new \\phpbb\\routing\\loader_resolver(${($_ = isset($this->services['routing.loader.collection']) ? $this->services['routing.loader.collection'] : $this->getRouting_Loader_CollectionService()) && false ?: '_'});\n }",
"public function getDataSource()\n {\n /** @var Model $modelClass */\n $modelClass = get_class($this);\n $parentModelName = get_parent_class($modelClass);\n\n if ($parentModelName == Model_Defined::getClass() || $parentModelName == Model_Factory::getClass()) {\n return Data_Source::getInstance(Object::getName($parentModelName) . ':model/' . $modelClass);\n }\n\n return Data_Source::getInstance($modelClass::getDataSourceKey());\n }",
"private function getRessourceService()\n {\n if (!$this->ressourceService) {\n $this->ressourceService = $this->getServiceManager()->get('playgroundcms_ressource_service');\n }\n\n return $this->ressourceService;\n }",
"public function create()\n {\n return new ConfigResolver();\n }",
"public function instance(): Container\n {\n return ($this->resolver)();\n }",
"public function getAggregateResolver()\n {\n return $this->aggregateResolver;\n }",
"public function getAggregateResolver()\n {\n return $this->aggregateResolver;\n }",
"public function getConnection()\n {\n return $this->resolver->connection();\n }",
"public static function getResolver($driver)\n {\n }",
"public static function instance() {\n if (static::$instance === null) {\n static::$instance = static::resolve_connection();\n }\n\n return static::$instance;\n }",
"public static function setDatasourceResolver(Resolver $resolver)\n {\n static::$resolver = $resolver;\n }",
"public function getResolverId()\n {\n return $this->resolver_id;\n }",
"function getDataSource() { return $this->_datasource; }",
"public function setResolver(Resolver $resolver)\r\n\t{\r\n\t\treturn $this;\r\n\t}",
"public function getConnectionRegistrar()\n {\n if (! $this->connectionRegistrar) {\n $this->connectionRegistrar = app(ConnectionRegistrar::class)->setSchema($this);\n }\n\n return $this->connectionRegistrar;\n }",
"public static function setConnectionResolver(Resolver $resolver);",
"public function getRulesDatasource() {\n\t$model = new Doctrine(\n\t\t$this->aclRuleDao->createQueryBuilder('rule'));\n\treturn $model;\n }",
"public function getDataSourceDefinition()\n {\n return $this->data_source_definition;\n }",
"protected function getVictoireCriteria_Criteria_DomainNameSourceService()\n {\n return $this->services['victoire_criteria.criteria.domain_name_source'] = new \\Victoire\\Bundle\\CriteriaBundle\\DataSource\\DomainNameDataSource(array(0 => array()), $this->get('request_stack'));\n }",
"protected function getController_ResolverService()\n {\n return $this->services['controller.resolver'] = new \\phpbb\\controller\\resolver($this, './../', ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }",
"public static function get_template_resolver(): TemplateResolver\n {\n return clone Render\\get_template_resolver();\n }",
"protected function getActiveDatasource()\n {\n return $this->datasources[$this->activeDatasourceKey];\n }",
"public function getValidator()\n\t{\n\t\tif (!is_object($this->_validator)) {\n\t\t\t$validatorClass = $this->xpdo->loadClass('validation.xPDOValidator', XPDO_CORE_PATH, true, true);\n\t\t\tif ($derivedClass = $this->getOption(xPDO::OPT_VALIDATOR_CLASS, null, '')) {\n\t\t\t\tif ($derivedClass = $this->xpdo->loadClass($derivedClass, '', false, true)) {\n\t\t\t\t\t$validatorClass = $derivedClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($profitClass = $this->getOption('mlmsystem_handler_class_profit_validator', null, '')) {\n\t\t\t\tif ($profitClass = $this->xpdo->loadClass($profitClass, $this->getOption('mlmsystem_core_path', null, MODX_CORE_PATH . 'components/mlmsystem/') . 'handlers/validations/', false, true)) {\n\t\t\t\t\t$validatorClass = $profitClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($validatorClass) {\n\t\t\t\t$this->_validator = new $validatorClass($this);\n\t\t\t}\n\t\t}\n\t\treturn $this->_validator;\n\t}",
"protected function getFileResolverConfiguration() : FileResolverConfigurationInterface\n {\n return $this->getSubjectConfiguration()->getFileResolver();\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getQueryRegistrar()\n {\n if (! $this->queryRegistrar) {\n $this->queryRegistrar = app(QueryRegistrar::class)->setSchema($this);\n }\n\n return $this->queryRegistrar;\n }",
"public function getDomain()\n {\n if (!$this->_domain) {\n try {\n $this->_domain = \\Ca\\Db\\DomainMap::create()->find($this->getDomainId());\n } catch (\\Exception $e) {}\n }\n return $this->_domain;\n }",
"protected static function resolve_connection() {\n global $DB;\n\n switch ($DB->get_dbfamily()) {\n case 'mysql':\n return new mysql_connection($DB);\n default:\n throw new \\Exception('Unsupported database family: ' . $DB->get_dbfamily());\n }\n }",
"protected function getConnection() {\n\t\tstatic $connection;\n\t\tif ($connection === null) {\n\t\t\t$connection = new ASolrConnection();\n\t\t\t$connection->clientOptions->hostname = SOLR_HOSTNAME;\n\t\t\t$connection->clientOptions->port = SOLR_PORT;\n\t\t\t$connection->clientOptions->path = SOLR_PATH;\n\t\t\tASolrDocument::$solr = $connection;\n\t\t}\n\t\treturn $connection;\n\t}",
"public function resolveConnection() {\n if ( !is_null($this->redis) ) return $this->redis;\n\n $parameters = $this->parameters ?: getenv('REDIS_URL') ?: 'tcp://127.0.0.1/6379?database=0';\n\n $this->redis = new Client($parameters);\n\n return $this->redis;\n }",
"protected function db()\n {\n $this->loadDb();\n\n return $this->resource;\n }",
"protected function getDoctrine_Orm_DefaultEntityListenerResolverService()\n {\n return $this->services['doctrine.orm.default_entity_listener_resolver'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Mapping\\ContainerAwareEntityListenerResolver($this);\n }",
"protected function getDoctrine_Orm_DefaultEntityListenerResolverService()\n {\n return $this->services['doctrine.orm.default_entity_listener_resolver'] = new \\Doctrine\\Bundle\\DoctrineBundle\\Mapping\\ContainerAwareEntityListenerResolver($this);\n }",
"public static function getInstance()\n {\n if (is_null(static::$_instance)) {\n static::$_instance = static::_getConnection();\n }\n\n return static::$_instance;\n }",
"public static function getConnection()\n {\n if (self::$resource == false)\n {\n self::$resource = plexcel_new(self::getLdapConfig(), array());\n if ( !is_resource(self::$resource))\n {\n throw new sfException(\"Connection error\");\n }\n }\n return self::$resource ;\n }",
"function readDataSource() {return $this->_datasource;}",
"function getDataSource() {return $this->_datasource;}",
"public function domain()\n {\n return $this->context->getDomainManager();\n }",
"protected function getResolver()\n {\n return function () {\n $resolutionArguments = func_get_args();\n\n // Check authentication first\n if (call_user_func_array([$this, 'authenticated'], $resolutionArguments) !== true) {\n throw new AuthorizationError('Unauthenticated');\n }\n\n // After authentication, check specific authorization\n if (call_user_func_array([$this, 'authorize'], $resolutionArguments) !== true) {\n throw new AuthorizationError('Unauthorized');\n }\n\n call_user_func_array([$this, 'validate'], $resolutionArguments);\n\n\n return call_user_func_array([$this, 'resolve'], $resolutionArguments);\n };\n }",
"public function getDataSourceCollection(): SourceCollection {\n\n return $this->dataSourceCollection;\n\n }",
"protected static function getInstance() {\n \n if (self::$oInstance == null) {\n \n self::$oInstance = new AvaliacaoRepository(); \n }\n return self::$oInstance;\n }",
"final public static function getInstance()\n {\n if (!static::$instance instanceof self) {\n static::$instance = new static();\n }\n\n return static::$instance->driver;\n }",
"public function getInstance() {\n\t\treturn $this->instance;\n\t}",
"public static function get() {\n if (null === static::$dataCreator) {\n static::$dataCreator = new static();\n }\n\n return static::$dataCreator;\n }",
"public function getRouteResolver(): Closure\n {\n return $this->routeResolver ?: function () {\n //\n };\n }",
"public function getDatabaseConnectorInstance() {\n return new DatabaseConnector($this->config['general']['db']);\n }",
"public function getResourceDiscovery() {\n\t\tif ($this->resourceDiscovery === null) {\n\t\t\t$repo = $this->getResourceRepository();\n\t\t\t$this->resourceDiscovery = $this->getPuliFactory()->createDiscovery($repo);\n\t\t}\n\n\t\treturn $this->resourceDiscovery;\n\t}",
"public function get_data_manager()\n {\n return DataManager::getInstance();\n }",
"protected function getVictoireCriteria_Criteria_RequestDataSourceService()\n {\n return $this->services['victoire_criteria.criteria.request_data_source'] = new \\Victoire\\Bundle\\CriteriaBundle\\DataSource\\RequestDataSource($this->get('request_stack'), array(0 => 'fr', 1 => 'en'));\n }",
"protected function getRouterService()\n {\n $this->services['router'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Routing\\Router($this, 'kernel:loadRoutes', array('cache_dir' => $this->targetDirs[0], 'debug' => true, 'generator_class' => 'Symfony\\\\Component\\\\Routing\\\\Generator\\\\UrlGenerator', 'generator_base_class' => 'Symfony\\\\Component\\\\Routing\\\\Generator\\\\UrlGenerator', 'generator_dumper_class' => 'Symfony\\\\Component\\\\Routing\\\\Generator\\\\Dumper\\\\PhpGeneratorDumper', 'generator_cache_class' => 'srcDevDebugProjectContainerUrlGenerator', 'matcher_class' => 'Symfony\\\\Bundle\\\\FrameworkBundle\\\\Routing\\\\RedirectableUrlMatcher', 'matcher_base_class' => 'Symfony\\\\Bundle\\\\FrameworkBundle\\\\Routing\\\\RedirectableUrlMatcher', 'matcher_dumper_class' => 'Symfony\\\\Component\\\\Routing\\\\Matcher\\\\Dumper\\\\PhpMatcherDumper', 'matcher_cache_class' => 'srcDevDebugProjectContainerUrlMatcher', 'strict_requirements' => true, 'resource_type' => 'service'), ${($_ = isset($this->services['router.request_context']) ? $this->services['router.request_context'] : $this->getRouter_RequestContextService()) && false ?: '_'});\n\n $instance->setConfigCacheFactory(${($_ = isset($this->services['config_cache_factory']) ? $this->services['config_cache_factory'] : $this->getConfigCacheFactoryService()) && false ?: '_'});\n\n return $instance;\n }",
"public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$configurationBuilder = Tx_Yag_Domain_Configuration_ConfigurationBuilderFactory::getInstance();\n\t\t\tself::$instance = new self($configurationBuilder);\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public function getAdapter()\n {\n if (null === $this->adapter) {\n $connection = new RedisService();\n\n $this\n ->checkConnect($connection)\n ->checkAuth($connection)\n ->checkIndex($connection)\n ;\n\n $connection->setOption(RedisService::OPT_PREFIX, $this->prefix);\n\n $this->setSerializer($connection);\n $this->adapter = $connection;\n }\n\n return $this->adapter;\n }",
"protected function getVictoireCriteria_Chain_DataSourceChainService()\n {\n $a = $this->get('victoire_criteria.criteria.request_data_source');\n\n $this->services['victoire_criteria.chain.data_source_chain'] = $instance = new \\Victoire\\Bundle\\CriteriaBundle\\Chain\\DataSourceChain();\n\n $instance->addDataSource($a, array('group' => 'request', 'method' => 'getLocale', 'alias' => 'request_locale'));\n $instance->addDataSource($a, array('group' => 'request', 'method' => 'getScheme', 'alias' => 'request_scheme'));\n $instance->addDataSource($this->get('victoire_criteria.criteria.roles_data_source'), array('group' => 'request', 'method' => 'getRoles', 'alias' => 'request_roles'));\n $instance->addDataSource($this->get('victoire_criteria.criteria.user_data_source'), array('group' => 'request', 'method' => 'getLoggedStatus', 'alias' => 'request_user'));\n $instance->addDataSource($this->get('victoire_criteria.criteria.domain_name_source'), array('group' => 'request', 'method' => 'getCurrentDomainName', 'alias' => 'request_domain_name'));\n\n return $instance;\n }",
"public function set_resolver(Resolver $resolver);",
"public function get($name)\n {\n if (Shopware::VERSION !== '___VERSION___') {\n if (version_compare(Shopware::VERSION, '4.3.3', '<') && $name === 'dbal_connection') {\n return $this->get('models')->getConnection();\n }\n\n if (version_compare(Shopware::VERSION, '4.2.0', '<')) {\n if ($name === 'loader') {\n return $this->Application()->Loader();\n }\n\n $name = ucfirst($name);\n\n return $this->Application()->Bootstrap()->getResource($name);\n }\n }\n\n return parent::get($name);\n }",
"public function getRoleDataSource()\n\t{\n\t\tif ($this->_roleDataSource === null)\n\t\t{\n\t\t\t$this->_roleDataSource = new Application_Model_RoleMapper;\n\t\t}\n\t\t\n\t\treturn $this->_roleDataSource;\n\t}",
"public static function getInstance() {\n // create instance if doesn't exist\n if ( self::$_instance === null )\n self::$_instance = new self(DB_TYPE, DB_HOST, DB_NAME, DB_USER, DB_PASS);\n\n return self::$_instance;\n }",
"public function getSubscriptionRegistrar()\n {\n if (! $this->subscriptionRegistrar) {\n $this->subscriptionRegistrar = app(SubscriptionRegistrar::class)->setSchema($this);\n }\n\n return $this->subscriptionRegistrar;\n }",
"public function getDatasourceName()\n {\n return $this->datasource;\n }",
"protected function _getCasAdapter()\n {\n static $adapter = NULL;\n \n if (!$adapter) {\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {\n $serviceUrl = 'https://';\n } else {\n $serviceUrl = 'http://';\n }\n $path = Zend_Controller_Front::getInstance()->getRouter()->assemble(array(\n 'module' => $this->getRequest()->getModuleName(),\n 'controller' => $this->getRequest()->getControllerName(),\n 'action' => 'cas'\n ));\n $serviceUrl .= $_SERVER['SERVER_NAME'] . $path;\n $adapter = new Unl_Cas($serviceUrl, 'https://login.unl.edu/cas');\n }\n \n return $adapter;\n }",
"public static function getInstance()\n {\n if (self::$instance == null) {\n self::$instance = new DBStorageAdapter();\n\n self::$instance->setStateHash(self::getStateHash());\n self::$instance->init();\n }\n \n return self::$instance;\n }",
"public function getDomain()\n {\n if(!($domainId = $this->getData('domainId'))) {\n return null;\n }\n \n return Core_Model_DiFactory::getDomainManager()->getDomain($domainId);\n }",
"protected static function getInstance() {\n\n if ( self::$oInstance == null ) {\n self::$oInstance = new CriterioAvaliacaoRepository();\n }\n return self::$oInstance;\n }",
"public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }",
"public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }",
"public function getInstance()\n {\n return $this;\n }",
"public function resolveTransformer()\n {\n if (\\is_string($this->resolver)) {\n return $this->container->make($this->resolver);\n } elseif (\\is_callable($this->resolver)) {\n return \\call_user_func($this->resolver, $this->container);\n } elseif (\\is_object($this->resolver)) {\n return $this->resolver;\n }\n\n throw new RuntimeException('Unable to resolve transformer binding.');\n }",
"public function getDBManagerHandler(): DatabaseManager\n {\n if (empty($this->dbManager)) {\n $this->dbManager = new DatabaseManager(Config::get('database'), new ConnectionFactory());\n }\n return $this->dbManager;\n }",
"public function get_data_manager()\n {\n // return DataManager :: getInstance();\n }",
"public function getDatasources()\n {\n return $this->datasources;\n }",
"public function getResource()\n {\n\n if ($this->is_collection)\n {\n return null;\n }\n\n if ($this->isError())\n {\n return null;\n }\n\n $class = $this->getResourceClass();\n return new $class($this->data);\n }"
] | [
"0.74746126",
"0.74746126",
"0.73314303",
"0.7196785",
"0.6959201",
"0.6614767",
"0.6291765",
"0.61531407",
"0.61505747",
"0.6123957",
"0.61236215",
"0.6103618",
"0.6086765",
"0.6069854",
"0.6024955",
"0.6020866",
"0.6020866",
"0.5958177",
"0.5931751",
"0.5924971",
"0.5905664",
"0.5903495",
"0.5890302",
"0.5841891",
"0.57964516",
"0.57893825",
"0.57383186",
"0.57285446",
"0.5725182",
"0.5723371",
"0.5657619",
"0.5597659",
"0.5597659",
"0.5583223",
"0.5577727",
"0.55636686",
"0.55570304",
"0.54521394",
"0.5438457",
"0.539676",
"0.53524196",
"0.53486586",
"0.5246607",
"0.52428305",
"0.5236822",
"0.52309173",
"0.521236",
"0.51806885",
"0.5173149",
"0.5144375",
"0.5139087",
"0.5139087",
"0.5139087",
"0.5139087",
"0.5135703",
"0.51289034",
"0.5128045",
"0.5127172",
"0.5118898",
"0.51082927",
"0.5101803",
"0.5101803",
"0.50983757",
"0.50869256",
"0.5067082",
"0.5065209",
"0.5060197",
"0.50455505",
"0.50409466",
"0.50389874",
"0.5033258",
"0.5021356",
"0.5002177",
"0.50015616",
"0.4993277",
"0.49887908",
"0.49852368",
"0.49803948",
"0.49735177",
"0.49730483",
"0.49704054",
"0.49665552",
"0.49500167",
"0.49491903",
"0.4948912",
"0.49416924",
"0.49293587",
"0.49259767",
"0.49230826",
"0.49193314",
"0.49192578",
"0.4919167",
"0.49165758",
"0.49165758",
"0.4915304",
"0.49122104",
"0.49115175",
"0.49050555",
"0.48979282",
"0.48933354"
] | 0.8466631 | 0 |
Set the datasource resolver instance. | public static function setDatasourceResolver(Resolver $resolver)
{
static::$resolver = $resolver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function setConnectionResolver(Resolver $resolver);",
"public function set_resolver(Resolver $resolver);",
"public static function setConnectionResolver(Resolver $resolver)\n {\n static::$resolver = $resolver;\n }",
"public static function getDatasourceResolver()\n {\n return static::$resolver;\n }",
"public function setResolver(Resolver $resolver)\n {\n $this->resolver = $resolver;\n }",
"public static function setConnectionResolver(ConnectionResolver $resolver)\n {\n static::$resolver = $resolver;\n }",
"public static function setDalResolver(DalResolver $resolver)\n {\n static::$_resolver = $resolver;\n }",
"public function setResolver(DriverResolver $resolver)\n {\n \n }",
"public static function unsetDatasourceResolver()\n {\n static::$resolver = null;\n }",
"public function getConnectionResolver()\n {\n return $this->resolver;\n }",
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public function setDatasource($datasource)\n {\n $this->datasource = $datasource;\n }",
"public static function resolveDatasource($datasource = null)\n {\n return static::$resolver->datasource($datasource);\n }",
"public function setResolver(ResolverInterface $resolver)\n {\n $this->resolver = $resolver;\n return $this;\n }",
"public function setResolver(LoaderResolverInterface $resolver)\n {\n }",
"public function setResolver(ResolverInterface $resolver)\n {\n $this->resolver = $resolver;\n\n return $this;\n }",
"public function resolver() {\n return $this->resolver;\n }",
"public function setResolver(Resolver $resolver)\r\n\t{\r\n\t\treturn $this;\r\n\t}",
"protected function registerResolver()\n {\n $this->app->bindShared('themify.resolver', function ($app) {\n return new Resolver($app);\n });\n }",
"public function setDatasource($datasource = NULL)\n {\n\n //If there are no datasource, set it to an empty array\n if($datasource === NULL)\n {\n $datasource = array();\n }\n\n //Wrap the array into an iterator\n if(is_array($datasource))\n {\n $datasource = new \\ArrayIterator($datasource);\n }\n\n //Validate\n if(!($datasource instanceof \\Traversable))\n {\n throw new \\InvalidArgumentException('Datasource must be either an array or \\\\Traversable');\n }\n\n //Save the datasource\n $this->datasource = $datasource;\n \n }",
"public function blueprintResolver(Closure $resolver)\n {\n $this->resolver = $resolver;\n }",
"public function blueprintResolver(Closure $resolver)\n {\n $this->resolver = $resolver;\n }",
"public static function withParameterResolver($resolver)\n {\n static::$parameterResolver = $resolver;\n }",
"function SetDatasource($ds)\r\n\t{\r\n\t\t$this->Datasource = $ds;\r\n\t\r\n\t\t//$repeater_outer =& $this->FindControl(\"rptRows\");\r\n\t\t//$repeater_outer->SetDatasource($ds);\r\n\t}",
"public function setResolver(ParameterInterface $resolver);",
"public static function resolveAvailabilityUsing($resolver)\n {\n static::$availabilityResolver = $resolver;\n }",
"public static function getConnectionResolver();",
"protected function _useSourceDatasource() {\n\n // Instantiate source datasource if it's not already instantiated\n if (is_null($this->_externalNewsSourceDatasource)) {\n $this->_externalNewsSourceDatasource = new Datasource_Cms_ExternalNews_Source();\n }\n }",
"public function setParameterResolver($resolver)\n {\n static::withParameterResolver($resolver);\n\n return $this;\n }",
"protected function getConfigResolver()\n {\n if (is_null($this->configResolver) === false) {\n return $this->configResolver;\n }\n\n $resolver = new AttributesResolver();\n $resolver->setDefault('host', '0.0.0.0', 'string', true)\n ->setDefault('port', 4000, 'integer', true)\n ->setValidator('port', function ($value) {\n return $value >= 0;\n })\n ->setDefault('server_watch_ext', ['html'], 'array', true)\n ->setDefault('parsedown_activated', false, 'bool', true);\n\n $this->configResolver = $resolver;\n\n return $this->configResolver;\n }",
"public function __construct( ConnectionResolverInterface $db )\n\t{\n\t\t$this->db = $db;\n\t}",
"public function configureOptionsResolver(OptionsResolver $optionsResolver): OptionsResolver;",
"public function setDataSource($ds) {\n $this->payload['ds'] = $ds ;\n }",
"protected function setTransactionInfoResolver(OptionsResolver $resolver)\n {\n }",
"public function setAggregateResolver(ResolverInterface $aggregateResolver)\n {\n $this->aggregateResolver = $aggregateResolver;\n }",
"public function setAggregateResolver(ResolverInterface $aggregateResolver)\n {\n $this->aggregateResolver = $aggregateResolver;\n }",
"public function setRouteResolver(Closure $callback): self\n {\n $this->routeResolver = $callback;\n\n return $this;\n }",
"public function setDataSource(IDataSource $dataSource)\n\t{\n\t\t$this->dataSource = $dataSource;\n\t\t$this->paginator->itemCount = count($dataSource);\n\t\treturn $this;\n\t}",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class' => Article::class,\n ]);\n\n\n }",
"public function setDatasource($name)\n {\n $this->datasource = $name;\n\n return $this;\n }",
"public function SetDataSource(SetDataSource $parameters)\n {\n return $this->__soapCall('SetDataSource', array($parameters));\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class' => $this\n ->factory\n ->getEntityNamespace(),\n ]);\n }",
"public function getResolver()\n {\n }",
"public static function setDataSource(string $serverName, DataSource $dataSource): void\n {\n self::$dataSources[$serverName] = $dataSource;\n }",
"public function resolveUsing(Closure $callback): static\n {\n $this->resolverOverride = $callback;\n\n return $this;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class' => Organization::class,\n ]);\n }",
"public function registerResolver(callable $resolver) {\n\t\t$this->getSmEntityFactory()\n\t\t ->register(null,\n\t\t\t function ($type = null, $schematic = null) use ($resolver) {\n\t\t\t\t if (!($schematic instanceof SmEntitySchematic)) {\n\t\t\t\t\t return null;\n\t\t\t\t }\n\n\t\t\t\t return $resolver($schematic->getSmID(), $schematic);\n\t\t\t });\n\t}",
"private function initResolver()\n {\n $this->resolver->setUserAgent('Mozilla/5.0 (compatible; PocketPriorityTags/1.0; +http://getpocket.com/)');\n\n // Designate a temporary file that will store cookies during the session.\n // Some web sites test the browser for cookie support, so this enhances results.\n $this->resolver->setCookieJar('/tmp/url_resolver.cookies', true);\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults(array(\n 'data_class' => 'AppBundle\\Entity\\Service',\n ));\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"protected function configureOptions(OptionsResolver $resolver)\n {\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function dataSource($value) {\n return $this->setProperty('dataSource', $value);\n }",
"public function datasource() {\n if (!isset($this->datasource)) {\n $this->datasource = search_api_get_datasource_controller($this->item_type);\n }\n return $this->datasource;\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class' => 'AppBundle\\Entity\\Framework'\n ]);\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n parent::configureOptions($resolver);\n \n $resolver->setDefined(array('target_method', 'entity_route_resolver'));\n }",
"public static function unsetDalResolver()\n {\n static::$_resolver = null;\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class'=>User::class\n ]);\n }",
"public function setSiteSources($val)\n {\n $this->_propDict[\"siteSources\"] = $val;\n return $this;\n }",
"public function setUserResolver(Closure $callback): self\n {\n $this->userResolver = $callback;\n\n return $this;\n }",
"public function setQueueResolver(callable $resolver)\n {\n $this->queueResolver = $resolver;\n\n return $this;\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class' => 'MovieBundle\\Entity\\Person'\n ]);\n }",
"function getDataSource() { return $this->_datasource; }",
"public function setMimeResolver(MimeResolver $resolver)\n {\n $this->mimeResolver = $resolver;\n }",
"public function setMimeResolver(MimeResolver $resolver)\n {\n $this->mimeResolver = $resolver;\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class' => Project::class,\n ]);\n }",
"public function testRegisterDataSource()\n {\n // Start of user code DataSourcesRegistryTest.testregisterDataSource\n $dataSource = new TestDataSource();\n $dataSource->setName('test');\n DataSourcesRegistry::registerDataSource($dataSource);\n $this->assertEquals($dataSource, DataSourcesRegistry::getDataSource('test'));\n // End of user code\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults(array(\n 'data_class' => 'App\\Entity\\DataRepository',\n 'allow_extra_fields' => true,\n 'csrf_protection' => false,\n ));\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefined('route');\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults([\n 'data_class'=> HeaterReading::class\n ]);\n }",
"public function getDatasourceRepository()\n {\n return $this->datasourceRepository;\n }",
"protected function setShopOrderIdResolver(OptionsResolver $resolver)\n {\n }",
"public function setClassResolver(ClassResolverInterface $classResolver)\n {\n $this->classResolver = $classResolver;\n\n return $this;\n }",
"public function bindResolver($id, Closure $resolver);",
"public function configureOptions(OptionsResolver $resolver)\n {\n // TODO: Implement configureOptions() method.\n }",
"public static function getDataSource()\n {\n return static::$_dataSource;\n }",
"public static function resolverFor($driver, Closure $callback)\n {\n static::$resolvers[$driver] = $callback;\n }",
"public function getResourceDataSource()\n\t{\n\t\tif ($this->_resourceDataSource === null)\n\t\t{\n\t\t\t$this->_resourceDataSource = new Application_Model_ResourceMapper;\n\t\t}\n\t\t\n\t\treturn $this->_resourceDataSource;\n\t}",
"protected function _useCategoryDatasource() {\n\n // Instantiate category datasource if it's not already instantiated\n if (is_null($this->_externalNewsCategoryDatasource)) {\n $this->_externalNewsCategoryDatasource = new Datasource_Cms_ExternalNews_Category();\n }\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults(array(\n 'data_class' => Property::class,\n ));\n }",
"protected function initUrl()\n {\n $this->di->setShared('url', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $url = new UrlResolver;\n\n if (ENV_PRODUCTION === APPLICATION_ENV) {\n $url->setBaseUri($config->get('application')->production->baseUri);\n $url->setStaticBaseUri($config->get('application')->production->staticBaseUri);\n } else {\n $url->setBaseUri($config->get('application')->development->baseUri);\n $url->setStaticBaseUri($config->get('application')->development->staticBaseUri);\n }\n\n return $url;\n });\n }",
"public function getDataSource()\n {\n return isset($this->DataSource) ? $this->DataSource : null;\n }",
"function getDataSource() {return $this->_datasource;}",
"public function bindSingletonResolver($id, Closure $resolver);",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefaults(array(\n 'data_class' => 'Ak\\PollBundle\\Entity\\QuestionDefinition',\n ));\n }",
"public function __construct(Resolver $resolver)\n {\n $this->resolver = $resolver;\n $this->builder = Builder::factory($this);\n }",
"public function configureOptions(OptionsResolver $resolver)\n {\n $resolver->setDefined([\n 'media_path',\n ]);\n }",
"public function getDataSource() {\n\t\treturn $this->dataSource;\n\t}",
"public function getDataSource()\n\t{\n\t\treturn $this->dataSource;\n\t}",
"public function setResourceDataSource(Application_Model_MapperAbstract $dataSource)\n\t{\n\t\t$this->_resourceDataSource = $dataSource;\n\t\t\n\t\treturn $this;\n\t}",
"public function setUserDomainNameSource($val)\n {\n $this->_propDict[\"userDomainNameSource\"] = $val;\n return $this;\n }",
"protected function registerEngineResolver() {\n $serviceProvider = $this;\n\n $this->app->singleton( 'view.engine.resolver',\n function () use ( $serviceProvider ) {\n $resolver = new EngineResolver();\n\n // Register the engines.\n foreach ( [ 'twig' ] as $engine ) {\n $serviceProvider->{'register' . ucfirst( $engine ) . 'Engine'}( $engine, $resolver );\n }\n\n return $resolver;\n } );\n }",
"public static function getResolver($driver)\n {\n }"
] | [
"0.70538473",
"0.6986677",
"0.6957359",
"0.6792438",
"0.6722543",
"0.66289234",
"0.66157186",
"0.6512312",
"0.6101639",
"0.5945581",
"0.59298414",
"0.59298414",
"0.589466",
"0.58686596",
"0.58485174",
"0.581797",
"0.57792646",
"0.5719786",
"0.5640163",
"0.5609125",
"0.5604885",
"0.5561649",
"0.5561649",
"0.5561528",
"0.5485377",
"0.5462566",
"0.5362225",
"0.5356651",
"0.52986723",
"0.5236213",
"0.5219354",
"0.5209748",
"0.51830447",
"0.51666355",
"0.5166196",
"0.5148522",
"0.5148522",
"0.5082587",
"0.5068769",
"0.5041832",
"0.50264835",
"0.50173146",
"0.5012499",
"0.50068265",
"0.5004884",
"0.50018036",
"0.49859783",
"0.49859783",
"0.49832997",
"0.4958583",
"0.4957643",
"0.4952511",
"0.49446312",
"0.49333498",
"0.49333498",
"0.48989865",
"0.4890104",
"0.4890104",
"0.4890104",
"0.4890104",
"0.48850363",
"0.48796353",
"0.4853926",
"0.48359528",
"0.48273677",
"0.48188168",
"0.4816102",
"0.4814339",
"0.47997338",
"0.4797422",
"0.47907",
"0.47907",
"0.47822303",
"0.47786865",
"0.47767144",
"0.47580022",
"0.47550967",
"0.4747671",
"0.4746463",
"0.47347105",
"0.4726273",
"0.47014877",
"0.46977097",
"0.46815243",
"0.46793184",
"0.46750814",
"0.46749595",
"0.4669613",
"0.4668988",
"0.4654965",
"0.4646973",
"0.4645708",
"0.46449092",
"0.46235475",
"0.4623078",
"0.46211255",
"0.46170628",
"0.46116003",
"0.46088165",
"0.46008623"
] | 0.7941913 | 0 |
Unset the datasource resolver for models. | public static function unsetDatasourceResolver()
{
static::$resolver = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function unsetDalResolver()\n {\n static::$_resolver = null;\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"public static function unsetConnectionResolver();",
"public function clearModels();",
"public function tearDown() {\n $this->model = null;\n }",
"public static function clearBootedModels();",
"public function reset()\n {\n $this->models = null;\n return $this;\n }",
"public function clearModels()\n {\n $this->_models = array();\n return $this;\n }",
"public function testGettingClearDataSource()\n {\n $dataSource = new TestDataSource();\n $dataSource->setName('test');\n DataSourcesRegistry::registerDataSource($dataSource);\n DataSourcesRegistry::clearDataSource('test');\n DataSourcesRegistry::getDataSource('test');\n }",
"public function testClearNonExistantDataSource()\n {\n DataSourcesRegistry::clearDataSource('test'); \n }",
"public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }",
"protected function tearDown ()\n {\n // TODO Auto-generated ModelTest::tearDown()\n\n $this->Model = null;\n\n parent::tearDown();\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 }",
"public function dropDatasource($source);",
"private function _unsetSetup()\n\t{\n\t\tforeach ( $this->_setup as $setup )\n\t\t{\n\t\t\t$setup->disconnect();\n\t\t}\n\n\t\t$this->_setup = null;\n\t\t$this->_setup = array();\n\t}",
"protected function tearDown(): void\n {\n foreach (['default'] as $connection) {\n $this->schema($connection)->drop('users');\n $this->schema($connection)->drop('friends');\n $this->schema($connection)->drop('posts');\n $this->schema($connection)->drop('photos');\n }\n\n Relation::morphMap([], false);\n }",
"protected function tearDown()\n {\n $this->_model = null;\n parent::tearDown();\n }",
"public function resetDataModel() {\r\n $this->arrModel = array();\r\n $intPackageId = NULL;\r\n }",
"protected function tearDown() {\n\t\t\n\n\t\t$this->_modelBase = null;\n\t\t\n\t\tparent::tearDown ();\n\t}",
"public function unsetClassResolver()\n {\n $this->classResolver = null;\n\n return $this;\n }",
"public function resetLookupCollections()\n\t{\n\t\t$this->lookupCollections[] = null;\n\t}",
"public static function clearBootedModels()\n {\n static::$booted = [];\n }",
"public static function clearBootedModels()\n {\n static::$booted = [];\n }",
"function clear() {\r\n /* clear datasource. you should call this before calling another populate() to avoid datasource gets appended\r\n */\r\n $this->ds = new DataSource;\r\n $this->db_count = 0;\r\n }",
"protected function tearDown(): void\n {\n parent::tearDown();\n $this->clearPlugins();\n ConnectionManager::dropAlias('test1');\n ConnectionManager::dropAlias('test2');\n }",
"public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }",
"protected function tearDown() {\n\t\t// TODO Auto-generated AliasResolverTest::tearDown()\n\t\t$this->AliasResolver = null;\n\t\t\n\t\tparent::tearDown ();\n\t}",
"public function unsetProvider();",
"public function clearResults($modelName);",
"public function testClearDataSource()\n {\n // Start of user code DataSourcesRegistryTest.testclearDataSource\n // Nothing to test here. Tested below by exceptions.\n // End of user code\n }",
"public function clear($modelName = null)\n {\n $this->manager->clear($modelName);\n }",
"public function tear_down() {\n\t\t$this->registry = null;\n\n\t\tparent::tear_down();\n\t}",
"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 cleanup(Model $model) {\n parent::cleanup($model);\n }",
"public static function uninstallModel() {\r\n return GearSection::dropTables() && GearOption::dropTables();\r\n }",
"public function clear()\n {\n self::foreignChecks(false);\n $this->model->truncate();\n self::foreignChecks(true);\n }",
"public function drop ()\n {\n //delete the records of the lookup value\n $records = LookupValue::where('lookup_type_id', 1)->get();\n foreach ( $records as $record )\n $record->forceDelete();\n\n //delete the lookup definition itself\n $record = LookupType::find(1);\n $record->forceDelete();\n }",
"public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }",
"public function unpopulate();",
"public function reset()\n {\n $this->values[self::SCHEMA] = null;\n }",
"protected function tear_down()\n {\n unset($this->_object, $this->_view);\n }",
"protected static function boot()\n {\n \tparent::boot();\n\n \tstatic::deleting(function($model) {\n \t\t$model->attributes()->sync([]);\n \t});\n }",
"public function unsetAll() {\n\t\tparent::unsetAll();\n\t}",
"protected function tearDown(): void\n {\n $this->schema('default')->drop('users');\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::deleting(function ($model) {\n $model->roles()->detach();\n $model->routes()->detach();\n $model->actions()->detach();\n });\n }",
"public function uninstall(){\n MergeRequestComment::dropTable();\n MergeRequest::dropTable();\n CommitCache::dropTable();\n Repo::dropTable();\n Project::dropTable();\n }",
"public static function clearDriver()\n {\n self::$driver = null;\n }",
"public function tear_down()\n {\n }",
"public function tear_down()\n {\n }",
"public function tear_down()\n {\n }",
"public function cleanup(Model $Model) {\n\t\tif (isset($this->config[$Model->alias]['fields']))\n\t\t\t$this->unbindThumbnail($Model, $this->config[$Model->alias]['fields']);\n\n\t\tif (isset($this->config[$Model->alias]))\n\t\t\tunset($this->config[$Model->alias]);\n\t}",
"public function resetRelations()\n\t{\n\t\t$this->relations = array();\n\t}",
"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 static function reset()\n {\n self::$config = null;\n self::$configLoaded = false;\n }",
"protected function forgetAddedModels()\n {\n $this->quantities = $this->modelPopulators = [];\n }",
"public function clear()\n {\n foreach ($this->objectsRepository as $repository) {\n if ($repository instanceof Repository) {\n $repository->clear();\n }\n }\n parent::clear();\n $this->objectsRepository = [];\n }",
"public function down()\n {\n Schema::drop('locations');\n }",
"protected function tearDown()\n {\n \n unset($this->object->db);\n\n }",
"protected function tearDown()\n {\n unset($this->constraint);\n }",
"public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}",
"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 tearDown(): void\n {\n $this->schema($this->schemaName)->drop('users');\n $this->schema($this->schemaName)->drop('emails');\n $this->schema($this->schemaName)->drop('phones');\n $this->schema($this->schemaName)->drop('role_users');\n $this->schema($this->schemaName)->drop('roles');\n $this->schema($this->schemaName)->drop('permission_roles');\n $this->schema($this->schemaName)->drop('permissions');\n $this->schema($this->schemaName)->drop('tasks');\n $this->schema($this->schemaName)->drop('locations');\n $this->schema($this->schemaName)->drop('assignments');\n $this->schema($this->schemaName)->drop('jobs');\n\n Relation::morphMap([], false);\n\n parent::tearDown();\n }",
"private function clear_dummy_data()\n {\n $this->adapter->query('DELETE FROM ' . RUCKUSING_TS_SCHEMA_TBL_NAME);\n }",
"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 static function unsetDbConnection(){\n\t\tself::$db=null;\n\t}",
"public function forceSourceOff()\n {\n $this->sendCommand(static::RCMD_SRC_FORCE_OFF);\n }",
"public function reset() {\n $this->num_aliases = 0;\n $this->alias2class = array();\n $this->alias2table = array();\n }",
"public function clear()\n {\n $this->repository = array();\n }",
"public static function clear(): void\n {\n self::$dialects = [];\n self::$definitions = [];\n self::$loaded = [];\n }",
"public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }",
"protected function tearDown(): void\n {\n $this->schema()->drop('users');\n $this->schema()->drop('users_created_at');\n $this->schema()->drop('users_updated_at');\n }",
"public function down()\n\t{\n\t\t//\n Schema::drop('satellites');\n\t}",
"public function __destruct()\n {\n\tunset($this->model);\n }",
"public function clearRootBindings();",
"protected static function booted(): void\n {\n static::deleting(function (Model $model) {\n $model->removeAllImages();\n });\n }",
"public function clear()\n {\n foreach ($this->backends as $b) {\n $b->clear();\n }\n }",
"protected function tearDown()\r\n {\r\n $this->driver = null;\r\n parent::tearDown();\r\n }",
"protected function reset()\n {\n $this->config = array();\n $this->pathsToIgnore = array();\n }",
"function unregister()\n {\n spl_autoload_unregister([$this, 'resolve']);\n }",
"static function dropAllConnection(){\r\n foreach(self::I()->connection as $name => &$connection)\r\n {\r\n $connection = null;\r\n unset(self::I()->connection[$name]);\r\n }\r\n }",
"public function tearDown()\n {\n $this->schema()->drop('users');\n $this->schema()->drop('users32');\n $this->schema()->drop('usersb');\n $this->schema()->drop('posts');\n $this->schema()->drop('posts32');\n $this->schema()->drop('postsb');\n $this->schema()->drop('rolesb');\n $this->schema()->drop('roles32');\n $this->schema()->drop('user32_role32');\n $this->schema()->drop('userb_roleb');\n }",
"public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }",
"public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }",
"public function clearCache()\n {\n $this->entities = null;\n $this->entitiesAreLoaded = false;\n $this->fields = [];\n\n $em = $this->getEntityManager();\n $em->clear('Oro\\Bundle\\EntityConfigBundle\\Entity\\FieldConfigModel');\n $em->clear('Oro\\Bundle\\EntityConfigBundle\\Entity\\EntityConfigModel');\n }",
"public function tearDown()\n {\n $this->flushModelEventListeners();\n parent::tearDown();\n unset($this->app);\n\n /*\n * Restore environment\n */\n if (file_exists(base_path($this->envTestingFile())) && file_exists(base_path('.env.backup'))) {\n $this->restoreEnvironment();\n }\n }",
"public function reset(): void\n {\n $this->data = [];\n $this->relationships = [];\n }",
"public function unregisterModelMock($modelClass)\n {\n if (isset($this->_registeredModelMocks[$modelClass])) {\n unset($this->_registeredModelMocks[$modelClass]);\n }\n }",
"private function purgeExisting() {\n $paths = array('tax/calculation', 'tax/calculation_rate', 'tax/calculation_rule');\n\n foreach( $paths as $path ) {\n $existingRecords = Mage::getModel($path)->getCollection();\n\n foreach( $existingRecords as $record ) {\n\n try {\n $record->delete();\n }\n catch (Exception $e) {\n Mage::getSingleton('core/session')->addError(\"There was an error deleting from Magento model \" . $path);\n }\n\n }\n\n }\n\n }",
"protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }",
"public function clear()\n {\n foreach ($this->testPacks['non-persistent'] as $alias => $entity) {\n unset($this->entities[$alias]);\n }\n\n $this->testPacks['non-persistent'] = [];\n\n $this->rollbackToSavePoint();\n\n return $this;\n }",
"public static function resetAll(): void\n {\n static::getFacadeRoot()->resetAll();\n }",
"public function removeFromSource(Model $model, string $source)\n {\n // Set the active datasource to the provided source and retrieve it\n $originalActiveKey = $this->activeDatasourceKey;\n $this->activeDatasourceKey = $source;\n $datasource = $this->getActiveDatasource();\n\n // Get the path parts\n $dirName = $model->getObjectTypeDirName();\n list($fileName, $extension) = $model->getFileNameParts();\n\n // Perform a forced delete on the selected datasource to ensure it's removed\n $this->forceDelete($dirName, $fileName, $extension);\n\n // Restore the original active datasource\n $this->activeDatasourceKey = $originalActiveKey;\n }",
"public function unsetSourceId(): void\n {\n $this->sourceId = [];\n }"
] | [
"0.6991766",
"0.67543536",
"0.67543536",
"0.65499735",
"0.60841894",
"0.5916611",
"0.5754598",
"0.5667877",
"0.5643645",
"0.56382513",
"0.5610049",
"0.5541841",
"0.5490016",
"0.5461307",
"0.5368551",
"0.53546363",
"0.53523505",
"0.5347345",
"0.53370273",
"0.53142",
"0.53045297",
"0.5302879",
"0.52922195",
"0.52922195",
"0.52727014",
"0.52698267",
"0.526752",
"0.52228504",
"0.52179754",
"0.5211016",
"0.5149404",
"0.5146812",
"0.51095027",
"0.5096005",
"0.50872195",
"0.5059427",
"0.50454706",
"0.50432247",
"0.5027531",
"0.5027088",
"0.5013677",
"0.5009716",
"0.50084037",
"0.5002062",
"0.49923417",
"0.49779868",
"0.4971269",
"0.49669912",
"0.49511454",
"0.49511454",
"0.49511454",
"0.49417815",
"0.49394304",
"0.49389485",
"0.49314535",
"0.49302778",
"0.4916949",
"0.49156725",
"0.49085024",
"0.4890969",
"0.48617822",
"0.48582187",
"0.48573798",
"0.48512065",
"0.48509943",
"0.48484913",
"0.48377407",
"0.4832374",
"0.48172885",
"0.4814952",
"0.48072022",
"0.48034218",
"0.47956687",
"0.47893432",
"0.4789035",
"0.47875062",
"0.4787165",
"0.47817823",
"0.47791928",
"0.47785214",
"0.4770784",
"0.47684613",
"0.4767464",
"0.476427",
"0.47626227",
"0.47569242",
"0.4749418",
"0.4745683",
"0.47443908",
"0.4741467",
"0.47382018",
"0.47382018",
"0.47382018",
"0.47382018",
"0.47382018",
"0.47364184",
"0.47357738",
"0.4735687",
"0.47288445",
"0.47192517"
] | 0.7958001 | 0 |
Get the event dispatcher instance. | public static function getEventDispatcher()
{
return static::$dispatcher;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getEventDispatcherService()\n {\n if (isset($this->shared['event_dispatcher'])) return $this->shared['event_dispatcher'];\n\n $class = $this->getParameter('event_dispatcher.class');\n $instance = new $class($this);\n $this->shared['event_dispatcher'] = $instance;\n\n return $instance;\n }",
"protected function getEventDispatcher()\n {\n return $this->eventDispatcher;\n }",
"public function getDispatcher(): Dispatcher\n {\n return $this->events;\n }",
"public function getEventDispatcher()\n {\n if (!isset($this['pantono.event.dispatcher'])) {\n $this['pantono.event.dispatcher'] = new Dispatcher($this);\n }\n return $this['pantono.event.dispatcher'];\n }",
"protected function getDispatcher()\n {\n return $this->di->getShared('dispatcher');\n }",
"public function getEventDispatcher()\n {\n return $this->eventDispatcher;\n }",
"static function getEventDispatcher() {\n\t\treturn self::getRegistry()->get(self::REGISTRY_EVENT_DISPATCHER);\n\t}",
"public static function get() {\n\t\tstatic $singleton = NULL;\n\t\tis_null($singleton) && $singleton = new Dispatcher();\n\t\treturn $singleton;\n\t}",
"public function getDispatcher(): EventDispatcherInterface;",
"public function getEventDispatcher()\n {\n return $this->options['event_dispatcher'];\n }",
"public function getEventDispatcher(): ?Dispatcher\n {\n if ($this->container->bound('events')) {\n return $this->container['events'];\n }\n\n return null;\n }",
"public function getDispatcher() {\n return $this->dispatcher;\n }",
"public function getEventDispatcher(): EventDispatcherInterface;",
"public function getDispatcher(): DispatcherContract\n {\n return $this->events;\n }",
"public static function getEventDispatcher()\n {\n if (static::$sharedInstance !== null) {\n return static::$sharedInstance;\n }\n\n global $app;\n\n $appEventDispatcher = null;\n if ($app instanceof Application) {\n static::$allowCodeceptionHooks = true;\n $appEventDispatcher = static::getAppEventDispatcher($app);\n } else {\n static::$allowCodeceptionHooks = false;\n $appEventDispatcher = new SymfonyEventDispatcher();\n }\n\n if (! $appEventDispatcher instanceof SymfonyEventDispatcher) {\n throw new TestRuntimeException(sprintf(\n '\\\\Codeception\\\\Codecept::$eventDispatcher property is not an instance of %s; value is instead: %s',\n SymfonyEventDispatcher::class,\n print_r($appEventDispatcher, true)\n ));\n }\n\n static::$sharedInstance = new self($appEventDispatcher);\n\n return static::$sharedInstance;\n }",
"public static function getEventDispatcher()\n {\n }",
"protected function getDispatcherListener()\n {\n return $this->di->getShared('dispatcherListener');\n }",
"public function getEventDispatcher()\n\t{\n\t\treturn $this->neoeloquent->getEventDispatcher();\n\t}",
"public function getEventDispatcher()\n {\n return $this->events;\n }",
"public function getEventDispatcher()\n {\n return $this->events;\n }",
"public static function getEventDispatcher(){\n\t\treturn \\Illuminate\\Log\\Writer::getEventDispatcher();\n\t}",
"public function getEventDispatcher()\n\t{\n\t\treturn $this->events;\n\t}",
"function &getDispatcher() {\n $dispatcher =& Registry::get('dispatcher', true, null);\n\n if (is_null($dispatcher)) {\n import('ikto.classes.core.ScienceJournalDispatcher');\n\n // Implicitly set dispatcher by ref in the registry\n $dispatcher = new ScienceJournalDispatcher();\n\n // Inject dependency\n $dispatcher->setApplication(PKPApplication::getApplication());\n\n // Inject router configuration\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalComponentRouter', ROUTE_COMPONENT);\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalPageRouter', ROUTE_PAGE);\n }\n\n return $dispatcher;\n }",
"public static function get_instance() \n {\n if ( ! isset(self::$instance)) \n {\n self::$instance = new Event();\n }\n\n return self::$instance;\n }",
"protected function getSignalSlotDispatcher() {\n\t\treturn $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher');\n\t}",
"public static function getSignalSlotDispatcher(): Dispatcher\n {\n return GeneralUtility::makeInstance(Dispatcher::class);\n }",
"public function getDispatcher(): RequestHandlerInterface {\n return $this->dispatcher;\n }",
"public function getDispatcherEvents()\n\t{\n\t\treturn $this->dispatcher;\n\t}",
"public function getOriginalEventDispatcher()\n {\n return $this->eventDispatcher;\n }",
"public function getDispatcher(): ?DispatcherInterface\n {\n return $this->dispatcher;\n }",
"public static function instance() {\n if ( ! isset( self::$instance ) && ! ( self::$instance instanceof FFW_EVENTS ) ) {\n self::$instance = new FFW_EVENTS;\n self::$instance->setup_constants();\n self::$instance->includes();\n // self::$instance->load_textdomain();\n // use @examples from public vars defined above upon implementation\n }\n return self::$instance;\n }",
"public function getEventLoop() {\n\t\treturn $this->eventLoop;\n\t}",
"protected function getSwiftmailer_Mailer_Default_Transport_EventdispatcherService()\n {\n return $this->services['swiftmailer.mailer.default.transport.eventdispatcher'] = new \\Swift_Events_SimpleEventDispatcher();\n }",
"protected function getEventDispatcherService()\n {\n $this->services['event_dispatcher'] = $instance = new \\Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher($this);\n\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 0);\n $instance->addListener('kernel.controller', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelController'), 0);\n $instance->addListener('kernel.view', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelView'), 0);\n $instance->addListener('kernel.exception', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelException'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['response_listener']) ? $this->services['response_listener'] : $this->services['response_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener('UTF-8')) && false ?: '_'};\n }, 1 => 'onKernelResponse'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['streamed_response_listener']) ? $this->services['streamed_response_listener'] : $this->services['streamed_response_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), -1024);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['locale_listener']) ? $this->services['locale_listener'] : $this->getLocaleListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 16);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['locale_listener']) ? $this->services['locale_listener'] : $this->getLocaleListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['validate_request_listener']) ? $this->services['validate_request_listener'] : $this->services['validate_request_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 256);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['resolve_controller_name_subscriber']) ? $this->services['resolve_controller_name_subscriber'] : $this->getResolveControllerNameSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 24);\n $instance->addListener('console.error', array(0 => function () {\n return ${($_ = isset($this->services['console.error_listener']) ? $this->services['console.error_listener'] : $this->load('getConsole_ErrorListenerService.php')) && false ?: '_'};\n }, 1 => 'onConsoleError'), -128);\n $instance->addListener('console.terminate', array(0 => function () {\n return ${($_ = isset($this->services['console.error_listener']) ? $this->services['console.error_listener'] : $this->load('getConsole_ErrorListenerService.php')) && false ?: '_'};\n }, 1 => 'onConsoleTerminate'), -128);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['session_listener']) ? $this->services['session_listener'] : $this->getSessionListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 128);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['session_listener']) ? $this->services['session_listener'] : $this->getSessionListenerService()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), -1000);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['session_listener']) ? $this->services['session_listener'] : $this->getSessionListenerService()) && false ?: '_'};\n }, 1 => 'onFinishRequest'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['session.save_listener']) ? $this->services['session.save_listener'] : $this->services['session.save_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\SaveSessionListener()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), -1000);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['translator_listener']) ? $this->services['translator_listener'] : $this->getTranslatorListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 10);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['translator_listener']) ? $this->services['translator_listener'] : $this->getTranslatorListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['debug.debug_handlers_listener']) ? $this->services['debug.debug_handlers_listener'] : $this->getDebug_DebugHandlersListenerService()) && false ?: '_'};\n }, 1 => 'configure'), 2048);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['router_listener']) ? $this->services['router_listener'] : $this->getRouterListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 32);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['router_listener']) ? $this->services['router_listener'] : $this->getRouterListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n $instance->addListener('kernel.exception', array(0 => function () {\n return ${($_ = isset($this->services['router_listener']) ? $this->services['router_listener'] : $this->getRouterListenerService()) && false ?: '_'};\n }, 1 => 'onKernelException'), -64);\n $instance->addListener('console.error', array(0 => function () {\n return ${($_ = isset($this->services['maker.console_error_listener']) ? $this->services['maker.console_error_listener'] : $this->services['maker.console_error_listener'] = new \\Symfony\\Bundle\\MakerBundle\\Event\\ConsoleErrorSubscriber()) && false ?: '_'};\n }, 1 => 'onConsoleError'), 0);\n $instance->addListener('console.terminate', array(0 => function () {\n return ${($_ = isset($this->services['maker.console_error_listener']) ? $this->services['maker.console_error_listener'] : $this->services['maker.console_error_listener'] = new \\Symfony\\Bundle\\MakerBundle\\Event\\ConsoleErrorSubscriber()) && false ?: '_'};\n }, 1 => 'onConsoleTerminate'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['security.rememberme.response_listener']) ? $this->services['security.rememberme.response_listener'] : $this->services['security.rememberme.response_listener'] = new \\Symfony\\Component\\Security\\Http\\RememberMe\\ResponseListener()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), 0);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['security.firewall']) ? $this->services['security.firewall'] : $this->getSecurity_FirewallService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 8);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['security.firewall']) ? $this->services['security.firewall'] : $this->getSecurity_FirewallService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n\n return $instance;\n }",
"public static function getInstance() {\n\t\tif (!is_null(self::$INSTANCE)) {\n\t\t\treturn self::$INSTANCE;\n\t\t}\n\n\t\t$page = self::getPage(PhpBB::getInstance()->getRequest());\n\t\tself::$INSTANCE = self::getDispatcherType($page);\n\t\tself::$INSTANCE->page = $page;\n\t\tself::$INSTANCE->controller = AController::getInstance($page);\n\t\treturn self::$INSTANCE;\n\t}",
"public static function getSharedDispatcher()\n {\n if (!self::$sharedDispatcher) {\n /** @var ObjectManagerInterface $objectManager */\n $objectManager = GeneralUtility::makeInstance(ObjectManager::class);\n $requestFactory = $objectManager->getRequestFactory();\n $responseFactory = $objectManager->getResponseFactory();\n /** @var LoggerInterface $logger */\n $logger = $objectManager->get(LoggerInterface::class);\n new static($objectManager, $requestFactory, $responseFactory, $logger);\n }\n\n return self::$sharedDispatcher;\n }",
"protected function getDispatcherService()\n {\n $this->services['dispatcher'] = $instance = new \\phpbb\\event\\dispatcher($this);\n\n $instance->addListener('core.viewtopic_post_row_after', [0 => function () {\n return ${($_ = isset($this->services['phpbb.viglink.listener']) ? $this->services['phpbb.viglink.listener'] : $this->getPhpbb_Viglink_ListenerService()) && false ?: '_'};\n }, 1 => 'display_viglink'], 0);\n $instance->addListener('core.acp_main_notice', [0 => function () {\n return ${($_ = isset($this->services['phpbb.viglink.acp_listener']) ? $this->services['phpbb.viglink.acp_listener'] : $this->getPhpbb_Viglink_AcpListenerService()) && false ?: '_'};\n }, 1 => 'set_viglink_services'], 0);\n $instance->addListener('core.acp_help_phpbb_submit_before', [0 => function () {\n return ${($_ = isset($this->services['phpbb.viglink.acp_listener']) ? $this->services['phpbb.viglink.acp_listener'] : $this->getPhpbb_Viglink_AcpListenerService()) && false ?: '_'};\n }, 1 => 'update_viglink_settings'], 0);\n $instance->addListener('console.exception', [0 => function () {\n return ${($_ = isset($this->services['console.exception_subscriber']) ? $this->services['console.exception_subscriber'] : $this->getConsole_ExceptionSubscriberService()) && false ?: '_'};\n }, 1 => 'on_exception'], 0);\n $instance->addListener('kernel.terminate', [0 => function () {\n return ${($_ = isset($this->services['cron.event_listener']) ? $this->services['cron.event_listener'] : $this->getCron_EventListenerService()) && false ?: '_'};\n }, 1 => 'on_kernel_terminate'], 0);\n $instance->addListener('kernel.exception', [0 => function () {\n return ${($_ = isset($this->services['kernel_exception_subscriber']) ? $this->services['kernel_exception_subscriber'] : $this->getKernelExceptionSubscriberService()) && false ?: '_'};\n }, 1 => 'on_kernel_exception'], 0);\n $instance->addListener('kernel.terminate', [0 => function () {\n return ${($_ = isset($this->services['kernel_terminate_subscriber']) ? $this->services['kernel_terminate_subscriber'] : ($this->services['kernel_terminate_subscriber'] = new \\phpbb\\event\\kernel_terminate_subscriber())) && false ?: '_'};\n }, 1 => 'on_kernel_terminate'], -9223372036854775807-1);\n $instance->addListener('kernel.response', [0 => function () {\n return ${($_ = isset($this->services['symfony_response_listener']) ? $this->services['symfony_response_listener'] : ($this->services['symfony_response_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener('UTF-8'))) && false ?: '_'};\n }, 1 => 'onKernelResponse'], 0);\n $instance->addListener('kernel.request', [0 => function () {\n return ${($_ = isset($this->services['router.listener']) ? $this->services['router.listener'] : $this->getRouter_ListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'], 32);\n $instance->addListener('kernel.finish_request', [0 => function () {\n return ${($_ = isset($this->services['router.listener']) ? $this->services['router.listener'] : $this->getRouter_ListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'], 0);\n $instance->addListener('kernel.exception', [0 => function () {\n return ${($_ = isset($this->services['router.listener']) ? $this->services['router.listener'] : $this->getRouter_ListenerService()) && false ?: '_'};\n }, 1 => 'onKernelException'], -64);\n\n return $instance;\n }",
"public function getEventManager()\n {\n if (!isset($this['event.manager'])) {\n $this['event.manager'] = new Manager($this['dispatcher']);\n }\n return $this['event.manager'];\n }",
"public static function getInstance()\n {\n static $instance = false;\n\n if (!$instance) {\n $instance = new \\Xoops\\Core\\Events();\n }\n\n return $instance;\n }",
"public static function getDispatcher($ignoreCache = false)\n {\n $class = get_called_class();\n if ($ignoreCache || !isset(self::$dispatchers[$class])) {\n self::$dispatchers[$class] = new EventDispatcher();\n }\n\n return self::$dispatchers[$class];\n }",
"protected static function getAppEventDispatcher(Application $app = null)\n {\n if ($app === null) {\n global $app;\n }\n\n if (! $app instanceof Application) {\n return null;\n }\n\n try {\n $runningCommand = readPrivateProperty($app, 'runningCommand');\n\n if (! $runningCommand instanceof Command) {\n throw new TestRuntimeException(\n 'Running command is empty or not an instance of the ' .\n 'Symfony\\Component\\Console\\Command\\Command class.'\n );\n }\n\n $codecept = readPrivateProperty($runningCommand, 'codecept');\n\n if (! $codecept instanceof Codecept) {\n throw new TestRuntimeException(\n 'Running command $codecept property is not set or not the correct type.'\n );\n }\n\n $appDispatcher = $codecept->getDispatcher();\n } catch (\\ReflectionException $e) {\n throw new TestRuntimeException(\n 'Could not get the value of the command $codecept property, message:' .\n $e->getMessage()\n );\n }\n\n return $appDispatcher;\n }",
"public function event(): EventDispatcherInterface;",
"public function getEventManager()\n {\n if ($this->eventManager == null) {\n ControllerException::eventManagerNotDefined();\n }\n\n return $this->eventManager;\n }",
"protected function getEventDispatcherService()\n {\n $this->services['event_dispatcher'] = $instance = new \\Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher($this);\n\n $instance->addListenerService('kernel.request', array(0 => 'knp_menu.listener.voters', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_blog.blog_menu_listener', 1 => 'addGlobal'), 90);\n $instance->addListenerService('victoire_core.article_menu.contextual', array(0 => 'victoire_blog.article_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.article_menu.contextual', array(0 => 'victoire_blog.article_settings_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.blog_menu.contextual', array(0 => 'victoire_blog.blog_menu.contextual', 1 => 'addBlogContextual'), 0);\n $instance->addListenerService('victoire_core.article_template_menu.contextual', array(0 => 'victoire_blog.article_template_menu.menu_listener.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.blog_menu.contextual', array(0 => 'victoire_blog.blog_page_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire.widget_filter.form.pre_set_data', array(0 => 'victoire.widget_filter.form.listener.presetdata', 1 => 'manageExtraFiltersFields'), 1);\n $instance->addListenerService('victoire.widget_filter.form.pre_submit', array(0 => 'victoire.widget_filter.form.listener.presubmit', 1 => 'manageExtraFiltersFields'), 1);\n $instance->addListenerService('victoire.widget_filter.form.date.set_default_value', array(0 => 'victoire.widget_filter.blog.set.default.values.form.listener', 1 => 'setDefaultDateValue'), 1);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_business_page.business_template_menu_listener', 1 => 'addGlobal'), 50);\n $instance->addListenerService('victoire_core.business_template_menu.contextual', array(0 => 'victoire_core.business_template_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_core.menu_dispatcher', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.backend_menu.global', array(0 => 'victoire_core.backend_menu_listener', 1 => 'addGlobal'), 100);\n $instance->addListenerService('kernel.controller', array(0 => 'victoire_core.listener.controller_listener', 1 => 'preExecuteAutorun'), 0);\n $instance->addListenerService('victoire.on_render_page', array(0 => 'victoire_core.view_css_listener', 1 => 'onRenderPage'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_i18n.kernelrequest.listener', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.media_menu_listener', 1 => 'addGlobal'), 60);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.page_menu_listener', 1 => 'addGlobal'), 100);\n $instance->addListenerService('victoire_core.page_menu.contextual', array(0 => 'victoire_core.page_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_sitemap.sitemap_menu_listener', 1 => 'addGlobal'), 70);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.template_menu_listener', 1 => 'addGlobal'), 80);\n $instance->addListenerService('victoire_core.template_menu.contextual', array(0 => 'victoire_core.template_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_twig.kernelrequest.listener', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_view_reference.cache_warmer', 1 => 'warmUp'), 0);\n $instance->addSubscriberService('response_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ResponseListener');\n $instance->addSubscriberService('streamed_response_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\StreamedResponseListener');\n $instance->addSubscriberService('locale_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\LocaleListener');\n $instance->addSubscriberService('validate_request_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ValidateRequestListener');\n $instance->addSubscriberService('translator_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\TranslatorListener');\n $instance->addSubscriberService('session_listener', 'Symfony\\\\Bundle\\\\FrameworkBundle\\\\EventListener\\\\SessionListener');\n $instance->addSubscriberService('session.save_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\SaveSessionListener');\n $instance->addSubscriberService('fragment.listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\FragmentListener');\n $instance->addSubscriberService('debug.debug_handlers_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\DebugHandlersListener');\n $instance->addSubscriberService('router_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\RouterListener');\n $instance->addSubscriberService('security.firewall', 'Symfony\\\\Component\\\\Security\\\\Http\\\\Firewall');\n $instance->addSubscriberService('security.rememberme.response_listener', 'Symfony\\\\Component\\\\Security\\\\Http\\\\RememberMe\\\\ResponseListener');\n $instance->addSubscriberService('twig.exception_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ExceptionListener');\n $instance->addSubscriberService('monolog.handler.console', 'Symfony\\\\Bridge\\\\Monolog\\\\Handler\\\\ConsoleHandler');\n $instance->addSubscriberService('swiftmailer.email_sender.listener', 'Symfony\\\\Bundle\\\\SwiftmailerBundle\\\\EventListener\\\\EmailSenderListener');\n $instance->addSubscriberService('sensio_framework_extra.controller.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\ControllerListener');\n $instance->addSubscriberService('sensio_framework_extra.converter.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\ParamConverterListener');\n $instance->addSubscriberService('sensio_framework_extra.view.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\TemplateListener');\n $instance->addSubscriberService('sensio_framework_extra.cache.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\HttpCacheListener');\n $instance->addSubscriberService('sensio_framework_extra.security.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\SecurityListener');\n $instance->addSubscriberService('troopers_alertifybundle.event_listener', 'Troopers\\\\AlertifyBundle\\\\EventListener\\\\AlertifyListener');\n $instance->addSubscriberService('fos_user.security.interactive_login_listener', 'FOS\\\\UserBundle\\\\EventListener\\\\LastLoginListener');\n $instance->addSubscriberService('fos_user.listener.authentication', 'FOS\\\\UserBundle\\\\EventListener\\\\AuthenticationListener');\n $instance->addSubscriberService('fos_user.listener.flash', 'FOS\\\\UserBundle\\\\EventListener\\\\FlashListener');\n $instance->addSubscriberService('fos_user.listener.resetting', 'FOS\\\\UserBundle\\\\EventListener\\\\ResettingListener');\n $instance->addSubscriberService('victoire_core.cache_subscriber', 'Victoire\\\\Bundle\\\\CoreBundle\\\\EventSubscriber\\\\CacheSubscriber');\n $instance->addSubscriberService('victoire_i18n.locale_subscriber', 'Victoire\\\\Bundle\\\\I18nBundle\\\\Subscriber\\\\LocaleSubscriber');\n $instance->addSubscriberService('victoire_view_reference.listener', 'Victoire\\\\Bundle\\\\ViewReferenceBundle\\\\Listener\\\\ViewReferenceListener');\n\n return $instance;\n }",
"public static function get_instance()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n self::$instance->hooks();\n }\n return self::$instance;\n }",
"private function getEventManager()\n {\n return $this->container->get('event_manager');\n }",
"public function getEvent()\n {\n return $this->getServiceLocator()->get('Application')->getEventManager();\n }",
"public static function getInstance() {\n return self::$instance;\n }",
"public static function get_instance() {\n\t\tif( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t\tself::$instance->hooks();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function getDispatcher($name = 'SHFactory')\n\t{\n\t\t$name = strtolower($name);\n\n\t\tif (!isset(self::$dispatcher[$name]))\n\t\t{\n\t\t\t// Something is up with the deprecation of JDispatcher in newer Joomla Versions\n\t\t\tif (class_exists('JDispatcher'))\n\t\t\t{\n\t\t\t\t// J2.5\n\t\t\t\tself::$dispatcher[$name] = new JDispatcher;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// J3.0+ and Platform\n\t\t\t\tself::$dispatcher[$name] = new JEventDispatcher;\n\t\t\t}\n\t\t}\n\n\t\treturn self::$dispatcher[$name];\n\t}",
"public function setDispatcher(EventDispatcher $dispatcher)\n {\n $this->dispatcher = $dispatcher;\n return $this;\n }",
"public static function instance() {\n\t\treturn tribe( 'events-aggregator.service' );\n\t}",
"public static function get_instance() {\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t\tself::$instance->hooks();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public function getEventsManager()\n {\n return $this->eventsManager;\n }",
"protected function createDispatcher()\n {\n return $this->dispatcher ?: \\FastRoute\\simpleDispatcher(function (\\FastRoute\\RouteCollector $r) {\n foreach ($this->routes as $pattern => $route) {\n $r->addRoute($route['methods'], $pattern, $route['handler']);\n }\n });\n }",
"public static function instance() {\n\t\tif ( is_null( static::$instance ) ) {\n\t\t\tstatic::$instance = new self();\n\t\t\tstatic::$instance->init_hooks();\n\t\t}\n\n\t\treturn static::$instance;\n\t}",
"public static function get_instance() {\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\t\treturn self::$instance;\n\t}",
"public static function getInstance()\n {\n return self::$instance;\n }",
"public static function getInstance()\n {\n return self::$instance;\n }",
"public static function get() {\n\t\tif ( self::$instance === null )\n\t\t\tself::$instance = new self();\n\n\t\treturn self::$instance;\n\t}",
"public function getEventManager()\n {\n return $this->eventManager;\n }",
"public function getEventManager()\n {\n return $this->eventManager;\n }",
"public function getInstance()\n {\n return self::$instance;\n }",
"public static function getInstance()\n {\n if (null === self::$instance) {\n self::initInstance();\n }\n\n return self::$instance;\n }",
"public static function instance() {\n return self::$instance;\n }",
"public static function getInstance()\n {\n return static::$instance;\n }",
"public static function get() {\n\t\tif ( self::$instance == null ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"function FFW_EVENTS() {\n return FFW_EVENTS::instance();\n}",
"public static function instance() {\r\n return self::$instance;\r\n }",
"public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager);\n }\n\n return $this->eventManager;\n }",
"public static function get() {\r\n\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$instance;\r\n\r\n\t}",
"public function getEventManager()\n {\n return $this->events;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public static function getInstance()\r\n {\r\n return static::$instance;\r\n }",
"public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager());\n }\n\n return $this->eventManager;\n }",
"public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager());\n }\n\n return $this->eventManager;\n }",
"public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager());\n }\n\n return $this->eventManager;\n }",
"public function getEventManager()\n {\n if (null === $this->eventManager) {\n $this->setEventManager(new EventManager());\n }\n\n return $this->eventManager;\n }",
"public static function instance() {\n\t\treturn static::$instance;\n\t}",
"function get() {\n\t\tif (!self::$instance) self::$instance = new self;\n\t\treturn self::$instance;\n\t}",
"public static function get()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n return self::$instance;\n }",
"public static function getInstance() {\n\t\treturn self::$instance;\n\t}",
"public function getEventManager()\n {\n if (is_null($this->_events)) {\n $container = ContainerBuilder::buildContainer(\n [\n 'DefaultEventManager' => Definition::object(\n 'Zend\\EventManager\\SharedEventManager'\n )\n ]\n );\n $sharedEvents = $container->get('DefaultEventManager');\n $events = new EventManager();\n $events->setSharedManager($sharedEvents);\n $this->setEventManager($events);\n }\n return $this->_events;\n }",
"public static function get() \n {\n if (!isset(self::$instance)) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public static function getInstance()\n\t{\n\t\treturn self::$instance;\n\t}",
"public static function getRestDispatch() : RestDispatch\n {\n static $dispatch;\n\n if ($dispatch === null || ! ($dispatch instanceof RestDispatch)) {\n $dispatch = new RestDispatch();\n }\n\n return $dispatch;\n }",
"public static function getInstance() {\n if (is_null(self::$_instance)) {\n self::$_instance = self::bootstrap();\n }\n \n return self::$_instance;\n }",
"public static function getInstance()\n {\n if (self::$instance === null) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }",
"public static function getInstance(): self\n {\n require_once '../routes/web.php';\n\n if (static::$instance === null) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }",
"public function getInstance() {\n\t\treturn $this->instance;\n\t}",
"private function getEventDispatcherServiceId()\n {\n return 'event_dispatcher';\n }",
"public function registerSymfonyDispatcher()\n {\n try {\n $this->app['symfony.dispatcher'];\n } catch (\\ReflectionException $e) {\n $this->app['symfony.dispatcher'] = $this->app->share(\n function ($app) {\n return new EventDispatcher;\n }\n );\n }\n }",
"public function get_instance() {\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }",
"public static function get_instance() {\n\n if ( ! isset( self::$instance ) ) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }",
"private function getBinderDispatcher(): IBinderDispatcher\n {\n // Always bind the cache so that we have the option to clear it in any environment\n $cachePath = GlobalConfiguration::getString('aphiria.binders.metadataCachePath');\n $cache = new FileBinderMetadataCollectionCache($cachePath);\n $this->container->bindInstance(IBinderMetadataCollectionCache::class, $cache);\n\n return new LazyBinderDispatcher(\\getenv('APP_ENV') === 'production' ? $cache : null);\n }",
"public static function get_instance() {\n\n\t\treturn null === self::$instance ? new self() : self::$instance;\n\n\t}"
] | [
"0.81160486",
"0.80278236",
"0.79869395",
"0.7969047",
"0.7869225",
"0.785308",
"0.7763506",
"0.77522147",
"0.75496876",
"0.75269914",
"0.7480979",
"0.7477476",
"0.7353422",
"0.72507995",
"0.71986276",
"0.71884865",
"0.71487474",
"0.70782775",
"0.70391905",
"0.70391905",
"0.70169383",
"0.6879971",
"0.68737817",
"0.68685246",
"0.67760277",
"0.6759505",
"0.674209",
"0.6699839",
"0.66834545",
"0.66175646",
"0.6597754",
"0.6587921",
"0.6521782",
"0.6512993",
"0.64700425",
"0.6457443",
"0.64370483",
"0.6322735",
"0.63145864",
"0.6307849",
"0.62639624",
"0.6253131",
"0.62500876",
"0.60991865",
"0.6082726",
"0.60469604",
"0.603816",
"0.60019636",
"0.5998497",
"0.5981587",
"0.59788495",
"0.59750664",
"0.5969206",
"0.5967014",
"0.5963276",
"0.59559256",
"0.5945331",
"0.5945331",
"0.5927206",
"0.5927206",
"0.59170705",
"0.59169",
"0.59169",
"0.58938605",
"0.5891513",
"0.5887049",
"0.58697337",
"0.5867441",
"0.58658004",
"0.5854629",
"0.58452296",
"0.58419377",
"0.5840813",
"0.58400714",
"0.58400714",
"0.58400714",
"0.58400714",
"0.58390355",
"0.5837367",
"0.5837367",
"0.5837367",
"0.5837367",
"0.5830119",
"0.5822866",
"0.5810445",
"0.581019",
"0.58055353",
"0.57991445",
"0.57946676",
"0.57934135",
"0.5771573",
"0.57687044",
"0.57682174",
"0.5758309",
"0.5755722",
"0.5745562",
"0.5742529",
"0.57419926",
"0.5738367",
"0.57379097"
] | 0.80964833 | 1 |
Set the event dispatcher instance. | public static function setEventDispatcher(Dispatcher $dispatcher)
{
static::$dispatcher = $dispatcher;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEventDispatcher (Dispatcher $dispatcher) {\n $this->container->instance('events', $dispatcher);\n }",
"public function setEventDispatcher(Dispatcher $dispatcher): void\n {\n $this->container->instance('events', $dispatcher);\n }",
"private function configureDispatcher()\n {\n $dispatcher = new Dispatcher($this->container);\n $this->setDispatcher($dispatcher);\n $this->container->set('dispatcher', $dispatcher);\n }",
"public function setEventDispatcher(EventDispatcherInterface $eventDispatcher): void;",
"public function setDispatcherEvents()\n\t{\n\t\t$this->dispatcher = (new Dispatcher())->register($this->routes);\n\t}",
"public function setEventDispatcher(Dispatcher $events)\n {\n $this->events = $events;\n }",
"public static function setEventDispatcher(Dispatcher $events)\n {\n }",
"public static function setWrappedEventDispatcher(SymfonyEventDispatcherInterface $eventDispatcher)\n {\n if (static::$sharedInstance === null) {\n static::$sharedInstance = new self($eventDispatcher);\n\n return;\n }\n\n static::$sharedInstance->eventDispatcher = $eventDispatcher;\n }",
"public static function setEventDispatcher($dispatcher){\n\t\t\\Illuminate\\Log\\Writer::setEventDispatcher($dispatcher);\n\t}",
"public function setDispatcher(EventDispatcher $dispatcher)\n {\n $this->dispatcher = $dispatcher;\n return $this;\n }",
"public function setEventDispatcher(\\Illuminate\\Events\\Dispatcher $events)\n\t{\n\t\t$this->events = $events;\n\t}",
"public function setDispatcher(DispatcherInterface $dispatcher): void\n {\n $this->dispatcher = $dispatcher;\n }",
"public function setEventDispatcher(IlluminateDispatcher $events)\n\t{\n\t\t$this->neoeloquent->setEventDispatcher(\\App::make(Dispatcher::class));\n\t}",
"public function registerSymfonyDispatcher()\n {\n try {\n $this->app['symfony.dispatcher'];\n } catch (\\ReflectionException $e) {\n $this->app['symfony.dispatcher'] = $this->app->share(\n function ($app) {\n return new EventDispatcher;\n }\n );\n }\n }",
"protected function attachDispatcher($event_dispatcher)\n {\n DocBlox_Parser_Abstract::$event_dispatcher = $event_dispatcher;\n DocBlox_Transformer_Abstract::$event_dispatcher = $event_dispatcher;\n DocBlox_Reflection_Abstract::$event_dispatcher = $event_dispatcher;\n }",
"public function setEventDispatcher(\\Leaps\\Events\\Dispatcher $events)\n {\n $this->events = $events;\n }",
"public function setDispatcher(Dispatcher $events): void\n {\n $this->events = $events;\n }",
"public function setDispatcher(RequestHandlerInterface $dispatcher): void {\n $this->dispatcher = $dispatcher;\n }",
"public function __construct()\n {\n $this->events = new EventDispatcher();\n }",
"public function getDispatcher(): EventDispatcherInterface;",
"protected function getEventDispatcherService()\n {\n if (isset($this->shared['event_dispatcher'])) return $this->shared['event_dispatcher'];\n\n $class = $this->getParameter('event_dispatcher.class');\n $instance = new $class($this);\n $this->shared['event_dispatcher'] = $instance;\n\n return $instance;\n }",
"public static function getEventDispatcher()\n {\n return static::$dispatcher;\n }",
"public function setEventDispatcher(Dispatcher $events)\n {\n $this->events = $events;\n\n return $this;\n }",
"protected function getEventDispatcher()\n {\n return $this->eventDispatcher;\n }",
"public function getEventDispatcher()\n {\n if (!isset($this['pantono.event.dispatcher'])) {\n $this['pantono.event.dispatcher'] = new Dispatcher($this);\n }\n return $this['pantono.event.dispatcher'];\n }",
"public function __construct(EventDispatcherInterface $event_dispatcher) {\n $this->eventDispatcher = $event_dispatcher;\n }",
"public function getEventDispatcher(): EventDispatcherInterface;",
"public function setEventDispatch(\\Montage\\Event\\Dispatch $dispatch);",
"public function getEventDispatcher()\n {\n return $this->eventDispatcher;\n }",
"public function getEventDispatcher()\n {\n return $this->options['event_dispatcher'];\n }",
"public function __construct(EventDispatcherInterface $event_dispatcher) {\n\t\t$this->eventDispatcher = $event_dispatcher;\n\t}",
"public function getDispatcher(): Dispatcher\n {\n return $this->events;\n }",
"public function injectEventDispatcher(\\EssentialDots\\ExtbaseHijax\\Event\\Dispatcher $eventDispatcher) {\n\t\t$this->hijaxEventDispatcher = $eventDispatcher;\n\t}",
"protected function linkEventDispatcherToSuperclasses()\n {\n \\phpDocumentor_Reflection_Abstract::$event_dispatcher = $this['event_dispatcher'];\n \\phpDocumentor_Parser_Abstract::$event_dispatcher = $this['event_dispatcher'];\n \\phpDocumentor_Transformer_Abstract::$event_dispatcher = $this['event_dispatcher'];\n }",
"public function testSettingEventDispatcher()\n {\n $mockEventDispatcher= new MockEventDispatcher();\n $transport = new Transport();\n $returnObject = $transport->setEventDispatcher($mockEventDispatcher);\n $this->assertInstanceOf(Transport::class, $returnObject);\n \n $refTransport = new \\ReflectionObject($transport);\n $eventDispatcher = $refTransport->getProperty('eventDispatcher');\n $eventDispatcher->setAccessible(true);\n $this->assertSame($mockEventDispatcher, $eventDispatcher->getValue($transport));\n }",
"public function __construct(EventDispatcherInterface $event_dispatcher)\n {\n $this->event_dispatcher = $event_dispatcher;\n }",
"private function registerDispatcher()\n\t{\n\t\t$abstract = 'Cerbero\\Workflow\\Wrappers\\DispatcherInterface';\n\n\t\t$this->app->bind($abstract, function($app)\n\t\t{\n\t\t\treturn $app['Cerbero\\Workflow\\Wrappers\\MarshalDispatcher'];\n\t\t});\n\t}",
"private function setupDispatcher()\n {\n $callback = function (\\FastRoute\\RouteCollector $r) {\n foreach ($this->routes as $route) {\n $r->addRoute($route[0], $route[1], $route[2]);\n }\n };\n\n $this->dispatcher = \\FastRoute\\simpleDispatcher($callback);\n }",
"public function testGetSetEventDispatcher()\n {\n $mockEventDispatcher = new MockEventDispatcher();\n $transport = new Transport();\n $refTransport = new \\ReflectionObject($transport);\n $clientProperty = $refTransport->getProperty('eventDispatcher');\n $clientProperty->setAccessible(true);\n $clientProperty->setValue($transport, $mockEventDispatcher);\n $this->assertSame($mockEventDispatcher, $transport->getEventDispatcher());\n }",
"public static function getEventDispatcher()\n {\n }",
"protected function getDispatcher()\n {\n return $this->di->getShared('dispatcher');\n }",
"public function __construct(Dispatcher $dispatcher)\n {\n $this->dispatcher = $dispatcher;\n }",
"public function setUp()\n {\n $this->app->instance($this->name(), new Dispatcher($this->app));\n }",
"public function setEventDispatcher(?EventDispatcherInterface $eventDispatcher = null): NotificationManagerInterface\n {\n $this->eventDispatcher = $eventDispatcher;\n\n return $this;\n }",
"public static function getSignalSlotDispatcher(): Dispatcher\n {\n return GeneralUtility::makeInstance(Dispatcher::class);\n }",
"public function __construct()\n {\n $this->dispatcher = app('Dingo\\Api\\Dispatcher');\n }",
"public function getDispatcher() {\n return $this->dispatcher;\n }",
"public function setAsGlobal()\n {\n static::$instance = $this;\n }",
"protected function getDispatcherService()\n {\n $this->services['dispatcher'] = $instance = new \\phpbb\\event\\dispatcher($this);\n\n $instance->addListener('core.viewtopic_post_row_after', [0 => function () {\n return ${($_ = isset($this->services['phpbb.viglink.listener']) ? $this->services['phpbb.viglink.listener'] : $this->getPhpbb_Viglink_ListenerService()) && false ?: '_'};\n }, 1 => 'display_viglink'], 0);\n $instance->addListener('core.acp_main_notice', [0 => function () {\n return ${($_ = isset($this->services['phpbb.viglink.acp_listener']) ? $this->services['phpbb.viglink.acp_listener'] : $this->getPhpbb_Viglink_AcpListenerService()) && false ?: '_'};\n }, 1 => 'set_viglink_services'], 0);\n $instance->addListener('core.acp_help_phpbb_submit_before', [0 => function () {\n return ${($_ = isset($this->services['phpbb.viglink.acp_listener']) ? $this->services['phpbb.viglink.acp_listener'] : $this->getPhpbb_Viglink_AcpListenerService()) && false ?: '_'};\n }, 1 => 'update_viglink_settings'], 0);\n $instance->addListener('console.exception', [0 => function () {\n return ${($_ = isset($this->services['console.exception_subscriber']) ? $this->services['console.exception_subscriber'] : $this->getConsole_ExceptionSubscriberService()) && false ?: '_'};\n }, 1 => 'on_exception'], 0);\n $instance->addListener('kernel.terminate', [0 => function () {\n return ${($_ = isset($this->services['cron.event_listener']) ? $this->services['cron.event_listener'] : $this->getCron_EventListenerService()) && false ?: '_'};\n }, 1 => 'on_kernel_terminate'], 0);\n $instance->addListener('kernel.exception', [0 => function () {\n return ${($_ = isset($this->services['kernel_exception_subscriber']) ? $this->services['kernel_exception_subscriber'] : $this->getKernelExceptionSubscriberService()) && false ?: '_'};\n }, 1 => 'on_kernel_exception'], 0);\n $instance->addListener('kernel.terminate', [0 => function () {\n return ${($_ = isset($this->services['kernel_terminate_subscriber']) ? $this->services['kernel_terminate_subscriber'] : ($this->services['kernel_terminate_subscriber'] = new \\phpbb\\event\\kernel_terminate_subscriber())) && false ?: '_'};\n }, 1 => 'on_kernel_terminate'], -9223372036854775807-1);\n $instance->addListener('kernel.response', [0 => function () {\n return ${($_ = isset($this->services['symfony_response_listener']) ? $this->services['symfony_response_listener'] : ($this->services['symfony_response_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener('UTF-8'))) && false ?: '_'};\n }, 1 => 'onKernelResponse'], 0);\n $instance->addListener('kernel.request', [0 => function () {\n return ${($_ = isset($this->services['router.listener']) ? $this->services['router.listener'] : $this->getRouter_ListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'], 32);\n $instance->addListener('kernel.finish_request', [0 => function () {\n return ${($_ = isset($this->services['router.listener']) ? $this->services['router.listener'] : $this->getRouter_ListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'], 0);\n $instance->addListener('kernel.exception', [0 => function () {\n return ${($_ = isset($this->services['router.listener']) ? $this->services['router.listener'] : $this->getRouter_ListenerService()) && false ?: '_'};\n }, 1 => 'onKernelException'], -64);\n\n return $instance;\n }",
"public static function get() {\n\t\tstatic $singleton = NULL;\n\t\tis_null($singleton) && $singleton = new Dispatcher();\n\t\treturn $singleton;\n\t}",
"static function getEventDispatcher() {\n\t\treturn self::getRegistry()->get(self::REGISTRY_EVENT_DISPATCHER);\n\t}",
"function &getDispatcher() {\n $dispatcher =& Registry::get('dispatcher', true, null);\n\n if (is_null($dispatcher)) {\n import('ikto.classes.core.ScienceJournalDispatcher');\n\n // Implicitly set dispatcher by ref in the registry\n $dispatcher = new ScienceJournalDispatcher();\n\n // Inject dependency\n $dispatcher->setApplication(PKPApplication::getApplication());\n\n // Inject router configuration\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalComponentRouter', ROUTE_COMPONENT);\n $dispatcher->addRouterName('ikto.classes.core.ScienceJournalPageRouter', ROUTE_PAGE);\n }\n\n return $dispatcher;\n }",
"protected function getSwiftmailer_Mailer_Default_Transport_EventdispatcherService()\n {\n return $this->services['swiftmailer.mailer.default.transport.eventdispatcher'] = new \\Swift_Events_SimpleEventDispatcher();\n }",
"public function injectSignalDispatcher(\\TYPO3\\Flow\\SignalSlot\\Dispatcher $signalDispatcher)\n {\n $this->signalDispatcher = $signalDispatcher;\n }",
"public function __construct(Dispatcher $dispatcher)\n {\n parent::__construct();\n\n $this->dispatcher = $dispatcher;\n }",
"public function __construct(Dispatcher $dispatcher = null)\n {\n parent::__construct($dispatcher);\n }",
"public function register(EventDispatcher $dispatcher)\n {\n $dispatcher->connect('core.exception', array($this, 'handle'));\n }",
"public static function unsetEventDispatcher()\n {\n static::$dispatcher = null;\n }",
"public function testInstanceReturnsGlobalInstanceOfDispatcher()\n\t{\n\t\t$instance1 = Dispatcher::instance();\n\n\t\t$instance2 = Dispatcher::instance();\n\n\t\t$this->assertSame($instance1, $instance2);\n\t}",
"protected function getEventDispatcherService()\n {\n $this->services['event_dispatcher'] = $instance = new \\Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher($this);\n\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 0);\n $instance->addListener('kernel.controller', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelController'), 0);\n $instance->addListener('kernel.view', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelView'), 0);\n $instance->addListener('kernel.exception', array(0 => function () {\n return ${($_ = isset($this->services['App\\EventSubscriber\\RestSubscriber']) ? $this->services['App\\EventSubscriber\\RestSubscriber'] : $this->getRestSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelException'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['response_listener']) ? $this->services['response_listener'] : $this->services['response_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener('UTF-8')) && false ?: '_'};\n }, 1 => 'onKernelResponse'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['streamed_response_listener']) ? $this->services['streamed_response_listener'] : $this->services['streamed_response_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\StreamedResponseListener()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), -1024);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['locale_listener']) ? $this->services['locale_listener'] : $this->getLocaleListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 16);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['locale_listener']) ? $this->services['locale_listener'] : $this->getLocaleListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['validate_request_listener']) ? $this->services['validate_request_listener'] : $this->services['validate_request_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 256);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['resolve_controller_name_subscriber']) ? $this->services['resolve_controller_name_subscriber'] : $this->getResolveControllerNameSubscriberService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 24);\n $instance->addListener('console.error', array(0 => function () {\n return ${($_ = isset($this->services['console.error_listener']) ? $this->services['console.error_listener'] : $this->load('getConsole_ErrorListenerService.php')) && false ?: '_'};\n }, 1 => 'onConsoleError'), -128);\n $instance->addListener('console.terminate', array(0 => function () {\n return ${($_ = isset($this->services['console.error_listener']) ? $this->services['console.error_listener'] : $this->load('getConsole_ErrorListenerService.php')) && false ?: '_'};\n }, 1 => 'onConsoleTerminate'), -128);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['session_listener']) ? $this->services['session_listener'] : $this->getSessionListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 128);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['session_listener']) ? $this->services['session_listener'] : $this->getSessionListenerService()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), -1000);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['session_listener']) ? $this->services['session_listener'] : $this->getSessionListenerService()) && false ?: '_'};\n }, 1 => 'onFinishRequest'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['session.save_listener']) ? $this->services['session.save_listener'] : $this->services['session.save_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\SaveSessionListener()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), -1000);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['translator_listener']) ? $this->services['translator_listener'] : $this->getTranslatorListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 10);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['translator_listener']) ? $this->services['translator_listener'] : $this->getTranslatorListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['debug.debug_handlers_listener']) ? $this->services['debug.debug_handlers_listener'] : $this->getDebug_DebugHandlersListenerService()) && false ?: '_'};\n }, 1 => 'configure'), 2048);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['router_listener']) ? $this->services['router_listener'] : $this->getRouterListenerService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 32);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['router_listener']) ? $this->services['router_listener'] : $this->getRouterListenerService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n $instance->addListener('kernel.exception', array(0 => function () {\n return ${($_ = isset($this->services['router_listener']) ? $this->services['router_listener'] : $this->getRouterListenerService()) && false ?: '_'};\n }, 1 => 'onKernelException'), -64);\n $instance->addListener('console.error', array(0 => function () {\n return ${($_ = isset($this->services['maker.console_error_listener']) ? $this->services['maker.console_error_listener'] : $this->services['maker.console_error_listener'] = new \\Symfony\\Bundle\\MakerBundle\\Event\\ConsoleErrorSubscriber()) && false ?: '_'};\n }, 1 => 'onConsoleError'), 0);\n $instance->addListener('console.terminate', array(0 => function () {\n return ${($_ = isset($this->services['maker.console_error_listener']) ? $this->services['maker.console_error_listener'] : $this->services['maker.console_error_listener'] = new \\Symfony\\Bundle\\MakerBundle\\Event\\ConsoleErrorSubscriber()) && false ?: '_'};\n }, 1 => 'onConsoleTerminate'), 0);\n $instance->addListener('kernel.response', array(0 => function () {\n return ${($_ = isset($this->services['security.rememberme.response_listener']) ? $this->services['security.rememberme.response_listener'] : $this->services['security.rememberme.response_listener'] = new \\Symfony\\Component\\Security\\Http\\RememberMe\\ResponseListener()) && false ?: '_'};\n }, 1 => 'onKernelResponse'), 0);\n $instance->addListener('kernel.request', array(0 => function () {\n return ${($_ = isset($this->services['security.firewall']) ? $this->services['security.firewall'] : $this->getSecurity_FirewallService()) && false ?: '_'};\n }, 1 => 'onKernelRequest'), 8);\n $instance->addListener('kernel.finish_request', array(0 => function () {\n return ${($_ = isset($this->services['security.firewall']) ? $this->services['security.firewall'] : $this->getSecurity_FirewallService()) && false ?: '_'};\n }, 1 => 'onKernelFinishRequest'), 0);\n\n return $instance;\n }",
"public static function getEventDispatcher()\n {\n if (static::$sharedInstance !== null) {\n return static::$sharedInstance;\n }\n\n global $app;\n\n $appEventDispatcher = null;\n if ($app instanceof Application) {\n static::$allowCodeceptionHooks = true;\n $appEventDispatcher = static::getAppEventDispatcher($app);\n } else {\n static::$allowCodeceptionHooks = false;\n $appEventDispatcher = new SymfonyEventDispatcher();\n }\n\n if (! $appEventDispatcher instanceof SymfonyEventDispatcher) {\n throw new TestRuntimeException(sprintf(\n '\\\\Codeception\\\\Codecept::$eventDispatcher property is not an instance of %s; value is instead: %s',\n SymfonyEventDispatcher::class,\n print_r($appEventDispatcher, true)\n ));\n }\n\n static::$sharedInstance = new self($appEventDispatcher);\n\n return static::$sharedInstance;\n }",
"protected function getSignalSlotDispatcher() {\n\t\treturn $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\SignalSlot\\\\Dispatcher');\n\t}",
"public function setGlobalInstance(){\n self::$instance = $this;\n }",
"public static function getEventDispatcher(){\n\t\treturn \\Illuminate\\Log\\Writer::getEventDispatcher();\n\t}",
"public function initialize(sfEventDispatcher $dispatcher, sfPearEnvironment $environment)\n {\n $this->dispatcher = $dispatcher;\n $this->environment = $environment;\n\n // configure this plugin manager\n $this->configure();\n }",
"protected static function configureInstance()\n\t{\n\t\t$logger = new Logger('Default');\n\t\t$logger->pushHandler(new StreamHandler(__DIR__.'/../../logs/app.log', Logger::DEBUG));\n\n\t\tself::$instance = $logger;\n\t}",
"protected function getEventDispatcherService()\n {\n $this->services['event_dispatcher'] = $instance = new \\Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher($this);\n\n $instance->addListenerService('kernel.request', array(0 => 'knp_menu.listener.voters', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_blog.blog_menu_listener', 1 => 'addGlobal'), 90);\n $instance->addListenerService('victoire_core.article_menu.contextual', array(0 => 'victoire_blog.article_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.article_menu.contextual', array(0 => 'victoire_blog.article_settings_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.blog_menu.contextual', array(0 => 'victoire_blog.blog_menu.contextual', 1 => 'addBlogContextual'), 0);\n $instance->addListenerService('victoire_core.article_template_menu.contextual', array(0 => 'victoire_blog.article_template_menu.menu_listener.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.blog_menu.contextual', array(0 => 'victoire_blog.blog_page_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire.widget_filter.form.pre_set_data', array(0 => 'victoire.widget_filter.form.listener.presetdata', 1 => 'manageExtraFiltersFields'), 1);\n $instance->addListenerService('victoire.widget_filter.form.pre_submit', array(0 => 'victoire.widget_filter.form.listener.presubmit', 1 => 'manageExtraFiltersFields'), 1);\n $instance->addListenerService('victoire.widget_filter.form.date.set_default_value', array(0 => 'victoire.widget_filter.blog.set.default.values.form.listener', 1 => 'setDefaultDateValue'), 1);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_business_page.business_template_menu_listener', 1 => 'addGlobal'), 50);\n $instance->addListenerService('victoire_core.business_template_menu.contextual', array(0 => 'victoire_core.business_template_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_core.menu_dispatcher', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.backend_menu.global', array(0 => 'victoire_core.backend_menu_listener', 1 => 'addGlobal'), 100);\n $instance->addListenerService('kernel.controller', array(0 => 'victoire_core.listener.controller_listener', 1 => 'preExecuteAutorun'), 0);\n $instance->addListenerService('victoire.on_render_page', array(0 => 'victoire_core.view_css_listener', 1 => 'onRenderPage'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_i18n.kernelrequest.listener', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.media_menu_listener', 1 => 'addGlobal'), 60);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.page_menu_listener', 1 => 'addGlobal'), 100);\n $instance->addListenerService('victoire_core.page_menu.contextual', array(0 => 'victoire_core.page_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_sitemap.sitemap_menu_listener', 1 => 'addGlobal'), 70);\n $instance->addListenerService('victoire_core.build_menu', array(0 => 'victoire_core.template_menu_listener', 1 => 'addGlobal'), 80);\n $instance->addListenerService('victoire_core.template_menu.contextual', array(0 => 'victoire_core.template_menu.contextual', 1 => 'addContextual'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_twig.kernelrequest.listener', 1 => 'onKernelRequest'), 0);\n $instance->addListenerService('kernel.request', array(0 => 'victoire_view_reference.cache_warmer', 1 => 'warmUp'), 0);\n $instance->addSubscriberService('response_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ResponseListener');\n $instance->addSubscriberService('streamed_response_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\StreamedResponseListener');\n $instance->addSubscriberService('locale_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\LocaleListener');\n $instance->addSubscriberService('validate_request_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ValidateRequestListener');\n $instance->addSubscriberService('translator_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\TranslatorListener');\n $instance->addSubscriberService('session_listener', 'Symfony\\\\Bundle\\\\FrameworkBundle\\\\EventListener\\\\SessionListener');\n $instance->addSubscriberService('session.save_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\SaveSessionListener');\n $instance->addSubscriberService('fragment.listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\FragmentListener');\n $instance->addSubscriberService('debug.debug_handlers_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\DebugHandlersListener');\n $instance->addSubscriberService('router_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\RouterListener');\n $instance->addSubscriberService('security.firewall', 'Symfony\\\\Component\\\\Security\\\\Http\\\\Firewall');\n $instance->addSubscriberService('security.rememberme.response_listener', 'Symfony\\\\Component\\\\Security\\\\Http\\\\RememberMe\\\\ResponseListener');\n $instance->addSubscriberService('twig.exception_listener', 'Symfony\\\\Component\\\\HttpKernel\\\\EventListener\\\\ExceptionListener');\n $instance->addSubscriberService('monolog.handler.console', 'Symfony\\\\Bridge\\\\Monolog\\\\Handler\\\\ConsoleHandler');\n $instance->addSubscriberService('swiftmailer.email_sender.listener', 'Symfony\\\\Bundle\\\\SwiftmailerBundle\\\\EventListener\\\\EmailSenderListener');\n $instance->addSubscriberService('sensio_framework_extra.controller.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\ControllerListener');\n $instance->addSubscriberService('sensio_framework_extra.converter.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\ParamConverterListener');\n $instance->addSubscriberService('sensio_framework_extra.view.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\TemplateListener');\n $instance->addSubscriberService('sensio_framework_extra.cache.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\HttpCacheListener');\n $instance->addSubscriberService('sensio_framework_extra.security.listener', 'Sensio\\\\Bundle\\\\FrameworkExtraBundle\\\\EventListener\\\\SecurityListener');\n $instance->addSubscriberService('troopers_alertifybundle.event_listener', 'Troopers\\\\AlertifyBundle\\\\EventListener\\\\AlertifyListener');\n $instance->addSubscriberService('fos_user.security.interactive_login_listener', 'FOS\\\\UserBundle\\\\EventListener\\\\LastLoginListener');\n $instance->addSubscriberService('fos_user.listener.authentication', 'FOS\\\\UserBundle\\\\EventListener\\\\AuthenticationListener');\n $instance->addSubscriberService('fos_user.listener.flash', 'FOS\\\\UserBundle\\\\EventListener\\\\FlashListener');\n $instance->addSubscriberService('fos_user.listener.resetting', 'FOS\\\\UserBundle\\\\EventListener\\\\ResettingListener');\n $instance->addSubscriberService('victoire_core.cache_subscriber', 'Victoire\\\\Bundle\\\\CoreBundle\\\\EventSubscriber\\\\CacheSubscriber');\n $instance->addSubscriberService('victoire_i18n.locale_subscriber', 'Victoire\\\\Bundle\\\\I18nBundle\\\\Subscriber\\\\LocaleSubscriber');\n $instance->addSubscriberService('victoire_view_reference.listener', 'Victoire\\\\Bundle\\\\ViewReferenceBundle\\\\Listener\\\\ViewReferenceListener');\n\n return $instance;\n }",
"public function __construct(sfEventDispatcher $dispatcher, sfPearEnvironment $environment)\n {\n $this->initialize($dispatcher, $environment);\n }",
"public function __construct(Router $router, EventDispatcher $dispatcher)\r\n {\r\n $this->router = $router;\r\n $this->dispatcher = $dispatcher;\r\n }",
"public function configure(ExerciseDispatcher $dispatcher): void\n {\n }",
"public function setDispatchContext($context)\n {\n $this->dispatchContext = $context;\n }",
"public function event(): EventDispatcherInterface;",
"public function getOriginalEventDispatcher()\n {\n return $this->eventDispatcher;\n }",
"public function setModelDispatcher(ModelDispatcher $modelDispatcher)\n {\n $this->modelDispatcher = $modelDispatcher;\n }",
"public static function setEventDispatcher($events){\n \\Illuminate\\Cache\\Repository::setEventDispatcher($events);\n }",
"public function getDispatcher(): DispatcherContract\n {\n return $this->events;\n }",
"protected function setKernel()\n {\n app()->singleton(\n \\Illuminate\\Contracts\\Http\\Kernel::class,\n \\Serff\\Cms\\Core\\Http\\Kernel::class\n );\n\n app()->singleton(\n \\Illuminate\\Contracts\\Console\\Kernel::class,\n \\Serff\\Cms\\Core\\Console\\Kernel::class\n );\n\n app()->singleton(\n \\Illuminate\\Contracts\\Debug\\ExceptionHandler::class,\n \\Serff\\Cms\\Core\\Exceptions\\Handler::class\n );\n }",
"public static function setDispatcher($events){\n \\Illuminate\\Auth\\Guard::setDispatcher($events);\n }",
"public function initialize(sfEventDispatcher $dispatcher, $options = array()): void\n {\n $this->dispatcher = $dispatcher;\n $this->options = $options;\n\n if (isset($this->options['level']))\n {\n $this->setLogLevel($this->options['level']);\n }\n\n $dispatcher->connect('application.log', array($this, 'listenToLogEvent'));\n }",
"public function __construct(Dispatcher $dispatcher, ImageUploader $uploader){\n $this->dispatcher = $dispatcher;\n $this->uploader = $uploader;\n }",
"protected function _before()\n {\n parent::_before();\n\n $dispatcherListener = new DispatcherListener();\n\n Di::reset();\n $this->di = new Di();\n $this->di->setShared('response', new Response());\n $this->di->setShared('dispatcherListener', $dispatcherListener);\n $this->di->setShared('dispatcher', function () use ($dispatcherListener) {\n // New dispatcher instance\n $dispatcher = new Dispatcher();\n\n // Initialize defaults such that these don't need to be specified everywhere\n $dispatcher->setNamespaceName('Phalcon\\Test\\Unit\\Mvc\\Dispatcher\\Helper');\n $dispatcher->setControllerName('dispatcher-test-default');\n $dispatcher->setActionName('index');\n\n // Ensure this gets called prior to any custom event listening which has a default priority of 100\n $eventsManager = new EventsManager();\n $eventsManager->attach('dispatch', $dispatcherListener, 200);\n\n $dispatcher->setEventsManager($eventsManager);\n\n return $dispatcher;\n });\n }",
"public function getEventDispatcher()\n\t{\n\t\treturn $this->neoeloquent->getEventDispatcher();\n\t}",
"public function getEventDispatcher()\n {\n return $this->events;\n }",
"public function getEventDispatcher()\n {\n return $this->events;\n }",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected static function getSignalSlotDispatcher() {}",
"protected static function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"protected function getSignalSlotDispatcher() {}",
"public function getEventDispatcher(): ?Dispatcher\n {\n if ($this->container->bound('events')) {\n return $this->container['events'];\n }\n\n return null;\n }",
"protected function getDispatcherListener()\n {\n return $this->di->getShared('dispatcherListener');\n }",
"public static function instance() {\n if ( ! isset( self::$instance ) && ! ( self::$instance instanceof FFW_EVENTS ) ) {\n self::$instance = new FFW_EVENTS;\n self::$instance->setup_constants();\n self::$instance->includes();\n // self::$instance->load_textdomain();\n // use @examples from public vars defined above upon implementation\n }\n return self::$instance;\n }",
"public function getDispatcherEvents()\n\t{\n\t\treturn $this->dispatcher;\n\t}"
] | [
"0.77570105",
"0.7520488",
"0.71289533",
"0.7071396",
"0.7070821",
"0.69521385",
"0.692976",
"0.68858975",
"0.6834073",
"0.6815494",
"0.6732975",
"0.67111564",
"0.67082524",
"0.66795456",
"0.6667227",
"0.6597695",
"0.64621615",
"0.6459911",
"0.6430024",
"0.6331454",
"0.6281154",
"0.62794554",
"0.6220162",
"0.6202639",
"0.6128912",
"0.6122344",
"0.6118444",
"0.6058926",
"0.60563487",
"0.60527533",
"0.60527515",
"0.6044357",
"0.6039922",
"0.6021596",
"0.59728396",
"0.59089345",
"0.590274",
"0.58931476",
"0.5850102",
"0.58352125",
"0.5819989",
"0.57968646",
"0.5755906",
"0.57328945",
"0.5698086",
"0.56973666",
"0.5690968",
"0.56903136",
"0.56879383",
"0.56853366",
"0.5671973",
"0.5652461",
"0.56491977",
"0.56348914",
"0.5626684",
"0.5625677",
"0.5598893",
"0.558747",
"0.55735797",
"0.5568655",
"0.55665874",
"0.55640084",
"0.55224645",
"0.5507535",
"0.5500587",
"0.54650027",
"0.5407637",
"0.5401044",
"0.5385574",
"0.53768414",
"0.5345016",
"0.5334359",
"0.5332099",
"0.53262013",
"0.5306035",
"0.5283262",
"0.52765596",
"0.52761775",
"0.5222201",
"0.51983696",
"0.51789963",
"0.51750964",
"0.5172796",
"0.5172796",
"0.51548487",
"0.5154596",
"0.5154596",
"0.5154596",
"0.5154378",
"0.515414",
"0.5151814",
"0.5151814",
"0.5151814",
"0.5151814",
"0.5151814",
"0.5151814",
"0.51497793",
"0.5143097",
"0.51323557",
"0.5130234"
] | 0.7515415 | 2 |
Unset the event dispatcher for models. | public static function unsetEventDispatcher()
{
static::$dispatcher = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function unsetEventDispatcher()\n {\n $this->events = null;\n }",
"public function unsetDispatcher(): void\n {\n $this->dispatcher = null;\n }",
"public function reset() {\n $this->_events->reset();\n }",
"public function unsetEventTypes(): void\n {\n $this->eventTypes = [];\n }",
"private function uninstallEvents()\n {\n $this->load->model('setting/event');\n $this->model_setting_event->deleteEvent('payment_mundipagg');\n }",
"public static function offAll()\n {\n self::$_events = [];\n self::$_eventWildcards = [];\n }",
"public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }",
"protected static function boot()\n {\n \tparent::boot();\n\n \tstatic::deleting(function($model) {\n \t\t$model->attributes()->sync([]);\n \t});\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 _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }",
"public function tear_down(): void {\n\t\t$this->dispatcher->execute();\n\t}",
"public function tearDown() {\n $this->model = null;\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::deleting(function ($model) {\n $model->roles()->detach();\n $model->routes()->detach();\n $model->actions()->detach();\n });\n }",
"protected static function booted(): void\n {\n static::deleting(function (Model $model) {\n $model->removeAllImages();\n });\n }",
"public function clearModels();",
"public function clearEvents()\n\t{\n\t\t$this->collEvents = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clear(): void\n {\n $this->eventRegistry->dequeueEvents();\n }",
"public function unsetScheduler() {}",
"public function detach(): void\n\t{\n\t\t$this->events->detach($this->type, $this->hook);\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 off($event);",
"protected function _unsubscribeFromEngineEvents()\n {\n $events = array(\n Streamwide_Engine_Events_Event::SDP,\n Streamwide_Engine_Events_Event::CHILD,\n Streamwide_Engine_Events_Event::OKMOVED,\n Streamwide_Engine_Events_Event::MOVED,\n Streamwide_Engine_Events_Event::FAILMOVED\n );\n \n $controller = $this->getController();\n foreach ( $events as $event ) {\n $controller->removeEventListener( $event, array( 'callback' => array( $this, 'onSignalReceived' ) ) );\n }\n }",
"protected function forgetAddedModels()\n {\n $this->quantities = $this->modelPopulators = [];\n }",
"function UnInstallEvents()\n\t{\n\t}",
"public function disable()\n\t{\n\t\t// Removes itself from the event queue\n\t\tEvent::clear('system.display', array($this, 'render'));\n\t}",
"private function clearAutoResponses()\n {\n $this->getEventDispatcher()->addListener(\n 'kernel.terminate',\n [$this->getAutoResponseRuleRepository(), 'clearAutoResponses']\n );\n }",
"public static function clearBootedModels();",
"public function tearDown() {\n\t\tparent::tearDown();\n\t\tunset($this->Event, $this->EventClass);\n\t\tunset($this->ObjectEvent, $this->ControllerEvent, $this->ModelEvent, $this->ViewtEvent);\n\t\tunset($this->ModelObject, $this->ViewObject, $this->ControllerObject);\n\t}",
"public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }",
"function off() {\n return $this;\n }",
"public function withoutModelEvents(callable $callback)\n {\n return fn () => Model::withoutEvents($callback);\n }",
"public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }",
"protected static function boot()\n {\n parent::boot();\n\n static::deleting(function($model) {\n $model->categories()->detach();\n $model->attributes()->detach();\n\n // Delete product images\n $disk = 'uploads';\n\n foreach ($model->images as $image) {\n // Delete image from disk\n\n Storage::disk($disk)->delete($image->name);\n\n\n // Delete image from db\n $image->delete();\n }\n });\n }",
"protected function flushModelEventListeners()\n {\n foreach (get_declared_classes() as $class) {\n if ($class == 'October\\Rain\\Database\\Pivot') {\n continue;\n }\n\n $reflectClass = new ReflectionClass($class);\n if (\n !$reflectClass->isInstantiable() ||\n !$reflectClass->isSubclassOf('October\\Rain\\Database\\Model') ||\n $reflectClass->isSubclassOf('October\\Rain\\Database\\Pivot')\n ) {\n continue;\n }\n\n $class::flushEventListeners();\n }\n\n ActiveRecord::flushEventListeners();\n }",
"public static function withoutTouchingOn(array $models, callable $callback);",
"public function getModelEvents();",
"public function clearRecordedEvents()\n {\n $this->events = [];\n }",
"function unextend() {\n if ($this->observation) {\n $this->observation->cancel();\n $this->observation = NULL;\n }\n }",
"public function clearEvents()\n {\n $this->recorded = [];\n }",
"public function stop(): void\n {\n $this->entityManager->getEventManager()->removeEventListener($this->initializeEvents, $this);\n }",
"public static function clearBootedModels()\n {\n static::$booted = [];\n }",
"public static function clearBootedModels()\n {\n static::$booted = [];\n }",
"public static function bootNotificable()\n {\n if (static::$removeNotificationsOnDelete) {\n static::deleting(function ($model) {\n $model->removeNotifications();\n });\n }\n }",
"public function __destruct()\n {\n\tunset($this->model);\n }",
"public function setEventDispatcher(IlluminateDispatcher $events)\n\t{\n\t\t$this->neoeloquent->setEventDispatcher(\\App::make(Dispatcher::class));\n\t}",
"public static function unsetDatasourceResolver()\n {\n static::$resolver = null;\n }",
"protected function tearDown() {\n\t\tConfig::getInstance()->clear();\n\t\tApplication::getInstance()->getDiContainer()->getEventHandlerRegistry()->clearAll();\n\t\tparent::tearDown();\n\t}",
"public static function clearCache()\n {\n static::$eventMap = [];\n \\Cache::forget(static::EVENT_CACHE_KEY);\n }",
"public static function clearCache()\n {\n static::$eventMap = [];\n \\Cache::forget(static::EVENT_CACHE_KEY);\n }",
"public static function boot()\n {\n parent::boot();\n\n //Bindando o deleting para remover as relationships\n static::deleting(function ($model) {\n DeleteModelHelper::deleteRelationships($model);\n });\n }",
"public static function clearAllHandlers(): void\n {\n foreach (self::registeredSignals() as $signal) {\n self::clearHandlers($signal);\n }\n }",
"public function clearRootBindings();",
"public static function unsetDalResolver()\n {\n static::$_resolver = null;\n }",
"public function unsetAll() {\n\t\tparent::unsetAll();\n\t}",
"public function clearModels()\n {\n $this->_models = array();\n return $this;\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"function eventUnRegister($eventName, $id);",
"public function clear()\n {\n $this->events = [];\n return $this;\n }",
"public function removeAllListeners($eventName);",
"static public function deleteHandlers()\n\t{\n\t\tself::$handlers = array();\n\t}",
"protected function tearDown ()\n {\n // TODO Auto-generated ModelTest::tearDown()\n\n $this->Model = null;\n\n parent::tearDown();\n }",
"public function clearEventI18ns()\n {\n $this->collEventI18ns = null; // important to set this to null since that means it is uninitialized\n $this->collEventI18nsPartial = null;\n\n return $this;\n }",
"public function cleanup(Model $model) {\n parent::cleanup($model);\n }",
"protected static function bootSoftDeleteRelated()\n {\n static::deleting(\n function ($model) {\n if (!empty($relations = $model->getRelations())) {\n foreach ($relations as $key => $value) {\n $model->{$key}()->delete();\n }\n }\n }\n );\n }",
"protected function tearDown()\n {\n $this->_model = null;\n parent::tearDown();\n }",
"public function run()\n {\n Model::unguard();\n\n\n\n }",
"public function clearAllCommand()\n {\n $this->eventRepository->removeAll();\n $this->eventSourceRepository->removeAll();\n }",
"public static function refreshListeners(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Reset event listeners on all models\n\t\t\tforeach (TestSettings::$modelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t\tforeach (TestSettings::$seededModelTables as $model => $table){\n\t\t\t\tcall_user_func(array($model, 'flushEventListeners'));\n\t\t\t\tcall_user_func(array($model, 'boot'));\n\t\t\t}\n\t\t}\n\t}",
"public function clearListeners()\n {\n $this->listeners = array();\n }",
"public static function clear($event) {\n unset(static::$events[$event]);\n }",
"private function _unsetSetup()\n\t{\n\t\tforeach ( $this->_setup as $setup )\n\t\t{\n\t\t\t$setup->disconnect();\n\t\t}\n\n\t\t$this->_setup = null;\n\t\t$this->_setup = array();\n\t}",
"public function clearListeners(string $event): void;",
"public function uninstall() {\n $this->helper_pricealert->deleteTables();\n $this->__deleteEvents();\n }",
"public static function reset()\n\t{\n\t\tself::engine()->reset();\n\t}",
"protected function withoutExceptionHandling()\n {\n $this->app->instance(ExceptionHandler::class, new class extends Handler {\n public function __construct() {}\n public function report(Exception $e) {}\n public function render($request, Exception $e) {\n throw $e;\n }\n });\n }",
"public function boot()\n {\n BelongsTo::setEventDispatcher($this->app['events']);\n HasMany::setEventDispatcher($this->app['events']);\n HasOne::setEventDispatcher($this->app['events']);\n MorphMany::setEventDispatcher($this->app['events']);\n MorphOne::setEventDispatcher($this->app['events']);\n MorphTo::setEventDispatcher($this->app['events']);\n }",
"static public function __unsetRegistry()\n {\n self::$_registry = null;\n }",
"public function __unset($name)\n\t{\n\t\tif(method_exists($this,$setter='set'.$name))\n\t\t\t$this->$setter(null);\n\t\telse if(method_exists($this,$jssetter='setjs'.$name))\n\t\t\t$this->$jssetter(null);\n\t\telse if(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t\t$this->_e[strtolower($name)]->clear();\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t\t$this->getEventHandlers($name)->remove(array($this, $name));\n\t\telse if($this->_m!==null&&$this->_m->getCount()>0&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tif(isset($this->_m[$name]))\n\t\t\t\t$this->detachBehavior($name);\n\t\t\telse {\n\t\t\t\t$unset=0;\n\t\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t\t{\n\t\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())) {\n\t\t\t\t\t\tunset($behavior->$name);\n\t\t\t\t\t\t$unset++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!$unset&&method_exists($this,'get'.$name))\n\t\t\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t\t\t}\n\t\t} else if(method_exists($this,'get'.$name))\n\t\t\tthrow new TInvalidOperationException('component_property_readonly',get_class($this),$name);\n\t}",
"public function erase_history()\n {\n $this->_event_history = [];\n }",
"public function unregisterModelMock($modelClass)\n {\n if (isset($this->_registeredModelMocks[$modelClass])) {\n unset($this->_registeredModelMocks[$modelClass]);\n }\n }",
"public static function bootTicketable()\n {\n static::deleted(function (self $model) {\n $model->bookings()->delete();\n });\n }",
"public function remove() {\n\t\tremove_action($this->controller->getHookName(),array($this,'handle'),$this->priority);\n }",
"public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }",
"public function unregister()\n {\n $previousHandlers = $this->previousHandlers;\n\n foreach ($previousHandlers as $signal => $handler) {\n if (is_null($handler)) {\n pcntl_signal($signal, SIG_DFL);\n\n unset($previousHandlers[$signal]);\n }\n }\n\n $this->setHandlers($previousHandlers);\n }",
"public function reset()\n {\n $this->models = null;\n return $this;\n }",
"public static function boot()\n\t{\n\t\tparent::boot();\n\n\t\t// Setup event bindings...\n\t\tOrder::deleted( function($order)\n\t\t{\n\t\t\tDB::table('history')->where('historable_id', '=', $order->id)->where('historable_type', '=', 'Order')->delete();\n\t\t});\n\t}",
"public function tearDown() {\n $this->listener = null;\n $this->event = null;\n $this->request = null;\n }",
"public function tearDown()\n {\n $this->app = null;\n }",
"public function truncateEventClosures(): void\n {\n $this->listeners = [];\n }",
"final private function priorityHandlerCleanup() {\n foreach ($this->priorityHelpers as $p)\n $p->remove();\n\n remove_action($this->hookName,array($this,'priorityHandlerCleanup'),self::LATEST+1);\n $this->priorityHelpers = array();\n }",
"public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}",
"public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}",
"public function setModelDispatcher(ModelDispatcher $modelDispatcher)\n {\n $this->modelDispatcher = $modelDispatcher;\n }",
"public function eventUnTaggable($key, $model)\n {\n $model->untag();\n }",
"public function run()\n {\n Model::unguard();\n }",
"function delete_post_type_event(){\n\tunregister_post_type( 'event' );\n}",
"public function remove_hooks()\n {\n }",
"public function remove_hooks()\n {\n }",
"public function remove_all_hook() {\n\t\tremove_action( 'all', [ $this, 'wrap_hook_callbacks' ] );\n\t}"
] | [
"0.7311602",
"0.67983913",
"0.63313633",
"0.62176996",
"0.6075609",
"0.6002631",
"0.58648247",
"0.57652485",
"0.57640064",
"0.57521355",
"0.57027155",
"0.5669808",
"0.5664629",
"0.5622729",
"0.5581341",
"0.55378693",
"0.55290747",
"0.5523264",
"0.552272",
"0.5500164",
"0.54785365",
"0.54449373",
"0.5443314",
"0.5400914",
"0.5385189",
"0.5381801",
"0.5348892",
"0.53390884",
"0.5322969",
"0.5301981",
"0.52948886",
"0.52830064",
"0.52759475",
"0.52598125",
"0.5258517",
"0.5252491",
"0.52467227",
"0.52384776",
"0.52368397",
"0.5228819",
"0.51881886",
"0.51881886",
"0.51807153",
"0.51776195",
"0.5163852",
"0.5144781",
"0.51360524",
"0.5129524",
"0.5129524",
"0.51258755",
"0.51197934",
"0.5119417",
"0.51184946",
"0.5111859",
"0.51108325",
"0.5108433",
"0.5108433",
"0.5099151",
"0.50945014",
"0.5094336",
"0.5077225",
"0.5065513",
"0.50490445",
"0.5048084",
"0.5037784",
"0.5036479",
"0.5035094",
"0.5032145",
"0.5020803",
"0.50197107",
"0.50134766",
"0.49947873",
"0.49915606",
"0.49803698",
"0.49760342",
"0.49742544",
"0.49718",
"0.4967144",
"0.49640936",
"0.4961116",
"0.49588442",
"0.49565193",
"0.4954497",
"0.49505708",
"0.494706",
"0.4937066",
"0.49265456",
"0.4920627",
"0.49096638",
"0.49079013",
"0.49071136",
"0.48996225",
"0.48996225",
"0.48976493",
"0.48832312",
"0.4875671",
"0.48631278",
"0.485731",
"0.485731",
"0.4852394"
] | 0.71739745 | 1 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.