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 |
---|---|---|---|---|---|---|
Return the id of the last inserted record. | public function lastInsertId()
{
return $this->pdo->lastInsertId();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function last_id() {\n return $this->_connection->lastInsertId();\n }",
"public function lastInsertId();",
"public function lastInsertId();",
"public function lastInsertId();",
"public function getLastInsertId();",
"public function getLastInsertId();",
"public function getLastInsertId();",
"public function getLastID() {\n return $this->db->insert_id();\n }",
"public function id() {\n return $this->lastInsertId();\n }",
"public function getLastInsertID();",
"protected function getLastID()\n {\n return $this->driver->getInsertId();\n }",
"public function getLastId(){\n return $this->con->insertId();\n }",
"public function lastId()\n\t{\n\t\treturn $this->_instance->lastInsertId();\n\t}",
"public function lastID() {\n return $this->getPDO()->lastInsertId();\n }",
"public static function lastId()\n {\n return self::connect()->lastInsertId();\n }",
"public function getLastId()\n {\n return $this->adodb->insert_Id();\n }",
"public function getLastInsertedID(){\n // Return last created id\n return $this->connection->insert_id();\n }",
"public static function getId() {\n\t\treturn self::getConexao()->lastInsertId();\n\t}",
"public function lastId()\n\t{\n\t\treturn $this->lastInsertID();\n\t}",
"public function lastInsertId() {\n return $this->connection->lastInsertId();\n }",
"function get_last_inserted_id() {\n return $this->db->insert_id();\n }",
"public function getLastId() {\n return $this->LastInsertId;\n }",
"public function last_insert_id() {\n\t\treturn $this->adapter->lastInsertId();\n\t}",
"public static function getLastInsertId()\n {\n return self::$sql->lastInsertId();\n }",
"public function lastInsertedId() {\n return $this->_dbh->lastInsertId();\n\n }",
"public function lastInsertId()\n\t{\n\t\treturn $this->connection->lastInsertId();\n\t}",
"public function lastInsertId () {\r\n return $this->cachedLastInsertId; // $this->db->lastInsertId();\r\n }",
"public function lastInsertId(){\n return $this->pdo->lastInsertId();\n }",
"public function LastInsertId() {\n\t\t\t\treturn $this->connection->lastInsertId();\n\t\t\t}",
"public function getLastInsertedId()\r\n\t{\r\n\t\treturn $this->db->getLastInsertedId();\r\n\t}",
"public function getLastInsertId()\r\n {\r\n return $this->getMaster()->lastInsertId();\r\n }",
"abstract public function getLastInsertId();",
"public function get_last_inserted_id(){\n\t\treturn $this->db->insert_id();\n\t}",
"public function insertGetId()\n {\n return $this->lastId;\n }",
"public function insertGetId()\n {\n return $this->lastId;\n }",
"public function lastInsertId()\n {\n return $this->_adapter->lastInsertId();\n }",
"function lastInsertId() {\n\t\treturn sqlite_last_insert_rowid($this->connection);\n\t}",
"public function getLastInsertId()\n {\n return $this->lastInsertId;\n }",
"public function getId(): int {\n return $this->database->lastInsertId();\n }",
"public function lastInsertId(){\n return $this->conn->lastInsertId();\n }",
"public function getLastInsertId()\n {\n return $this->getHandler()->getConnection()->lastInsertId();\n }",
"public function getLastInsertId(){\n return $this->lastInsertId;\n }",
"public function lastInsertId() {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId() {\n return $this->pdo->lastInsertId();\n }",
"public function lastID(){\n return $this->_lastInsertID;\n }",
"public function get_last_insert_id(){\n\t\treturn $this->db->insert_id();\n\t}",
"public function lastId()\n {\n return $this->mysqli->insert_id;\n }",
"public function getLastInsertId()\n {\n return $this->getPdo()->lastInsertId();\n }",
"public function get_last_insert_id()\n\t\t{\n\t\t\treturn( $this->last_insert_id );\n\t\t}",
"public function last_insert_id() {\n\t\t\n\t\treturn $this->pdo->lastInsertId();\n\t\n\t}",
"public function lastInsertID() {\n return $this->_pdo->lastInsertId();\n }",
"function lastInsertId() {\n return $this->pdo->lastInsertId();\n }",
"public function getLastInsertId()\n {\n return $this->PDO->lastInsertId();\n }",
"public function getLastInsertedId() {\n\t\treturn $this->lastInsertedID;\n\t}",
"public function last_insert_id ()\n\t{\n\t\treturn $this->db->lastInsertId();\n\t}",
"public function lastInsertId()\n {\n return sqlite_last_insert_rowid($this->connection);\n }",
"public function getLastInsertId(){\n\t\treturn $this->connection->insert_id;\n\t}",
"public function lastId()\n\t{\n\t\treturn mysqli_insert_id($this->connection);\n\t}",
"public function getLastInsertId()\t{\n\t\treturn $this->_hDb->lastInsertId();\n\t}",
"function getLastId()\n {\n return mysqli_insert_id($this->Db);\n }",
"public function insert_id()\n\t{\n\t\treturn $this->lastInsertId();\n\t}",
"public function insertId() {\n\t\treturn $this->_dbh->lastInsertId();\n\t}",
"function get_last_id() {\n if ($this->is_valid())\n return @mysql_insert_id($this->connection);\n }",
"function getLastInsertID(){\r\n\t\t\r\n\t\treturn $this->connection->insert_id;\r\n\t}",
"public function lastInsert(){\n\t\treturn $this->dbh->lastInsertId();\n\t}",
"public function GetLastInsertID()\r\n\t{\r\n\t\treturn $this->last_insert_id;\r\n\t}",
"public function lastInsertId()\n {\n return @db2_last_lastInsertId($this->connection);\n }",
"public function getLastInsertID()\n {\n return $this->_lastInsertID;\n }",
"public function lastInsertedId(): mixed;",
"public function getLastInsertID()\n {\n\t return $this->connections[ $this->activeConnection]->insert_id;\n }",
"function lastId() {\n return mysqli_insert_id($this->con);\n }",
"public function getLastInsertId(): int;",
"public function insertId () {\n\n return $this->_lastInsertId;\n }",
"public function insert_id() {\n\t\treturn $this->db->lastInsertId();\n\t}",
"public static function lastInsertId(): string {\r\n return self::getConnection()->lastInsertId();\r\n }",
"public function lastId () {\n\treturn mysql_insert_id();\n }",
"public function lastInsertedId()\n {\n $id = $this->pdo->lastInsertId();\n return $id;\n }",
"public function insert_id()\n\t{\n\t\tif ($this->db_type == 'pgsql')\n\t\t{\n\t\t\treturn $this->execute('SELECT lastval() as id')->current()->id;\n\t\t}\n\t\treturn $this->conn->lastInsertId();\n\t}",
"function insertid() {\n return $this->last_insert_id;\n }",
"public function getLastInsertId()\n {\n $this->setActive(true);\n\n return self::$_pdo->lastInsertId();\n }",
"public function getLastInsertedId(): string\n {\n return $this->db->lastInsertId();\n }",
"function get_last_inserted() {\n return $this->db->insert_id();\n }",
"function get_insert_id() {\n\t\t\treturn self::$db->last_inserted_id();\n\t\t}",
"public function getId(): int\n {\n return $this->pdo->lastInsertId() ?: 0;\n }",
"public function getLastInsertedID(){\r\n try {\r\n //Get & return last inserted ID\r\n return $this->db->lastInsertId();\r\n }\r\n catch(Exception $e){\r\n exit($this->echoException($e));\r\n }\r\n catch(PDOException $e){\r\n exit($this->echoPDOException($e));\r\n }\r\n }",
"function lastInsertId()\n\t{\n\t\treturn @$this->functions['insert_id']($this->connection_master);\n\t}",
"public function lastInsertId(): int {\n return intval( $this->pdo->lastInsertId() );\n }",
"public function lastInsertID()\n\t{\n\t\treturn $this->_conn->insert_id;\n\t}",
"public function insertId()\n\t{\n\t\treturn $this->pdo->lastInsertId();\n\t}",
"function last_inserted_id() {\n return mysql_insert_id($this->db_conn);\n }",
"public function insertid()\n {\n $this->connect();\n\n return $this->connection->lastInsertId();\n }",
"public static function getLastInsertId() : string\n {\n return static::getConn()->lastInsertId();\n }",
"function getLastinsertId (){\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertID()\r\n {\r\n return @mysql_insert_id();\r\n }",
"public function getLastInsertId()\n {\n return $this->wpDatabase->insert_id;\n }"
] | [
"0.8800096",
"0.8793759",
"0.8793759",
"0.8793759",
"0.87822884",
"0.87822884",
"0.87822884",
"0.8763969",
"0.8735688",
"0.8730565",
"0.86828357",
"0.86741924",
"0.86563045",
"0.86329615",
"0.86297405",
"0.862288",
"0.857508",
"0.8569663",
"0.85602546",
"0.8498436",
"0.849425",
"0.84884036",
"0.8485708",
"0.8482873",
"0.8474253",
"0.8457785",
"0.8450861",
"0.8439635",
"0.84377956",
"0.84353924",
"0.84334487",
"0.84308535",
"0.84288096",
"0.84203935",
"0.84203935",
"0.84149593",
"0.8414802",
"0.84129256",
"0.8406398",
"0.8392492",
"0.8388334",
"0.83866847",
"0.83820814",
"0.83820814",
"0.8380986",
"0.837897",
"0.8377223",
"0.83746225",
"0.8373653",
"0.8368313",
"0.83679247",
"0.8365624",
"0.8365526",
"0.83635044",
"0.8343617",
"0.8340535",
"0.8340502",
"0.8335061",
"0.8332986",
"0.8331328",
"0.8330547",
"0.8314774",
"0.8301017",
"0.8291811",
"0.82873404",
"0.8284829",
"0.82841116",
"0.82839286",
"0.8279302",
"0.8277129",
"0.8268739",
"0.82661426",
"0.8264253",
"0.82633096",
"0.8255628",
"0.8248157",
"0.82459617",
"0.82458526",
"0.8224615",
"0.82216173",
"0.8221532",
"0.8218068",
"0.8211233",
"0.8206807",
"0.81970763",
"0.8189516",
"0.8183723",
"0.8180101",
"0.8167998",
"0.8167033",
"0.8160423",
"0.81591284",
"0.81574196",
"0.81520015",
"0.8150929"
] | 0.8363826 | 56 |
Return all records of the given table and return instances of the given class. | public function all(string $table, $columns = '*')
{
if (is_array($columns)) {
foreach ($columns as &$column) {
$column = preg_replace('/[^a-zA-Z_]*/', '', $column);
}
$columns = implode(',', $columns);
$stmt = $this->pdo->prepare("SELECT {$columns} FROM {$table}");
} else {
$stmt = $this->pdo->prepare("SELECT * FROM {$table}");
}
$stmt->execute();
return $stmt->fetchAll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function fetchAll() {\n // Initialize fetch-all cache, if necessary\n if (!isset(self::$fetchAllRecordsPreparedStatementCache)) {\n self::$fetchAllRecordsPreparedStatementCache = array();\n }\n\n // Cache calling subclass name \n $table_name = static::getTableName();\n \n // Begin implicit transaction if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n \n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()'\n assert(isset(self::$databaseHandle));\n\n try {\n // Create prepared statement if nonextant \n if (!isset(self::$fetchAllRecordsPreparedStatementCache[$table_name])) {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $query_str = \"SELECT * FROM {$fully_qualified_table_name}\";\n self::$fetchAllRecordsPreparedStatementCache[$table_name] =\n self::$databaseHandle->prepare($query_str); \n } \n\n // Fetch all records\n $fetch_all_stmt = self::$fetchAllRecordsPreparedStatementCache[$table_name]; \n $fetch_all_stmt->execute();\n $raw_record_set = $fetch_all_stmt->fetchAllRows();\n \n // Conclude implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n\n // Extrude raw records to objects\n $record_objects = array();\n foreach ($raw_record_set as $raw_record) {\n $record_objects[] = new static($raw_record); \n }\n\n return $record_objects;\n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n }",
"public abstract function fetchAll($table);",
"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 selectAll($table)\n { $sql=\"select * from {$table}\";\n $statement = $this->pdo->prepare($sql);\n\n $statement->execute();\n\n return $statement->fetchAll(PDO::FETCH_CLASS);\n }",
"public function selectAll($table)\n {\n $stmt = $this->pdo->prepare(\"select * from {$table}\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_CLASS);\n }",
"public static function all()\n\t{\n\t\treturn self::new_instance_records()->all();\n\t}",
"public function selectAll($table)\n {\n $statement = $this->pdo->prepare(\"select * from {$table}\");\n\n $statement->execute();\n\n return $statement->fetchAll(PDO::FETCH_CLASS);\n }",
"public function getRecords($table, $where=false){// method getRecords body start\n\t\t\n\t\tif($where){\n\t\t\t$where = $this->makeWhere($where);\n\t\t}\n\t\t$query = \"SELECT * FROM $table \".$where;\n\t\treturn $this->exeQuery($query);\n\t\t\n\t}",
"public function table_get_all($table);",
"public function findAll(string $className) : array \r\n{\r\n \r\n $resultatRequete = $this->pdo->query(\"SELECT * FROM {$this->table}\");\r\n\r\n $items = $resultatRequete->fetchAll(PDO::FETCH_CLASS, $className);\r\n\r\n return $items;\r\n}",
"public function findAll(){\n //recupere le nom de la classe et le formate\n $table = strtolower(get_class($this));\n\n //Prepare la requete\n $query = \"SELECT * FROM $table\";\n $results = $this->conn->prepare($query);\n\n //Execution requete et stockage resultats dans une variable\n $results->execute();\n $resultats = $results->fetchAll(PDO::FETCH_ASSOC);\n return $resultats;\n }",
"public function fetchAllFromTable(string $className) : array\n {\n $tableName = $className::getTableName();\n\n $query = 'SELECT * FROM `'. $tableName .'`';\n\n $statement = $this->databaseHandler->query($query);\n\n $result = $statement->fetchAll(\n PDO::FETCH_FUNC,\n function (...$params) use ($className)\n {\n return new $className(...$params);\n }\n );\n\n return $result;\n }",
"public function byClass($class)\n {\n $arr = array();\n foreach ($this->rows as $r)\n $arr[] = $r->_byClass($class);\n\n return $arr;\n }",
"public static function getAll() {\n $entities = [];\n $sqlResult = DatabaseConnection::getResult(\"SELECT * FROM \" . static::$table);\n\n foreach($sqlResult as $row) {\n $object = new static();\n foreach($row as $property => $value) {\n $object -> $property = $value;\n }\n\n $entities[] = $object;\n }\n\n return $entities;\n }",
"public function getAll($table){\n $query = $this->pdo->prepare(\"SELECT * FROM {$table}\");\n $query->execute();\n return $query->fetchAll(\\PDO::FETCH_OBJ);\n }",
"public static function all() {\n\t\t$pdo = FizzConfig::getDB();\n\t\t$sql = \"SELECT * FROM \" . static::tablename();\n\t\t$result = $pdo->query($sql);\n\t\treturn $result->fetchAll(\\PDO::FETCH_CLASS, get_called_class());\n\t}",
"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 static function find_all() {\r\n\t\treturn self::find_by_sql(\"SELECT * FROM \".self::$table_name);\r\n\t}",
"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 function find() {\r\n\t\t\t$class = new ReflectionObject($this);\r\n\t\t\t$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\r\n\r\n\t\t\t// Loop through the properties to set them from the current row\r\n\t\t\t$select = $this->db->select();\r\n\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t$name = $property->getName();\r\n\t\t\t\t// Set only DO field names of subclass\r\n\t\t\t\tif ($property->class == $class->name) {\r\n\t\t\t\t\tif (!is_null($this->$name)) {\r\n\t\t\t\t\t\t$columnName = $this->map($name);\r\n\t\t\t\t\t\t$select->where(\"$columnName = ?\", $this->$name);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$select->from($this->table);\r\n\t\t\t$stmt = $this->db->query($select);\r\n\t\t\t$rs = $stmt->fetchAll();\r\n\r\n\t\t\t$dataobjects = array();\r\n\t\t\tforeach ($rs as $row) {\r\n\t\t\t\t$dataobject = new $class->name($this->app);\r\n\t\t\t\treset($properties);\r\n\t\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t\t$name = $property->getName();\r\n\t\t\t\t\t$dataobject->$name = $row[$this->map($name)];\r\n\t\t\t\t}\r\n\t\t\t\t$dataobjects[] = $dataobject;\r\n\t\t\t}\r\n\t\t\treturn $dataobjects;\r\n\t\t}",
"public static function find_all()\n {\n return self::find_by_sql(\"SELECT * from \".self::$table_name);\n }",
"public function getAll($table){\n\t\treturn $this->db->get($table);\n\t}",
"public function findAll()\n {\n $this->ensureIsConfigured();\n $classname = $this->getRecordClassname();\n return $classname::find();\n }",
"public static function find_all()\n {\n return static::find_by_sql(\"SELECT * FROM \".self::$table_name.\";\");\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 fetchAllObj(string $class = null): array\n {\n if (!$this->wasExecuted()) {\n $this->exec();\n }\n\n if ($class === null) {\n return $this->getAdapter()->getStatement()->fetchAll(\\PDO::FETCH_OBJ);\n } else {\n $objectInstances = [];\n\n foreach ($this->fetchAll() as $r) {\n $objectInstances[] = new $class($r);\n }\n\n return $objectInstances;\n }\n }",
"public function findAll()\n {\n return $this->getTable();\n }",
"public function fetchClazz(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM clazz\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}",
"public function selectAll(): array\n {\n return $this->pdoConnection->query('SELECT * FROM ' . $this->table, \\PDO::FETCH_CLASS, $this->className)->fetchAll();\n }",
"public static function find_all(){\n global $database;\n $result_set = static::find_by_sql(\"SELECT * FROM \".static::$table_name);\n return $result_set;\n }",
"public static function all()\n {\n self::getAllByTableName();\n return parent::getAllByTableName();\n }",
"function all($table)\n {\n $sql = \"SELECT * FROM $table\";\n $statement = $this->pdo->prepare($sql);\n $statement->execute();\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n return $results;\n }",
"public function getAllRecords();",
"public function getAll()\n {\n $resultSet = $this->oMapper->getAll();\n\n $className = get_class($this);\n\n// $return = array();\n $dto = new EntityDTO($this->oDb, $this->oLogger);\n foreach ($resultSet as $key => $row) {\n $obj = new $className($dto);\n $obj->fillByObject($row);\n\n $this->aCollection[] = $obj;\n }\n unset($resultSet);\n\n return $this->aCollection;\n }",
"public function getAll()\n {\n $sql = \"SELECT * FROM `%s`\";\n $this->_sql[] = sprintf($sql, $this->_table);\n $this->_parameters[] = array();\n return $this->run();\n }",
"function find($table, $where=\"1=1\", $fields=\"*\", $orderBy=\"1\"){\n\t\tActiveRecord::sql_item_sanizite($table);\n\t\tActiveRecord::sql_sanizite($fields);\n\t\tActiveRecord::sql_sanizite($orderBy);\n\t\t$q = $this->query(\"select $fields from $table where $where order by $orderBy\");\n\t\t$results = array();\n\t\twhile($row=$this->fetch_array($q)){\n\t\t\t$results[] = $row;\n\t\t}\n\t\treturn $results;\n\t}",
"protected function tableclass(){\n\n\t\tforeach($this->mapChild($this) as $key => $table ){\n\n\t\t\t$myadrs = $this->address;\n\n\t\t\tif(!in_array($table,$myadrs)){\n\n\t\t\t\tarray_push($myadrs,$table);\n\n\t\t\t\teval('$this->'.$table.' = new $this::$tclass($myadrs);');\n\n\t\t\t}\n\n\t\t\t//print($key . ':' .$table. p);\n\n\t\t}\n\n\t}",
"public function find($table) {\n\t\treturn $this->model->getData($table, $this->criteria, $this->orderby);\n\t}",
"public function fetchRecords() {\n return self::all();\n }",
"public static function find_all(){\n $result = array();\n static::setConnection();\n $keyColumn = static::$keyColumn;\n $table = static::$table;\n $sql = \"SELECT * FROM \".$table.\" ORDER BY \".$keyColumn.\" DESC\";\n $res = mysqli_query(static::$conn,$sql);\n while($row = mysqli_fetch_object($res,get_called_class())){\n $result[] = $row;\n }\n return $result;\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 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 getObjects($table, $conditions = array(), $params = array(), $className = NULL) {\r\n $p = array( 'object' => $table );\r\n if (!empty($conditions)) {\r\n $p['condition'] = $conditions;\r\n }\r\n if (!empty($params)) {\r\n $p = array_merge($p, $params);\r\n }\r\n $xml = $this->post('/api/getObjects.sjs', $p);\r\n \r\n if ($this->success($xml)) {\r\n if (empty($className)) {\r\n return $xml;\r\n }\r\n else {\r\n $out = array();\r\n if ($xml->$table->item) {\r\n\t\t foreach ($xml->$table->item as $item) {\r\n\t\t $out[] = new $className($item);\r\n\t\t }\r\n }\r\n return $out;\r\n }\r\n }\r\n return NULL;\r\n }",
"public function fetchAll(string $table)\n {\n $query = \"SELECT * FROM $table\";\n return $this->conn->query($query);\n }",
"public function getAll()\n {\n return $this->prepare(DB::findAll($this->table));\n }",
"public function selectAll($table){\n $requete = \"SELECT * FROM $table\";\n $result = array();\n foreach($this->_dbh->query($requete) as $raw){\n array_push($result,$raw);\n }\n return $result;\n }",
"public function all()\n {\n $records = R::findAll( $this->table_name(), \" order by id \");\n\n $object = array_map( function($each_record) {\n return $this->map_reford_to_object( $each_record );\n },\n $records\n );\n\n return array_values( $object );\n }",
"function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}",
"public function selectAll($table)\n {\n return $this->_db->fetchAll('SELECT * FROM ' . $table);\n }",
"public function getAllClasses () {\n\t\t$qry = \"SELECT * from $this->table_name\";\n\t\t$dbh = $this->db->prepare($qry);\n\t\t$dbh->execute();\n\t\tif($dbh->rowCount()) {\n\t\t\treturn $dbh->fetchAll();\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}",
"public function table(): Query\n {\n return $this->database->records();\n }",
"public static function fetchAll() {\n $db = new PDO(DB_SERVER, DB_USER, DB_PW);\n // 2. Prepare the query\n $sql = 'SELECT * FROM ProductType';\n $statement = $db->prepare($sql);\n // 3. Run the query\n $success = $statement->execute();\n // 4. Handle the results\n $arr = [];\n while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n $theProductType = new ProductType($row);\n array_push($arr, $theProductType);\n }\n return $arr;\n }",
"public static function getAll()\n {\n $sql = sprintf(\n 'SELECT * FROM `%s` LIMIT :limitFrom, :perPage',\n static::getTableName()\n );\n $stmt = static::getConn()->prepare($sql);\n $stmt->bindValue(':limitFrom', static::LIMIT_FROM, \\PDO::PARAM_INT);\n $stmt->bindValue(':perPage', static::PER_PAGE, \\PDO::PARAM_INT);\n\n $stmt->execute();\n\n $info = $stmt->errorInfo();\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n\n return $stmt->fetchAll(\n \\PDO::FETCH_CLASS |\n \\PDO::FETCH_PROPS_LATE,\n get_called_class()\n );\n }",
"protected function get_table_classes()\n {\n }",
"public function findAll() {\r\n$sql = \"SELECT * FROM $this->tabela\";\r\n$stm = DB::prepare($sql);\r\n$stm->execute();\r\nreturn $stm->fetchAll();\r\n}",
"public function queryAll() {\r\n $sql = \"SELECT * FROM $this->table\";\r\n $stmt = ConnectionFactory::prepare($sql);\r\n $stmt->execute();\r\n return $stmt->fetchAll();\r\n }",
"public static function findAll() {\n $cons = \"select * from `\".ApplicationADO::$tableName.\"`\";\n return ApplicationADO::findByQuery( $cons, [] );\n }",
"public function all(): ResultSetContract;",
"public function all()\r\n {\r\n return new IteratorResult(R::findAll($this->table),'redbean');\r\n }",
"public function fetchAll($table = null)\n {\n if ($table){\n $this->table = $table;\n }\n\n $sql = $this->fetchStatement();\n\n $query = $this->query($sql , $this->bindings);\n $results = $query->fetchAll();\n $this->rows = $query->rowCount();\n\n $this->reset();\n return $results;\n }",
"public static function find($db, $table, $class, $criterion = array(), $returnObjects = false)\n {\n $result = array();\n\n if (is_array($criterion))\n {\n $select = '';\n $from = '';\n $join = '';\n $where = '';\n $other = '';\n\n if (empty($criterion['from']))\n $criterion['from'] = $table;\n\n if (empty($criterion['select']))\n $criterion['select'] = '*';\n\n $select = is_array($criterion['select']) ? implode(',', $criterion['select']) : $criterion['select'];\n $from = is_array($criterion['from']) ? implode(',', $criterion['from']) : $criterion['from'];\n\n if (!empty($criterion['join']))\n {\n $joinQuery = $criterion['join'];\n\n if (is_string($joinQuery))\n $join = $joinQuery;\n elseif (is_array($joinQuery))\n {\n foreach ($joinQuery as $joinData)\n {\n // Do inner join if no type specified\n $joinType = isset($joinData['type']) ? $joinData['type'] : 'INNER';\n\n // We do a full cross join if no condition specified\n $joinOn = isset($joinData['on']) ? $joinData['on'] : '1=1';\n\n if (!isset($joinData['table']))\n throw new Db_Exception('Cannot join without secondary table');\n else\n $joinTable = $joinData['table'];\n\n $join .= $joinType.' JOIN '.$joinTable.' ON '.$joinOn.' ';\n }\n }\n }\n\n if (!empty($criterion['where']))\n {\n // if it's associative array, keys are fields and values are requested values\n if (Oxygen_Utils::isAssociativeArray($criterion['where']) && empty($criterion['bind']))\n {\n $fieldsWhere = [];\n\n foreach ($criterion['where'] as $field => $value)\n {\n $fieldsWhere[] = '`'.$field.'` = :'.$field;\n $criterion['bind'][$field] = $value;\n }\n\n $criterion['where'] = $fieldsWhere;\n }\n\n $where = 'WHERE ('. (is_array($criterion['where']) ? implode(') AND (', $criterion['where']) : $criterion['where']). ')';\n }\n\n if (!empty($criterion['other']))\n $other = is_array($criterion['other']) ? implode(\"\\n\", $criterion['other']) : $criterion['other'];\n\n\n $query = 'SELECT '.$select.'\n FROM '.$from.'\n '.$join.'\n '.$where.'\n '.$other;\n\n try\n {\n $res = $db->prepare($query);\n\n if (!empty($criterion['bind']))\n {\n foreach ($criterion['bind'] as $param => $value)\n {\n $res->bindValue($param, $value, is_int($value) ? PDO::PARAM_INT : PDO::PARAM_STR);\n }\n }\n\n $res->execute();\n }\n catch (Exception $e)\n {\n // Append query to the exception\n $queryInfo = \"\\n\" . (!empty($criterion['bind']) ? \"Prepared query\" : 'Query').' was: ';\n $queryInfo .= $query;\n\n throw new Db_Exception($e->getMessage().$queryInfo);\n }\n\n while ($row = $res->fetch())\n {\n if ($returnObjects)\n $result[] = new $class($row['id']);\n else\n $result[] = $row;\n }\n }\n\n return $result;\n }",
"public static function all()\n {\n self::select(self::tableName());\n return self::fetchAll();\n }",
"public function findAll(): array {\n $tableName = static::tableName();\n $st = self::prepare(\n \"SELECT * FROM $tableName\"\n );\n $st->execute();\n \n return $st->fetchAll(\\PDO::FETCH_OBJ);\n }",
"public function getAllData($table)\n {\n return $this->db->get($table)->result();\n }",
"public function getAllData($table)\n {\n return $this->db->get($table)->result();\n }",
"public function getAllData($table)\n {\n return $this->db->get($table)->result();\n }",
"function getAllData($table){\n\t\ttry {\n\t\t\t$sql = \"SELECT * FROM $table\";\n\t\t\t$query = $this->executeQuery($sql);\n\t\t\t$list = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($sql, $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $list;\n\t}",
"public function findAll()\n {\n $hydrator = $this->_hydrator;\n $className = $this->_class->getName();\n $result = $this->_em->getConnexionDriver()->findAll($this->_class);\n return array_map(function ($item) use ($hydrator, $className) {\n return $hydrator->hydrate($item, new $className());\n }, $result);\n }",
"public static function all()\n {\n \t//Start by connecting to the DB\n \tself::dbConnect();\n \t$stmt = self::$dbc->query('SELECT * FROM ads');\n \t//Assign results to a variable\n \t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n \t$instance = null;\n if ($result) {\n $instance = new static;\n $instance->attributes = $result;\n }\n return $instance;\n\n }",
"public function selectAll($table){\n\t\t\n\t\t$statement = $this->pdo->prepare(\"select * from {$table}\");//The prepare() is a built in method, it will create a PDO statement (PDO Statement is a class too). We are saying: prepare everything from todos database. \n\n\t\t$statement->execute();//please execute the $statement from above.\n\n\t\treturn $statement->fetchAll(PDO::FETCH_CLASS);//fetchAll returns an array containing all of the result set rows. PDO::FETCH_CLASS: Returns instances of the specified class, mapping the columns of each row to named properties in the class.\n\t}",
"public function fetchAll(){\r\n$table=$this->getTable();\r\nreturn $this->fetch_array($this->query(\"SELECT * FROM {$table}\"));\r\n}",
"public function fetchAllObjects($statement, array $params = array(), $class = 'stdClass', $args = array());",
"public function findAll(){\n \n\t\t$sql = 'SELECT * FROM ' . self::TABLENAME;\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n\t\t$stmt = $db->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll();\n\t\n\t\treturn $results; \n }",
"public function findAll(){\n \n\t\t$sql = 'SELECT * FROM ' . self::TABLENAME;\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n\t\t$stmt = $db->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll();\n\t\n\t\treturn $results; \n }",
"public function all()\n {\n $query = $this->database->table('instances')->fetch(function ($props) {\n $props['instances'] = $this;\n return new Instance($props);\n });\n\n if (func_num_args() > 0) {\n $query = $query->where(...func_get_args());\n }\n\n return $query->all();\n }",
"public function getAll() {\n return $this->db->getAllFromTable($this->table);\n }",
"public function from($table);",
"function get_records($recordType, $params = array(), $limit = 10)\n{\n return get_db()->getTable($recordType)->findBy($params, $limit);\n}",
"public function all()\r\n {\r\n return $this->db->table($this->table)->get();\r\n }",
"public function fetchAll() {\n\t\t$queryBuilder = $this->db->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t->select('*')\n\t\t\t->from($this->table_name, 't1')\n\t\t;\n\t\t$result = $queryBuilder->execute()->fetchAll();\n\n\t\treturn $result;\n\t}",
"public function getAll()\n {\n return $this->db->table($this->tableName)->select('*')->findAll();\n }",
"protected function all($tableName)\n {\n $sql = \"select * from {$tableName}\";\n $data = $this->select($sql);\n\n return $data;\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 fetchAllObjGenerator(string $class = null): Generator\n {\n if (!$this->wasExecuted()) {\n $this->exec();\n }\n\n $statement = $this->getAdapter()->getStatement();\n\n if ($class === null) {\n while ($record = $statement->fetch(PDO::FETCH_OBJ)) {\n yield $record;\n }\n } else {\n while ($record = $statement->fetch(PDO::FETCH_ASSOC)) {\n yield new $class($record);\n }\n }\n }",
"protected function tableRows()\n {\n $tbody = DB::table($this->argument('table'))->get();\n\n return $tbody->map(function ($field) {\n return $this->selectRowByField($field);\n });\n }",
"function getData($table)\n {\n $record = array();\n $sql = \"select * from $table\";\n $result = $this->conn->prepare($sql);\n $result->execute();\n if ($result->rowCount() > 0) {\n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n $record[] = $row;\n }\n return $record;\n } else {\n return $record = false;\n }\n $this->conn = null;\n }",
"public function getAll($table)\n {\n return $this->action('SELECT * ', $table, array('1','=','1'));\n }",
"function get_all()\n {\n return $this->db->get($this->table)->result();\n }",
"public static function find_by_query($sql){\n global $database;\n $result_set = $database->query($sql);\n $the_object_array = array();\n while($row = mysqli_fetch_array($result_set)){\n \n $the_object_array[] = static::instantation($row);// Getting array\n }\n\n return $the_object_array;\n }",
"public function custList($table){\n\t\t\t\n\t\t\t$this->db->query($table);\n\t\t\t$row=$this->db->resultset();\n\t\t\t\n\t\t\treturn $row;\n\t\t\t\n\t\t}",
"public function take() {\n\n $records = self::query();\n\n if ($records) {\n $table_name = $this->_table;\n\n foreach ($records as $record) {\n $object = $table_name::find((int)$record[\"id\"]);\n $object->_fields = $record;\n $objects[] = $object;\n }\n return $objects;\n }\n return null;\n }",
"public function fetchAll($table = null)\n\t{\n\t\tif ($table)\n\t\t{\n\t\t\t$this->table = $table;\n\t\t}\n\t\t\n\t\t$sql = $this->fetchStatement();\n\t\t\n\t\t$query = $this->query($sql, $this->bindings);\n\t\t\n\t\t$results = $query->fetchAll();\n\t\t\n\t\t$this->rows = $query->rowCount();\n\t\t\n\t\t$this->reset();\n\t\t\n\t\treturn $results;\n\t}",
"public function getAll(){\n\t\treturn $this->db->get($this->table);\n\t}",
"public function All()\n {\n $query = \"SELECT * FROM $this->table\";\n $result = $this->query($query);\n return $this->convertArray($result);\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 }",
"function query_objects($sql, $parameters = null) {\n $query = $this->query($sql, $parameters);\n\n // This may not be the most optimal way to get an array of objects\n // from PDO, but it functions properly for now and can be discretely\n // optimized later.\n return $query->fetchAll(PDO::FETCH_CLASS);\n }",
"public function all(){ \n $arraytoret = array();\n $query='select *\n from Usuario';\n $results = $this->driver->exec($query);\n return $this->factory($results);\n}",
"public static function getAll()\n {\n $conn = Db::getInstance();\n $result = $conn->query('select * from users ');\n\n // fetch all records from the database and return them as objects of this __CLASS__ (Post)\n return $result->fetchAll(PDO::FETCH_CLASS, __CLASS__);\n }",
"function findAll() {\n\t\t$query = \"SELECT id, nameEN, nameES FROM saga\";\n\t\t$res = array();\n\t\t\n\t\tforeach(DB::ejecutarConsulta($query) as $row) {\n\t\t\t// Añadimos un objeto por cada elemento obtenido\n\t\t\t$res[] = new SagaDAO($row);\n\t\t}\n\t\treturn $res;\n\t}",
"public function getRecords()\n {\n $result = $this->fetchAll($this->select()->order('id ASC'))->toArray();\n return $result;\n }",
"public function fetchAll($table, $where = null, $orderBy = null)\n {\n $results = array();\n $className = '\\Lib\\\\' . ucfirst(strtolower($table));\n $query = \"SELECT * FROM $table $where $orderBy\";\n $rows = $this->getDb()->get_rows($query);\n foreach ($rows as $row) {\n $results[] = $this->build($className, $row);\n }\n\n return $results;\n }"
] | [
"0.69339484",
"0.674267",
"0.66717446",
"0.66242766",
"0.6612012",
"0.65876335",
"0.6526707",
"0.64963025",
"0.6483578",
"0.647809",
"0.64717907",
"0.6465002",
"0.64388925",
"0.64375657",
"0.6427804",
"0.6406902",
"0.6375559",
"0.63473886",
"0.6344997",
"0.6326025",
"0.63035196",
"0.62866724",
"0.62862504",
"0.62372553",
"0.6230907",
"0.6201975",
"0.6134884",
"0.6131802",
"0.61090165",
"0.60970294",
"0.6091266",
"0.6054163",
"0.60524917",
"0.6020677",
"0.59996474",
"0.59985",
"0.5986466",
"0.5982969",
"0.59699",
"0.5967356",
"0.595921",
"0.59573925",
"0.5953189",
"0.5949242",
"0.59242094",
"0.59124106",
"0.5885794",
"0.5882486",
"0.587146",
"0.5856833",
"0.58556056",
"0.58543915",
"0.58536863",
"0.5851507",
"0.58501005",
"0.5839402",
"0.58349746",
"0.583252",
"0.5828638",
"0.5822095",
"0.5810463",
"0.5807545",
"0.58044916",
"0.5797039",
"0.5797039",
"0.5797039",
"0.5795322",
"0.5791462",
"0.5789031",
"0.5788536",
"0.57878965",
"0.57778853",
"0.57758373",
"0.57758373",
"0.57749957",
"0.57738996",
"0.5767935",
"0.5758679",
"0.57477665",
"0.57471186",
"0.57393765",
"0.5737686",
"0.5736662",
"0.5720182",
"0.5708927",
"0.5707145",
"0.57062256",
"0.57005847",
"0.5700415",
"0.5692871",
"0.568581",
"0.56824195",
"0.56754035",
"0.56753397",
"0.5666115",
"0.5663143",
"0.565056",
"0.56503594",
"0.56378156",
"0.5634709",
"0.5631674"
] | 0.0 | -1 |
Return the first record of the given table as an instance of the given class. | public function findWithId(string $table, $id)
{
$stmt = $this->pdo->prepare("SELECT * FROM {$table} WHERE id = ?");
$stmt->execute([$id]);
return $stmt->fetchAll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function first()\n\t{\n\t\treturn self::new_instance_records()->first();\n\t}",
"public function selectFirst()\n {\n return $this->pdoConnection->query('SELECT * FROM ' . $this->table . ' LIMIT 1 ', \\PDO::FETCH_CLASS, $this->className)->fetch();\n }",
"public function first()\n {\n return call_user_func($this->class . \"::__createInstanceFromArray\", $this->query->first());\n }",
"function fetch_obj($class = null)\n {\n if($class === null) { try { return $this->result->fetch(PDO::FETCH_OBJ); } catch(PDOException $e) { throw new DBException($e->getMessage()); } }\n $d = $this->fetch_assoc();\n if(!$d) return false;\n $o = new $class;\n foreach($d as $k=>$v) $o->$k = $v;\n if( method_exists($o, '__construct') ) $o->__construct();\n return $o;\n }",
"private static function object_from_table_row($record) {\n\t // Could check that $record exists and is an array\n\t // Simple, long-form approach:\n\t $class_name = get_called_class();\n\t\t$object = new $class_name;\n\t\t\n\t\tforeach($record as $attribute=>$value){\n $attr = strtolower($attribute); //specific for Oracle, where table columns are always uppercase\n\t\t if($object->has_attribute($attr)) {\n\t\t $object->$attr = $value;\n\t\t }\n\t\t}\n\t\treturn $object;\n }",
"public function selectSingle() {\n $suffix = $this->formQuerySuffix();\n $arr = $this->table->selectSingle($suffix);\n $class = $this->className;\n $result = null;\n\n DBRecord::$fromPostData = false;\n if ($arr) $result = new $class($arr);\n DBRecord::$fromPostData = true;\n\n return $result;\n }",
"public static function findOne($where, $class){\n $tableName = $class::tableName();\n $attributes = array_keys($where);\n $sql = implode(\"AND \", array_map(fn($attr) => \"$attr = :$attr\", $attributes));\n $statement = self::prepare(\"SELECT * FROM $tableName WHERE $sql\");\n foreach($where as $key => $item){\n $statement->bindValue(\":$key\", $item);\n }\n \n $statement->execute();\n return $statement->fetchObject(static::class);\n }",
"public function singleResult() {\n $this->_pstmt->setFetchMode(PDO::FETCH_CLASS, $this->_className);\n return $this->_pstmt->fetch(PDO::FETCH_CLASS);\n }",
"public function first_row($type = 'object')\n\t{\n\t\treturn $this->row(0, $type);\n\t}",
"protected function first($tableName)\n {\n $sql = \"select * from {$tableName}\";\n $data = $this->select($sql,'single');\n\n return $data;\n }",
"private function _getRecord($class)\n\t{\n\t\t$nsClass = __NAMESPACE__.'\\\\'.$class;\n\n\t\tif (!class_exists($nsClass))\n\t\t{\n\t\t\techo 'Error: No records exist with the class '.$nsClass.\"\\n\";\n\t\t\texit(1);\n\t\t}\n\n\t\treturn new $nsClass('install');\n\t}",
"function findFirst($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\t$obj = $statement->fetchObject($this->resultClass, array($this));\n\t\treturn $obj;\n\t}",
"public function getObject($table, $key, $className = NULL) {\r\n $p = array( 'object' => $table, 'key' => $key );\r\n $xml = $this->post('/api/getObject.sjs', $p);\r\n if ($this->success($xml)) {\r\n if (empty($className)) {\r\n return $xml;\r\n }\r\n return new $className($xml->$table->item[0]);\r\n }\r\n return NULL;\r\n }",
"public function first() {\n\t\treturn $this->execute()->first();\n\t}",
"public function findOne(PDO $con)\n\t{\n\t\t$class = $this->resultClass;\n\t\t$stmt = $this->doExecute($con);\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$record = new $class();\n\t\t\t$record->load($row);\n\t\t\treturn $record;\n\t\t} \n\t}",
"public function single()\n {\n $this->executeQuery($this->statement);\n return $this->fetch($this->statement);\n }",
"public function fetchFirst($table)\n {\n $index = strtolower($table) . '_id';\n $className = '\\Lib\\\\' . ucfirst(strtolower($table));\n $query = \"SELECT * FROM $table\n WHERE release_date <= date()\n ORDER BY $index ASC\n LIMIT 1\";\n $row = $this->getDb()->get_row($query);\n if ($row) {\n return $this->build($className, $row);\n } else {\n return null;\n }\n }",
"static function first() {\n list($record) = self::collection(null, \"id LIMIT 1\");\n return isset($record) ? $record : null;\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return parent::first();\n }",
"public function first()\n {\n return $this->retrieveOrCreateQueryInstance()->firstOrFail();\n }",
"public function getOne() {\n $prepareStatement = $this->pdo->prepare($this->sql);\n $prepareStatement->execute($this->param);\n\n Connection::disconnect();\n\n if ($this->fetch !== PDO::FETCH_CLASS) {\n if (1 == $prepareStatement->columnCount())\n return $prepareStatement->fetch(PDO::FETCH_COLUMN);\n return $prepareStatement->fetch($this->fetch);\n }\n\n return $prepareStatement->fetchObject();\n }",
"public function single()\n\t{\n\t\t$this->execute();\n\t\treturn $this->stm->fetch(PDO::FETCH_OBJ);\n\t}",
"final public function first()\n {\n $queryBuilder = $this->createQueryBuilder();\n $queryBuilder->selectAll();\n $queryBuilder->limit(1);\n\n return $this->fetchOne($queryBuilder);\n }",
"public function first(){\n return $this->find(1);\n }",
"public function fetchObject($class = \\stdClass::class)\n {\n return $this->cursor->fetchObject($class);\n }",
"public function get_single_record($table_name,$id)\n\t{\n\t\t\n\t\t$sql = \"SELECT * FROM \".$table_name.\" WHERE id=\".$id;\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->result();\n\t\t\n\t}",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function first();",
"public function find( int $id, string $className, ? string $table = null) //$className parametre de la function, ? parametre optionnel\r\n{\r\n $sql = \"SELECT * FROM {$this->table} WHERE id =:id\";\r\n\r\n if(!empty($table)){\r\n $sql = \"SELECT * FROM $table WHERE id=:id\";\r\n }\r\n\r\n $maRequete = $this->pdo->prepare($sql);\r\n $maRequete->execute(['id' => $id]);\r\n\r\n $item = $maRequete->fetchObject($className); //deja fait pour l'objet il sait qu'on va lui donner une classe;\r\n\r\n return $item;\r\n}",
"public function single() {\n $this->execute();\n return $this->stmt->fetch(PDO::FETCH_OBJ);\n }",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"public function first()\n\t{\n\t\treturn parent::first();\n\t}",
"protected function fetchObject(string $className = 'stdClass')\n {\n $row = oci_fetch_object($this->resultID);\n\n if ($className === 'stdClass' || ! $row) {\n return $row;\n }\n if (is_subclass_of($className, Entity::class)) {\n return (new $className())->injectRawData((array) $row);\n }\n\n $instance = new $className();\n\n foreach (get_object_vars($row) as $key => $value) {\n $instance->{$key} = $value;\n }\n\n return $instance;\n }",
"public function single(){\n\t\t$this->execute();\n\t\treturn $this->stmt->fetch(PDO::FETCH_OBJ);\n\t}",
"public function first()\n\t{\n\t\treturn Model::first();\n\t}",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('TrOnlineRecord');\n }",
"public function getOne($query = array())\n\t{\n\t\t// Check if database query has been given\n\t\tif (!$query instanceof Kohana_Database_Query)\n\t\t{\n\t\t\t// Query not given so create one\n\t\t\t$query = $this->populateWhere(DB::select(), $query);\n\t\t}\n\t\t$query->from($this->table); // Use the specified entity table\n\t\t$query->limit(1); // Limit to only 1 record\n\t\t$query->as_object($this->entityClass); // Use the defined entity class\n\t\t$result = $query->execute(); // Execute the query\n\n\t\t// Did we get a result?\n\t\tif ($result->count() === 0)\n\t\t{\n\t\t\t// No result\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Return the first (and only) row\n\t\t\treturn $this->loadRelations($result[0]);\n\t\t}\n\t}",
"public function fetchFromRow($row)\n {\n $cn = $this->getClassName();\n $obj = new $cn();\n foreach ($row as $key => $value) {\n $obj->{$key} = $value;\n }\n return $obj;\n }",
"public function fetchSingle() {\n $this->execute();\n return $this->stmt->fetch(PDO::FETCH_OBJ);\n }",
"public function singleRow(){\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }",
"public function single(){\r\n $this->execute();\r\n return $this->stmt->fetch(PDO::FETCH_OBJ);\r\n }",
"public function getTable()\r\n\t{\r\n\t\tif ($this->_table===null) {\r\n\t\t\t$this->_table=new $this->_tableClass;\r\n\t\t}\r\n\t\treturn $this->_table;\r\n\t}",
"public function findOne()\r\n {\r\n $records = $this->find(1);\r\n \r\n return isset($records[0]) ? $records[0] : null;\r\n }",
"public function singleRecord($table_name, $table_field_name_with_value) {\n return $this->db->where($table_field_name_with_value)->get($table_name)->row();\n }",
"public function from($table){\n\t\treturn $this->table($table);\n\t}",
"public function findFirst() {\r\n\t\t$aux = $this->fetchAllPg(1);\r\n\t\tif($aux == null)\r\n\t\t\treturn null;\r\n\t\treturn $aux[0];\r\n\t}",
"protected function getOne()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetch($statement);\n }",
"function single_rec( $sql, $binds = '' ){\n $cur = $this->exec_sql( $sql, $binds );\n return oci_fetch_object( $cur );\n }",
"public function first() {\n $this->limit(1);\n $query = $this->query( $this->_active_query->getQuery(), $this->_active_query->getParams() );\n return new QueryResult($query, TRUE);\n }",
"public static function instance() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$instance = db::instance(db::table($table));\n\t\treturn $instance;\n\t}",
"public function first()\n {\n if (!$this->_result) {\n $this->limit(1);\n }\n\n return $this->all()->first();\n }",
"public function from($table) {\n\t\treturn $this->table($table);\n\t}",
"public function get($primaryKeyValue = 0)\n\t{\n\t\t// Create new row object\n\t\tif(!$primaryKeyValue) {\n\t\t\t$row = new $this->rowClass();\n\t\t\treturn $row;\n\t\t\n\t\t// Find record by primary key\n\t\t} else {\n\t\t\treturn $this->first(array($this->getPrimaryKeyField() => $primaryKeyValue));\n\t\t}\n\t}",
"private function hasOne($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)->limit(1)->get();\n\t\t$result = $this->_db()->result();\n\t\t$priId = $result[$priKey];\n\t\t$entity = new $model($priId);\n\t\treturn $entity;\n\t}",
"public final function newRow($table) \n {\n return AutoRecord::loadRow($this, $table, null);\n }",
"public function findOne($entity)\n {\n $statement = \"SELECT * FROM contact WHERE id = :id LIMIT 1\";\n $prepare = $this->db->prepare($statement);\n $prepare->bindValue(\":id\", $entity->getId());\n $prepare->execute();\n return $prepare->fetch(\\PDO::FETCH_CLASS, Contact::class);\n }",
"public function one($db = null)\n {\n $data = $this->executeScript($db, 'One');\n if (empty($data)) {\n return null;\n }\n $row = [];\n $c = count($data);\n for ($i = 0; $i < $c;) {\n $row[$data[$i++]] = $data[$i++];\n }\n if ($this->asArray) {\n $model = $row;\n } else {\n /* @var $class ActiveRecord */\n $class = $this->modelClass;\n $model = $class::instantiate($row);\n $class = get_class($model);\n $class::populateRecord($model, $row);\n }\n if (!empty($this->with)) {\n $models = [$model];\n $this->findWith($this->with, $models);\n $model = $models[0];\n }\n if (!$this->asArray) {\n $model->afterFind();\n }\n\n return $model;\n }",
"function getOne($_sTable, $_mWhere = NULL, $_bConnectWhereArrayWithOrInsteadOfAnd = FALSE) {\n $aTemp = get($_sTable, $_mWhere, $_bConnectWhereArrayWithOrInsteadOfAnd);\n return count($aTemp) > 0 ? $aTemp[0] : NULL;\n}",
"public function first()\n\t{\n\t\treturn $this->find()->first();\n\t}",
"function get_one_by( $conds = array()) {\n\n\t\t// where clause\n\t\t$this->custom_conds( $conds );\n\n\t\t// query the record\n\t\t$query = $this->db->get( $this->table_name );\n\n\t\tif ( $query->num_rows() == 1 ) {\n\t\t// if there is one row, return the record\n\t\t\treturn $query->row();\n\t\t} else {\n\t\t// if there is no row or more than one, return the empty object\n\t\t\t return $this->get_empty_object( $this->table_name );\n\t\t\t\n\t\t}\n\n\t}",
"public function fetch_object($class_name = 'stdClass')\r\n {\r\n return $this->resultID->fetch_object($class_name);\r\n }"
] | [
"0.7174507",
"0.6719947",
"0.6544192",
"0.65335566",
"0.6489773",
"0.63462794",
"0.6261499",
"0.6242785",
"0.6187188",
"0.61449975",
"0.6129657",
"0.6110063",
"0.61063194",
"0.61044705",
"0.6100232",
"0.6035502",
"0.6009321",
"0.59512377",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5909191",
"0.5904603",
"0.5874989",
"0.5871534",
"0.5861857",
"0.5853765",
"0.58344823",
"0.5819231",
"0.5817046",
"0.5817046",
"0.5817046",
"0.5817046",
"0.5817046",
"0.5817046",
"0.5817046",
"0.5817046",
"0.5809939",
"0.5809295",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.57974565",
"0.5787919",
"0.5787115",
"0.5779408",
"0.5775588",
"0.57729805",
"0.57559574",
"0.5742598",
"0.57193345",
"0.5712899",
"0.5704753",
"0.57034343",
"0.57019776",
"0.56952363",
"0.5684508",
"0.5678597",
"0.56689155",
"0.565456",
"0.5647585",
"0.56404567",
"0.5639882",
"0.5632349",
"0.56288713",
"0.5627985",
"0.562753",
"0.56273",
"0.56203663",
"0.5600118",
"0.55983895",
"0.55895996"
] | 0.0 | -1 |
Perform a custom select query with user input data passed as $parameters. | public function select(string $query, array $parameters)
{
$stmt = $this->pdo->prepare($query);
$stmt->execute($parameters);
return $stmt->fetchAll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function prepareSelect();",
"public function select($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"SELECT \";\n\t\t$p = $this->clean($params);\n\t\t$statement = $prefix.\" \".$this->genFrom($p['cols']).\" \".$this->genTable($p['tables']).$this->genWhere($p['where']);\t\n\t\treturn $DB->select($statement);\t\n\t}",
"public function select()\n\t{\n\t\treturn call_user_func_array([$this->queryFactory->__invoke('select'), 'select'], func_get_args());\n\t}",
"public function select($params = []) {\n\t\t\t// Get the target table\n\t\t\t$table = $params['table'] ?? $this->table;\n\t\t\t// Get columns names [col1, col2, col3] => \"col1, col2, col3\"\n\t\t\t$columns = isset($params['columns']) ? implode(', ', $params['columns']) : '*';\n\t\t\t// Get WHERE condition\n\t\t\t$where = $this->get_where_condition($params['where'] ?? []);\n\t\t\t// Get the params to bind\n\t\t\t$bindings = $this->bindings;\n\n\t\t\t// Execute the query and return results\n\t\t\treturn $this->query(\"SELECT $columns FROM $table $where\", $bindings);\n\t\t}",
"private function _select(){\n $this->debugBacktrace();\n $parameter = $this->selectParam; //transfer to local variable.\n $this->selectParam = \"\"; //reset updateParam.\n\n \n \n $sql = \"\";\n if($this->hasRawSql){\n $sql = $parameter;\n $this->hasRawSql = false;\n }\n else{\n $tableName = $this->tableName;\n $this->tableName = \"\"; //reset.\n\n $columns = \"\";\n if(!isset($parameter) || empty($parameter)){\n $columns = \"*\";\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n else{\n //first check whether it has 'select' keyword\n $parameter = trim($parameter);\n $keyWord = substr($parameter,0,6);\n if(strtoupper($keyWord)==\"SELECT\") {\n $sql = $parameter;\n }\n else{\n $columns = $parameter;\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n }\n }\n\n \n $queryObject = $this->_perform_mysql_query($sql);\n \n if(empty($this->selectModifier)){\n //No select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $quantity = 0;\n $rows = array();\n switch ($this->fetchType){\n case \"fetch_object\":\n while ($row = mysqli_fetch_object($queryObject)) {\n if(isset($tableName)){\n $meta = new stdClass();\n $meta->type = $tableName;\n $row->__meta = $meta;\n }\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_assoc\":\n while ($row = mysqli_fetch_assoc($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_array\":\n while ($row = mysqli_fetch_array($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_row\":\n while ($row = mysqli_fetch_row($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_field\":\n while ($row = mysqli_fetch_field($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n }\n\n if($quantity>0){\n mysqli_free_result($queryObject);\n }\n\n return $rows;\n //<----No select modifier (first, firstOrDefault, single, singleOrDefault) found \n }\n else{ \n //select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $selectModifier = $this->selectModifier;\n $this->selectModifier = \"\";\n $row;\n switch($selectModifier){\n case \"first\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n break;\n \n case \"firstOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n break;\n\n case \"single\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n if($numRows > 1){\n throw new ZeroException(\"Multiple records found.\");\n }\n break;\n\n case \"singleOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n if($numRows > 1){\n return NULL;\n }\n break;\n }\n\n return $this->_prepareSingleRecord($queryObject);\n //<---- select modifier (first, firstOrDefault, single, singleOrDefault) found *212*062#\n }\n }",
"public function select($fields);",
"public function select();",
"public function select();",
"public function select();",
"public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }",
"public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);",
"public function select($arg){\n if(is_string($arg)){\n $this->params['SELECT'] = \"$arg\";\n }else if(is_array($arg)){\n $c = \"\";\n $x = 0;\n foreach($arg as $a){//foreach, translate into SQL language\n if($x != 0){\n $c .= \",\";\n }\n $x++;\n $c .= $a;\n }\n $this->params[\"SELECT\"] = $c;//change the select using the arguments\n }else{\n echo 'An error has occured';\n return false;\n }\n return $this;\n }",
"public static function doSelect($params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->select(self::TABLE_NAME, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}",
"private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }",
"public function select($sql, $parameters = null) {\n\n\t\treturn $this->query($sql, $parameters)->fetchAll(PDO::FETCH_ASSOC);\n\t\t\n\t}",
"public function select($query, $bindings = []);",
"public function select($query, $bindings = []);",
"public function select($query, $bindings = []);",
"protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }",
"function select($fields = '*', $fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n return call_user_func_array([$this->db, __FUNCTION__], func_get_args());\n }",
"public function Do_select_Example1(){\n\n\t}",
"public function getSelect();",
"public function getSelect();",
"protected function prepareSelectStatement() {}",
"public abstract function getSelect(\n $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0\n );",
"public function select()\r\n\t{\r\n\t\t$this->clear();\r\n\t\t$where = null;\r\n\t\t// no args, so I'm searching for ALL... or doing a specific search\r\n\t\tif(func_num_args() === 0\r\n\t\t || ($where = call_user_func_array(array($this->obj, 'buildWhere'), func_get_args())))\r\n\t\t{\r\n\t\t\t$query = 'SELECT *\r\n\t\t\t\tFROM '.$this->obj->buildFrom();\r\n\t\t\t// pass args to where generator\r\n\t\t\tif($where)\r\n\t\t\t{\r\n\t\t\t\t$query .= ' WHERE '.$where;\r\n\t\t\t}\r\n\t\t\t$results = $this->site->db->query($query);\r\n\t\t\t$success = ($results->num_rows > 0);\r\n\t\t\twhile($row = $results->fetch_assoc())\r\n\t\t\t{\r\n\t\t\t\t$obj = new $this->obj->__CLASS__($this->obj->site);\r\n\t\t\t\tif($obj->loadRow($row))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->push($obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $success;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"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 }",
"function buildSelect($db_name,$table_name,$columns,$where_select){\n\n\t$query_select = \"SELECT \";\n\t//FILL COLUMNS FOR GET\n\tforeach ($columns as $c) {\n\t\t$query_select .= $c;\n\t\tif(array_search($c,$columns) != count($columns) - 1) $query_select .= \",\";\n\t}\n\tif($where_select != \"*\"){//GET \n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name WHERE \";\n\t\t//FILL VALUES WHERE\n\t\tend($where_select);\n\t\t$last_key = key($where_select);\n\t\tforeach ($where_select as $key => $value) {\n\t\t\t$query_select .= $key . \"=\" . \":\" . $key;\n\t\t\tif($key != $last_key) $query_select .= \" AND \";\n\t\t}\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,$where_select);\n\t}\n\telse{//GET ALL SELECT\n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name\";\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,\"*\");\n\t}\n\n}",
"function select($column0=null, $_=null){\n $obj = new SelectRule(new Context($this->connection));\n if($column0 == null){\n $args = ['*'];\n }elseif(is_array($column0)){\n $args = $column0;\n }else{\n $args = func_get_args();\n }\n foreach ($args as &$arg){\n $arg = DB::wrap($arg);\n if($arg == '*'){\n continue;\n }\n }\n return $obj->select(implode(',', $args));\n }",
"public function querySelect($sql, $fields = NULL, $fetchMode = NULL) : Collection;",
"private function _createSQLSelect(array $params){\n\t\t$select = 'SELECT ';\n\t\tif(isset($params['columns'])){\n\t\t\t$this->clear();\n\t\t\t$select.= $params['columns'];\n\t\t} else {\n\t\t\t$select.= join(', ', $this->_getAttributes());\n\t\t}\n\t\tif($this->_schema){\n\t\t\t$select.= ' FROM '.$this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$select.= ' FROM '.$this->_source;\n\t\t}\n\t\t$return = 'n';\n\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\tif(isset($params['conditions'])&&$params['conditions']){\n\t\t\t$select.= ' WHERE '.$params['conditions'].' ';\n\t\t} else {\n\t\t\tif(!isset($primaryKeys[0])){\n\t\t\t\tif($this->isView==true){\n\t\t\t\t\t$primaryKeys[0] = 'id';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($params[0])){\n\t\t\t\tif(is_numeric($params[0])){\n\t\t\t\t\tif(isset($primaryKeys[0])){\n\t\t\t\t\t\t$params['conditions'] = $primaryKeys[0].' = '.$this->_db->addQuotes($params[0]);\n\t\t\t\t\t\t$return = '1';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new ActiveRecordException('No se ha definido una llave primaria para este objeto');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif($params[0]===''){\n\t\t\t\t\t\tif(isset($primaryKeys[0])){\n\t\t\t\t\t\t\t$params['conditions'] = $primaryKeys[0].\" = ''\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new ActiveRecordException('No se ha definido una llave primaria para este objeto');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params['conditions'] = $params[0];\n\t\t\t\t\t}\n\t\t\t\t\t$return = 'n';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($params['conditions'])){\n\t\t\t\t$select.= ' WHERE '.$params['conditions'];\n\t\t\t}\n\t\t}\n\t\tif(isset($params['group'])&&$params['group']) {\n\t\t\t$select.= ' GROUP BY '.$params['group'];\n\t\t}\n\t\tif(isset($params['order'])&&$params['order']) {\n\t\t\t$select.= ' ORDER BY '.$params['order'];\n\t\t}\n\t\tif(isset($params['limit'])&&$params['limit']) {\n\t\t\t$select = $this->_limit($select, $params['limit']);\n\t\t}\n\t\tif(isset($params['for_update'])&&$params['for_update']==true){\n\t\t\t$select = $this->_db->forUpdate($select);\n\t\t}\n\t\tif(isset($params['shared_lock'])&&$params['shared_lock']==true){\n\t\t\t$select = $this->_db->sharedLock($select);\n\t\t}\n\t\treturn array('return' => $return, 'sql' => $select);\n\t}",
"public function select() {\n\t\t// PHP doesn't allow direct use as function argument\n\t\t$_args=func_get_args();\n\t\treturn call_user_func_array(array($this,'lookup'),$_args);\n\t}",
"function select() {\n\t\t// PHP doesn't allow direct use as function argument\n\t\t$args=func_get_args();\n\t\treturn call_user_func_array(array($this,'lookup'),$args);\n\t}",
"function select_sql($table='', $fields='*', ...$get_args) {\n\t\t$this->select_result = false;\n return $this->selecting($table, $fields, ...$get_args);\t \n }",
"function selectQuery($query) \t{\n\t\tif($query != '')\t\t{\n\t $res = $this->execute($query);\n\t\t\treturn $this->fetchAll($res);\n\t\t}\n\t}",
"public function getSelectData($fields, $parameter=\"\") {\n\t$qb = new \\Doctrine\\ORM\\QueryBuilder($this->getEntityManager());\n\t$companyObj = new PhvCompany();\n\t$studyObj = new PhvStudy();\n\t$query = $qb->select('s.id', 'c.company_name','c.id as comId')\n\t\t ->from($this->getTableName(), 's')\n\t\t ->leftJoin($companyObj->getTableName(), 'c', \"ON\", 'c.id=s.cro_id');\n\tif($parameter != \"\") {\n\t $currentUser = $this->getCurrentUser();\n\t $query->leftJoin($studyObj->getTableName(), 'st', \"ON\", 'st.id=s.study_id')\n\t\t->where($query->expr()->like('c.company_name', $query->expr()->literal('%' . $parameter . '%')))\n\t\t->andWhere($query->expr()->eq('st.sponser_id', intval($currentUser->getCompany()->getId())));\n\t}\n\t$result = $this->getEntityManager()->getConnection()->executeQuery($query)->fetchAll();\n $tempArr = array();\n foreach ($result as $val) {\n\t \n $tempArr[$val['comId']] = $val['company_name'];\n }\n return array_unique($tempArr);\n }",
"protected static function select()\n {\n }",
"public function select($columns);",
"public function select($table_name, $fields = array(), $where = array(), $order_by = '')\r\n {\r\n }",
"public function select($params){\n\t$this->select.=\" \".$params;\n\t\t\treturn $this;\n\t}",
"public function cpSelect($tablename,$value1=0,$value2=0) {\n /*\n * Prepare the select statement\n */\n $sql=\"SELECT * FROM $tablename\";\n if($value1!=0)\n { $key1= key($value1);\n $sql.=\" where $key1='$value1[$key1]'\";\n }\n if($value1!=0 && $value2!=0) \n {\n $key2= key($value2);\n $sql.=\" AND $key2='$value2[$key2]'\";\n }\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}",
"protected function runSelect()\n {\n return $this->connection->select(\n $this->toSql(),\n $this->getBindings(),\n $this->option->setUseWrite($this->useWritePdo)\n );\n }",
"public function createSelectSql(): \\Hx\\Db\\Sql\\SelectInterface;",
"static function select($sql, $params = array()) {\n $sth = static::execute($sql, $params);\n\n $result = $sth->fetchAll();\n\n return $result;\n }",
"public function doQuery($sql, $params);",
"function select ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tselect');\n return $rc->newInstanceArgs( $arguments ); \n}",
"function buildSelect($params)\n {\n // Fetching field list\n $fieldList = $this->getFieldList($params['table']);\n if (!is_array($fieldList))\n {\n return false;\n }\n\n //--------------------------------------------------------------------\n\n // Walk through the array of given parameters and if one of them is a\n // field name, include it in the query\n reset($params);\n $fieldSelect = '';\n $whereStatement = '';\n\n while (key($params))\n {\n if (in_array(key($params), $fieldList))\n {\n $fieldSelect .= key($params) . \", \";\n if (current($params))\n {\n $whereStatement .= \" \" . key($params) . \" = '\"\n . current($params) . \"' AND \";\n }\n }\n next($params);\n }\n\n //--------------------------------------------------------------------\n\n // If parameter * is specified or no field name is given at all,\n // build up \"SELECT *\"\n if (!$fieldSelect || in_array(\"*\", array_keys($params)))\n {\n $fieldSelect = \" * \";\n }\n else\n {\n $fieldSelect = preg_replace(\"/,\\s*$/\", \"\", $fieldSelect);\n }\n\n //--------------------------------------------------------------------\n\n // Append custom where conditions\n if (isset($params['where']))\n {\n $whereStatement .= $params['where'];\n }\n $whereStatement\n = $whereStatement\n ? \" WHERE \" . preg_replace(\"/AND\\s*$/\", \"\", $whereStatement)\n : \"\";\n\n $result = \"SELECT \" . $fieldSelect . \" FROM \" . $params['table']\n . $whereStatement;\n return $result;\n }",
"public function select($table, $where_sql = false, $where_fields_values = false, $custom_select_sql = false, $order = false, $limit = false)\r\n\t{\r\n\t\t$sql = $this->generate_select_sql ($table, $where_sql, $where_fields_values, $custom_select_sql, $order, $limit);\r\n\t\treturn $this->query($sql);\r\n\t}",
"public function select(string $query)\n{\n // guardamos lo que venga como parametros en la funcion select\n $this->strquery = $query;\n // preparamos el query\n $result = $this->conexion->prepare($this->strquery);\n $result->execute();\n // se utiliza fetch porque solo devuelve un resultado\n $data = $result->fetch(PDO::FETCH_ASSOC);\n return $data;\n}",
"public function showOption_where($table,$cols,$identifier,$identifierData) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT ($cols) cols FROM $table WHERE $identifier = '$identifierData' order by cols asc \");\n\nwhile($row = mysqli_fetch_array($result))\n {\necho \"<option value='\".$row['cols'].\"'>\".$row['cols'].\"</option>\";\n }\n\n}",
"public function select($data = '*') \n {\t\n // Empty out the old junk\n $this->clear();\n \n // Process our columns, if array, we need to implode to a string\n if(is_array($data))\n {\n if(count($data) > 1)\n {\n $this->sql = \"SELECT \". $this->clean( implode(', ', $data) );\n }\n else\n {\n $this->sql = \"SELECT \". $this->clean($data[0]);\n }\n }\n else\n {\n $this->sql = \"SELECT \". $this->clean($data);\n }\n return $this;\n }",
"public function _select ($table, $fields_array = array(), $where_params_array = array(), $order_array = array(), $limit = null, $offset = null)\n {\n // if not set a wildcard to return everything\n if ( !empty ($fields_array) )\n {\n\n $fields = implode (', ', $fields_array);\n }\n else\n {\n\n $fields = '*';\n }\n\n // create the basic query\n $query = \"\n\t\tSELECT {$fields}\n\t\tFROM {$table}\n\t\t\";\n\n $bind_params_array = array();\n\n // if there are any WHERE parameters then add them to the query and the bind params array\n if ( !empty ($where_params_array) )\n {\n\n $query .= \"WHERE\n \";\n $count = 0;\n foreach ($where_params_array as $key => $value) {\n\n $bind_params_array[$count] = $value;\n\n if ( $count > 0 )\n {\n $query .= \" AND \";\n }\n $query .= \"`{$key}` = ?\n \";\n $count++;\n }\n }\n\n // if an order by setting has been received then add it to the query\n if ( !empty ($order_array) )\n {\n\n $query.= \"ORDER BY\n \";\n foreach ($order_array as $key => $value) {\n\n $query.= \"{$key} {$value},\n \";\n }\n $query = rtrim (trim ($query), ',');\n }\n\n // if an LIMIT setting has been received then add it to the query\n if ( is_numeric ($limit) )\n {\n $query.= \"\n LIMIT {$limit}\n \";\n }\n\n // if an OFFSET setting has been received then add it to the query\n if ( $limit !== null && $offset != null )\n {\n if ( !is_int ($offset) )\n {\n\n throw new Exception ('Non integer passed to function as OFFSET value');\n return false;\n }\n\n $query.= \"\n OFFSET {$offset}\n \";\n }\n\n return $this->queryDatabase ($query, $bind_params_array, true);\n }",
"public function select($field);",
"public function select($perifericos);",
"public function SqlQuery($sql, $parameters)\n {\n \n }",
"function adv_select($table, array $where = null, array $fields = null, $order = '', $limit = null, $offset = null);",
"public function getValue(string $sql, array $parameters = []);",
"public function select($columns = array('*'));",
"public function processSelect(Builder $query, $results);",
"public function select()\n\t{\n\t\t$this->_query['select'] = func_get_args();\n\n\t\treturn $this;\n\t}",
"function createSelect($_table, $_value, $_colum)\n{\n\n $_prev_par= false;\n $_query = \"SELECT * FROM $_table\";\n\n foreach ($_value as $_key => $_value)\n {\n if ($_value != \"\")\n {\n if ($_prev_par)\n {\n $_query.= \" AND \";\n }\n else\n {\n $_query.= \" WHERE \";\n }\n\n $_query.= $_colum[$_key].\" = '$_value'\";\n $_prev_par = true;\n }\n }\n $_query.=\";\";\n\n return $_query;\n}",
"private function Select()\n {\n $return = false;\n $action = $this->Action();\n $columns = $this->Columns();\n $table = $this->Table();\n $where = (Checker::isArray($this->Where(), false))?$this->Where():array(Where::QUERY => \"\", Where::VALUES => array());\n $order = (Checker::isString($this->Order()))?$this->Order():\"\";\n $limit = (Checker::isInt($this->Limit()))?\" LIMIT \".$this->Limit():\"\";\n if($columns && $table && Checker::isArray($where, false))\n {\n $return[Where::QUERY] = \"$action $columns FROM $table\".$where[Where::QUERY].\"$order$limit\";\n\n if(Checker::isArray($where, false) && isset($where[Where::VALUES])) $return[Where::VALUES] = $where[Where::VALUES];\n else $return[Where::VALUES] = array();\n }\n return $return;\n }",
"public function select($fields) {\n\n $fields = self::check_fields_of_table_list(array_map('trim', explode(',', $fields)));\n\n // varsayılan olarak ekle, objeler yüklenirken her zaman id olmalıdır.\n $table_and_primary_key = $this->_table . \".id\";\n if (!in_array($table_and_primary_key, $fields))\n array_push($fields, $table_and_primary_key);\n\n $this->_select = $fields; // [\"User.first_name\", \"User.last_name\", \"Comment.name\"]\n return $this;\n }",
"public function fetchDropDown(string $sql, array $parameters = [])\n {\n $result = $this->fetchAll($sql, $parameters);\n $data = [];\n foreach ($result as $field) {\n $data[array_shift($field)] = array_shift($field);\n }\n\n return $data;\n }",
"function BDDselect($sql, $param){\n $bdd = BDDopen();\n $req = $bdd->prepare($sql);\n if($req->execute($param) === FALSE){\n echo 'Errore de la requette';\n print_r($param);\n }\n return $req;\n}",
"function dmSelect($table, $name, $value=\"\", $all=FALSE, $attrs=NULL, $required=TRUE) {\n $dmQ = new DmQuery();\n $dmQ->connect();\n # Don't use getAssoc() so that we can set the default below\n $dms = $dmQ->get($table);\n $dmQ->close();\n $default = \"\";\n $options = array();\n if ($all) {\n $options['all'] = 'All';\n }\n if (!$required) {\n // Add \"Any\" for the first option.\n $loc = new Localize(OBIB_LOCALE, \"shared\");\n $options[''] = $loc->getText(\"any\");\n }\n foreach ($dms as $dm) {\n $options[$dm->getCode()] = $dm->getDescription();\n if ($dm->getDefaultFlg() == 'Y') {\n $default = $dm->getCode();\n }\n }\n if ($value == \"\") {\n $value = $default;\n }\n if (!$required) {\n // Selected on \"Any\" option.\n $value = \"\";\n }\n return inputField('select', $name, $value, $attrs, $options);\n}",
"public static function doSelect($params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->select(self::TABLE_NAME, $what);\n\t\treturn DbModel::doSelect($conn, new PollTemplatesModel());\n\t}",
"function MyMod_Data_Fields_Sql_Search_Select($data,$rdata,$value)\n {\n if\n (\n $this->ItemData[ $data ][ \"GETSearchVarName\" ]\n &&\n !preg_match('/^Admin$/',$this->Profile())\n )\n {\n $getvalue=$this->CGI_GETint($this->ItemData[ $data ][ \"GETSearchVarName\" ]);\n if (!empty($getvalue))\n {\n if (empty($value))\n {\n $value=$getvalue;\n }\n }\n }\n\n //Where clause in module sql table\n $where=$this->MyMod_Data_Fields_Sql_Where($data,$value);\n\n if (!is_array($where)) { $where=$this->Hash2SqlWhere($where); }\n\n //Get values present in table.\n $colvalues=$this->Sql_Select_Unique_Col_Values\n (\n $data,\n $where\n );\n $colvalues=preg_grep('/^\\d+$/',$colvalues);\n \n if (!empty($colvalues))\n {\n $where[ \"ID\" ]=$colvalues;\n }\n\n $datas=$this->MyMod_Data_Fields_Module_Datas($data);\n $datas=preg_grep('/^ID$/',$datas,PREG_GREP_INVERT);\n array_push($datas,\"ID\");\n\n $hashes=array();\n if (!empty($this->ItemData[ $data ][ \"SqlTables_Regex\" ]))\n {\n $class=$this->ItemData[ $data ][ \"SqlClass\" ];\n \n $hashes=\n $this->Module2Object($data)->Sql_Tables_Select_Hashes\n (\n $this->ItemData[ $data ][ \"SqlTables_Regex\" ],\n $where,\n $datas\n );\n }\n elseif (!empty($this->ItemData[ $data ][ \"Search_Vars\" ]))\n {\n $class=$this->ItemData[ $data ][ \"SqlClass\" ];\n $sqltable=$this->ApplicationObj()->SubModulesVars[ $class ][ \"SqlTable\" ];\n\n foreach ($this->ItemData[ $data ][ \"Search_Vars\" ] as $searchvar)\n {\n $sqltable=\n preg_replace\n (\n '/#'.$searchvar.'/',\n $this->MyMod_Search_CGI_Value($searchvar),\n $sqltable\n );\n }\n $hashes=\n $this->Module2Object($data)->Sql_Select_Hashes\n (\n $where,\n $datas,\n \"\",FALSE,\n $sqltable\n );\n }\n else\n {\n if (!empty($where[ $data ]))\n {\n #$where[ \"ID\" ]=$where[ $data ];\n unset($where[ $data ]);\n }\n $class=$this->ItemData[ $data ][ \"SqlClass\" ];\n if (\n !empty($this->ItemData[ $data ][ \"SqlClass\" ])\n &&\n method_exists($this->Module2Object($data),\"SqlWhere\")\n )\n {\n if (!is_array($where))\n {\n $where=$this->SqlClause2Hash($where);\n }\n\n $where=\n array_merge\n (\n $where,\n $this->Module2Object($data)->SqlWhere(array($data => $value))\n );\n }\n\n $hashes=\n $this->Module2Object($data)->Sql_Select_Hashes\n (\n $where,\n $datas,\n join(\",\",$this->ApplicationObj()->SubModulesVars[ $class ][ \"SqlDerivedData\" ])\n );\n }\n\n $rvalue=$this->Html_Select_Hashes2Field\n (\n $this->MyMod_Search_CGI_Name($data),\n $this->MyMod_Data_Fields_Module_SubItems_2Options\n (\n $data,\n $this->MyMod_Sort_List($hashes,$datas)\n ),\n $value\n );\n\n if ($this->ItemData[ $data ][ \"SqlTextSearch\" ] && ($value==\"\" || $value==0))\n {\n $rvalue=\n array\n (\n $value,\n $this->MyMod_Search_Field_Text($data)\n );\n }\n else\n {\n $rvalue=preg_replace\n (\n '/NAME=\\''.$data.'\\'/',\n \"NAME='\".$rdata.\"'\",\n $rvalue\n );\n }\n \n return $rvalue;\n }",
"public function select()\n {\n\n }",
"public function select($table, $fields, $where, $order, $start);",
"public function PgSelect($sql){\n $this->StartBD();\n $this->SQuery = $this->PgQuery($sql);\n if (!$this->SQuery){\n die(\"SELECT Erroneo!\");\n }\n $this->EndBD();\n }",
"function select($columns)\n{\n\t$this->tryModify();\n\t$this->query['select'] = is_array($columns)? $columns : explode(',', $columns);\n\t$this->execute();\n\t$rows = $this->db->fetchAll($this->result);\n\t$this->close();\n\t$this->query['select'] = array('*');\n\treturn $rows;\n}",
"function select_dropdown_options($name)\n{\n $conn = db_connect();\n\n // Generate the salespeople from the database as select options if that is the name passed in to the element\n if ($name == \"salesperson\") {\n\n // Prepared statement for selecting salesperson dropdown options\n $salesperson_dropdown_select_stmt = pg_prepare(\n $conn,\n \"salesperson_dropdown_select_stmt\",\n \"SELECT id, first_name, last_name FROM salespeople;\"\n );\n\n $result = pg_execute($conn, \"salesperson_dropdown_select_stmt\", array());\n\n // Generate the clients from the database as select options if salesperson is logged in \n // by filtering only their clients\n } else if ($name == \"client\" && $_SESSION['type'] == \"a\") {\n\n // Prepared statement for selecting client dropdown options\n $salesperson_id = $_SESSION['id'];\n $clients_dropdown_select_stmt = pg_prepare(\n $conn,\n \"clients_dropdown_select_stmt\",\n \"SELECT id, first_name, last_name FROM clients WHERE salesperson_id = $salesperson_id;\"\n );\n\n $result = pg_execute($conn, \"clients_dropdown_select_stmt\", array());\n }\n\n // Return the data required to populate dropdown menu options\n return $result;\n}",
"public static function doSelect($params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->select(self::TABLE_NAME, $what);\n\t\treturn DbModel::doSelect($conn, new CampaignDefinitionsModel());\n\t}",
"protected function runSelectWithMeta()\n {\n return $this->connection->selectWithMeta(\n $this->toSql(),\n $this->getBindings(),\n ! $this->useWritePdo\n );\n }",
"static function select ($in = '', $data = []) {\n\t\treturn static::select_common($in, $data, __FUNCTION__);\n\t}",
"public function selectQuery($param_query) {\n\t\t\t// Connect to the database\n\t\t\t$connection = $this->openConnection();\n\n\t\t\t$rows = array();\n\t\t\t$result = $connection->query($param_query);\n\t\t\tif($result === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\twhile ($row = $result->fetch_object()) {\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\t\t\treturn $rows;\n\t\t}",
"function Select($table, $fields, $where, $limit = false, $where_type = 'AND')\n\t{\n\t\t$where = $this->QueryWhereGenerate($where);\n\t\t\n\t\t$fields_query = '';\n\t\t$where_query = '';\n\t\t\n\t\tif (strstr($fields, ','))\n\t\t{\n\t\t\t$fields_array = explode(',', $fields);\n\t\t\t\n\t\t\tforeach ($fields_array AS $field)\n\t\t\t{\n\t\t\t\t$fields_query .= ', `' . trim($field) . '`';\n\t\t\t}\n\t\t\t\n\t\t\t$fields_query = substr($fields_query, 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fields == '*')\n\t\t\t{\n\t\t\t\t$fields_query = $fields;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fields_query = '`' . $fields . '`';\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($where AS $key => $value)\n\t\t{\n\t\t\t$where_query .= ' ' . $where_type. \" `\" . $key . \"` \" . $value;\n\t\t}\n\t\t\n\t\tif ($limit)\n\t\t{\n\t\t\treturn $this->RunQuery(\"SELECT \" . $fields_query . \" FROM `\" . $table . \"` WHERE \" . substr($where_query, strlen($where_type) + 1) . ' LIMIT ' . $limit);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->RunQuery(\"SELECT \" . $fields_query . \" FROM `\" . $table . \"` WHERE \" . substr($where_query, strlen($where_type) + 1));\n\t\t}\n\t}",
"public function sql_select_db() {}",
"public function sql_select_db() {}",
"function select($table, $where = null, $params = array())\n {\n\n $defaults = array(\n 'fields' => '*',\n 'group' => NULL,\n 'order' => NULL,\n 'limit' => NULL,\n 'offset' => 0,\n 'join' => ''\n );\n\n $params = array_merge($defaults, $params);\n\n /**\n * JOIN\n */\n if (is_array($params['join'])) {\n $join = '';\n foreach ($params['join'] as $k => $v) {\n if (is_numeric($k)) {\n $join .= \" $v\";\n } else {\n if ($k[0] == '*') {\n $join .= ' left';\n $k = ltrim($k, '*');\n } else {\n $join .= ' inner';\n }\n $join .= \" join {$this->prefix}{$k} {$k} on {$v}\";\n }\n }\n } else {\n $join = $params['join'];\n }\n\n /**\n * FIELDS\n */\n if (!is_array($params['fields'])) {\n $params['fields'] = explode(\",\", $params['fields']);\n }\n\n $fields = array();\n\n foreach ($params['fields'] as $k => $v) {\n\n // Allow * and functions\n if (preg_match('/(\\*|[A-Z]+\\([^\\)]+\\)|[a-z]+\\([^\\)]+\\)|SQL_CALC_FOUND_ROWS.*)/', $v)) {\n $r = str_replace('`', '``', $v);\n } else {\n $r = \"`\" . implode('`.`', explode(\".\", str_replace('`', '``', $v))) . \"`\";\n }\n\n if (!is_numeric($k)) {\n $r .= sprintf(\" as `%s`\", str_replace('`', '``', $k));\n }\n\n //$fields[] = $r;\n $params['fields'][$k] = $r;\n }\n\n list($where, $bindings) = $this->_where($where);\n\n $sql = sprintf(/** @lang text */\n \"SELECT %s FROM `%s` %s %s %s\",\n implode(\", \", $params['fields']),\n $this->prefix . $table,\n $table,\n $join,\n !empty($where) ? 'WHERE ' . $where : '');\n\n if ($params['group']) {\n if (is_array($params['group'])) {\n throw new \\Exception('not implemented');\n } else {\n $sql .= sprintf(' GROUP BY %s', $params['group']);\n }\n }\n\n if (!empty($params['order'])) {\n if (is_array($params['order'])) {\n $params['order'] = implode(' ', $params['order']);\n }\n $sql .= sprintf(' ORDER BY %s', $params['order']);\n }\n\n if ($params['limit']) {\n $sql .= sprintf(' LIMIT %d,%d', $params['offset'], $params['limit']);\n }\n\n $query = $this->query($sql);\n\n $query->exec($bindings);\n\n return $query;\n }",
"public function cpSelectDsc($tablename,$value3=0, $value1=0,$value2=0) {\n /*\n * Prepare the select statement\n */\n $sql=\"SELECT * FROM $tablename\";\n if($value1!=0)\n { $key1= key($value1);\n $sql.=\" where $key1='$value1[$key1]'\";\n }\n if($value1!=0 && $value2!=0) \n {\n $key2= key($value2);\n $sql.=\" AND $key2='$value2[$key2]'\";\n }\n $sql.= \" ORDER BY $value3 DESC\";\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}",
"public function select($actividades_fuera);",
"function select($item,$table,$s_cul=0,$value=0){\r\n global $con;\r\n $query=$con->prepare(\"SELECT $item FROM $table where $s_cul=? \");\r\n $query->execute(array($value));\r\n $content=$query->fetchall();\r\n return $content;\r\n}",
"function dataSelect() {\n\t\t\t\t$koneksi = $this->koneksi;\n\t\t\t\t// SQL\n\t\t\t\t$query\t\t\t= \"SELECT * FROM pegawai ORDER BY id ASC\";\n\t\t\t\t\n\t\t\t\t$sql\t\t\t= mysqli_query($koneksi,$query);\n\t\t\t\t\n\t\t\t\treturn $sql;\n\t\t\t}",
"function query_select ($name,$query,$default=\"\")\n// from the Welling and Thomson book - thanks for a cool little function!\n{\n global $lg;\n switch ($lg)\n {\n case \"en\":\n $opt_field=1;\n $choose=\"-- Choose --\";\n break;\n case \"cy\":\n $opt_field=2;\n $choose=\"-- Dewis --\";\n break;\n }\n // that should do it\n\n $result=mysql_query($query);\n if (!result)\n return(\"Sorry, I couldn't connect to the database\");\n\n $select=\"<select name=\\\"$name\\\">\";\n $select .= \"<option value=\\\"\\\">$choose</option>\";\n\n for ($i=0; $i<mysql_numrows($result); $i++)\n {\n // $opt_code is the id field for the list of options, starting from 0\n // this assumes that your primary key field will always be the very first\n // field in the table\n $opt_code=mysql_result($result, $i, 0);\n // $opt_desc is the field for the label to be applied to the options\n // the placement number is selected by the switch statement above;\n // note that this implies that your languages will be in the same sequence\n // in each table, ie en always in field 1 (the second field), cy always\n // in field 2 (the third field in the table), etc\n $opt_desc=mysql_result($result, $i, $opt_field);\n $select .= \"<option value=\\\"$opt_code\\\"\";\n if ($opt_code==$default)\n {\n $select .= \" selected\";\n }\n $select .= \"> $opt_desc</option>\";\n }\n $select .= \"</select>\\n\";\n return $select;\n}",
"function select ($distinct, \n\t\t\t\t\t $table_name, \n\t\t\t\t\t $select_column_names,\n\t\t\t\t\t $identifier_array = null,\n\t\t\t\t\t $order_by_array = null,\n\t\t\t\t\t $limit = null,\n\t\t\t\t\t $offset = null,\n\t\t\t\t\t $reconnect_attempt = TRUE\n\t\t\t\t\t )\n\t{\n\t\tif ($reconnect_attempt) {\n\t\t\t// If the connection is lost, try to reconnect.\n\t\t\tif ( !isset( $this->dbcon ) || ! $this->dbcon ) {\n\t\t\t\t$this->db_connect();\n\t\t\t}\n\t\t}\n\t\t$statement = $this->_select($table_name, $select_column_names, $distinct);\n\t\t$statement .= empty($identifier_array) ? '' : $this->_where($identifier_array, TRUE);\n\t\t$statement .= empty($order_by_array) ? '' : $this->_order_by($order_by_array, TRUE);\n\t\t$statement .= empty($limit) && empty($offset) ? '' : $this->_limit_offset($limit, $offset);\n\t\t// echo $statement . '<br />';\n\t\t$result = mysqli_query($this->dbcon, $statement);\n\t\tif (! $result ) {\n\t\t\t/* ===== Bail ===== */\n\t\t\tif (DEBUG_DISPLAY) {\n\t\t\t\techo \"Error. \" . mysqli_error($this->dbcon);\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\treturn $result;\n\t\t}\n\t}",
"function Select($name,$data,$parameters = \"\",$value = \"\",$event = \"\") {\n\n $attributes = Render::explodeParameters($parameters);\n $event = $attrubutes[event];\n\n $content .= \"<select name=\\\"$name\\\" $event class=dataentry>\\n\";\n\n if (count($data) == 0) {\n $content .= \"<option value=\\\"\\\"> \\n\";\n } else {\n\n if (isset($attributes[first])) {\n\t$content .= \"<option value=\\\"\\\">$attributes[first]\\n\";\n } \n }\n\n if (count($data) > 0) { \n foreach($data as $k => $v) {\n\t\n\tif (($v[value] == $value) or ($v[value] == $attributes[value]) or ($v[checked]) or ($v[selected])) {\n\t $content .= \"<option value=\\\"$v[value]\\\" selected> $v[text]\\n\";\n\t} else {\n\t $content .= \"<option value=\\\"$v[value]\\\"> $v[text]\\n\";\n\t}\n }\n }\n\n $content .= \"</select>\\n\";\n\n return $content;\n }",
"protected abstract function getSelectStatement();",
"protected abstract function getSelectStatement();",
"function select($tablename,$firstColumn,$lastColumn,$sort = '',$columnName = '',$valueName=''){\n if($valueName == ''){\n $this->query = \"SELECT * from $tablename order by $columnName $sort limit $firstColumn,$lastColumn\";\n }else{\n if(is_numeric($valueName)){\n $this->query = \"select * from $tablename where $columnName < $valueName order by $columnName $sort limit $firstColumn,$lastColumn\";\n }else{\n $this->query = \"select * from $tablename where $columnName like '$valueName%' order by $columnName $sort limit $firstColumn,$lastColumn\";\n }\n }\n \n return $this->query;\n }",
"public function select($columns = array('*'))\n\t{\n\t\t$columns = is_array($columns) ? $columns : func_get_args();\n\n\t\t$this->selects = (array) $columns;\n\n\t\t$sql = $this->grammar->select($this);\n\n\t\t$results = $this->connection->query($sql, $this->bindings, $this->options);\n\n\t\t// Reset the SELECT clause so more queries can be performed using\n\t\t// the same instance. This is helpful for getting aggregates and\n\t\t// then getting actual results from the query.\n\t\t$this->selects = null;\n\n\t\treturn $results;\n\t}",
"function select() {\n\n $query = 'SELECT '\n .'trafficjam.id, '\n .'trafficjam.from, '\n .'trafficjam.from_loc_lat, '\n .'trafficjam.from_loc_lon, '\n .'trafficjam.to, '\n .'trafficjam.to_loc_lat, '\n .'trafficjam.to_loc_lon, '\n .'trafficjam.start, '\n .'trafficjam.delay, '\n .'trafficjam.distance, '\n .'trafficjam.timestamp, '\n .'trafficjam.road_name '\n .'FROM trafficjam '\n .'JOIN trafficjam tj ON tj.from = trafficjam.from AND tj.to = trafficjam.to AND tj.start = trafficjam.start AND tj.id = ? ';\n \n // Prepare statement.\n $stmt = $this->conn->prepare($query);\n \n // Bind id parameter.\n $stmt->bindParam(1, $this->id);\n \n // Execute query.\n $stmt->execute();\n \n return $stmt;\n }",
"public function query ($select,$table,$where=null,$data = array()){\n\t\tif ($where != null){\n\t\t\t$this->_query = \"SELECT $select FROM $table WHERE $where\";\n\t\t}else {\n\t\t\t$this->_query = \"SELECT $select FROM $table \";\n\t\t}\n\t\t$stmt = $this->db->prepare($this->_query);\n\t\t$stmt->execute($data);\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}",
"protected function _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }",
"public function parseSelect(&$arguments)\n {\n /* Initialize some variables */\n $arguments = array('action' => 'select');\n\n /* Look for the main keywords */\n while ($word = $this->getNextWord(true)) {\n switch (strtolower($word)) {\n case 'distinct':\n {\n $arguments['distinct']= $this->getNextWord(true);\n\n break;\n }\n\n case 'from':\n {\n $this->parseFrom($arguments);\n\n break;\n }\n\n case 'where':\n {\n $this->parseWhere($arguments);\n\n break;\n }\n\n case 'orderby':\n {\n $this->parseOrderBy($arguments);\n\n break;\n }\n\n case 'limit':\n {\n $this->parseLimit($arguments);\n\n break;\n }\n\n default:\n {\n if (empty($arguments['table'])) {\n $this->c -= strlen($word) + 1;\n $column = $this->getNextWord(true, $this->whitespace . \",\");\n $arguments['select'][] = $column;\n\n if (strtolower($nextword = $this->getNextWord(true, $this->whitespace . ',')) == 'as') {\n $arguments['aliases'][$column] = $this->getNextWord(true, $this->whitespace . ',');\n break;\n }\n\n $this->c -= strlen($nextword) + 1;\n }\n }\n }\n }\n\n /* Return our arguments */\n return $arguments;\n }",
"public static function apiQuery($params)\n\t\t{\n\t\t\t$class = get_called_class();\n\t\t\t$metaSelectReflect = new ReflectionMethod($class, 'MetaSelect');\n\t\t\tif($metaSelectReflect->class != $class)\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaSelect\"-method has not been overridden. You must apply security restrictions before this api can be made available. The method must return a where clause or NULL if you wish to make everything available to everybody.');\n\t\t\ttry {\n\t\t\t\t$metaFieldsReflect = new ReflectionMethod($class, 'MetaFields');\n\t\t\t} catch (ReflectionException $e) {\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaFields\"-method has not been declared. You must apply security restrictions before this api can be made available. The method must return an array containing the field names the user is allowed to read or NULL if all fields should be available.');\n\t\t\t}\n\t\t\tif($metaFieldsReflect->class != $class)\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaFields\"-method has not been declared. You must apply security restrictions before this api can be made available. The method must return an array containing the field names the user is allowed to read or NULL if all fields should be available.');\n\n\t\t\t$fields = call_user_func(array($class, 'MetaFields'), $options);\n\n\t\t\t$query = SERIA_Meta::all($class);\n\n\t\t\tif (isset($params['order'])) {\n\t\t\t\tif (substr($params['order'], 0, 1) == '-') {\n\t\t\t\t\tif (in_array(substr($params['order'], 1), $fields))\n\t\t\t\t\t\t$query->order(substr($params['order'], 1).' DESC');\n\t\t\t\t} else {\n\t\t\t\t\tif (in_array($params['order'], $fields))\n\t\t\t\t\t\t$query->order($params['order'].' ASC');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($params['length'])) {\n\t\t\t\tif (isset($params['start']))\n\t\t\t\t\t$query->limit(intval($params['start']), intval($params['length']));\n\t\t\t\telse\n\t\t\t\t\t$query->limit(intval($params['length']));\n\t\t\t}\n\n\t\t\tforeach ($params as $name => $value) {\n\t\t\t\tif (in_array($name, $fields))\n\t\t\t\t\t$query->where($name.' = :'.$name, array($name => $value));\n\t\t\t}\n\t\t\t$res = array();\n\t\t\tforeach ($query as $obj) {\n\t\t\t\t$arr = array();\n\t\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t$value = $obj->get($field);\n\t\t\t\t\tif ($value instanceof SERIA_MetaObject)\n\t\t\t\t\t\t$value = SERIA_Meta::getReference($value);\n\t\t\t\t\t$arr[$field] = $value;\n\t\t\t\t}\n\t\t\t\t$res[] = $arr;\n\t\t\t}\n\t\t\treturn $res;\n\t\t}",
"public function queryByField($conditions = array(), $params=array(), $columns = \"*\", $order = array()) {\n \n \tif ( is_array($columns) ) {\n \t\t$columns = implode(\",\", $columns);\n \t}\n \n \t$dbkey = $this->getDbKey();\n \t$selectObj = Yii::app()->$dbkey->createCommand()\n \t->select($columns)\n \t->from($this->tableName());\n \t\n \tif (! empty($conditions) ) {\n \t\t$selectObj->where($conditions, $params);\n \t}\n \n \tif (! empty($order) ) {\n \t\t$selectObj->order($order);\n \t}\n\n \tif ( strpos($columns, \",\") === false &&\n \tstrpos($columns, \"*\") === false ) {\n \t\t$result = $selectObj->queryColumn();\n \t} else {\n \t\t$result = $selectObj->queryAll();\n \t}\n \treturn $result;\n }",
"public function query($selection){\n $this->query = mysqli_query($this->connection, $selection);\n return $this->query;\n}",
"public function runCustomQuery($query, Database_Config $databaseConfig = NULL);"
] | [
"0.68805516",
"0.6455435",
"0.6454289",
"0.6419162",
"0.6303152",
"0.6268975",
"0.6247069",
"0.6247069",
"0.6247069",
"0.62282544",
"0.6150493",
"0.6144399",
"0.6140313",
"0.6131772",
"0.6094365",
"0.60730684",
"0.60730684",
"0.60730684",
"0.60623974",
"0.6011941",
"0.5992475",
"0.5990258",
"0.5990258",
"0.59862983",
"0.5985577",
"0.59765047",
"0.5970833",
"0.59610593",
"0.5940695",
"0.59332347",
"0.5915851",
"0.5913974",
"0.5912281",
"0.59072685",
"0.59018713",
"0.5897176",
"0.5889093",
"0.5887694",
"0.5886479",
"0.58741564",
"0.5874093",
"0.585207",
"0.58460397",
"0.584553",
"0.58321893",
"0.5828631",
"0.5824359",
"0.5822219",
"0.58065057",
"0.5802063",
"0.58016056",
"0.5789537",
"0.5787761",
"0.57818615",
"0.577141",
"0.5767605",
"0.57584155",
"0.5757519",
"0.5753942",
"0.57432866",
"0.5738256",
"0.5719466",
"0.57087725",
"0.56912637",
"0.56846017",
"0.56696457",
"0.56628567",
"0.5661407",
"0.56590796",
"0.56541264",
"0.5649173",
"0.56305975",
"0.5625282",
"0.5623964",
"0.5604983",
"0.5603926",
"0.5593672",
"0.5586565",
"0.5581263",
"0.55811024",
"0.55805224",
"0.5575409",
"0.55729395",
"0.55722994",
"0.5568787",
"0.55645514",
"0.5563219",
"0.55575234",
"0.55531055",
"0.55531055",
"0.55525976",
"0.5551091",
"0.55496806",
"0.55454344",
"0.5541849",
"0.55343205",
"0.5532563",
"0.5527766",
"0.55225974",
"0.5517587"
] | 0.5750872 | 59 |
Perform a custom query with user input data passed as $parameters. | public function query(string $query, array $parameters = [])
{
$stmt = $this->pdo->prepare($query);
return $stmt->execute($parameters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function query($q, $params = []);",
"public function doQuery($sql, $params);",
"abstract public function query();",
"public function runCustomQuery($query, Database_Config $databaseConfig = NULL);",
"abstract public function Query( $query, $params );",
"public function query(string $sql, array $parameters = []): void;",
"public function SqlQuery($sql, $parameters)\n {\n \n }",
"public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }",
"public function query();",
"public function query();",
"public function query();",
"public function query($query);",
"public function query($query);",
"public function query($query);",
"function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}",
"public function createQuery($data);",
"public function query($sql, $arguments = array());",
"protected function query($sql, array $params)\n {\n }",
"abstract function query( $p_filter_input );",
"public function query($statement, array $parameters = null);",
"public static function query();",
"public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }",
"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 query($sql = null);",
"function query() {\r\n\t\t\t$args = func_get_args();\r\n\t\t\t$sql = array_shift($args);\r\n\t\t\tforeach ($args as $key => $value)\r\n\t\t\t\t$args[$key] = $this->clean($value);\r\n\t\t\treturn mysql_query(vsprintf($sql, $args));\r\n\t\t}",
"public abstract function get_query();",
"function query() {}",
"public function executeQuery($query, array $params = array());",
"abstract public function query($sql);",
"public function query($sql);",
"public function query($sql);",
"public function query($sql);",
"public function query($sql);",
"function createQuery() ;",
"public function query(string $sql);",
"public function query($query=null, $data=null) {\r\n\t\treturn call_user_func_array(array($this, $query), $data);\r\n\t}",
"abstract public function exec($query='');",
"public function query()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n if (count($bindings) == 1 and is_array($bindings[0])){\n $bindings = $bindings[0];\n }\n\n try{\n $query = $this->connection()->prepare($sql);\n\n foreach ($bindings as $key => $value){\n $query->bindValue($key + 1 , _e($value));\n }\n $query->execute();\n\n return $query;\n }\n catch (PDOException $e){\n echo $sql;\n pre($this->bindings);\n die($e->getMessage());\n }\n\n }",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function execute()\n\t{\n\t\t$this->arrParams = func_get_args();\n\n\t\tif (is_array($this->arrParams[0]))\n\t\t{\n\t\t\t$this->arrParams = array_values($this->arrParams[0]);\n\t\t}\n\n\t\treturn $this->query();\n\t}",
"function executeQuery($query);",
"public function query($rawQuery, $param = array()){\n \n $stmt = $this->conn->prepare($rawQuery);\n \n $this->setParams($stmt, $param);\n \n $stmt->execute();\n \n return $stmt;\n \n}",
"public function RawQuery( $sql, $parameters ){\n\t\tif($this->Execute($sql, $parameters)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private function query()\n {\n $lStart = microtime(true);\n\n //arguments should be query (with placeholders) followed by an array of key-value pairs\n $args = func_get_args();\n $args = array_shift($args);\n $query = array_shift($args);\n $params = $args ? array_shift($args) : [];\n\n $sth = $this->pdo->prepare($query);\n if (!$sth) {\n //prepare failed\n $this->handlePrepareError($sth, $query, $params);\n }\n\n //explicitly bind parameters as int/string so IN() doens't get quoted\n foreach ($params as $key => $value) {\n if (is_numeric($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_INT);\n } elseif (is_bool($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_BOOL);\n } elseif (is_null($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_NULL);\n } else {\n $sth->bindValue($key, $value, PDO::PARAM_STR);\n }\n }\n\n //query invalid\n if(!$sth->execute()) {\n $this->handleExecuteError($sth, $query, $params);\n }\n $this->queryTimer += microtime(true) - $lStart;\n $this->queryCount++;\n\n $query = preg_replace('/^\\s+/', '', $query);\n if(str_starts_with(strtolower($query), 'select')) {\n //return results for SELECT\n return $sth;\n\n } elseif(str_starts_with(strtolower($query), 'insert')) {\n //return insert id for INSERT\n $id = $this->pdo->lastInsertId();\n return ($id ?: true);\n\n } else {\n //return TRUE for DELETE, UPDATE\n //NB: don't return affected rows for UPDATE since 0 affected will be interpreted as query failed)\n return true;\n }\n }",
"public function _query()\n {\n }",
"abstract public function queryRaw($q);",
"abstract public function query($type, $sql, $asObject = false, array $params = null);",
"public static function query($sql);",
"abstract public function execute($query);",
"abstract public function call($query, $config);",
"public function execute(array $input_parameters = array())\r\n\t{\r\n\t\t$queryString = $this->queryString;\r\n\t\t\r\n\t\tif(count($input_parameters) > 0)\r\n\t\t{\r\n\t\t\tif(count($this->parameters) > 0 || count($this->parametersBound) > 0)\r\n\t\t\t{\r\n\t\t\t\tthrow new LikePDOException(\"There is have parameters bound\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach($input_parameters as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = is_int($param) ? intval($param) : $this->pdo->quote($param, LikePDO::PARAM_STR);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(is_int($key))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$position = strpos($queryString, \"?\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!strstr($queryString, \"?\"))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tthrow new LikePDOException(\"Statement: Too few parameters\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$queryString = substr_replace($queryString, $value, $position, 1);\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$queryString = str_replace($key, $value, $queryString);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(count($this->parametersBound) > 0)\r\n\t\t{\r\n\t\t\tforeach($this->parametersBound as $key => $param)\r\n\t\t\t{\r\n\t\t\t\t$value = $this->pdo->quote($param['variable'], $param['data_type']);\r\n\t\t\t\t\r\n\t\t\t\tif(is_int($key))\r\n\t\t\t\t{\r\n\t\t\t\t\t$position = strpos($queryString, \"?\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!strstr($queryString, \"?\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Statement: Too few parameters\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$queryString = substr_replace($queryString, $value, $position, 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$queryString = str_replace($key, $value, $queryString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(count($this->parameters) > 0)\r\n\t\t{\r\n\t\t\tforeach($this->parameters as $key => $param)\r\n\t\t\t{\r\n\t\t\t\t$value = $this->pdo->quote($param['value'], $param['data_type']);\r\n\t\t\t\t\r\n\t\t\t\tif(is_int($key))\r\n\t\t\t\t{\r\n\t\t\t\t\t$position = strpos($queryString, \"?\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!strstr($queryString, \"?\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Statement: Too few parameters\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$queryString = substr_replace($queryString, $value, $position, 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$queryString = str_replace($key, $value, $queryString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->resource = $this->pdo->driver->query($queryString);\r\n\t\t$this->executed = true;\r\n\t\t$this->rowsAffected = $this->pdo->driver->getRowsAffected();\r\n\t\t$this->columnCount = $this->pdo->driver->getNumFields($this->resource);\r\n\t\t\r\n\t\tif(!$this->resource)\r\n\t\t{\r\n\t\t\t$this->failed = true;\r\n\t\t\t\r\n\t\t\t$this->errorCode = $this->pdo->errorCode();\r\n\t\t\t$this->errorInfo = $this->pdo->errorInfo();\r\n\t\t\t\r\n\t\t\tnew LikePDOException(\"Failed to execute the query \".$this->queryString);\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"abstract public function\r\n\t\tget_query_for_something();",
"public function query()\n\t{\n\t\t\n\t}",
"protected abstract function executeQuery($query);",
"abstract protected function doQuery( $sql );",
"public function query($q = null);",
"abstract public function execute($params = array(), $input = null);",
"abstract protected function _query($sql);",
"public static function query()\n {\n }",
"function build_query($data)\n {\n }",
"public function query(QueryObject $query);",
"function query() {\n }",
"public function parametersAndQueriesDataProvider() {}",
"public function execute($input_parameters = null) {\n \t//$cache = Ajde_Db_Cache::getInstance();\n\t\t$log = array('query' => '[PS] ' . $this->queryString);\n\t\t$start = microtime(true);\n\t\ttry {\n\t\t//if (!$cache->has($this->queryString . serialize($input_parameters))) { \n\t\t\t$result = parent::execute($input_parameters);\n\t\t\t//$cache->set($this->queryString . serialize($input_parameters), $result);\n\t\t//\t$log['cache'] = false;\t\t\t\n\t\t//} else {\n\t\t//\t$result = $cache->get($this->queryString . serialize($input_parameters));\n\t\t//\t$log['cache'] = true;\n\t\t//} \n\t\t} catch (Exception $e) {\n\t\tif (Config::get('debug') === true) {\n\t\t\t\tif (isset($this->queryString)) dump($this->queryString);\n\t\t\t\tdump('Go to ' . Config::get('site_root') . '?install=1 to install DB');\n\t\t\t\tthrow new Ajde_Db_Exception($e->getMessage());\n\t\t\t} else {\n\t\t\t\tAjde_Exception_Log::logException($e);\n\t\t\t\tdie('DB connection problem. <a href=\"?install=1\">Install database?</a>');\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}\n $time = microtime(true) - $start; \n\t\t$log['time'] = round($time * 1000, 0);\n Ajde_Db_PDO::$log[] = $log;\n return $result; \n }",
"public function queryRow($sql, $params = array());",
"public function execute($params);",
"function query($args, $operator = 'AND')\n {\n }",
"public function execute($query);",
"public function execute(array $parameters = array());",
"function _execQ($query, $param_strs, $params){\n $db = MySQLConnect::get_instance();\n $res = $db->prepare($query);\n \t array_unshift($params, $param_strs);\n call_user_func_array(array($res, 'bind_param'), $params);\n $bool = $res->execute();\n $sonuclar = $res->get_result();\n $rows = $sonuclar->fetch_all(MYSQLI_ASSOC);\n return $rows;\n }",
"static public function execute($query, $parameters = array()){\n\t\t\tglobal $connection;\n\t\t\t// echo \"<br>$query<br>\";\n\t\t\t// var_dump($parameters);\n\t\t\t//PDO query building and execution\n\t\t\ttry {\n\t\t\t\t$stmt = $connection->prepare($query);\n\t\t\t\tforeach ($parameters as $key => $value) {\n\t\t\t\t\t//echo \"PREPARE: $key------>$value<br/>\";\n\t\t\t\t\t$stmt->bindValue(\":$key\", $value);\n\t\t\t\t}\n\t\t\t\t$stmt->execute();\n\t\t\t\treturn $stmt?$stmt:false;//return $stmt is successful, false otherwise\n\t\t\t} catch (PDOException $e) {\n\t\t\t\techo \"QueryBuilder PDO error: \". $e->getMessage();\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public function query($query){\r\n $args = func_get_args();\r\n array_shift($args); //first element is not an argument but the query itself, should removed\r\n\r\n $reponse = parent::prepare($query);\r\n $reponse->execute($args);\r\n return $reponse;\r\n\r\n }",
"public function rawQuery($query);",
"public function foobar()\n {\n $result = $this->db->query_params(\"SELECT field FROM table WHERE something = $1 and something_else = $2\", array('foo', 'bar'));\n // use $result as usual ...\n }",
"public function execute( Array $params = array() ) {\r\n \r\n // check if the query type is known / allowed\r\n try {\r\n if ( $this -> query_type == false ) {\r\n throw new Exception('query type not recognised');\r\n }\r\n }\r\n catch ( Exception $exc ) {\r\n $this -> errors['query'] = $exc -> getMessage();\r\n return $this -> respond( false);\r\n }\r\n\r\n try {\r\n if ( $this -> verifyParams( $params ) == false ) {\r\n throw new Exception('parameters supplied do not match query requirements');\r\n }\r\n }\r\n catch ( Exception $exc ) {\r\n $this -> errors['parameter'] = $exc -> getMessage();\r\n return $this -> respond( false);\r\n }\r\n\r\n try{\r\n $statement = $this -> connection -> prepare($this -> query_string);\r\n if ( !$statement ) {\r\n throw new Exception( $this -> connection -> error );\r\n }\r\n if ( count($params) > 0 ) {\r\n // build the parameter string, eg iii\r\n $param_string = $this -> buildParamString( $params );\r\n $statement -> bind_param( $param_string, ...$params );\r\n }\r\n if ( $statement -> execute() == false ) {\r\n throw new Exception('query' . $this -> connection -> error );\r\n }\r\n }\r\n catch( Exception $exc ) {\r\n $this -> errors['number'] = $this -> connection -> errno;\r\n $this -> errors['execution'] = $exc -> getMessage();\r\n return $this -> respond( false);\r\n }\r\n // get the result if the query is select\r\n \r\n if ( $this -> query_type == 'select' ) {\r\n $result = $statement -> get_result();\r\n // add result to $this -> data\r\n while( $row = $result -> fetch_assoc() ) {\r\n array_push( $this -> data, $row );\r\n }\r\n }\r\n return $this -> respond( true );\r\n }",
"abstract function executeQuery($cons);",
"function query($_sql, $param = null)\n{\n\t$res = null;\n\t\n\tif (isset($param) and !is_array($param)) {\n\t\t$param = func_get_args();\n\t\tarray_shift($param);\n\t}\n\t$sql = $param? $this->setParams($_sql, $param) : $_sql;\n\t\n\t$event = $this->onBeforeQuery($sql);\n\tif ($event and !$event->propagate) return;\n\n\tif (!$this->disabled) {\n\t\t$res = $this->drv->query($sql);\n\t}\n\t\n\tif ($this->logging > 1 and !$this->drv->error) {\n\t\t$this->messages[] = \"(n) Proceed $sql\";\n\t}\n\tif ($this->logging and $this->drv->error)\n\t\t$this->messages[] = \"(e) \".$this->drv->error;\n\telse\n\t\t$this->lastQuery = $sql;\n\n $this->onAfterQuery($sql, $this->drv->error);\n\treturn $res;\n}",
"public function execute(array $parameters = []);",
"public function getValue(string $sql, array $parameters = []);",
"public function Query() {\n \n }",
"private static function executeHelper($sql, $parameters) {\n $connection = self::getConnection();\n $query = $connection->prepare($sql);\n $query->execute($parameters); \n return $query;\n }",
"public function query()\n {\n }",
"public function query()\n {\n }",
"public function execute($input_parameters = array())\n {\n }",
"public function query($query)\n {\n }",
"public function query($query)\n {\n }",
"public function query($query)\n {\n }",
"public function query($query)\n {\n }",
"public function query($query)\n {\n }",
"public function query($query)\n {\n }",
"abstract protected function getQuery();",
"public function query() {\n\n }",
"function CustomQuery($dalSQL)\n{\n\t$connection = getDefaultConnection();\n\t$result = $connection->query( $dalSQL );\n\tif($result)\n\t\treturn $result;\n}",
"public function query($params)\n { \n return $this->request(Resource::RESOURCE_QUERY, $params);\n }",
"public function query ($sqlString);",
"function query(/* $sql [, ... ] */)\n {\n // SQL statement\n $sql = func_get_arg(0);\n\n // parameters, if any\n $parameters = array_slice(func_get_args(), 1);\n\n // try to connect to database\n static $handle;\n if (!isset($handle))\n {\n try\n {\n // connect to database\n $handle = new PDO(\"mysql:dbname=\" . DATABASE . \";host=\" . SERVER, USERNAME, PASSWORD);\n\n // ensure that PDO::prepare returns false when passed invalid SQL\n $handle->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); \n }\n catch (Exception $e)\n {\n // trigger (big, orange) error\n trigger_error($e->getMessage(), E_USER_ERROR);\n exit;\n }\n }\n\n // prepare SQL statement\n $statement = $handle->prepare($sql);\n if ($statement === false)\n {\n // trigger (big, orange) error\n trigger_error($handle->errorInfo()[2], E_USER_ERROR);\n exit;\n }\n\n // execute SQL statement\n $results = $statement->execute($parameters);\n\n // return result set's rows, if any\n if ($results !== false)\n {\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }\n else\n {\n return false;\n }\n }",
"abstract public function query($sql, $execute =FALSE);",
"static private function do_the_query($arg1, $arg2 = null, $arg3 = null)\n {\n self::open_default(); // just for sure\n\n if(!isset($arg1)) throw new DBException(\"DB class error: empty query!\");\n if(is_array($arg1)) throw new DBException(\"DB class error: first argument can't ne array!\");\n if(is_array($arg2) && is_array($arg3)) throw new DBException(\"DB class error: second and third arguments can't be arrays at the same time!\");\n\n // by default = $query, [$params]\n $query = $arg1;\n $params = $arg2;\n\n if(isset($arg2) && !is_array($arg2)) // $db, $query, [$params] -> database name passed first\n {\n $database_name = $arg1;\n $query = $arg2;\n $params = $arg3;\n }\n\n $unbuffered = strpos($database_name, ':unbuffered') !== false;\n $database_name = str_replace(':unbuffered', '', $database_name);\n if($database_name == '') $database_name = 'default';\n\n if (!self::is_open($database_name) && !self::is_predicted($database_name)) throw new DBException(\"Trying to query DB connection '{$database_name}' which does not exist and has not been predicted!\");\n if (!self::is_open($database_name) && self::is_predicted($database_name)) {\n self::add_predicted($database_name);\n if(!self::is_open($database_name)) throw new DBException(\"Can't open a predicted '{$database_name}'!\");\n }\n\n if($unbuffered) {\n $db = self::connection_unbuffered($database_name);\n }\n else {\n $db = self::connection($database_name);\n }\n\n\n // do the job!\n try {\n $statement = $db->prepare($query);\n\n $simple_params = null;\n foreach ((array)$params as $k => $v) {\n if ($k === 0) // support for '?' parameters\n {\n foreach ($params as $param) {\n if (is_object($param)) throw new DBException(\"Trying to send an object in \\$params array!\", [\"query\" => $query, \"params\" => $params]);\n if (is_array($param)) throw new DBException(\"Trying to send an array in \\$params array!\", [\"query\" => $query, \"params\" => $params]);\n }\n $simple_params = $params;\n break;\n }\n\n if (is_object($v)) throw new DBException(\"Trying to send an object in \\$params array!\", [\"query\" => $query, \"params\" => $params]);\n if (is_array($v)) throw new DBException(\"Trying to send an array in \\$params array!\", [\"query\" => $query, \"params\" => $params]);\n\n $statement->bindParam(':' . str_replace([' ', ':'], '', $k), $v); // support for ':name' parameters\n }\n }\n catch(Exception $e) { throw new DBException($e->getMessage(), [\"query\" => $query, \"params\" => $params] ); }\n\n self::try_execute_the_query($statement, $simple_params, $query, $params);\n\n self::$insert_id = $db->lastInsertId();\n self::$affected_rows = $statement->rowCount();\n\n return $statement;\n }"
] | [
"0.70814127",
"0.70514184",
"0.6959246",
"0.6915109",
"0.685056",
"0.6796333",
"0.6735587",
"0.6670455",
"0.66446424",
"0.66446424",
"0.66446424",
"0.6642994",
"0.6642994",
"0.6642994",
"0.66143525",
"0.6595483",
"0.6564408",
"0.65640193",
"0.6546601",
"0.6539666",
"0.65152776",
"0.65138376",
"0.6480905",
"0.64724",
"0.6461944",
"0.6461174",
"0.64456517",
"0.6441352",
"0.6426614",
"0.6414227",
"0.6414227",
"0.6414227",
"0.6414227",
"0.6296018",
"0.62860775",
"0.628578",
"0.62757295",
"0.62548506",
"0.6226165",
"0.6226165",
"0.6226165",
"0.6224919",
"0.62191975",
"0.6214203",
"0.6213905",
"0.6200022",
"0.6195894",
"0.6193418",
"0.6191927",
"0.61735207",
"0.6165454",
"0.6165154",
"0.615942",
"0.6145075",
"0.6139634",
"0.6134282",
"0.61204743",
"0.6118615",
"0.6111584",
"0.61094403",
"0.6109299",
"0.6106769",
"0.6092779",
"0.6091709",
"0.6072961",
"0.6060127",
"0.60595995",
"0.6054651",
"0.6048514",
"0.60449636",
"0.60445946",
"0.6043418",
"0.6038852",
"0.60320044",
"0.60297376",
"0.60140115",
"0.6012409",
"0.6009056",
"0.6008775",
"0.6001168",
"0.599139",
"0.597849",
"0.5975401",
"0.5969397",
"0.59601575",
"0.59601575",
"0.5959711",
"0.59575766",
"0.59575766",
"0.59575766",
"0.59575766",
"0.59560156",
"0.59560156",
"0.5954368",
"0.5947012",
"0.59458125",
"0.5937995",
"0.59297425",
"0.59280616",
"0.59219384",
"0.59213644"
] | 0.0 | -1 |
the constructor of this class | public function __construct($post_type = '', $taxs = array(), $meta_data = array(), $localize = array()){
$this->post_type = 'mjob_agreement';
parent::__construct( $this->post_type, $taxs, $meta_data, $localize);
$this->meta = array(
'is_consumer_right_statement',
'is_notice_cancellation'
);
$this->post_type_singular = 'Agreement';
$this->post_type_regular = 'Agreements';
$this->taxs = array(
'mjob_category'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _construct() {\n \t\n\t\t\n\t}",
"final private function __construct() {\n\t\t\t}",
"private function __construct()\t{}",
"private function __construct()\r\n\t{\r\n\t\r\n\t}",
"public function _construct()\n\t{\n\n\t}",
"public function construct()\n\t\t{\n\t\t}",
"public function __construct() { \n\t\t\n\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\t//\n\t\t}",
"private function __construct() {\r\n\t\r\n\t}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"final private function __construct() {}",
"final private function __construct() {}",
"private function __construct() {\n\t\t}",
"public function __construct()\r\n\t\t{\r\n\t\t}",
"final private function __construct()\n {\n }",
"final private function __construct()\n\t{\n\t}",
"public function __construct()\n\t\t{\n\t\t\t\n\t\t}",
"function _construct(){ }",
"private function __construct()\n\t{\n\t\t\n\t}",
"public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}",
"final private function __construct(){\r\r\n\t}",
"private function __construct() {\r\n\t\t\r\n\t}",
"private function __construct(){\n\t\t }",
"public function __construct() {\n\n\t\t}",
"private function __construct()\n\t{\n\n\t}",
"private function __construct() { \n\t\t\n\n\t}",
"private function __construct()\r\n\t{\r\n\t}",
"private function __construct()\r\r\n\t{\r\r\n\t}",
"private function __construct( )\n {\n\t}",
"function __construct (){\n\t\t}",
"final private function __construct() { }",
"final private function __construct() { }",
"final private function __construct() { }",
"function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}",
"function __construct() ;",
"protected function __construct()\r\n\t\t{\r\n\t\t}",
"private final function __construct() {}",
"protected final function __construct() {}",
"function __construct() {\n\n\t\t}",
"private function __construct () \n\t{\n\t}",
"private function __construct()\r\n {}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct () {}",
"public function __construct()\n\t\t{\t\t\t\n\t\t}",
"private function __construct(){\n \t\n }",
"public function __construct() {\r\n\r\n\t\t}",
"private function __construct() {\r\n\t}",
"private function __construct() {\r\n\t}",
"function __construct(){\n\t\t// nowt much...\n\t}",
"public function __construct() {\r\n\t\t//\r\n\t}",
"function __construct(){\n\n\t\t}",
"function __construct() {\n\t\t\t\n\t\t}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}"
] | [
"0.8621917",
"0.8557927",
"0.85266626",
"0.8508989",
"0.84813875",
"0.846886",
"0.8468103",
"0.84507173",
"0.84484714",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.84474564",
"0.8423002",
"0.8423002",
"0.8403655",
"0.8397848",
"0.8397018",
"0.838808",
"0.8385032",
"0.83848876",
"0.8376934",
"0.8376277",
"0.8372419",
"0.8367734",
"0.8362566",
"0.83585155",
"0.8352169",
"0.83512807",
"0.8350748",
"0.834153",
"0.8340065",
"0.83347034",
"0.83337843",
"0.83337843",
"0.83337843",
"0.83303493",
"0.8313701",
"0.8298642",
"0.8297868",
"0.8273864",
"0.8273278",
"0.8272216",
"0.8235685",
"0.8233414",
"0.8233414",
"0.8233414",
"0.8233414",
"0.8233414",
"0.8233414",
"0.8233414",
"0.8233414",
"0.8233414",
"0.8228491",
"0.8222219",
"0.82202727",
"0.82198596",
"0.8218575",
"0.8218575",
"0.8215092",
"0.8202586",
"0.8201577",
"0.8200407",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714",
"0.81982714"
] | 0.0 | -1 |
todo dle popisu je to spravne, ale z nejakyho duvodu to ne vzdy sedi | public static function isValidDataBoxId(string $dataBoxId)
{
$charCount = 7;
$mapString = 'abcdefghijkmnpqrstuvwxyz23456789';
if (Strings::length($dataBoxId) !== $charCount) {
throw new InputNotValid(sprintf('DataBoxId "%s" have less char. Required is %d char.', $dataBoxId, $charCount));
}
$checkChar = Strings::substring($dataBoxId, -1);
$checkId = Strings::substring($dataBoxId, 0, -1);
$tmp = null;
$splittedDataBoxId = str_split($checkId);
foreach ($splittedDataBoxId as $charIndex => $char) {
$int = strpos($mapString, $char);
$charIndex = Strings::indexOf($mapString, $char);
if (($charIndex % 2) > 0) {
$int *= 2;
}
$restOfTheDivision = null;
$value = null;
if ($int > 0) {
$value = round($int / 32);
$restOfTheDivision = $int % 32;
$int = $value + $restOfTheDivision;
}
$tmp += $int;
}
$restOfTheDivision = $tmp % 32;
if ($restOfTheDivision > 0) {
$restOfTheDivision = 32 - $restOfTheDivision;
}
if ($mapString[$restOfTheDivision] !== $checkChar) {
throw new InputNotValid(sprintf('Luhn algoritmh is not valid for DataBoxId "%s"', $dataBoxId));
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function AggiornaPrezzi(){\n\t}",
"public function masodik()\n {\n }",
"public function obtenerViajesplus();",
"abstract public function getPasiekimai();",
"public function valorpasaje();",
"public function obtenerViajesplusAbonados();",
"public function boleta()\n\t{\n\t\t//\n\t}",
"private function Zapis_kolize_formulare($pole, $idcka_skolizi, $iducast, $formular) { \r\n//znevalidneni vsech kolizi pro ucastnika a tento formular\r\n self::Znevalidni_kolize_ucastnika_formulare($iducast, $formular); \r\n\r\n//zapis do uc_kolize_table pro kazdou nastalou s_kolizi\r\n foreach ($idcka_skolizi as $id_skolize) { //zapisovana policka jsou v $pole\r\n //echo \"policko: \" . $pole['uc_kolize_table§' . $id_skolize . '_revidovano'];\r\n $kolize = new Projektor2_Table_UcKolizeData ($iducast, (int)$id_skolize,\r\n $pole['uc_kolize_table§' . $id_skolize . '_revidovano'],\r\n $pole['uc_kolize_table§' . $id_skolize . '_revidovano_pozn'],\r\n null, 1,\r\n null,null,null,null,null) ;\r\n // echo \"v Zapis_kolize_temp\" . var_dump ($kolize);\r\n $kolize->Zapis_jednu_kolizi(); //kdyz je v tabulce uc_kolize_table, tak prepsat, kdyz neni, tak insert\r\n }\r\n\r\n}",
"private function Zapis_jednu_kolizi() { \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n//echo \"<hr><br>* v Zapis_jednu_kolizi:\";\r\n\r\n //vyberu kolizi z uc_kolize_table pokud jiz existuje\r\n $query= \"SELECT * FROM uc_kolize_table WHERE id_ucastnik =\" . $this->id_ucastnik . \" and id_s_typ_kolize_FK=\" . $this->id_s_typ_kolize_FK ;\r\n //echo \"<br>*dotaz v Zapis_jednu_kolizi: \" . $query;\r\n $data = $dbh->prepare($query)->execute();\r\n //var_dump($data);\r\n \r\n if ($data) {\r\n $zaznam_kolize = $data->fetch() ; //vemu prvni (je predpoklad ze je jen jedna)\r\n if ($zaznam_kolize) {\r\n //echo \"<br>kolize je - budu prepisovat\"; //budu prepisovat\r\n $query1 = \"UPDATE uc_kolize_table set \" .\r\n \"revidovano='\" . $this->revidovano . \"', \" .\r\n \"revidovano_pozn='\" . $this->revidovano_pozn . \"', \" .\r\n \"valid=1 \" . \r\n \"WHERE id_uc_kolize_table =\" . $zaznam_kolize['id_uc_kolize_table'];\r\n //echo \"<br>\" . $query1; \r\n $data1 = $dbh->prepare($query1)->execute(); \r\n \r\n }\r\n else {\r\n //echo \"<br>kolize neni - budu vkladat\"; //budu vkladat\r\n $query1 = \"INSERT uc_kolize_table set \" . \r\n \"id_ucastnik= \" . $this->id_ucastnik . \", \" .\r\n \"id_s_typ_kolize_FK=\" . $this->id_s_typ_kolize_FK . \", \" .\r\n \"revidovano='\" . $this->revidovano . \"', \" .\r\n \"revidovano_pozn='\" . $this->revidovano_pozn . \"', \" .\r\n \"valid=1, date_vzniku=now() \" ;\r\n //echo \"<br>\" . $query1; \r\n $data1 = $dbh->prepare($query1)->execute();\r\n \r\n }\r\n } \r\n\r\n//echo \"<hr>\";\r\n}",
"final function velcom(){\n }",
"function _JsemNaRade($posta_id, $prac = 0) {\r\n if (is_array($posta_id)) $posta_id = $posta_id[0];\r\n $pid = split(',',$posta_id);\r\n $posta_id = $pid[0];\r\n $sql = 'select * from posta_schvalovani where posta_id=' . $posta_id . ' and schvaleno=0 and stornovano is null order by id asc';\r\n $q = new DB_POSTA;\r\n $q->query($sql); \r\n $q->Next_Record();\r\n if ($q->Record['POSTUP'] == 2 || ($q->Record['POSTUP'] == 1 && $q->Record['SCHVALUJICI_ID'] == $prac)) return true;\r\n else return false; \r\n}",
"public function extra_voor_verp()\n\t{\n\t}",
"public function ispisiOsobu(){\n // echo \"$this->ime $this->prezime $this->godRdoj\";\n echo \"<br>Ime: \" . $this->getIme() . \"<br>Prezime: \" . $this->getPrezime() . \"<br>Godina rodjenja: \" . $this->getGodRodj() . \"<br>\";\n }",
"public function uputstvo()\n {\n $this->prikaz(\"uputstvo\", []);\n }",
"public function testKojiPreskacem()\n {\n $this->markTestSkipped(\"ovaj test je namjerno prekocen\");\n }",
"public function Zapis_vsechny_kolize_v_zaveru_formulare ($pole, $idcka_skolizi, $iducast, $formular){\r\n //zapise kolize formulare \r\n self::Zapis_kolize_formulare($pole,$idcka_skolizi, $iducast, $formular);\r\n //-----------------------------------------------------------------------------\r\n \r\n \r\n //a zjisti a zapise kolize ucastnika pro vsechny formulare \r\n $vsechny_kolize_ucastnika_pole = self::Najdi_kolize_vsechny($iducast);\r\n //echo \"<br>**Vsechny kolize_pole v Zapis_vsechny_kolize..... **\";\r\n //var_dump($vsechny_kolize_ucastnika_pole);\r\n \r\n //znevalidneni vsech kolizi pro ucastnika \r\n self::Znevalidni_kolize_ucastnika_vsechny($iducast);\r\n foreach($vsechny_kolize_ucastnika_pole as $jedna_kolize){\r\n if ($jedna_kolize->kolize_nastala) {\r\n $jedna_kolize->Zapis_jednu_kolizi();\r\n } \r\n }\r\n \r\n}",
"public function valordelospasajesplus();",
"public static function Najdi_kolize_pro_formular_dosud_nezavolane ($iducast, $formular, $pole_id_volanych ) {\r\n $query= \"SELECT * FROM s_typ_kolize WHERE formular='\" . $formular . \"' and valid\" ;\r\n $kolize_pole = self::Najdi_kolize ($query,$iducast) ; //to jsou vsechny pro formular\r\n \r\n //ty, co uz volal, z pole vypustit\r\n $kolize_pole_redukovane = array();\r\n \r\n foreach ($kolize_pole as $kprvek) {\r\n if ( in_array( $kprvek->id_s_typ_kolize_FK, $pole_id_volanych) ) {\r\n }\r\n else {\r\n array_push ($kolize_pole_redukovane, $kprvek ); //$kprvek->id_s_typ_kolize_FK);\r\n } \r\n }\r\n \r\n return $kolize_pole_redukovane; \r\n}",
"public static function Znevalidni_kolize_ucastnika_vsechny($iducast) {\r\n//echo \"<hr><br>*Znevalidnuji vsechny kolize ucastnika , formular=\" . $formular;\r\n \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n //vyberu vsechny ulozene kolize z tabulky uc_kolize_table\r\n $query= \"SELECT * FROM uc_kolize_table \" .\r\n \"WHERE id_ucastnik=\" . $iducast . \" and uc_kolize_table.valid\" ;\r\n\r\n //echo \"<br>*dotaz na kolize v Znevalidni_kolize_ucastnika: \" . $query;\r\n \r\n $sth = $dbh->prepare($query);\r\n $succ = $sth->execute(); \r\n while($zaznam_kolize = $sth->fetch(PDO::FETCH_ASSOC)) {\r\n //echo \"<br>*Znevalidnuji kolizi: \" . $zaznam_kolize[id_uc_kolize_table];\r\n \r\n $query1 = \"UPDATE uc_kolize_table SET \" .\r\n \"valid=0 WHERE uc_kolize_table.id_uc_kolize_table=\" . $zaznam_kolize['id_uc_kolize_table'] ;\r\n $data1= $dbh->prepare($query1)->execute(); \r\n }\r\n \r\n//echo \"<hr>\";\r\n}",
"public function elso()\n {\n }",
"public function pasaje_abonado();",
"public static function dodajArtikelVKosarico() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n // ce narocilo ze obstaja mu samo povecamo kolicino \n // drugace narocilo ustvarimo\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n\n if (!$narocilo) {\n\n $id_narocila = NarocilaDB::insert($id, $status);\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $id_narocila);\n\n } else {\n\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n if (!$podrobnost_narocila) {\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $narocilo[\"id\"]);\n } else {\n PodrobnostiNarocilaDB::edit($id_artikla, $podrobnost_narocila[\"kolicina\"] + 1, $narocilo[\"id\"]); \n } \n }\n\n echo ViewHelper::redirect(BASE_URL);\n\n }",
"function ToonFormulierAfspraak()\n{\n\n}",
"function ogretmen_odev_getir ()\n {\n // if($odev=$this->vtb->query($sorgu))\n // {\n // $odevlist = $odev->fetchAll();\n\n // foreach ($odevlist as $o)\n // {\n // echo \"<div class='panel_akis_kutusu'>\".\"<p>\" . $o['odevadi'] . \"</p>\" . \"<p>\" . $o['dersadi'] . \"</p><p>\". $o['dtarih'] . \" \". $o['ttarih'] . \"</p></div>\" ;\n // }\n // }\n $sorgu=new sorgubul(\"select * from seviye_odevleri\",\"dersid\",\"=\",$_SESSION['dersler'],\"0,30\",\"or\");\n $sorgu=$sorgu->sorgu;\n\n if ($odev=$this->vtb->query($sorgu))\n {\n $odevlist = $odev->fetchAll();\n\n foreach ($odevlist as $o)\n {\n if ($a=$this->vtb->query(\"select count(*) from seviye_odev_teslimleri where odevid = \" . $o['soid']) and $b =$this->vtb->query(\"select count(*) from seviye_odev_teslimleri where odevid = \" . $o['soid'] . ' and okundumu = 0') )\n {\n $c = $a->fetchColumn();\n $d = $b->fetchColumn();\n $derssev=$this->vtb->prepare(\"select seviyeno,dersid from ders_seviyeler where seviyeid = ?\");\n $derssev->execute(array($o['seviye']));\n $derssev=$derssev->fetch();\n $ders=$this->vtb->prepare(\"select dersadi from dersler where dersid = ?\");\n $ders->execute(array($o['dersid']));\n $ders=$ders->fetchColumn();\n echo \"<div class='isbox' style='height:auto;overflow:hidden;'> \".\" <div class='isboxust'><p class='icerik' style='color: #048CAD; margin:5px 5px 0px 0px;'>\" . $o['odevbaslik'] . \" > \" . $ders . \" > \" . $derssev['seviyeno'] . \". Seviye</p></div>\" . \"<div class='icerik' style='position:relative;'><p >\" . $o['odevmetni'] . \"</p></div><div class='isboxalt'><p style='padding: 10px 0px 0px 100px;float:left;'>\". $c . \" kişi teslim etti,\". $d . \" kişiyi okumadınız</p><a style='margin-left:20px;' class='soruonay' href='ogretmen_ders_goruntuleme.php?dersid=\" . $derssev['dersid'] . \"&seviyeno=\" . $derssev['seviyeno'] . \"&dersadi=\" . $ders .\"'>Kontrol et</a></div></div>\" ;\n\n }\n else\n {\n echo \"<div class='isbox' style='height:auto;overflow:hidden;'> \".\" <div class='isboxust'><p class='icerik' style='color: #048CAD; margin:5px 5px 0px 0px;'>\" . $o['odevbaslik'] . \" > \" . $ders . \" > \" . $derssev['seviyeno'] . \". Seviye</p></div>\" . \"<div class='icerik' style='position:relative;'><p >\" . $o['odevmetni'] . \"</p></div><div class='isboxalt'><p>Kimse teslim etmedi</p></div></div>\" ;\n }\n }\n }\n\n }",
"public function hapus_toko(){\n\t}",
"public function nadar()\n {\n }",
"public static function posodobiKosarico() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n $kolicina = filter_input(INPUT_POST, \"num\", FILTER_SANITIZE_SPECIAL_CHARS);\n\n if ($kolicina < 1) {\n if (PodrobnostiNarocilaDB::delete($podrobnost_narocila[\"id_podrobnosti_narocila\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n } else {\n\n if (PodrobnostiNarocilaDB::edit($podrobnost_narocila[\"id_podrobnosti_narocila\"], $id_artikla, $kolicina, $narocilo[\"id\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n }\n }",
"public function isplata($iznos){\n\n $stanjesalimitom=$this->stanje+$this->limit;\n\n if($iznos<=$stanjesalimitom){\n // $novostanje=$stanjesalimitom-$iznos;\n //echo \"Vas iznos je isplacen<br>\";\n // echo \"Novo stanje na racunu je: \".$novostanje;\n if($iznos>$this->stanje){\n // ovde je kontrolno logika ako klijent ulazi u minus\n $zaduzenje=$iznos-$this->stanje;\n $this->limit-=$zaduzenje;\n $this->stanje=0;\n echo \"Vas iznos je isplacen<br>\";\n echo \"Usli ste u dozvoljeni minus, Vas limit iznosi jos: \".$this->limit;\n\n }else{\n // ako trazi manji iznos od stanja koje ima na racunu\n $this->stanje-=$iznos;\n echo \"Vas iznos je isplacen, novo stanje je: \".$this->stanje;\n }\n\n }else{\n echo \"Nemate dovoljno sredstava na racunu\";\n }\n\n\n\n}",
"public function serch()\n {\n }",
"function cl_tfd_situacaopedidotfd() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_situacaopedidotfd\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"private function prehledNavstev(){\n $this->tpl = \"historie-navstev\";\n \n \t$prehled = new HlavniPrehled($this->db);\n \n $this->render = array(\n\t\t\t'navstevy' => $prehled->vypis(@$_POST), \n\t\t);\t\n }",
"function SuoritaLisaysToimet(){\n /*Otetaan puuhaId piilotetustaKentasta*/\n $puuhaid = $_POST['puuha_id'];\n \n /* Hae puuhan tiedot */\n $puuha = Puuhat::EtsiPuuha($puuhaid);\n $suositus=luoSuositus($puuhaid,null);\n \n /*Tarkistetaan oliko suosituksessa virheita*/\n if(OlioOnVirheeton($suositus)){\n LisaaSuositus($suositus,$puuhaid);\n header('Location: puuhanTiedotK.php?puuhanid=' . $puuhaid . '.php');\n } else {\n $virheet = $suositus->getVirheet();\n naytaNakymaSuosituksenKirjoitusSivulle($puuha, $suositus, $virheet, \"Lisays\");\n }\n}",
"public function prepararSopa(){\n\n echo(\"Revuelva los ingredientes y deje cocinar por 20 minutos\");\n\n}",
"public function tampilDataGalang(){\n\t\t\n\t}",
"function formulaires_editer_feuillederoute_charger_dist() {\n\t$valeurs = array( '_texte' => '' );\n\tlire_fichier_securise(_DIR_IMG . 'feuillederoute.php',$contenu);\n\t$contenu = @unserialize($contenu);\n\tif($contenu){\n\t\t$valeurs['_texte'] = $contenu;\n\t}\n\treturn $valeurs;\n}",
"public function sortPredvidjanjeNajteze() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najteza_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }",
"public function tratarDados(){\r\n\t\r\n\t\r\n }",
"public function pretragaIdeja(){\n $data['kor_ime']=$this->session->get('kor_tip');\n $idejaModel=new IdejaModel();\n $korisnik= $this->request->getVar(\"pretraga\");\n $ideje=$idejaModel->dohvati_ideje_po_korisnickom_imenu($korisnik);\n $data['ideje']=$ideje;\n $this->prikaz('pregled_ideja', $data);\n }",
"function fantacalcio_get_titolari_riserve_fisse($pl_votes, $competition_round, $c_id) {\n $sql = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.has_played = 0 \" .\n \"AND f.position = 1 \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d'\";\n $result = db_query($sql, $competition_round, $c_id);\n while ($row = db_fetch_array($result)) {\n\n $role = $row['role'];\n $t_id = $row['t_id'];\n \n #1a riserva dello stesso ruolo\n $sqla = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.position = 2 \" .\n \"AND f.has_played = 0 \" .\n \"AND p.role = '%d' \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d' \" .\n \"AND f.t_id = '%d' \";\n $resulta = db_query($sqla, $role, $competition_round, $c_id, $t_id);\n\n if (db_affected_rows($resulta) > 0) {\n\n while ($rowa = db_fetch_array($resulta)) {\n $pl_id = $rowa['pl_id'];\n \n #se con il voto entra la prima riserva\n if (in_array($pl_id, $pl_votes)) {\n $sqlb = \"UPDATE {fanta_lineups} set has_played = 1 \" .\n \"WHERE pl_id = '%d' \" .\n \"AND t_id = '%d' \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\";\n $resultb = db_query($sqlb, $pl_id, $t_id, $c_id, $competition_round);\n }\n #se senza voto cerco la seconda riserva\n else {\n $sqlb = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.position = 3 \" .\n \"AND f.has_played = 0 \" .\n \"AND p.role = '%d' \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d' \" .\n \"AND f.t_id = '%d' \";\n $resultb = db_query($sqlb, $role, $competition_round, $c_id, $t_id);\n while ($rowb = db_fetch_array($resultb)) {\n $pl_id = $rowb['pl_id'];\n if (in_array($pl_id, $pl_votes)) {\n $sqlc = \"UPDATE {fanta_lineups} set has_played = 1 \" .\n \"WHERE pl_id = '%d' \" .\n \"AND t_id = '%d' \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\";\n $resultc = db_query($sqlc, $pl_id, $t_id, $c_id, $competition_round);\n }\n }\n }\n }\n }\n\n #nessuna prima riserva ancora non entrata\n else {\n $sqlb = \"SELECT * FROM {fanta_lineups} f, {fanta_players} p \" .\n \"WHERE p.pl_id = f.pl_id \" .\n \"AND f.position = 3 \" .\n \"AND f.has_played = 0 \" .\n \"AND p.role = '%d' \" .\n \"AND f.round = '%d' \" .\n \"AND f.c_id = '%d' \" .\n \"AND f.t_id = '%d' \";\n $resultb = db_query($sqlb, $role, $competition_round, $c_id, $t_id);\n while ($rowb = db_fetch_array($resultb)) {\n $pl_id = $rowb['pl_id'];\n if (in_array($pl_id, $pl_votes)) {\n $sqlc = \"UPDATE {fanta_lineups} set has_played = 1 \" .\n \"WHERE pl_id = '%d' \" .\n \"AND t_id = '%d' \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\";\n $resultc = db_query($sqlc, $pl_id, $t_id, $c_id, $competition_round);\n }\n }\n }\n\n }\n}",
"public function sortIdejaPopularno() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $idejaModel=new IdejaModel();\n $ideje=$idejaModel->dohvati_najpopularnije_ideje(); \n $data['ideje']=$ideje;\n $this->prikaz('pregled_ideja', $data);\n }",
"function hitungDenda(){\n\n return 0;\n }",
"function recorrerMatrizPlaneServicios() {\n\t\t\t\n\t\t\t\tglobal $res,$matriz;\n\t\t\t\t\tfor($pos=0;$pos < mysql_num_rows($res); $pos++) {\n\n\t\t\t\t\t$nombreplan= $matriz[\"nombreplan\"][$pos] ;\t\n\t\t\t\t\t$nombreplan = eliminarCaracteresEspeciales($nombreplan)\t;\n\t\t\t\t\t$autoid = $matriz[\"autoid\"][$pos];\n\t\t\t\t\t$autoid = str_replace(\"A\",\"\",$autoid);\n\t\t\t\t\t$autoid = str_replace(\"a\",\"\", $autoid);\n\t\t\t\t\t$compania = $_SESSION[\"compania\"];\n\t\t\t\t\t$ambito = \"\";\n\t\t\t\t\t$clase = \"CUPS\";\n\t\t\t\t\n\t\t\t\t\tinsertarPlaneServicios($nombreplan, $autoid, $compania, $ambito, $clase);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t}",
"public function sortPredvidjanjePopularno() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najpopularnija_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }",
"function sobre_planeacion($minimoMes,$maximoMes,$vigencia,$unidades,$tipo_usuario)\n\t\t{\n\t\t\t//$tipo_usuario ALMACENA EL TIPO DE USUARIO( I O E), EN UN ARRAY, ESTE SE CARGA EN LA PAGINA DE PLANEACION DE PROYECTOS (upHTplaneacionProy.PHP)\t\n//echo $unidades[0].\" - $minimoMes - $maximoMes - $vigencia ********************** <br><br>\";\n\t\t?>\n\n<?\t\t\n\t\t$ban_reg=0; //PERMITE IDENTIFICAR, SI SE ENCONTRO ALMENOS, UN USUARIO SOBRE PLANEADO, DE NO SER ASI, NO SE ENVIA EL CORREO\n\t\t$pTema ='<table width=\"100%\" border=\"0\">\n\t\t <tr class=\"Estilo2\" >\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td width=\"5%\" >Asunto:</td>\n\t\t\t<td >Sobre planeación de participantes.</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t \n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\">Los siguientes participantes, tienen una dedicación superior a 1 en los siguientes proyectos:</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t\n\t\t </tr>\n\t\t\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\" >\n\t\t\t\t<table width=\"100%\" border=\"1\" >\n\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td colspan=\"5\"></td>\n\t\t\t\t\t<td colspan=\"'.(($maximoMes-$minimoMes)+1).'\" align=\"center\" >'.$vigencia.'</td>\n\t\t\t\t </tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td>Unidad</td>\n\t\t\t\t\t<td>Nombre</td>\n\t\t\t\t\t<td>Departamento</td>\n\t\t\t\t\t<td>División</td>\n\t\t\t\t\t<td>Proyecto</td>';\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$vMeses= array(\"\",\"Ene\",\"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"); \n\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t{\n\n\t\t\t\t\t $pTema = $pTema.'<td>'.$vMeses[$m].' </td>';\n\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 $pTema = $pTema.' </tr>';\n\t\t\t\t$cur_tipo_usu=0; //CURSOR DEL ARRAY, DEL TIPO DE USUARIO \n\t\t\t\tforeach($unidades as $unid)\n\t\t\t\t{\n//tipo_usuario\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"I\")\t\n\t\t\t\t\t{\n\t\t\t\t\t//CONSULTA SI EL USUARIO ESTA SOBREPLANEADO EN ALMENOS, UN MES DURANTE LA VIGENCIA\n\n\t\t\t\t\t//COSNULTA PARA LOS USUARIOS INTERNOS\n\t\t\t\t\t\t\t$sql_planea_usu=\"select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, Usuarios.nombre, \n\t\t\t\t\t\t\t\t\t\t\tUsuarios.apellidos ,Divisiones.nombre as div,Departamentos.nombre as dep\n\t\t\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t\t inner join Usuarios on PlaneacionProyectos.unidad=Usuarios.unidad \n\t\t\t\t\t\t\t\t\t\t\t inner join Departamentos on Departamentos.id_departamento=Usuarios.id_departamento \n\t\t\t\t\t\t\t\t\t\t\t inner join Divisiones on Divisiones.id_division=Departamentos.id_division \n\t\t\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \"; \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\t\t//PlaneacionProyectos.id_proyecto,\t\t\t\t\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\t\t\tand esInterno='I'\n\t\t\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,Usuarios.nombre, Usuarios.apellidos,Divisiones.nombre ,Departamentos.nombre \n\t\t\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \";\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"E\")\t\n\t\t\t\t\t{\n\t\t\t\t\t\t//COSNULTA PARA LOS USUARIOS EXTERNOS\n\t\t\t\t\t\t$sql_planea_usu=\" select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, TrabajadoresExternos.nombre, \n\t\t\t\t\t\t\t\t\tTrabajadoresExternos.apellidos,'' div, ''dep\n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t inner join TrabajadoresExternos on PlaneacionProyectos.unidad=TrabajadoresExternos.consecutivo \n\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\tand esInterno='E'\n\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,TrabajadoresExternos.nombre, TrabajadoresExternos.apellidos\n\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \t\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$cur_planea_usu=mssql_query($sql_planea_usu);\n//echo $sql_planea_usu.\" ---- <br>\".mssql_get_last_message().\" *** \".mssql_num_rows($cur_planea_usu).\"<br>\";\n\t\t\t\t\twhile($datos__planea_usu=mssql_fetch_array($cur_planea_usu))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ban_reg=1; //SI ENCUENTRA ALMENOS UN USUARIO SOBREPLANEADO, ENVIA EL CORREO\n\t\t\t\t\n\t\t\t\t\t\t//CONSULTA LOS PROYECTOS, EN LOS CUALES EL PARTICIAPENTE HA SIDO PLANEADO, ESTO PARA PODER DOBUJAR LA TABLA DE FORMA CORRECTA\n\t\t\t\t\t\t$sql_uu=\" select distinct(id_proyecto),nombre,codigo,cargo_defecto from (select SUM (hombresMes) as total_hombre_mes ,unidad, mes,PlaneacionProyectos.id_proyecto ,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto \n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos\n\t\t\t\t\t\t\t\t\t\tinner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\n\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$sql_uu=$sql_uu.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]=0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql_uu=$sql_uu.\"0) and unidad in(\".$unid.\") and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by unidad, mes , PlaneacionProyectos.id_proyecto,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto ) aa \";\n// HAVING (SUM (hombresMes)\t>1\t\n\t\t\t\t\t\t$cur_uu=mssql_query($sql_uu);\n\t\t\t\t\t\t$cant_proy=mssql_num_rows($cur_uu);\n//echo \"<br><BR>---//**************--------------\".$sql_uu.\" \".mssql_get_last_message().\"<br>\".$cant_proy.\"<br>\";\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t<?\n\t\t\t\t//echo $sql_proy_planea.\" ---- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\n\t\t\t\t\t\t$total_planeado= array();\n\t\t\t\t\t\t$cont=0;\n\t\t\t\t\t\twhile($datos_uu=mssql_fetch_array($cur_uu))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($cont==0)\n\t\t\t\t\t\t\t{\n\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\t\t\t\t\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \"> '.$datos__planea_usu[\"unidad\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'.$datos__planea_usu[\"apellidos\"].' '.$datos__planea_usu[\"nombre\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"dep\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"div\"].' </td>';\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" >['.$datos_uu[\"codigo\"].'.'.$datos_uu[\"cargo_defecto\"].'] '. $datos_uu[\"nombre\"].' </td>';\n\n\t\t\t\t\t\t\t//CONSULTA LA INFORMACION DE LO PLANEADO EN CADA MES, DE ACUERDO AL PORYECTO CONSULTADO\n\t\t\t\t\t\t\t$sql_pro=\"select SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.id_proyecto,PlaneacionProyectos.unidad,mes\n\t\t\t\t\t\t\t\t\t\t from PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and PlaneacionProyectos.unidad=\".$unid.\" and id_proyecto=\".$datos_uu[\"id_proyecto\"].\" and mes in(\";\n\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" 0) and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by PlaneacionProyectos.id_proyecto ,PlaneacionProyectos.unidad ,mes order by (mes) \";\n// HAVING (SUM (hombresMes))>1\n\t\t\t\t\t\t\t$cur_proy_planea=mssql_query($sql_pro);\n//\t\t\t\techo $sql_pro.\" --22222222222-- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\t\t\t$m=$minimoMes;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($datos_proy_planea=mssql_fetch_array($cur_proy_planea))\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tfor ($m;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($datos_proy_planea[\"mes\"]==$m)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]+=( (float) $datos_proy_planea[\"total_hombre_mes\"]);\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" align=\"right\" >'.((float) $datos_proy_planea[\"total_hombre_mes\"] ).'</td>';\n\n\t\t\t\t\t\t\t\t\t\t$m=$datos_proy_planea[\"mes\"];\n\t\t\t\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td> </td>';\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$m--;\n\t\t\t\t\t\t\tfor ($m++;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.'<td> </td>';\n\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t$cont++;\n\t\t\t\t\t\t\tunset($datos_proy_planea);\n\n\t\t\t\t\t\t\t $pTema = $pTema.' </tr>';\n\n\t\t\t\t//\t\t\techo $datos_proy_planea[\"total_hombre_mes\"].\"<br>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\n\t\t\t\t\t\t<td colspan=\"4\" > </td>\n\n\t\t\t\t\t\t<td>Total planeación</td>';\n\n\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($total_planeado[$m]==0)\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td> </td>';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>'.$total_planeado[$m].'</td>';\n\t\t\t\t\t\t}\n \n\t\t\t\t\t $pTema = $pTema.' </tr>\n\t\t\t\t\t <tr >\n\t\t\t\t\t\t<td colspan=\"17\"> </td>\n\t\t\t\t\t </tr>\t';\n\n\t\t\t\t\t}\n\t\t\t\t\t$cur_tipo_usu++;\n\t\t\t\t}\n\t\t\t\t$pTema = $pTema.'\n\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t </tr>\n\t\t<tr class=\"Estilo2\"><td colspan=\"2\" >Para consultar en detalle la planeación de un participante, en un proyecto especifico, utilice el reporte Usuarios por proyecto, accediendo a el, atravez del boton Consolidados por división, ubicado en la parte superior de la pagina principal de la planeación por proyectos. </td></tr>\n\t\t</table>';\n\n\t\t/*\n\t\t\t\t//consulta la unidad del director y el coordinador de proyecto\n\t\t\t\t$sql=\"SELECT id_director,id_coordinador FROM HojaDeTiempo.dbo.proyectos where id_proyecto = \" . $cualProyecto.\" \" ;\n\t\t\t\t$eCursorMsql=mssql_query($sql);\n\t\t\t\t$usu_correo= array(); //almacena la unidad de los usuarios a los que se le enviara el correo\n\t\t\t\t$i=1;\n\t\t\t\twhile($datos_dir_cor=mssql_fetch_array($eCursorMsql))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_coordinador\"];\n\t\t\t\t\t$i++;\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_director\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\n\t\t\t\t//consulta la unidad porgramadores y ordenadores de gasto\t\t\t\n\t\t//select unidad from HojaDeTiempo.dbo.Programadores where id_proyecto=\".$cualProyecto.\" union\n\t\t\t\t$sql_pro_orde=\" select unidadOrdenador from GestiondeInformacionDigital.dbo.OrdenadorGasto where id_proyecto=\".$cualProyecto;\n\t\t\t\t$cur_pro_orde=mssql_query($sql_pro_orde);\n\t\t\t\twhile($datos_pro_orde=mssql_fetch_array($cur_pro_orde))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_pro_orde[\"unidad\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\t\t\t\n\t\t\n\t\t\t\t$i=0;\n\t\t\t\t//consulta el correo de los usuarios(director,cordinador,ordenadroes de G, y programadores) asociados al proyecto\n\t\t\t\t$sql_usu=\" select email from HojaDeTiempo.dbo.Usuarios where unidad in(\";\n\t\t\t\tforeach($usu_correo as $unid)\n\t\t\t\t{\n\t\t\t\t\tif($i==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" \".$unid;\t\t\n\t\t\t\t\t\t$i=1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" ,\".$unid;\n\t\t\t\t}\n\t\t\t\t$sql_usu=$sql_usu.\") and retirado is null\";\n\t\t\t\t$cur_usu=mssql_query($sql_usu);\t\t\t\t\n\t\t\n\t\t\t\t//se envia el correo a el director, cordinador, orenadores de gasto, y programadores del proyecto\t\n\t\t\t\twhile($eRegMsql = mssql_fetch_array($cur_usu))\n\t\t\t\t{\t\t\n\t\t\t\t $miMailUsuarioEM = $eRegMsql[email] ;\n\t\t\t\n\t\t\t\t //***EnviarMailPEAR\t\n\t\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\n\t\t\t\n\t\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\n\t\t\t\n\t\t\t\t //***FIN EnviarMailPEAR\n\t\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t\n\t\t\t\t}\n\t\t*/\n\t\t\tif($ban_reg==1) //SEW ENVIA EL CORREO SI EXISTE ALMENOS UN USUARIO SOBREPLANEADO\n\t\t\t{\n\t\t///////////////////////////**********************************************************PARA QUITAR\n\t\t\t $miMailUsuarioEM = 'carlosmaguirre'; //$eRegMsql[email] ;\t\n\t\t\t\t$pAsunto='Sobre planeación de proyectos';\n\t\t\t //***EnviarMailPEAR\t\n\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\t\n\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\t\n\t\t\t //***FIN EnviarMailPEAR\n\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t}\n\t\t\n\t\t?>\n\n<?\n}",
"function getAllFromProizvod(){\n\t\treturn $this->ime . \" \" . $this->imeProizvođača . \" \" \n\t\t. $this->prezimeProizvođača . \" \" . $this->cijena;\n\t}",
"function cl_pcorcamfornelic() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pcorcamfornelic\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function checkPrzygoda($who){\n\t$r = polacz();\n\t$przygoda = getFromDB($r,'players','Przy_ID','ID_Player',$who);\n\tif($przygoda) {\n\t\t$czas = date('Y-m-d H:i:s');\n\t\t$zapytanie = \"SELECT * FROM przygody INNER JOIN przygody_types ON przygody.Przy_Type_ID = przygody_types.ID_Przy_Type WHERE ID_Przy = \" . $przygoda . \";\";\n\t\t$res = $r->query($zapytanie);\n\t\t$row = $res->fetch_assoc();\n\t\tif ($row) {\n\t\t\t$end = strtotime($row['Started']) + ($row['For_Time'] * 60);\n\t\t\t$diff = ($end - strtotime($czas));\n\t\t\tif ($diff <= 0) {\n\t\t\t\t$money = floor($row['For_Time'] * (0.4 + $row['Difficulty']));\n\t\t\t\t$exp = floor($row['For_Time'] * (0.8 + $row['Difficulty']));\n\t\t\t\tif (getFromDB($r, 'users', 'PERMISSIONS_ID', 'PLAYERS_ID', $who) <= 1) {\n\t\t\t\t\t$money = floor($money * 1.5);\n\t\t\t\t\t$exp = floor($exp * 1.5);\n\t\t\t\t}\n\t\t\t\t$kasa = getFromDB($r, 'players', 'Money_Player', 'ID_Player', $who);\n\t\t\t\t$dos = getFromDB($r, 'players', 'Experience', 'ID_Player', $who);\n\t\t\t\t$kasa += $money;\n\t\t\t\t$dos += $exp;\n\t\t\t\t$dataKoniec = date('Y-m-d H:i:s', $end);\n\t\t\t\t$zapytanie = \"UPDATE players SET Experience = '\" . $dos . \"', Money_Player = '\" . $kasa . \"', Przy_ID = NULL WHERE ID_Player = \" . $who . \";\nINSERT INTO komunikaty (PLAYER_ID, Komunikat, Kom_Typ_ID, Data_Kom) VALUES ('\" . $who . \"', 'Twoja przygoda na \" . $row['Name_Przy'] . \" się zakończyła. Zysk: Haisy-\" . $money . \", Doświadczenie-\" . $exp . \".', '0', '\" . $dataKoniec . \"');\nDELETE FROM przygody WHERE ID_Przy = \" . $przygoda . \";\";\n\t\t\t\t$res = $r->multi_query($zapytanie);\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}",
"function moviextranjeros($ejer,$poli){\n\t\t\t$sql=$this->query(\"select m.*,c.manual_code from cont_polizas p,cont_movimientos m,cont_accounts c,cont_config con\n\t\t\twhere m.IdPoliza=p.id and m.Cuenta=c.`account_id` and c.currency_id!=1 and m.Activo=1 and c.main_father!=con.CuentaBancos\n\t\t\t and p.idejercicio=\".$ejer.\" and p.id=\".$poli);\n\t\t\t \n\t\t\treturn $sql;\n\t\t\t\n\t\t}",
"function loadSimple($id){\r\n //$sql = $GLOBALS[\"db\"]->query('SELECT j_compte.*,j_partie.vitesse,j_partie.type FROM j_compte,j_partie WHERE j_compte.id = '.$id.' AND j_compte.partie = j_partie.id');\r\n if($id>0 AND $id != \"\"){\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_compte WHERE id = '.$id);\r\n $donnees = mysql_fetch_array($sql);\r\n }\r\n if($donnees['partie'] != 0 ){\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_partie WHERE id = '.$donnees['partie']);\r\n $donneesPartie = mysql_fetch_array($sql);\r\n }\r\n $this->id = $donnees['id'];\r\n $this->login = $donnees['login'];\r\n $this->mdp = $donnees['mdp'];\r\n $this->email = $donnees['email'];\r\n $this->skin = $donnees['skin'];\r\n $this->etat = $donnees['etat'];\r\n $this->points = $donnees['points'];\r\n $this->date_inscription = $donnees['date_inscription'];\r\n $this->date_dern_action = $donnees['date_dern_action'];\r\n $this->description = $donnees['description'];\r\n $this->age = $donnees['age'];\r\n $this->sexe = $donnees['sexe'];\r\n $this->alliance = $donnees['alliance'];\r\n $this->guilde = $donnees['guilde'];\r\n $this->avatar = $donnees['avatar'];\r\n $this->idVille = unserialize($donnees['idVille']);\r\n $this->idHero = unserialize($donnees['idHero']);\r\n $this->bois = $donnees['bois'];\r\n $this->ors = $donnees['ors'];\r\n $this->boisMax = $donnees['boisMax'];\r\n $this->orsMax = $donnees['orsMax'];\r\n $this->augOrsParMinute = $donnees['augOrsParMinute'];\r\n $this->augBoisParMinute = $donnees['augBoisParMinute'];\r\n $this->position = $donnees['position'];\r\n $this->partie = $donnees['partie'];\r\n $this->etatPartie = $donnees['etatPartie'];\r\n\r\n $this->tuto = unserialize($donnees['tuto']);\r\n\r\n $this->typePartie = $donneesPartie['type'];\r\n $this->vitesse = $donneesPartie['vitesse'];\r\n\r\n $GLOBALS['skin'] = $this->skin;\r\n $GLOBALS['ors'] = $this->ors;\r\n $GLOBALS['bois'] = $this->bois;\r\n $GLOBALS['idjoueur'] = $this->id;\r\n $GLOBALS['alliance'] = $this->alliance;\r\n $GLOBALS['typePartie'] = $this->typePartie;\r\n $GLOBALS['partie'] = $this->partie;\r\n $GLOBALS['vitesse'] = $this->vitesse;\r\n\r\n $_SESSION['typePartie'] = $this->typePartie;\r\n $_SESSION['partie'] = $this->partie;\r\n $_SESSION['alliance'] = $this->alliance;\r\n $_SESSION['etat'] = $this->etat;\r\n }",
"public function inOriginal();",
"function prelasesor(){\n include(\"../include/conectar.php\"); \n $query =\"UPDATE tblsemestrepro SET asesor = '$this->asesor' WHERE tblsemestrepro.id_semestrepro = $this->semestrepy;\";\n $sql = mysqli_query($conection, $query);\n mysqli_close($conection); \n if($sql){\n\t\t\t $p =\"relacion\";\n include('../plantillas/paso.php');\n } \n else\n throw new Exception (\"Error: No es posible registrar\");\n }",
"public function acessarRelatorios(){\n\n }",
"public function podrskaPotvrdjeno(){\n $this->prikaz('podrskaPotvrdjeno' , []);\n }",
"function aggiungiAllegato($pratica,$documento){\n \n}",
"function ler($nome) {\n $x = 1;\n\t while($x < $this->bd[0][0] && !$this->str_igual($nome, $this->bd[$x][2])) {$x++;}\n if($x >= $this->bd[0][0]) {return 0;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\nreturn 1;\n }",
"function mostrar_planilla_diligencia_distribucion($iddistribucion)\n{ //Planilla Asociada\n $ft_destapacho_ingresados = Model::getQueryBuilder()\n ->select('b.iddocumento', 'b.numero')\n ->from('ft_despacho_ingresados', 'a')\n ->innerJoin('a', 'documento', 'b', 'a.documento_iddocumento=b.iddocumento')\n ->innerJoin('a', 'ft_item_despacho_ingres', 'c', 'a.idft_despacho_ingresados=c.ft_despacho_ingresados')\n ->where('lower(b.estado)=\"aprobado\"')\n ->andWhere('c.ft_destino_radicacio = :iddist')\n ->setParameter(':iddist', $iddistribucion, \\Doctrine\\DBAL\\Types\\Type::INTEGER)\n ->execute()->fetchAll();\n\n $html = \"No tiene planilla asociada\";\n //Pendiente\n //el componente 379 tiene busqueda de planillas\n $Distribucion = new Distribucion($iddistribucion);\n if (($iddistribucion == $Distribucion->entre_sedes) || ($Distribucion->entre_sedes == 0)) {\n if ($ft_destapacho_ingresados) {\n $html = '';\n foreach ($ft_destapacho_ingresados as $planilla) {\n $html .= '<div class=\"kenlace_saia\" enlace=\"views/documento/index_acordeon.php?documentId=' . $planilla['iddocumento'] . '\" conector=\"iframe\" titulo=\"No Registro ' . $planilla['numero'] . '\"><center><button class=\"btn btn-complete\">' . $planilla['numero'] . '</button></center></div>';\n }\n }\n } else {\n $registros_planillas = Model::getQueryBuilder()\n ->select('b.iddocumento', 'b.numero')\n ->from('ft_despacho_ingresados', 'a')\n ->innerJoin('a', 'documento', 'b', 'a.documento_iddocumento=b.iddocumento')\n ->innerJoin('a', 'ft_item_despacho_ingres', 'c', 'a.idft_despacho_ingresados=c.ft_despacho_ingresados')\n ->where('lower(b.estado)=\"aprobado\"')\n ->andWhere('c.ft_destino_radicacio = :iddist')\n ->setParameter(':iddist', $Distribucion->entre_sedes, \\Doctrine\\DBAL\\Types\\Type::INTEGER)\n ->execute()->fetchAll();\n $html = '';\n foreach ($registros_planillas as $planilla) {\n $html .= '<div class=\"kenlace_saia\" enlace=\"views/documento/index_acordeon.php?documentId=' . $planilla['iddocumento'] . '\" conector=\"iframe\" titulo=\"No Registro ' . $planilla['numero'] . '\"><center><button class=\"btn btn-complete\">' . $planilla['numero'] . '</button></center></div>';\n }\n }\n\n return $html;\n}",
"function crea_ruta_punto($itm,$r){\n\t \n\n global $db,$dbf,$fecha_con_formato,$cp,$cpno, $existe_punto_detalle;\n $cuenta_puntos=0;\n\t$cuenta_puntos_no = 0;\n\t$otra_ban = 0;\n\t$bandera =0;\n \n\t\t\t\t$usuario = \"SELECT COD_OBJECT_MAP FROM SAVL_G_PRIN WHERE ITEM_NUMBER = '\".$itm.\"'\";\n\t\t\t $query_user = $db->sqlQuery($usuario);\n\t\t\t\t$row_user = $db->sqlFetchArray($query_user);\n\t\t\t\t$count_user = $db->sqlEnumRows($query_user);\t \t \n\t\t\t\t\t\t\t \n\t\t\t\t\tif($count_user > 0)\t{\t\t\n\t\t\t\t \n \t\t\t\t\t$punto = \"SELECT COD_OBJECT_MAP FROM SAVL_ROUTES_DETAIL WHERE COD_OBJECT_MAP =\".$row_user['COD_OBJECT_MAP'];\n \t\t\t $query_punto = $db->sqlQuery($punto);\n \t\t\t\t $count_punto = $db->sqlEnumRows($query_punto);\n\t\t\t\t \n \t\t\t\t if($count_punto>0){\n \t\t\t\t\t\t // $existe_punto = $existe_punto +1;\n \t\t\t\t echo \"ya existe el geopunto en routes_detail, se guardara este mismo geopunto con otra ruta...\";\n\t\t\t\t\t\t\t\t\t\t\t$otra_ban = 1;\n \t\t\t\t\t\t }\n\t\t\t\t \n \t\t\t\t //if($count_punto==0){\n \t\t\t\t\t\t\t $data_2 = Array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'ID_ROUTE' => $r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'COD_OBJECT_MAP' => $row_user['COD_OBJECT_MAP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'CREATE_DATE' => $fecha_con_formato\n\t\t\t\t\t\t\t\t\t\t\t\t );\n \t\t\t\tif($dbf-> insertDB($data_2,'SAVL_ROUTES_DETAIL',false) == true){\n \t\t\t\t\t\t\t\t\t $bandera = 1;\n \t\t\t\t\t\t\t\t\t echo 1;\t\t\n }\telse{\n echo 0;\t\n }\t\n \t\t\t // }else{\n \t\t\t\t\t //\t\t$bandera = 0;\n \t\t\t\t\t //}\n\t\t\t\t \n\t\t\t\t }\n\n\t\t\tif($bandera ==1){\n\t\t\t $cp = $cp +1;\n\t\t\t}else{\n\t\t\t $cpno = $cpno +1;\n\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\tif($otra_ban ==1){\n\t\t\t $existe_punto_detalle = $existe_punto_detalle +1;\n\t\t\t} \n \n }",
"public function pregledtudjegpredv() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $trenprikaz='prikazprofpredv_admin'; \n $username=$this->request->uri->getSegment(3);\n $korisnikModel=new KorisnikModel();\n $data['user']=$korisnikModel->dohvati_korisnika($username);\n if(($data['user']->Username)==($this->session->get('korisnik')->Username)) {$data['user']=$this->session->get('korisnik'); $trenprikaz='profilkorisnikpredvidjanja'; }\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_predvidjanja_po_korisnickom_imenu($data['user']->Username);\n $data['predvidjanja']=$predvidjanja;\n $this->prikaz($trenprikaz, $data);\n }",
"public function liberar() {}",
"function cl_habitcandidatointeresseprograma() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"habitcandidatointeresseprograma\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function ver_buscar_mapa($fid_string=\" \",$presenta=0,$idmapa=0,$intensidad){\n \n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/ver_mapa.html\");\n \n //echo \"intensidad : $intensidad\";\n \n if($intensidad>0){\n $plantilla->iniciaBloque(\"intensidad\");\n }\n \n $imapa = new imapa();\n \n $result1 = $imapa->get_mapa();\n \n $nombres = array();\n \n $count=0;\n \n $modo=0;\n \n $color=array(\"#B19CD9\",\"#FF6961\",\"#77DD77\",\"#CFCFC4\",\"#FDFD96\");\n \n $stroke=array(\"#966FD6\",\"#C23B22\",\"#03C03C\",\"#836953\",\"#FFB347\");\n \n while($mapa= mysql_fetch_array($result1)){\n $count++;\n \n $plantilla->iniciaBloque(\"mapa\");\n $plantilla->reemplazaEnBloque(\"idmapa\", $mapa[idgis_mapa],\"mapa\");\n $plantilla->reemplazaEnBloque(\"nombre\", $mapa[nombre],\"mapa\");\n \n if( $mapa[idgis_mapa]==$idmapa || ( $mapa[predeterminado]>0 && $idmapa==0 ) ){\n \n $plantilla->reemplazaEnBloque(\"selected\", \"selected\",\"mapa\");\n \n $plantilla->reemplaza(\"frontera\", $mapa[frontera]);\n $plantilla->reemplaza(\"enfoque\", $mapa[enfoque]);\n $plantilla->reemplaza(\"resolucion\", $mapa[resolucion]);\n $plantilla->reemplaza(\"proyeccion\", $mapa[proyeccion]);\n $plantilla->reemplaza(\"unidad\", $mapa[unidad]);\n\n $i=0;\n $nombre=\"\";\n $result2 = $imapa->get_capa_mapa($mapa[idgis_mapa]);\n while($capa= mysql_fetch_array($result2)){\n $nombre=$capa[nombre];\n $nombres[$nombre]=$nombre;\n if($modo>0){\n $plantilla->iniciaBloque(\"capa\");\n $plantilla->reemplazaEnBloque(\"i\", $i, \"capa\");\n\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"capa\");\n\n\n $plantilla->reemplazaEnBloque(\"proyeccion\", $capa[proyeccion], \"capa\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"capa\");\n }else{\n \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"capa\");\n }\n }else{\n $plantilla->iniciaBloque(\"gml\"); \n $plantilla->reemplazaEnBloque(\"i\", $i, \"gml\");\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"gml\");\n $plantilla->reemplazaEnBloque(\"color\", $color[($i%5)], \"gml\");\n $plantilla->reemplazaEnBloque(\"stroke\", $stroke[($i%5)], \"gml\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"gml\");\n }else{ \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"gml\");\n }\n } \n $i++;\n }\n $capas=\" \";\n\n foreach ($nombres as $nombre){\n $capas .= $nombre.\",\";\n }\n\n\n $capas = substr($capas, 0, -1);\n\n\n $plantilla->reemplaza(\"i\", $i);\n $plantilla->reemplaza(\"nombre\", $nombre);\n $plantilla->reemplaza(\"capas\", $capas);\n $plantilla->reemplaza(\"fid_string\", $fid_string);\n \n }\n \n \n }\n \n if($count==0){\n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/no_mapa.html\");\n }\n \n if($presenta>0){\n $plantilla->presentaPlantilla();\n }else{\n return $plantilla->getPlantillaCadena();\n }\n \n}",
"function cl_rhconsignadomovimentoservidorrubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhconsignadomovimentoservidorrubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public static function prijavi($upime, $geslo)\n\t{\n\t\t$db = Db::getInstance();\n\t\t//začnemo sejo, dobimo podatke iz PB (recimo ka nemreta meti istoga imena, kak je že v večini primerov gnesden)\n\t\t//Db::sessionStart();\n\t\t$result = mysqli_query($db, \"SELECT ID, upime, geslo FROM oseba WHERE upime='$upime'\");\n\t\n\t\t$row = mysqli_fetch_array($result);\n\t\t//tu dobimo isti hash, s kerin smo koderali (ali kak se tumi pravi) geslo, zato ka ga te v if stavki ponucamo za primerjavo\n\t\t\n\t\t//primerjamo podatke keri so v bazi pa vpisani podatki, password_verify pa je kak san že prej napisao za primerjavo vpisanoga gesla pa hash_gesla iz baze\n\t\tif($row[1] == $upime && password_verify($geslo, $row[2]))\n\t\t{\n\t\t\t//če smo vpisali prave podatke, shranimo v sejo ID uporabnika (mogoče bi ime?)\n\t\t\t$_SESSION[\"id\"]=$row[0];\n\t\t\t//dobimo id, pa zovemo uspesnaPrijava.php v keroj izpišemo ka smo se prijavili, pa povezava do \"home\" je not\n\t\t\t//$oseba = Oseba::najdi($row[0]);\n\t\t\t$query = mysqli_query($db, \"INSERT INTO osebaAktivna (osebaID) VALUES ('$row[0]')\");\n\t\t\t\n\t\t\terror_reporting(E_ALL);\n\t\t require_once('views/osebe/uspesnaPrijava.php');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//če nejsmo vnesli pravih podatkov, zovemo stran napakaPrijava.php, v keroj je izpis o ton ka smo napačne podatki dali, pa link za nazaj (torej na stran prijavi.php)\n\t\t require_once('views/osebe/napakaPrijava.php');\n\t\t}\n\t}",
"private function metodo_privado() {\n }",
"function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}",
"public static function vratiSve($db){\n \n \n // $result = $db->query('SELECT *,((i.datumDo - i.datumOd)*i.cenaPoDanu) as ukupnaCena FROM iznajmljivanje i join korisnik k on i.korisnik=k.korisnikID join vozilo v on i.vozilo=v.voziloID');\n $result = $db->query('SELECT * FROM iznajmljivanje i join korisnik k on i.korisnik=k.korisnikID join vozilo v on i.vozilo=v.voziloID');\n \n\n\n $iznajmljivanja = array();\n\n while($row = $result->fetch_assoc()) { \n // $tip = new TipVozila();\n // $tip->tipID= $row['tipID'];\n // $tip->nazivTipa= $row['nazivTipa'];\n\n\n $vozilo = new Vozilo();\n $vozilo->voziloID= $row['voziloID'];\n $vozilo->model= $row['model'];\n $vozilo->marka= $row['marka'];\n $vozilo->regBr= $row['regBr'];\n // $voziloPom->tipVozila = $tip;\n\n $korisnik= new Korisnik();\n $korisnik->korisnikID= $row['korisnikID'];\n $korisnik->ime = $row['ime'];\n $korisnik->prezime = $row['prezime'];\n\n $iznajmljivanje = new Iznajmljivanje();\n $iznajmljivanje->iznajmljivanjeID = $row['iznajmljivanjeID'];\n $iznajmljivanje->vozilo = $vozilo;\n $iznajmljivanje->korisnik = $korisnik;\n $iznajmljivanje->datumOd = $row['datumOd'];\n $iznajmljivanje->datumDo = $row['datumDo'];\n $iznajmljivanje->cenaPoDanu = $row['cenaPoDanu'];\n // $ukupnaCena = $row['ukupnaCena'];\n\n array_push($iznajmljivanja, $iznajmljivanje); \n }\n\n return $iznajmljivanja;\n}",
"function fantacalcio_trova_titolari($vote_round) {\n drupal_set_title(filter_xss('Risultati ' . $vote_round . 'ª giornata'));\n\n $out = \"\";\n\n// $vote_round = get_last_votes();\n\n $teams = get_teams();\n $votes = get_votes($vote_round);\n $competitions = get_competitions();\n\n $pl_votes = array();\n foreach ($votes as $vote)\n $pl_votes[] = $vote->pl_id;\n\n $elenco_pl_ids = implode(',', $pl_votes);\n \n $sqlx = \"SELECT * FROM {fanta_rounds_competitions} \" .\n \"WHERE round = '%d'\";\n $resultx = db_query($sqlx, $vote_round);\n while ($row = db_fetch_array($resultx)) {\n\n $c_id = $row['c_id'];\n $competition_round = $row['competition_round'];\n \n $out .= \"<h3>\" . $competitions[$c_id]->name . \"</h3>\";\n \n //resetto i valori \n $sql = \"UPDATE {fanta_lineups} \n SET has_played = 0 \n WHERE round = '%d' \n AND c_id = '%d'\";\n $result = db_query($sql, $competition_round, $c_id);\n\n #titolari con voto\n $sql = \"UPDATE {fanta_lineups} \" .\n \"SET has_played = 1 \" .\n \"WHERE position = 1 \" .\n \"AND round = '%d' \" .\n \"AND c_id = '%d'\" .\n \"AND pl_id IN ($elenco_pl_ids)\";\n //echo $sql;\n $result = db_query($sql, $competition_round, $c_id);\n \n switch (variable_get(\"fantacalcio_riserve_fisse\", 0) ) {\n case 0: //riserve libere\n fantacalcio_get_titolari_riserve_libere($pl_votes, $competition_round, $c_id);\n break;\n case 1: //riserve fisse\n fantacalcio_get_titolari_riserve_fisse($pl_votes, $competition_round, $c_id);\n break;\n default:\n fantacalcio_get_titolari_riserve_fisse($pl_votes, $competition_round, $c_id);\n }\n\n #report\n $sql = \"SELECT count(*) AS n, t_id FROM {fanta_lineups} \" .\n \"WHERE has_played = 1 \" .\n \"AND c_id = '%d' \" .\n \"AND round = '%d'\" .\n \"GROUP BY t_id\";\n $result = db_query($sql, $c_id, $competition_round);\n $played = array();\n $i = 0;\n while ($row = db_fetch_array($result)) {\n $i++;\n $played[$i]['t_id'] = $row['t_id'];\n $played[$i]['n'] = $row['n'];\n }\n\n $players = get_players();\n\n $sql = \"SELECT * FROM {fanta_lineups} \" .\n \"WHERE c_id = '%d' \" .\n \"AND round = '%d'\";\n $result = db_query($sql, $c_id, $competition_round);\n $formazioni = array();\n while ($row = db_fetch_object($result)) {\n\n $role = $players[$row->pl_id]->role;\n\n if ($row->position == 1) $formazioni[$row->t_id][\"titolari\"][$role]++;\n if ($row->has_played == 1) $formazioni[$row->t_id][\"played\"][$role]++;\n }\n\n #riepilogo titolari squadre\n $header = array(\"Squadra\", \"N° Titolari\", \"Modulo Titolari\", \"Modulo Formazione\");\n\n $rows = array();\n foreach ($formazioni as $key => $value) {\n $n_titolari = array_sum($formazioni[$key][\"played\"]);\n\n $style = ($n_titolari == 11) ? \"\" : \"font-weight: bold; color: red;\";\n\n ksort($formazioni[$key][\"played\"]);\n ksort($formazioni[$key][\"titolari\"]);\n\n $rows[$key][] = $teams[$key]->name;\n $rows[$key][] = array(\"data\" => $n_titolari, \"style\" => $style);\n $rows[$key][] = implode(\"-\", $formazioni[$key][\"played\"]);\n $rows[$key][] = implode(\"-\", $formazioni[$key][\"titolari\"]);\n }\n $out .= theme_table($header, $rows);\n\n }\n\n return $out;\n\n}",
"function getKontaktStamm($id,$pfad=\"\") {\n $sql=\"select C.*,E.login from contacts C left join employee E on C.cp_employee=E.id where C.cp_id=$id\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if(!$rs) {\n $daten=false;\n } else {\n $firma=\"Einzelperson\";\n $tab=\"\";\n $cnr=\"\";\n if (!empty($rs[0][\"cp_cv_id\"])) { // gehört zu einem Kunden oder Lieferanten\n $sql=\"select id,name,department_1,customernumber,language_id from customer where id=\".$rs[0][\"cp_cv_id\"];\n $rs1=$GLOBALS['dbh']->getAll($sql);\n if (empty($rs1[0][\"name\"])) { // nicht zu Kunde sondern zu Lieferant\n $sql=\"select id,name,department_1,vendornumber,language_id from vendor where id=\".$rs[0][\"cp_cv_id\"];\n $rs1=$GLOBALS['dbh']->getAll($sql);\n $tab=\"V\";\n $cnr=$rs1[0][\"vendornumber\"];\n $firma=$rs1[0][\"name\"];\n $language_id=$rs1[0][\"language_id\"];\n } else {\n $tab=\"C\";\n $cnr=$rs1[0][\"customernumber\"];\n $firma=$rs1[0][\"name\"];\n $language_id=$rs1[0][\"language_id\"];\n }\n }\n $daten=$rs[0];\n if ($daten[\"cp_grafik\"]) {\n $image=\"$pfad./dokumente/\".$_SESSION[\"dbname\"].\"/$tab$cnr/$id/kopf$id.\".$daten[\"cp_grafik\"];\n clearstatcache();\n if (file_exists($image)) {\n $size=@getimagesize($image);\n $daten[\"size\"]=$size[3];\n if ($size[1]>$size[0]) {\n $faktor=ceil($size[1]/70);\n } else {\n $faktor=ceil($size[0]/120);\n }\n $breite=floor($size[0]/$faktor);\n $hoehe=floor($size[1]/$faktor);\n $daten[\"icon\"]=\"width=\\\"$breite\\\" height=\\\"$hoehe\\\"\";\n } else {\n $daten[\"icon\"]=\"width=\\\"75\\\" height=\\\"100\\\"\";\n }\n }\n $daten[\"Firma\"] = $firma;\n $daten[\"Department_1\"]=$rs1[0][\"department_1\"];\n $daten[\"tabelle\"] = $tab;\n $daten[\"nummer\"]=$cnr;\n $daten[\"language_id\"]=$language_id;\n }\n return $daten;\n}",
"function cl_criterioavaliacaodisciplina() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"criterioavaliacaodisciplina\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function stocks_pre_boucle($boucle) {\n $id_table = $boucle->id_table;\n\n //Savoir si on consulté la table organisations_liens\n if ($jointure = array_keys($boucle->from, 'spip_stocks')) {\n //Vérifier qu'on est bien dans le cas d'une jointure automatique\n if (isset($boucle->join[$jointure[0]])\n and isset($boucle->join[$jointure[0]][3])\n and $boucle->join[$jointure[0]]\n and $boucle->join[$jointure[0]][3]\n ) {\n //Le critere ON de la jointure (index 3 dans le tableau de jointure) est incompléte\n //on fait en sorte de retomber sur ses pattes, en indiquant l'objet à joindre\n $boucle->join[$jointure[0]][3] = \"'L1.objet='.sql_quote('\".objet_type($id_table).\"')\";\n\t\t}\n }\n\n return $boucle;\n}",
"public static function Znevalidni_kolize_ucastnika_formulare($iducast,$formular) {\r\n//echo \"<hr><br>*Znevalidnuji vsechny kolize ucastnika , formular=\" . $formular;\r\n \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n //vyberu vsechny ulozene kolize z tabulky uc_kolize_table\r\n $query= \"SELECT * FROM uc_kolize_table left join s_typ_kolize on (s_typ_kolize.id_s_typ_kolize = uc_kolize_table.id_s_typ_kolize_FK) \" .\r\n \"WHERE id_ucastnik=\" . $iducast . \" and s_typ_kolize.formular='\" . $formular . \"' and uc_kolize_table.valid\" ;\r\n \r\n //echo \"<br>*dotaz na kolize v Znevalidni_kolize_ucastnika_formulare: \" . $query;\r\n \r\n $sth = $dbh->prepare($query);\r\n $succ = $sth->execute();\r\n \r\n while($zaznam_kolize = $sth->fetch()) {\r\n //echo \"<br>*Znevalidnuji kolizi: \" . $zaznam_kolize[id_uc_kolize_table];\r\n \r\n $query1 = \"UPDATE uc_kolize_table SET \" .\r\n \"valid=0 WHERE uc_kolize_table.id_uc_kolize_table=\" . $zaznam_kolize['id_uc_kolize_table'] ;\r\n $data1= $dbh->prepare($query1)->execute(); \r\n }\r\n \r\n//echo \"<hr>\";\r\n}",
"public function sortPredvidjanjeNovo() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najnovija_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }",
"function identificar_pago_cli_mercantil($acceso,$id_cuba,$abrev_cuba){\n\t$acceso2=conexion();\n\t\n\t\tsession_start();\n\t\t$ini_u = $_SESSION[\"ini_u\"]; \n\t\tif($ini_u==''){\n\t\t\t$ini_u =\"AA\";\n\t\t}\n\t$acceso->objeto->ejecutarSql(\"select *from pagodeposito where (id_pd ILIKE '$ini_u%') ORDER BY id_pd desc\"); \n\t$id_pd = $ini_u.verCoo($acceso,\"id_pd\");\n\t$login = $_SESSION[\"login\"]; \n\t$fecha= date(\"Y-m-d\");\n\t$hora= date(\"H:i:s\");\n\t\n\t$palabra_clave='DEPOSITO EN EFECTIVO';\n\t$palabra_clave1='DEPO-FACIL ELECTRONICO';\n\t//ECHO \" select * from vista_tablabancos where id_cuba='$id_cuba' and descrip_tb ilike 'REC. INT. CARGO CUENTA%'\";\n\t$acceso2->objeto->ejecutarSql(\" select * from vista_tablabancos where id_cuba='$id_cuba' and (descrip_tb ilike '$palabra_clave%' or descrip_tb ilike '$palabra_clave1%' )AND (Status_tb='REGISTRADO' or status_tb='NO RELACIONADO')order by id_tb \");\n\t\twhile($row=row($acceso2)){\n\t\t\t$abrev_cuba=trim($row[\"abrev_cuba\"]);\n\t\t\t$id_tb=trim($row[\"id_tb\"]);\n\t\t\t//echo \"<br>$abrev_cuba:\";\n\t\t\t$fecha_tb=trim($row[\"fecha_tb\"]);\n\t\t\t$referencia_tb=trim($row[\"referencia_tb\"]);\n\t\t\t$monto_tb=trim($row[\"monto_tb\"]);\n\t\t\t$descrip_tb=trim($row[\"descrip_tb\"]);\n\t\t\t$valor=explode($palabra_clave,$descrip_tb);\n\t\t\t$ini=substr($referencia_tb, 0, 3);\n\t\t\t$nro_contrato='00000000000000000000000000';\n\t\t\t//echo \"<br>:$referencia_tb:\";\n\t\t\t//if($ini=='000'){\n\t\t\t\t//$nro_contrato=\t$ano=substr($referencia_tb, 3, 8);\n\t\t\t\t$nro_contrato=\t$referencia_tb;\n\t\t\t\tif(strlen($nro_contrato)!=8 && strlen($nro_contrato)!=7){\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//\techo \"<br>nro_contrato:$nro_contrato:\";\n\t\t\t//}\n\t\t\t//echo \"<br>$referencia_tb: select * from contrato where nro_contrato ilike '%$nro_contrato%' \";\n\t\t\t$acceso->objeto->ejecutarSql(\" select * from contrato where nro_contrato ilike '%$nro_contrato%' \");\n\t\t\tif($row=row($acceso)){\n\t\t\t\t$id_contrato=trim($row[\"id_contrato\"]);\n\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pagodeposito(id_pd,id_contrato,fecha_reg,hora_reg,login_reg,fecha_dep,banco,numero_ref,status_pd,tipo_dt,monto_dep,obser_p,id_tb,fecha_conf,hora_conf,login_conf) values \n\t\t\t\t('$id_pd','$id_contrato','$fecha','$hora','$login','$fecha_tb','$id_cuba','$referencia_tb','CONFIRMADO','DEPOSITO','$monto_tb','$descrip_tb','$id_tb','$fecha','$hora','$login')\");\t\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='CONCILIADO' , tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t\t$id_pd=$ini_u.verCoo_inc($acceso,$id_pd);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='NO RELACIONADO', tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t}\n\t\t}\n\treturn $cad;\t\n}",
"public function moverse(){\n\t\techo \"Soy $this->nombre y me estoy moviendo a \" . $this->getVelocidad();\n\t}",
"public function baseSlajderi()\n {\n \n $this->linija = Slajderi::model()->findAllByAttributes(array('jezik'=>Yii::app()->session[\"lang\"]),array('order'=>'id'));\n $this->nalovSlajderi = $this->linija[0] -> naslov;\n \n \n }",
"function cl_rhempenhofolharubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhempenhofolharubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public function ogs()\r\n {\r\n }",
"public function videPanier()\n {\n $this->CollProduit->vider();\n }",
"function cc_ho_vetrina($agenzia, $rif){\n\tglobal $invetrina;\n\t\n\t// $agenzia qua è il numero interno di Cometa\n\tif( isset( $invetrina[$agenzia] ) ){\t\t\n\t\t\n\t\tif ($invetrina[$agenzia]['imm'] == $rif) {\n\t\t\t// questo immobile è in vetrina\n\t\t\t$vetrina = '1';\n\t\t\tcc_import_immobili_error_log($rif.\" è in vetrina\");\n\t\t\t\n\t\t\t// vediamo se è lo stesso di quello che era già in vetrina o meno\n\t\t\t$oldrif = cc_get_rif_vetrina( substr($rif, 0, 2) );\n\t\t\tcc_import_immobili_error_log(\"oldrif: \".$oldrif);\n\t\t\t\n\t\t\t// se l'immobile attualemnte in vetrina non è questo tolgo quello attuale da vetrina\n\t\t\tif($oldrif != $rif) {\n\t\t\t\tcc_updateVetrina($oldrif); \n\t\t\t\tcc_import_immobili_error_log(\"Tolgo vetrina da \".$oldrif);\n\t\t\t}\n\t\t}else{\n\t\t\t$vetrina = '0';\n\t\t}\t\t\n\t\n\t}else{\n\t\t$vetrina = '0';\n\t}\n\t\n\treturn $vetrina;\n}",
"public function stampaDipendenti() {\n echo '<p> Nome: ' . $this->nome . '</p>';\n echo '<p> Cognome: ' . $this->cognome . '</p>';\n echo '<p> Software utilizzati: ' . $this->software . '</p>';\n }",
"private function processarParametros() {\n\n /**\n * Busca os usuarios definidos para notificar quando acordo ira vencer, ordenando pelo dia\n */\n $oDaoMensageriaUsuario = db_utils::getDao('mensagerialicenca_db_usuarios');\n $sSqlUsuarios = $oDaoMensageriaUsuario->sql_query_usuariosNotificar('am16_sequencial', 'am16_dias');\n $rsUsuarios = db_query($sSqlUsuarios);\n $iTotalUsuarios = pg_num_rows($rsUsuarios);\n\n if ($iTotalUsuarios == 0) {\n throw new Exception(\"Nenhum usuário para notificar.\");\n }\n\n /**\n * Percorre os usuarios e define propriedades necessarias para buscar acordos\n */\n for ($iIndiceUsuario = 0; $iIndiceUsuario < $iTotalUsuarios; $iIndiceUsuario++) {\n\n /**\n * Codigo do usuario para notificar: mensageriaacordodb_usuario.ac52_sequencial\n */\n $iCodigoMensageriaLicencaUsuario = db_utils::fieldsMemory($rsUsuarios, $iIndiceUsuario)->am16_sequencial;\n\n /**\n * Codigo dos usuarios que serao notificados\n * - usado para verificar os usuarios que ja foram notificados\n * - mensageriaacordodb_usuario.ac52_sequencial\n */\n $this->aCodigoMensageriaLicencaUsuario[] = $iCodigoMensageriaLicencaUsuario;\n\n /**\n * Usuario para notificar\n * - mensageriaacordodb_usuario\n */\n $oMensageriaLicencaUsuario = MensageriaLicencaUsuarioRepository::getPorCodigo($iCodigoMensageriaLicencaUsuario);\n\n /**\n * Codigo do usuario do sistema\n * - db_usuarios.id_usuario\n */\n $iCodigoUsuario = $oMensageriaLicencaUsuario->getUsuario()->getCodigo();\n\n /**\n * Data de vencimento:\n * - Soma data atual com dias definidos na rotina de parametros de mensageria\n */\n $iDias = $oMensageriaLicencaUsuario->getDias();\n $this->aDataVencimento[] = date('Y-m-d', strtotime('+ ' . $iDias . ' days'));\n }\n\n return true;\n }",
"function control_suplente($desde,$hasta,$id_desig_suplente){\n //busco todas las licencias de la designacion que ingresa\n //novedades vigentes en el periodo\n $anio=date(\"Y\", strtotime($desde)); \n $pdia = dt_mocovi_periodo_presupuestario::primer_dia_periodo_anio($anio);\n $udia = dt_mocovi_periodo_presupuestario::ultimo_dia_periodo_anio($anio);\n $sql=\"SELECT distinct t_n.desde,t_n.hasta \n FROM novedad t_n\n WHERE t_n.id_designacion=$id_desig_suplente\n and t_n.tipo_nov in (2,3,5)\n and t_n.desde<='\".$udia.\"' and t_n.hasta>='\".$pdia.\"'\"\n . \" ORDER BY t_n.desde,t_n.hasta\"; \n $licencias=toba::db('designa')->consultar($sql);\n $i=0;$seguir=true;$long=count($licencias);$primera=true;\n while(($i<$long) and $seguir){\n if($primera){\n $a=$licencias[$i]['desde'];\n $b=$licencias[$i]['hasta'];\n $primera=false;\n }else{\n if($desde>=$licencias[$i]['desde']){\n $a=$licencias[$i]['desde'];\n $b=$licencias[$i]['hasta'];\n }\n if($hasta<=$licencias[$i]['hasta']){\n $seguir=false;\n }\n \n if(($licencias[$i]['desde']==date(\"Y-m-d\",strtotime($b.\"+ 1 days\"))) or ($licencias[$i]['desde']==$b)){\n $b=$licencias[$i]['hasta'];\n }\n }\n $i++;\n }\n if($long>0){\n if($desde>=$a and $hasta<=$b){\n return true;\n }else{\n return false;\n }\n }else{//no tiene novedades\n return false;\n }\n\n// $sql=\"select * from designacion t_d\"\n// . \" INNER JOIN novedad t_n ON (t_d.id_designacion=t_n.id_designacion and t_n.tipo_nov in (2,3,5) )\"\n// . \" where t_d.id_designacion=$id_desig_suplente\"\n// . \" and '\".$desde.\"'>=t_n.desde and '\".$hasta.\"'<=t_n.hasta\";\n// $res=toba::db('designa')->consultar($sql);\n// if(count($res)>0){\n// return true;\n// }else{\n// return false;\n// }\n }",
"function cariPosisi($batas){\nif(empty($_GET['haldatasiswa'])){\n\t$posisi=0;\n\t$_GET['haldatasiswa']=1;\n}\nelse{\n\t$posisi = ($_GET['haldatasiswa']-1) * $batas;\n}\nreturn $posisi;\n}",
"function cl_sau_triagemavulsa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_triagemavulsa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public function contrato()\r\n\t{\r\n\t}",
"public function htmlValue() {\n \n //Tableau Entête\n //- objet de la table_entete \n $arra_module = pnModGetInfo(pnModGetIDFromName($_GET['name']));\n //Si module visuclient affichage site ou groupe(si plusieurs site)\n if ($this->bool_title) {\n if ($arra_module['displayname'] == _DISPLAY_MOD_VISUCLIENT) {\n if ($_SESSION['SITE_CLIENT'] != \"TOUS\") {\n $affichage = str_replace(\"_\", \" \", $_SESSION['SITE_CLIENT']);\n } else {\n $affichage = _ALL_SITE . \"\" . str_replace(\"_\", \" \", $_SESSION['GROUPE_CLIENT']);\n } //Afichage sans underscore mais avec espace\n $obj_font_title0 = new font($arra_module['displayname'] . ' ' . $affichage, true);\n $obj_font_title0->setStyle('font-size:27px');\n } else {\n if ($arra_module['displayname']!=\"\"){\n $obj_font_title0 = new font($arra_module['displayname'] . ' V ' . $arra_module['version'], true);\n $obj_font_title0->setStyle('font-size:27px');\n }\n }\n } else {\n $obj_font_title0 = new font($this->stri_title, true);\n $obj_font_title0->setStyle('font-size:27px');\n }\n\n //LOGO SAVOYELINE\n if ($_SERVER['SERVER_ADDR'] == '10.10.100.98') {\n $obj_img_Savoye = new img(\"images/MaJ_graphique/logo_a_sis_test.gif\");\n $obj_img_Savoye->setStyle(\"cursor:pointer;padding:2px;\");\n $obj_img_Savoye->setBorder(\"0\");\n $obj_img_Savoye->setHeight(\"60px\");\n $obj_img_Savoye->setWidth(\"150px\"); \n $obj_img_Savoye->setTitle(\"Savoyeline\");\n $obj_img_Savoye->setAlt(\"Savoyeline\");\n $obj_a_Savoye = new a(\"http://\" . $_SERVER['SERVER_NAME'] . \"/\", $obj_img_Savoye->htmlValue(), true);\n $obj_a_Savoye->setTarget(\"http://\" . $_SERVER['SERVER_NAME'] . \"/\");\n } else {\n $obj_img_Savoye = new img(\"images/MaJ_graphique/logo_a_sis_gf.png\");\n $obj_img_Savoye->setStyle(\"cursor:pointer;padding:2px;\");\n $obj_img_Savoye->setBorder(\"0\");\n $obj_img_Savoye->setHeight(\"60px\");\n $obj_img_Savoye->setWidth(\"150px\");\n $obj_img_Savoye->setTitle(\"Savoyeline\");\n $obj_img_Savoye->setAlt(\"Savoyeline\");\n $obj_a_Savoye = new a(\"/index.php\", $obj_img_Savoye->htmlValue(), true);\n }\n\n //LOGO ENTREPRISE\n $obj_img_logo = new img($this->CreateLogo());\n //$obj_img_logo->setStyle(\"cursor:pointer;padding:2px;padding-right:10px;\");\n $obj_img_logo->setStyle(\"padding:2px;padding-right:10px;\");\n $obj_img_logo->setBorder(\"0\");\n $obj_img_logo->setTitle($this->getRaisonSociale());\n $obj_img_logo->setAlt($this->getRaisonSociale());\n $obj_img_logo->setHeight(\"60px\");\n $obj_img_logo->setWidth(\"165px\");\n //$obj_a_logo = new a(\"http://\" . $_SERVER['SERVER_NAME'] . \"/\", $obj_img_logo->htmlValue(), true);\n //$obj_a_logo->setTarget(\"http://\" . $_SERVER['SERVER_NAME'] . \"/\");\n\n //Création table \n $obj_table_entete = new table();\n $obj_tr = $obj_table_entete->addTr();\n \n //Bascule\n $obj_a_Savoye=($this->bool_logo_savoye)?$obj_a_Savoye:null;\n\n $obj_td = $obj_tr->addTd($obj_a_Savoye);\n $obj_td->setWidth(\"150px\");\n $obj_td->setRowspan(2);\n $obj_td->setAlign('left');\n\n $obj_td = $obj_tr->addTd($obj_font_title0);\n $obj_td->setAlign('center');\n $obj_td->setStyle('height : 64px;');\n \n //Bascule\n $obj_img_logo=($this->bool_logo_firm)?$obj_img_logo:null;\n\n $obj_td = $obj_tr->addTd($obj_img_logo);\n $obj_td->setWidth(\"150px\");\n $obj_td->setRowspan(2);\n $obj_td->setAlign('right');\n\n if($this->bool_lang)\n {\n $obj_td = $obj_tr->addTd($this->displayLang());\n $obj_td->setWidth(\"180px\");\n $obj_td->setRowspan(2);\n $obj_td->setAlign('right');\n }\n else\n {$obj_td = $obj_tr->addTd(\"\");}\n\n \n $obj_table_entete->setClass(\"titre0\");\n $obj_table_entete->setBorder(\"0\");\n $obj_table_entete->setWidth(\"100%\");\n\n return $obj_table_entete->htmlValue();\n }",
"function gestiondegats($idvaisseauquisefaittirerdessus, $pvvaisseau, $degatdutir, $idarme, $idvaisseauquitire, $idflotteattaquant, $idflottedefenseur, $sensbataille)\r\n {\r\n require __DIR__ . '/../include/bddconnection.php';\r\n $reqdiminuernbtir = $bd->prepare(\"UPDATE c_composantvaisseau SET tirrestant = tirrestant-1 WHERE idtable = ?\");\r\n $reqdiminuernbtir->execute(array($idarme));\r\n\r\n $nvpv = $pvvaisseau - $degatdutir;\r\n $Commentairestour = 'Le vaisseau '.$idvaisseauquisefaittirerdessus.' se fait tirer dessus par le vaisesau '.$idvaisseauquitire.', il perd '.$degatdutir.' PV.<br>';\r\n \r\n $texte1 = '<br>Votre vaisseau ('.$idvaisseauquitire.') vient de tirer sur un vaisseau ennemi ('.$idvaisseauquisefaittirerdessus.'). '.$degatdutir.' dégâts infligés.';\r\n $texte2 = '<br>Votre vaisseau ('.$idvaisseauquisefaittirerdessus.') se fait tirer dessus par un vaisseau ennemi ('.$idvaisseauquitire.'). '.$degatdutir.' dégâts recus.';\r\n\r\n if ($nvpv < 0)\r\n {\r\n $texte1 .= ' Vaisseau détruit.';\r\n $texte2 .= ' Vaisseau détruit.';\r\n\r\n $Commentairestour .= 'Le vaisseau '.$idvaisseauquisefaittirerdessus.' vient de se faire détruire.<br>';\r\n $reqinfopvvaisseau = $bd->prepare(' SELECT p.idjoueurplanete, v.nomvaisseau, f.xflotte, f.yflotte, f.universflotte, v.biensvaisseau, v.titanevaisseau, f.idplaneteflotte\r\n FROM c_vaisseau v\r\n INNER JOIN c_flotte f ON f.idflotte = v.idflottevaisseau\r\n LEFT JOIN c_planete p ON p.idplanete = f.idplaneteflotte\r\n WHERE v.idvaisseau = ?');\r\n $reqinfopvvaisseau->execute(array($idvaisseauquisefaittirerdessus));\r\n $repinfopvvaisseau = $reqinfopvvaisseau->fetch();\r\n\r\n $reqcreerasteroides = $bd->prepare('INSERT INTO c_champsasteroides (xaste , yaste , uniaste, typeitemsaste, quantite) VALUES (?, ?, ?, ?, ?)');\r\n\r\n if ($repinfopvvaisseau['idjoueurplanete'] != 0)\r\n { // On envoit ce message uniquement aux joueurs.\r\n $textemessage = 'Nous avons perdu le vaisseau ' . $repinfopvvaisseau['nomvaisseau'] . ' en ' . $repinfopvvaisseau['xflotte'] . '-' . $repinfopvvaisseau['yflotte'] . ' lors d\\'une bataille spatiale.' ; \r\n $reqmessageinterne = $bd->prepare('INSERT INTO c_messagerieinterne (expediteur , destinataire , lu , titre , texte) VALUES (?, ?, ?, ?, ?)');\r\n $reqmessageinterne->execute(array('Amirauté', $repinfopvvaisseau['idjoueurplanete'], 0, 'Perte d\\'un vaisseau', $textemessage));\r\n }\r\n \r\n // Créer champs d'astéroides : Reprendre le prix du vaisseau\r\n $nbchampsastebien = floor(($repinfopvvaisseau['biensvaisseau'] / 150));\r\n $nbchampsastetitane = floor(($repinfopvvaisseau['titanevaisseau'] / 30));\r\n\r\n if ($nbchampsastebien > 0)\r\n {\r\n $reqcreerasteroides->execute(array($repinfopvvaisseau['xflotte'], $repinfopvvaisseau['yflotte'], $repinfopvvaisseau['universflotte'], 6, $nbchampsastebien));\r\n }\r\n if ($nbchampsastetitane > 0)\r\n {\r\n $reqcreerasteroides->execute(array($repinfopvvaisseau['xflotte'], $repinfopvvaisseau['yflotte'], $repinfopvvaisseau['universflotte'], 8, $nbchampsastetitane));\r\n }\r\n\r\n $reqinfocargo = $bd->prepare(\"SELECT typeitems, quantiteitems FROM c_cargovaisseau WHERE idvaisseaucargo = ?\");\r\n $reqinfocargo->execute(array($idvaisseauquisefaittirerdessus));\r\n while ($repinfocargo = $reqinfocargo->fetch())\r\n { // Cas d'un vaisseau trouvé dans le 1er univers\r\n $reqcreerasteroides->execute(array($repinfopvvaisseau['xflotte'], $repinfopvvaisseau['yflotte'], $repinfopvvaisseau['universflotte'], $repinfocargo['typeitems'], $repinfocargo['quantiteitems']));\r\n }\r\n\r\n // cargovaisseau\r\n $reqdeletecargo = $bd->prepare(\"DELETE FROM c_cargovaisseau WHERE idvaisseaucargo = ?\");\r\n $reqdeletecargo->execute(array($idvaisseauquisefaittirerdessus));\r\n\r\n // composantvaisseau\r\n $reqdeletecomposant = $bd->prepare(\"DELETE FROM c_composantvaisseau WHERE idvaisseaucompo = ?\");\r\n $reqdeletecomposant->execute(array($idvaisseauquisefaittirerdessus));\r\n\r\n // vaisseau\r\n $reqdeletevaisseau = $bd->prepare(\"DELETE FROM c_vaisseau WHERE idvaisseau = ?\");\r\n $reqdeletevaisseau->execute(array($idvaisseauquisefaittirerdessus));\r\n }\r\n else\r\n {\r\n $reqdiminuerpvvaisseau = $bd->prepare('UPDATE c_vaisseau SET HPvaisseau = ? WHERE idvaisseau = ?');\r\n $reqdiminuerpvvaisseau->execute(array($nvpv, $idvaisseauquisefaittirerdessus));\r\n }\r\n\r\n $reqtrouverrapportdecombat = $bd->prepare('SELECT idrapportcombat FROM c_rapportcombat WHERE idflotteattaquant = ? AND idflottedefenseur = ?');\r\n $reqtrouverrapportdecombat->execute(array($idflotteattaquant, $idflottedefenseur));\r\n $reptrouverrapportdecombat = $reqtrouverrapportdecombat->fetch();\r\n\r\n // Vérifier si le rapport existe. Si ce n'est pas le cas, le créer.\r\n if (!isset($reptrouverrapportdecombat['idrapportcombat']))\r\n {\r\n $reqcreerrapportcombat = $bd->prepare('INSERT INTO c_rapportcombat(idflotteattaquant, idflottedefenseur, texteattaquant, textedefenseur) VALUES(?, ?, ?, ?)');\r\n $texteattaquant = 'Début du rapport de combat. Vous attaquez une flotte ('.$idflottedefenseur.').';\r\n $textedefenseur = 'Début du rapport de combat. Vous êtes attaqués par une flotte ('.$idflotteattaquant.').';\r\n $reqcreerrapportcombat->execute(array($idflotteattaquant, $idflottedefenseur, $texteattaquant, $textedefenseur));\r\n }\r\n\r\n if($sensbataille == 1)\r\n {\r\n $textesupplementaireattaquant = $texte1;\r\n $textesupplementairedefenseur = $texte2;\r\n }\r\n elseif($sensbataille == 2)\r\n {\r\n $textesupplementaireattaquant = $texte2;\r\n $textesupplementairedefenseur = $texte1;\r\n }\r\n\r\n // Le compléter.\r\n $requpdaterapportcombat = $bd->prepare('UPDATE c_rapportcombat\r\n SET texteattaquant = concat(texteattaquant, ?), textedefenseur = concat(textedefenseur, ?)\r\n WHERE idflotteattaquant = ? AND idflottedefenseur = ?');\r\n $requpdaterapportcombat->execute(array($textesupplementaireattaquant, $textesupplementairedefenseur, $idflotteattaquant, $idflottedefenseur));\r\n\r\n return $Commentairestour;\r\n }",
"public static function odstraniArtikelIzKosarice() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n\n if (PodrobnostiNarocilaDB::delete($podrobnost_narocila[\"id_podrobnosti_narocila\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n }",
"public function truycapvao_private_cha(){\n }",
"function cl_tfd_bpamagnetico() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_bpamagnetico\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"private function verrouPoser(){\n\t\t$verrou['etat'] = '';\n\t\tself::verrouSupprimer();\n\t\tif($this->formulaire['cle'] != ''){\n\t\t\t$verrou = self::verrouRechercher();\n\t\t\tif(empty($verrou)){\n\t\t\t\t$verrou = self::verrouInserer();\n\t\t\t\t$verrou['etat'] = 'ok';\n\t\t\t}else{\n\t\t\t\t$verrou['etat'] = 'nok';\n\t\t\t\t$verrou['message'] = \"L'enregistrement \".$verrou['ad_ve_cle'].\" est actuellement verrouillé par \".$verrou['ad_ve_nom'].\" depuis le \".$verrou['ad_ve_date'].\".\\nLes modifications, enregistrement et suppression sont donc impossibles sur cet enregistrement.\";\n\t\t\t}//end if\n\t\t}//end if\n\t\treturn $verrou;\n\t}",
"function cariPosisi($batas){\nif(empty($_GET['halgalerifoto'])){\n\t$posisi=0;\n\t$_GET['halgalerifoto']=1;\n}\nelse{\n\t$posisi = ($_GET['halgalerifoto']-1) * $batas;\n}\nreturn $posisi;\n}",
"private function f_ListarValidado(){\n $lobj_AccesoZona = new cls_AccesoZona;\n //creo la peticion\n $pet = array(\n 'operacion' => 'buscarZonas',\n 'codigo_usuario' => $_SESSION['Con']['Nombre']\n );\n //guardo los datos en el objeto y gestiono para obtener una respuesta\n $lobj_AccesoZona->setPeticion($pet);\n $zona = $lobj_AccesoZona->gestionar();\n $cadenaBusqueda = ' where codigo_zona in(';\n if($zona['success'] == 1){\n for($x = 0;$x < count($zona['registros']) - 1; $x++){\n $cadenaBusqueda .= $zona['registros'][$x].',';\n }\n $cadenaBusqueda .= $zona['registros'][count($zona['registros']) - 1].' ';\n }\n $cadenaBusqueda .= \") \";\n $cadenaBusqueda .= ($this->aa_Atributos['valor']=='')?'':\"and nombre_finca like '%\".$this->aa_Atributos['valor'].\"%'\";\n $ls_SqlBase=\"SELECT * FROM agronomia.vfinca $cadenaBusqueda\";\n $orden = ' order by codigo_productor,letra';\n $ls_Sql = $this->f_ArmarPaginacion($ls_SqlBase,$orden);\n $x=0;\n $la_respuesta=array();\n $this->f_Con();\n $lr_tabla=$this->f_Filtro($ls_Sql);\n while($la_registros=$this->f_Arreglo($lr_tabla)){\n $la_respuesta[$x]['codigo']=$la_registros['codigo_productor'];\n $la_respuesta[$x]['nombre']=$la_registros['codigo_productor'].'-'.$la_registros['letra'];\n $la_respuesta[$x]['id_finca']=$la_registros['id_finca'];\n $x++;\n }\n $this->f_Cierra($lr_tabla);\n $this->f_Des();\n $this->aa_Atributos['registros'] = $la_respuesta;\n $lb_Enc=($x == 0)?false:true;\n return $lb_Enc;\n }",
"function iptsr_internal_deb($debata_id) {\n\t$rocnik = cpdb_fetch_one_value(\"select rocnik from debata left join soutez using (soutez_ID) where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t$status = true;\n\tcpdb_transaction();\n\t\n\t// vycistit\n\t$status &= cpdb_exec(\"delete from clovek_debata_ibody where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t// --- debateri\n\t// (podle poharovych bodu)\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_debata.clovek_ID, clovek_debata.debata_ID, :rocnik, 'debater', debata_tym.body * 0.1 from clovek_debata left join debata_tym on clovek_debata.debata_ID = debata_tym.debata_ID and substring(clovek_debata.role,1,1) = elt(debata_tym.pozice + 1,'n','a') where clovek_debata.debata_ID = :debata_id and find_in_set(clovek_debata.role,'a1,a2,a3,n1,n2,n3')\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\t\n\t// --- rozhodci\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_ID, debata_ID, :rocnik, 'rozhodci', 1 from clovek_debata where debata_ID = :debata_id and role = 'r'\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\n\t// --- treneri\n\t$treneri_dostanou = array();\n\t\n\tif (cpdb_fetch_all(\"select clovek_ID, ibody from clovek_debata_ibody where debata_ID = :debata_id and role = 'debater'\", array(\":debata_id\"=>$debata_id), $debateri)) {\n\t\tforeach ($debateri as $debater) {\n\t\t\t$pocet_treneru = cpdb_fetch_all(\"\n\t\t\t\tselect\n\t\t\t\t\tdk.clovek_ID as clovek_ID\n\t\t\t\tfrom\n\t\t\t\t\tclovek d, clovek_klub dk\n\t\t\t\twhere\n\t\t\t\t\td.clovek_ID = :clovek_ID\n\t\t\t\t\tand d.klub_ID = dk.klub_ID\n\t\t\t\t\tand dk.role = 't'\n\t\t\t\t\tand dk.rocnik = :rocnik\n\t\t\t\t\", array(\":clovek_ID\"=>$debater[\"clovek_ID\"], \":rocnik\"=>$rocnik), $treneri);\n\t\t\t\n\t\t\tforeach ($treneri as $trener) {\n\t\t\t\t$treneri_dostanou[$trener[\"clovek_ID\"]] += 0.1 * $debater[\"ibody\"] / $pocet_treneru;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tforeach ($treneri_dostanou as $trener_cid => $trener_ib) {\n\t\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'trener', :ibody)\", array(\":clovek_id\"=>$trener_cid, \":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik, \":ibody\"=>$trener_ib));\n\t}\n\t\n\t// --- organizatori\n\t$dostanou = 0.15; // kolik IB je z debaty\n\t$zasluhy_primych = 1; // defaultni zasluhy u primych ogranizatoru\n\t$celkem_zasluhy = 0;\n\t$zasluhy = array();\n\t\n\t// primi\n\tcpdb_fetch_all(\n\t\t\"select clovek_ID from clovek_debata where clovek_debata.role = 'o' and debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id), $res_primi);\n\t\n\tforeach ($res_primi as $org) {\n\t\t$celkem_zasluhy += $zasluhy_primych;\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $zasluhy_primych;\n\t}\n\t\n\t// neprimi\n\tcpdb_fetch_all(\"\n\t\tselect\n\t\t\tclovek_turnaj.clovek_ID,\n\t\t\tclovek_turnaj.mocnost\n\t\tfrom\n\t\t\tdebata, clovek_turnaj\n\t\twhere\n\t\t\tdebata.debata_ID = :debata_id\n\t\t\tand clovek_turnaj.turnaj_ID = debata.turnaj_ID\n\t\t\tand clovek_turnaj.role = 'o'\n\t\", array(\":debata_id\"=>$debata_id), $res_neprimi);\n\t\n\tforeach($res_neprimi as $org) {\n\t\t$celkem_zasluhy += $org[\"mocnost\"];\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $org[\"mocnost\"];\n\t}\n\t\n\tforeach($zasluhy as $org_cid => $org_zasluhy) {\n\t\t$status &= cpdb_exec(\n\t\t\t\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'organizator', :ibody)\",\n\t\t\tarray(\n\t\t\t\t\":clovek_id\" => $org_cid,\n\t\t\t\t\":debata_id\" => $debata_id,\n\t\t\t\t\":rocnik\" => $rocnik,\n\t\t\t\t\":ibody\" => $dostanou * $org_zasluhy / $celkem_zasluhy\n\t\t\t)\n\t\t);\n\t}\n\t\n\t// zaver\n\tif ($status) {\n\t\tcpdb_commit();\n\t} else {\n\t\tcpdb_rollback();\n\t}\n}",
"function cortDrive(){\n \n // an o xrhsths einai guest (mh syndedemenos): vale sth $_SESSION['cortTable'] ena keno pinaka\n // kai kane return\n if (UserType::$userType != UserType::notAdmin && UserType::$userType != UserType::admin){\n \n $_SESSION['cortTable']=[];\n \n return;\n }\n \n // an den einai orismenh h $_SESSION['cortTable'], arxikopoihsete thn me keno pinaka\n if (! isset($_SESSION['cortTable'])){\n \n $_SESSION['cortTable']=[];\n }\n \n // ta koumpia kalathiou exoyn html name btnPr_i,opou i anhkei [0,1,2,3]. h arithmish\n // mpainei apo aristera pros deksia. Antistoixa einai ta name twn allwn elements\n // ths kathe formas\n // etsi diatrexontai ola ta parathira proiontwn - tsekarete an to post aforouse auta\n // kai sth synexeia diatrexontai ola ta elements ths formas kai kataxwroyntai \n // ston pinaka me onoma $product\n // Se kathe anoigma selidas me koumpi submit kalathiou, mono ena apo ta $_POST['btnPr_' . $i]\n // tha einai orismeno\n // Opote se kathe anoigma ths selidas, an den einai guest o xrhsths\n // tha dhmiourghthei 0 h 1 $product\n \n $products =[];\n \n for ($i=0;$i<6;$i++){\n \n// if (isset($_POST['btnPr_' . $i])){\n if (isset($_POST['prodCode_' . $i])){\n \n $product = [\"prodCode\"=>$_POST['prodCode_' . $i],\n \"quantity\"=>$_POST['quantity_' . $i],\n \"prodValue\"=>$_POST['prodValue_' . $i],\n \"deleted\" => false, // auto exei mpei gia thn periptwsh pou kapoio proion\n // pou exei mpei sto kalathi, mhdenistei h posothta toy\n \"prodName\" => $_POST['prodName_' . $i],\n \"prodStock\" => $_POST['prodStock_' . $i]\n ];\n \n $products [] = $product;\n }\n }\n\n //print_r($products);\n \n \n \n// if (isset($product)){\n// //echo \"yes \";\n// }\n// else{\n// //echo \"no\";\n// }\n\n // an dhmiourghthike ena proion\n foreach ($products as $product){\n \n // arxika tha psaksei an o sugkekrimenos kwdikos proiontos\n // uparxei ston pinaka $_SESSION['cortTable']\n \n // an yparxei, \n // tote an to $product['quantity'] einai 0, tha kanei to deleted bit true, enw\n // an to $product['quantity'] einai <> tou 0, tha kanei to deleted bit false kai tha \n // thesei to $_SESSION['cortTable'][$i]['quantity'] = $product['quantity']\n \n $found=false;\n $nextIndex = count($_SESSION['cortTable']);\n \n for($i=0;$i<$nextIndex;$i++){\n \n if ($_SESSION['cortTable'][$i]['prodCode'] == $product['prodCode']){\n \n if ($product['quantity'] != 0){\n \n $_SESSION['cortTable'][$i]['quantity'] = $product['quantity'];\n $_SESSION['cortTable'][$i]['deleted'] = false;\n }\n \n else {\n \n //unset($_SESSION['cortTable'][$i]);\n //$_SESSION['cortTable'] = array_values($_SESSION['cortTable']);\n \n $_SESSION['cortTable'][$i]['deleted'] = true;\n }\n \n $found=true;\n }\n }\n \n // an den yparxei o sugkekrimenos kwdikos proiontos\n // ston pinaka $_SESSION['cortTable'] kai to $product['quantity']!=0\n // tote vale ston pinaka $_SESSION['cortTable'], ws epomeno element\n // ton pinaka $product\n \n if ($found==false && ($product['quantity']!=0)){\n \n $_SESSION['cortTable'][$nextIndex]=$product;\n } \n }\n }",
"static function setPubblico($id){\n if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');\n else{\n session_start();\n if(!isset($_SESSION['location'])) header('Location: /Progetto/Utente/homepagedef');\n else{\n if(stripos($_SESSION['location'],'Watchlist')!==false && FPersistentManager::exist('id',$id,'FWatchlist')){\n $w=FPersistentManager::load('id',$id,'FWatchlist');\n if($w[0]->getProprietario()==$_SESSION['utente']->getUsername())\n FPersistentManager::update('pubblico',1,'id',$id,'FWatchlist');\n\n }\n\n header('Location: /Progetto'.$_SESSION['location']);\n\n }\n //header('Location: /Progetto/Utente/homepagedef');\n\n }\n}",
"public function generujKod(){\n\t\t//\n\t}",
"function distribuir(){\r\n\t\t$fPesq = new fachada_pesquisador();\r\n\t\t$fAtend = new fachada_atendimento();\r\n\t\t$fSelecao = new fachada_selecao();\r\n\t\t$fOferta = new fachada_oferta();\r\n\t\t$fMax = new fachada_maxbolsa();\r\n\t\t$ano = $_SESSION['sAno'];\r\n\t\t$tpSelecao = $_SESSION['sEdital'];\r\n\t\t// retorna um vetor com as bolsas ofertadas em um edital em determinado ano. (cod,codTipoEdital,codTipoBolsa,ano,prioridade,qtd)\r\n\t\t$vetOfertaBolsas = $fOferta->getOfertasAnoEdital($ano,$tpSelecao);\r\n\t\t$ofertaBolsasGeral = array();\r\n\t\t$qtdOfertaBolsasCapital = 0;\r\n\t\t$qtdOfertaBolsasAF = 0;\r\n\t\t$qtdOfertaBolsasInterior = 0;\r\n\t\t$qtdOfertaBolsasPIBITI = 0;\r\n\t\t\r\n\t\tfor($i=0;$i<count($vetOfertaBolsas);$i++){\r\n\t\t\t// Soma as quantidades de bolsas ofertadas do 1 - CNPq, 2 - UFPA e 3- FAPESPA e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 1) OR ($vetOfertaBolsas[$i]->getPrioridade() == 2) OR ($vetOfertaBolsas[$i]->getPrioridade() == 3) ){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital Capital\r\n\t\t\t\t$qtdOfertaBolsasCapital += $vetOfertaBolsas[$i]->getQtd();\r\n\t\t\t}\r\n\t\t\t// Soma as quantidades de bolsas ofertadas do 4 - CNPq AF e 5 - UFPA AF e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 4) OR ($vetOfertaBolsas[$i]->getPrioridade() == 5) ){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\t\t\t\t\t\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital AF\r\n\t\t\t\t$qtdOfertaBolsasAF += $vetOfertaBolsas[$i]->getQtd();\t\t\r\n\t\t\t}\r\n\t\t\t// Soma a quantidade de bolsas ofertadas do 6 - Interior e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 6)){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\t\t\t\t\t\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital Interior\r\n\t\t\t\t$qtdOfertaBolsasInterior += $vetOfertaBolsas[$i]->getQtd();\t\r\n\t\t\t\t}\r\n\t\t\t// Soma a quantidade de bolsas ofertadas do 7 - PIBITI e atribui ao vetor $ofertaBolsasGeral\r\n\t\t\tif( ($vetOfertaBolsas[$i]->getPrioridade() == 7)){\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][codTipoBolsa] = $vetOfertaBolsas[$i]->getCodTipoBolsa();\r\n\t\t\t\t$ofertaBolsasGeral[$vetOfertaBolsas[$i]->getCodTipoBolsa()][qtdBolsaOfertada] = $vetOfertaBolsas[$i]->getQtd();\t\t\t\t\t\r\n\t\t\t\t//Soma a quantidade de cada bolsa e agrupa no total do subedital Interior\r\n\t\t\t\t$qtdOfertaBolsasPIBITI += $vetOfertaBolsas[$i]->getQtd();\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t} //Fim do FOR\r\n\t\t\r\n\t\t// retorna um vetor com a quantidade m�xima que um pesquisador pode receber de acordo com a pontua��o m�nima. (cod,ponto,qtd,tpselecao,ano)\r\n\t\t$vetMax = $fMax->getMaxbolsaSelecao(); \r\n\r\n\t\t$oferta\t = 0;\r\n\t\t$vetAtend = array();\r\n\t\tif($vetMax and $vetOfertaBolsas ){\r\n\t\t\t$maxqtd = $vetMax[0]->getQtd();\r\n\t\t\tfor($i=0;$i<count($vetOfertaBolsas);$i++){\r\n\t\t\t\t$oferta \t= $oferta + $vetOfertaBolsas[$i]->getQtd(); //Soma das quantidades de bolsas ofertadas em um edital\r\n\t\t\t}\r\n\t\t\t$fSelecao->zeraNumBolsaAtend(); //zera o numero de bolsas atendidas,caso esteja redistribuindo\r\n\t\t\t$fAtend->deletaTodosAt();\t\t //deleta os atendimentos,caso esteja redistribuindo\r\n\t\t\tif($tpSelecao==1){\t\t//problema: considera q os pedidos s�o menores q o disponivel\r\n\t\t\t\t$vetProd = $fPesq->getClassificadosProd(); // retorna os pesquisadores de produtividade inscritos e ativos(nome,id,numBolsa,numBolsaAtend,unidade)\r\n\t\t\t\t\r\n\t\t\t\twhile($l = array_shift($vetProd )){ \r\n\t\t\t\t\t// Retorna um vetor com o(s) tipo(s) de bolsas e quantidade solicitadas pelo pesquisador: tipoConjBolsasSolic,qtdBolsaTipoSolic\r\n\t\t\t\t\t$vTipoBolsasSolicitadas = $fSelecao->getTipoBolsasSolicitadasAno($l[id]);\r\n\t\t\t\t\t$max = $maxqtd; // quantidade m�xima que um pesquisador poder� receber\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($l[numBolsa]>$max){ // se o n�mero de bolsas solicitadas for maior que o n�mero m�ximo de bolsas permitido a um pesquisador\r\n\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($max,$l[id]); // seta no banco de dados o numero de bolsas atendidas igual ao n�mero m�ximo de bolsas permitidas\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// Caso o pesquisador tenha solicitado um tipo de bolsa\r\n\t\t\t\t\t\t\tif (count($vTipoBolsasSolicitadas)==1){\r\n\t\t\t\t\t\t\t\t$vEditalBolsaSolicitada = array_shift($vTipoBolsasSolicitadas);\r\n\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile ($flagProximaBolsa==1){\r\n\t\t\t\t\t\t\t\t\tswitch($vEditalBolsaSolicitada[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolsas CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa],$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>=$l[numBolsa]){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>=$l[numBolsa]){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim fapespa\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Capital if($qtdOfertaBolsasCapital >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim CNPq AF\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas UFPA AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim CNPq AF\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF if($qtdOfertaBolsasAF >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim Interior\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital INTERIOR if($qtdOfertaBolsasINTERIOR >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolsas PIBITI CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>=$l[numBolsa]){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$l[numBolsa]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $l[numBolsa];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($l[numBolsa]+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$l[numBolsa]--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim PIBITI\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI if($qtdOfertaBolsasPIBITI >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t} //Fim while ($flagProximaBolsa=1)\t\r\n\t\t\t\t\t\t\t}// Fim count($vTipoBolsasSolicitadas)==1)\r\n\t\t\t\t\t\t\telseif (count($vTipoBolsasSolicitadas)==2){\r\n\t\t\t\t\t\t\t\t$qtdBolsasSolic = 1;\r\n\t\t\t\t\t\t\t\t// Caso o pesquisador j� tenha recebido alguma bolsa durante a distribui��o atual de bolsas\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile($bolsaSolic = array_shift($vTipoBolsasSolicitadas)){\r\n\t\t\t\t\t\t\t\t\tswitch($bolsaSolic[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim fapespa\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Capital\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq af\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa af\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim Interior\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Interior\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim PIBITI\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI\r\n\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t}// while\r\n\t\t\t\t\t\t\t} // elseif (count($vTipoBolsasSolicitadas)==2)\r\n\t\t\t\t\t\t} // Fim do else ($l[numBolsa]>$max)\r\n\t\t\t\t}//FIM DO WHILE DE ARRAY DE PESQUISADORES DE PRODUTIVIDADE\r\n\t\t\t}// fim do if $tpSelecao==1\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$vetPesqPontos = $fPesq->getClassificadosPonto(); //retorna a rela��o de pesquisadores por ordem de pontua��o.\r\n\t\t\t\r\n\t\t\t// INICIO DA ORDENA��O DO VETOR DE PONTUA��O\r\n\t\t\t\r\n\t\t\tforeach($vetPesqPontos as &$vetor){\r\n \t\t\t$anoNota = $_SESSION['sAno']-1;\r\n\t\t\t\t\r\n\t\t\t\tif ($this->getSelecaoNotaPesq($vetor[id],$anoNota)){\r\n\t\t\t\t\t$notaPesquisador = $this->getSelecaoNotaPesq($vetor[id],$anoNota);\r\n\t\t\t\t}\r\n\t\t\t\telse $notaPesquisador = 0;\r\n\t\t\t\t$vetor[ponto] = $vetor[ponto] + ($notaPesquisador*0.025*$vetor[ponto]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach ($vetPesqPontos as $chave => $linha) { \r\n\t\t\t\t$nome[$chave] = $linha['nome']; \r\n\t\t\t\t$id[$chave] = $linha['id']; \r\n\t\t\t\t$numBolsa[$chave] = $linha['numBolsa']; \r\n\t\t\t\t$unidade[$chave] = $linha['unidade']; \r\n\t\t\t\t$ponto[$chave] = $linha['ponto']; \r\n\t\t\t} \r\n\r\n\t\t\tarray_multisort($ponto, SORT_DESC, $nome, SORT_ASC, $vetPesqPontos);\r\n\t\t\t// FIM DA ORDENA��O DO VETOR DE PONTUA��O\r\n\r\n\t\t\t//foreach ($vetPesqPontos as $vetor) { \r\n\t\t\t//\techo \"O nome do pesquisadador (ID: \".$vetor[id].\") � \".$vetor[nome].\", sua pontua��o � \".$vetor[ponto].\"<br>\";\r\n\t\t\t//}\r\n\r\n\t\t\twhile($l = array_shift($vetPesqPontos)){\r\n\t\t\t\t$valorAtendido = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//verifica se ainda h� bolsa para distribuir\r\n\t\t\t\tif (($qtdOfertaBolsasCapital > 0) || ($qtdOfertaBolsasAF > 0) || ($qtdOfertaBolsasInterior > 0) || ($qtdOfertaBolsasPIBITI > 0)){\r\n\t\r\n\t\t\t\t\t$vBolsasAtivasPesq = $this->getBolsaAtivaPesqAno($l[id],2014); //verifica se determinado pesquisador possui bolsa em vigor\r\n\t\t\t\t\tif($vBolsasAtivasPesq){\r\n\t\t\t\t\t\t$numbolAtivas = count($vBolsasAtivasPesq); // quantidade de bolsas ativas de um pesquisador\r\n\t\t\t\t\t} else $numbolAtivas = 0;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$ponto = $l[ponto]; // pontua��o do pesquisador\r\n\t\t\t\t\t$maxBolsaPorPontuacao = 0;\r\n\t\t\t\t\t// verfica a quantidade m�xima que o pesquisador poder� receber comparando as pontua��es m�nima e m�xima. \r\n\t\t\t\t\t//Por exemplo, pontua��o > 300 pontos -> $max=2; pontua��o > 0 pontos -> $max=1;\r\n\t\t\t\t\tfor ($i=0;$i<count($vetMax);$i++){\r\n\t\t\t\t\t\tif($ponto >= $vetMax[$i]->getPonto()){\r\n\t\t\t\t\t\t\t$maxBolsaPorPontuacao = $vetMax[$i]->getQtd();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Caso a soma da quantidade m�xima de bolsas permitidas com o n�mero de bolsas ativas de um pesquisador exceda 2\r\n\t\t\t\t\t$BolsasPesqPodeReceber = $maxBolsaPorPontuacao;\r\n\t\t\t\t\twhile(($BolsasPesqPodeReceber+$numbolAtivas)>2){\r\n\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Quantidade de bolsas que o pesquisador pode receber\t\t\t\t\r\n\t\t\t\t\tif($BolsasPesqPodeReceber>$l[numBolsa]){\r\n\t\t\t\t\t\t$BolsasPesqPodeReceber = $l[numBolsa];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Retorna um vetor com o(s) tipo(s) de bolsas e quantidade solicitadas pelo pesquisador: tipoSubEdital,qtdBolsa\r\n\t\t\t\t\t$vTipoBolsasSolicitadas = $fSelecao->getTipoBolsasSolicitadasAno($l[id]);\r\n\r\n\t\t\t\t\t\t// Caso o pesquisador tenha solicitado um tipo de bolsa\r\n\t\t\t\t\t\t\tif (count($vTipoBolsasSolicitadas)==1){\r\n\t\t\t\t\t\t\t\t$vEditalBolsaSolicitada = array_shift($vTipoBolsasSolicitadas);\r\n\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile ($flagProximaBolsa==1){\r\n\r\n\t\t\t\t\t\t\t\t\tswitch($vEditalBolsaSolicitada[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber,$l[id]);\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){ \r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim fapespa\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Capital if($qtdOfertaBolsasCapital >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim CNPq AF\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolas CNPq AF � suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim UFPA AF\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF if($qtdOfertaBolsasAF >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolsas Interior suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim Interior\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Interior if($qtdOfertaBolsasInterior >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\techo \"Nenhuma das op��es.\";\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas PIBITI\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// Verifica se o n�mero de bolsas PIBITI suficiente para atender a quantidade solicitada pelo pesq\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>=$BolsasPesqPodeReceber){\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$BolsasPesqPodeReceber);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $BolsasPesqPodeReceber;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($BolsasPesqPodeReceber+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada] -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI -= $qtdBolsasSolic;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$BolsasPesqPodeReceber--;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} // Fim PIBITI\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI if($qtdOfertaBolsasPIBITI >0)\r\n\t\t\t\t\t\t\t\t\t// Caso o subedital n�o possua mais bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\telse $flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\techo \"Nenhuma das op��es.\";\r\n\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t} //Fim while ($flagProximaBolsa=1)\t\r\n\t\t\t\t\t\t\t}// Fim count($vTipoBolsasSolicitadas)==1)\r\n\t\t\t\t\t\t\telseif (count($vTipoBolsasSolicitadas)==2){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$qtdBolsasSolic = 1;\r\n\t\t\t\t\t\t\t\t// Caso o pesquisador j� tenha recebido alguma bolsa durante a distribui��o atual de bolsas\r\n\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 0;\r\n\t\t\t\t\t\t\t\twhile($bolsaSolic = array_shift($vTipoBolsasSolicitadas)){\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tswitch($bolsaSolic[\"tipoConjBolsasSolic\"]){\r\n\t\t\t\t\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Capital ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasCapital >0){\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[1][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[1][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[1][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[2][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[2][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[2][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas FAPESPA\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[4][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[4][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[4][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasCapital--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim fapespa\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Capital\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"2\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital AF ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasAF >0){\r\n\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas CNPq AF\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[5][qtdBolsaOfertada]>0){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[5][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[5][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim cnpq af\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas UFPA AF\r\n\t\t\t\t\t\t\t\t\t\telseif ($ofertaBolsasGeral[6][qtdBolsaOfertada]>0){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[6][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\t\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[6][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasAF--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim ufpa af\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital AF\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"3\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital Interior ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasInterior >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas Interior\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[3][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[3][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[3][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasInterior--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim Interior\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital Interior\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tcase \"4\":\r\n\t\t\t\t\t\t\t\t\t// Verifica se o subedital PIBITI ainda possui bolsas dispon�veis\r\n\t\t\t\t\t\t\t\t\tif($qtdOfertaBolsasPIBITI >0){\r\n\t\t\t\t\t\t\t\t\t\t// Verifica se ainda h� bolsas PIBITI\r\n\t\t\t\t\t\t\t\t\t\tif ($ofertaBolsasGeral[8][qtdBolsaOfertada]>0){\r\n\t\t\t\t\t\t\t\t\t\t\t// instancia um objeto da classe Atendimento\r\n\t\t\t\t\t\t\t\t\t\t\t$oAtend = $fAtend->atendimento($l[id],$ano,$ofertaBolsasGeral[8][codTipoBolsa],$qtdBolsasSolic);\r\n\t\t\t\t\t\t\t\t\t\t\t$fAtend->insere($oAtend); //insere o objeto no banco de dados\r\n\t\t\t\t\t\t\t\t\t\t\t$ofertaBolsasGeral[8][qtdBolsaOfertada]--;\r\n\t\t\t\t\t\t\t\t\t\t\t$qtdOfertaBolsasPIBITI--;\r\n\t\t\t\t\t\t\t\t\t\t\t$fSelecao->updateNumBolsaAtend($qtdBolsasSolic+$algumaBolsaJaAtendida,$l[id]);\r\n\t\t\t\t\t\t\t\t\t\t\t// Zera a vari�vel para ser utilizada com o pr�ximo pesquisador\r\n\t\t\t\t\t\t\t\t\t\t\t$algumaBolsaJaAtendida = 1;\r\n\t\t\t\t\t\t\t\t\t\t} // Fim PIBITI\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t} // fim subedital PIBITI\r\n\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tdefault: \r\n\t\t\t\t\t\t\t\t\t\t$flagProximaBolsa=0;\r\n\t\t\t\t\t\t\t\t\t\techo \"Nenhuma das op��es.\";\r\n\t\t\t\t\t\t\t\t\t} //final switch\r\n\t\t\t\t\t\t\t\t}// while\r\n\t\t\t\t\t\t\t} // elseif (count($vTipoBolsasSolicitadas)==2)\r\n\t\t\t\t}//if (($qtdOfertaBolsasCapital) OR ($qtdOfertaBolsasAF) OR ($qtdOfertaBolsasInterior))\r\n\t\t\t}//fim while naum producao\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t} //fim if($vetMax and $vetOfertaBolsas )\r\n\t}",
"function cariPosisi($batas){\nif(empty($_GET['halhasillulusadministrasi'])){\n\t$posisi=0;\n\t$_GET['halhasillulusadministrasi']=1;\n}\nelse{\n\t$posisi = ($_GET['halhasillulusadministrasi']-1) * $batas;\n}\nreturn $posisi;\n}",
"private static function Najdi_kolize ($query,$iducast){\r\n $kolize_pole = array();\r\n $dbh = Projektor2_AppContext::getDB();\r\n \r\n //echo \" <br>\". $query . \" \" . $iducast;\r\n \r\n //--\r\n Projektor2_Table_UcKolizeData::$zjistovane_kolize=array();\r\n Projektor2_Table_UcKolizeData::$nastava_kolize_ve_zjistovanych = false; \r\n //echo \"NAJDI KOLIZE\";\r\n \r\n try { \r\n $sth = $dbh->prepare($query);\r\n $succ = $sth->execute();\r\n while($zaznam_s_kolize = $sth->fetch(PDO::FETCH_ASSOC)) { //pro pozadovane kontroly (kolize) sestavuji dotazy\r\n //var_dump($zaznam_s_kolize);\r\n //--\r\n array_push (Projektor2_Table_UcKolizeData::$zjistovane_kolize, $zaznam_s_kolize['id_s_typ_kolize']);\r\n //echo \"Table_UcKolizeData::zjistovane_kolize\"; var_dump(Table_UcKolizeData::$zjistovane_kolize);\r\n \r\n //ze zjistenych udaju sestavuji dotazy na kolize\r\n $query_kolize = self::Sestav_dotaz_na_kolizi($zaznam_s_kolize['zobrazovany_text_kolize'], $zaznam_s_kolize['select_text'], $zaznam_s_kolize['from_text'], $zaznam_s_kolize['where_text'] );\r\n //echo \"<br>*id_s_typ_kolize a dotaz na kolizi*|\" . $zaznam_s_kolize['id_s_typ_kolize'] ;\r\n //echo \" |<br>\". $query_kolize;\r\n \r\n if ($query_kolize) {\r\n $sth = $dbh->prepare($query_kolize);\r\n $succ = $sth->execute($iducast); \r\n \r\n //while ($zaznam_kolize = $data_kolize->fetch()) { \r\n $zaznam_kolize = $sth->fetch(PDO::FETCH_ASSOC);\r\n //echo \"<br>zaznam_kolize\" ; var_dump( $zaznam_kolize );\r\n \r\n if ( $zaznam_kolize['kolize_nastala'] ) { // kolize nastava\r\n // echo \"<br>\" . $zaznam_kolize['kolize_nastala'];\r\n //--/\r\n Projektor2_Table_UcKolizeData::$nastava_kolize_ve_zjistovanych = true; // nastavi priznak, ze alespon jedna zjistovana kolize skutecne nastava\r\n \r\n // ***minula*** - kolize nastava, je treba z uc_kolize_table precist ulozena data pokud uz kolize byla a !je! validni\r\n // hledat podle iducast, id s kolize , formular-nemusi, lokace-nemusi\r\n $query_minula = \"SELECT * FROM uc_kolize_table left join s_typ_kolize on (s_typ_kolize.id_s_typ_kolize = uc_kolize_table.id_s_typ_kolize_FK) \" .\r\n \"WHERE id_ucastnik=\" . $iducast .\r\n //\" and s_typ_kolize.formular='\" . $formular .\"'\" .\r\n //\" and s_typ_kolize.lokace_kolize='\" . $lokacekolize .\"'\" .\r\n \" and s_typ_kolize.id_s_typ_kolize=\" . $zaznam_s_kolize['id_s_typ_kolize'] . \r\n \" and uc_kolize_table.valid\" ; \r\n //echo \"<br>query_minula: \" .$query_minula;\r\n $sth = $dbh->prepare($query_minula);\r\n $suvv = $sth->execute();\r\n $zaznam_minula = $sth->fetch(PDO::FETCH_ASSOC);\r\n //var_dump ($zaznam_minula);\r\n \r\n if ($zaznam_minula) {\r\n $kolize = new Projektor2_Table_UcKolizeData($iducast, $zaznam_s_kolize['id_s_typ_kolize'],\r\n $zaznam_minula['revidovano'], $zaznam_minula['revidovano_pozn'],\r\n $zaznam_minula['date_vzniku'], $zaznam_kolize['kolize_nastala'],\r\n $zaznam_s_kolize['nazev_kolize'], \r\n $zaznam_kolize['zobrazovany_text_kolize'] , $zaznam_s_kolize['uroven_kolize'] , $zaznam_s_kolize['lokace_kolize'],\r\n $zaznam_minula['id_uc_kolize_table']);\r\n }\r\n else {\r\n $kolize = new Projektor2_Table_UcKolizeData($iducast, $zaznam_s_kolize['id_s_typ_kolize'],\r\n null, null,\r\n null, $zaznam_kolize['kolize_nastala'],\r\n $zaznam_s_kolize['nazev_kolize'],\r\n $zaznam_kolize['zobrazovany_text_kolize'] , $zaznam_s_kolize['uroven_kolize'] , $zaznam_s_kolize['lokace_kolize'],\r\n null);\r\n }\r\n //var_dump($kolize); \r\n $kolize_pole[] = $kolize;\r\n \r\n \r\n \r\n } //- kolize nastava\r\n \r\n else { // kolize nenastava nevim zda i u kolize ktera nenastava mam naplnovat informace z uc_kolize_table (revidovano....)\r\n $kolize = new Projektor2_Table_UcKolizeData($iducast, $zaznam_s_kolize['id_s_typ_kolize'],\r\n null, null,\r\n null, $zaznam_kolize['kolize_nastala'],\r\n $zaznam_s_kolize['nazev_kolize'],\r\n $zaznam_kolize['zobrazovany_text_kolize'] , $zaznam_s_kolize['uroven_kolize'] , $zaznam_s_kolize['lokace_kolize'],\r\n null);\r\n \r\n $kolize_pole[] = $kolize; \r\n \r\n }\r\n \r\n //}//while\r\n \r\n }//if query \r\n \r\n } // while - pro pozadovane kontroly (kolize) sestavuji dotazy\r\n } //try\r\n catch (Exception $e) {\r\n\t//header(\"Location: ./login.php?originating_uri=\".$_SERVER['REQUEST_URI']);\r\n \r\n }\r\n//echo \"<br>**Kolize_pole v Najdi_kolize..... **\";\r\n//var_dump($kolize_pole);\r\n \r\n return $kolize_pole;\r\n \r\n}",
"function rekamMedis($nomor_pasien)\n\t{\n\n\t}"
] | [
"0.65236425",
"0.6050779",
"0.60170317",
"0.5945462",
"0.5827543",
"0.57499284",
"0.5735956",
"0.57131404",
"0.564948",
"0.56271726",
"0.56250745",
"0.5609532",
"0.5592202",
"0.5572959",
"0.5547439",
"0.55439174",
"0.5531015",
"0.55304086",
"0.55072117",
"0.545865",
"0.5452569",
"0.5445323",
"0.5419057",
"0.54076743",
"0.54007715",
"0.5375976",
"0.5371054",
"0.5348116",
"0.5343475",
"0.53256094",
"0.53047395",
"0.5299677",
"0.5296123",
"0.5284627",
"0.52770483",
"0.52608746",
"0.52503914",
"0.52496475",
"0.5246731",
"0.5246078",
"0.5241475",
"0.52414113",
"0.5239439",
"0.52295005",
"0.5204089",
"0.5197232",
"0.51966995",
"0.51903504",
"0.51898265",
"0.51820415",
"0.51813126",
"0.51799464",
"0.5162797",
"0.51599777",
"0.51582193",
"0.51511335",
"0.51408595",
"0.5139458",
"0.5136988",
"0.5134179",
"0.513175",
"0.51316744",
"0.5120993",
"0.511086",
"0.5105058",
"0.51046824",
"0.5097342",
"0.5095117",
"0.50929266",
"0.5091678",
"0.5084892",
"0.50805444",
"0.50774515",
"0.5074484",
"0.50741386",
"0.507407",
"0.50697184",
"0.5069162",
"0.50675195",
"0.5067215",
"0.506635",
"0.50619465",
"0.50601584",
"0.5059156",
"0.5058434",
"0.5056647",
"0.5054352",
"0.5053258",
"0.5049919",
"0.50461316",
"0.5041859",
"0.5039714",
"0.50369483",
"0.50238293",
"0.50232583",
"0.50226426",
"0.5020075",
"0.50181687",
"0.5017502",
"0.5015396",
"0.5015198"
] | 0.0 | -1 |
Read data length (1 byte) | function op_pushdata1(&$stack, &$bytecode, &$return) {
$size = unpack('C', substr($bytecode, 0, 1))[1];
// Push data on the stack
array_push($stack, substr($bytecode, 1, $size));
// Skip the data we just pushed on stack
$bytecode = substr($bytecode, $size+1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function read($length);",
"public function read($length);",
"public function read($length);",
"public function getLength()\n {\n return strlen($this->data);\n }",
"public function readBytes($length) {}",
"public function read($length)\n {\n }",
"function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}",
"function getPayloadLength();",
"public function getLengthBytes()\n {\n return $this->length_bytes;\n }",
"public function getBytesRead(): int\n {\n return $this->content->bytesRead();\n }",
"public function getLen()\n {\n return $this->_len;\n }",
"public function read($length) {\n $this->waitForData();\n return $this->readData($length);\n }",
"public function get_data_length() {\n return $this->duration;\n }",
"private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}",
"public static function sl($data)\n {\n return strlen($data);\n }",
"protected function getSize()\n {\n return strlen($this->data);\n }",
"protected function _read($length) {\n $data = false;\n if (!feof($this->_socket)) {\n $data = fread($this->_socket, $length);\n }\n return $data;\n }",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength();",
"public function length()\n {\n return strlen($this->buffer);\n }",
"public function pipe($length)\n {\n $data = $this->connection->read($length);\n $this->buffer .= $data;\n\n return strlen($data);\n }",
"public function getLength() : int\n {\n return $this->b[$this->offset];\n }",
"public function NextReadSize() {\n switch($this->state) {\n case INITIAL:\n case IN_HEADER:\n case ENDOFDATA:\n return 1;\n case DATA:\n return $this->length - $this->position;\n case SUCCESS:\n return 0;\n default:\n throw new Exception(\"Invalid decoder state $this->state\");\n }\n }",
"public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}",
"private function fread($length) {\n\t\t$data = fread($this->stream, $length);\n\t\t$this->contentIndex += strlen($data);\n\t\t$this->checkReadTimeout();\n\n\t\treturn $data;\n\t}",
"private function readData($length) {\n $result = '';\n while ($length > 0) {\n $bytesToRead = self::CHUNK_SIZE < $length\n ? self::CHUNK_SIZE : $length\n ;\n $result .= socket_read($this->communicationSocket, $bytesToRead);\n $length -= self::CHUNK_SIZE;\n }\n\n return $result;\n }",
"public function read($len) {\n if (strlen($this->rbuffer_) > 0) {\n $ret = substr($this->rbuffer_, 0, $len);\n $this->rbuffer_ = substr($this->rbuffer_, $len);\n return $ret;\n }\n\n $data = $this->transport_->readAll(4);\n $array = unpack('Nlength', $data);\n $length = $array['length'];\n\n $this->rbuffer_ = $this->transport_->readAll($length);\n $ret = substr($this->rbuffer_, 0, $len);\n $this->rbuffer_ = substr($this->rbuffer_, $len);\n return $ret;\n }",
"abstract public function getLength();",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\r\n {\r\n return $this->length;\r\n }",
"public function getLength() {\r\n return $this->length;\r\n }",
"public function getLength() {\n return $this->_length;\n }",
"private function getSize()\n {\n $this->seek($this->offset);\n\n return $this->readLong();\n }",
"public function getLength(): int;",
"public function getLength(): int;",
"function getLength(): int\n {\n return $this->length;\n }",
"function getSize(): int {\n return \\strlen($this->buffer);\n }",
"public function getLength() {\n \n return $this->_length;\n }",
"public function length()\n {\n return count($this->__data);\n }",
"public function read($length)\n {\n return fread($this->stream, $length);\n }",
"public function stream_read(int $length)\n\t{\n\t\treturn fread($this->tempHandle, $length);\n\t}",
"public function getLen()\n {\n $value = $this->get(self::LEN);\n return $value === null ? (integer)$value : $value;\n }",
"public function length() {\n \n return $this->getLength();\n }",
"public function read($length = null)\n {\n // TODO: Implement read() method.\n }",
"protected function nextRecordLength()\r\n\t{\r\n\t\tlist($size, $temp) = ['', ''];\r\n\t\t\r\n\t\twhile ($temp != \",\" and $this->hasNext()) {\r\n\t\t\t$size .= $temp;\r\n\t\t\t$temp = Bin::toStr($this->readBits());\r\n\t\t}\r\n\r\n\t\treturn intval($size);\r\n\t}",
"public function length()\n {\n return $this->length;\n }",
"function getContentLength(){\n\t\treturn $this->_OutputBuffer->getLength();\n\t}",
"public function read($length)\n {\n return $this->fread($length);\n }",
"public function length() {\r\n return strlen($this->contents);\r\n }",
"public function read($length) {\n\n $readArray = array($this->client);\n $writeArray = array();\n $errorArray = array();\n $count = swoole_client_select($readArray, $writeArray, $errorArray, 1);\n foreach($readArray as $client) {\n $data = $client->recv($length);\n }\n $dataArray = unpack(\"N\", $data);\n $length = $dataArray[1];\n $data = $length . substr($data, -$length);\n return $data;\n }",
"public function length();",
"public function length();",
"function read_data_packet($socket, &$buffer) {\n\tread_from_socket($socket, $countSize, 1);\n\t// read data length\n\tread_from_socket($socket, $readCount, $countSize);\n\t$expectedReadCount = $readCount;\n\t// read data\n $readCount = read_from_socket($socket, $buffer, $readCount);\n\tif ($readCount == $expectedReadCount)\n\t return $readCount;\n\telse\n\t return FALSE;\n}",
"public function getLength()\n {\n return $this->int_length;\n }",
"public function hasDataLength(){\n return $this->_has(6);\n }",
"public function downloadlength() {\n return $this->info['download_content_length'];\n }",
"public function read($length)\n {\n return false;\n }",
"function Read($length=1) \r\n{ \r\nif(intval($length) <= 0) \r\n{ \r\n$this->LastError = \"Cannot read zero or less bytes\"; \r\nreturn null; \r\n} \r\n//** no connection is available to read from, no data can be read. \r\n\r\nelse if(!$this->isOpen()) \r\n{ \r\n$this->LastError = \"No connection available for reading\"; \r\nreturn null; \r\n} \r\nelse //** a valid connection identifier is available. \r\n{ \r\n$this->_SetTimeout(); //** ensure timeout is set. \r\nreturn fread($this->Socket, $length); //** attempt to read n-bytes. \r\n} \r\n}",
"public function getSize()\n {\n return $this->length;\n }",
"public function readBytes($length, $pos = null) {}",
"public function readBytes($length, $pos = null) {}",
"public function read($start = 0, $length) {}",
"public function read($length, $untilDataEnough = true)\n {\n $data = $this->peek($length, $untilDataEnough);\n\n if($data) {\n $this->buffer = substr($this->buffer, strlen($data));\n }\n\n return $data;\n }",
"public function read($len) {\r\n\t\tif($len<0) {\r\n\t\t\tthrow new Curly_Stream_Exception('The given length '.$len.' is invalid for a read operation. Only positive values area valid.');\r\n\t\t}\r\n\t\t\r\n\t\t$read='';\r\n\t\t$readLen=0;\r\n\t\t\r\n\t\t// Read from every stream, until we have enough data\r\n\t\tforeach($this->_streams as $stream) {\r\n\t\t\t$read.=$stream->read($len-$readLen);\r\n\t\t\t\r\n\t\t\t// Enough data read\r\n\t\t\t$readLen=strlen($read);\r\n\t\t\tif($readLen==$len) {\r\n\t\t\t\treturn $read;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->shift();\r\n\t\t}\r\n\t\t\r\n\t\t// So, not enough data found, but return what we´ve got.\r\n\t\treturn $read;\r\n\t}",
"function getLength(): ?int;",
"public function getContentLength() { return $this->content_length; }",
"public function get_data_length() {\n return $this->pages;\n }",
"public function getContentLength() {\r\n return $this->__contentLength;\r\n }",
"public function length() : int;",
"public function readLine($length = 1024) {}",
"public function length()\n {\n return UTF8::strlen($this->str, $this->encoding);\n }",
"function readIntLength(): ?int {\n $f = $this->readInt1();\n if($f <= 250) {\n return $f;\n }\n \n if($f === 251) {\n return null;\n }\n \n if($f === 252) {\n return $this->readInt2();\n }\n \n if($f === 253) {\n return $this->readInt3();\n }\n \n return $this->readInt8();\n }",
"public function read($len = 1024) {\n\t\treturn fread($this->fp, $len);\n\t}",
"public function readBytes($length, $pos = null);",
"public function read($length) {\n\t\tif (! $this->readable) {\n\t\t\tthrow new RuntimeException(\"Stream is not readable\");\n\t\t}\n\t\treturn fread($this->handle, $length);\n\t}",
"public function read($length = 0)\n {\n if ($this->offset >= strlen($this->data)) {\n if ($this->throw === true) {\n throw new \\RuntimeException('EOF');\n }\n\n return false;\n }\n\n if ($length <= 0 || $this->offset + $length >= strlen($this->data)) {\n $length = strlen(substr($this->data, $this->offset));\n }\n\n $offset = $this->offset;\n $this->offset += $length;\n\n return substr($this->data, $offset, $length);\n }",
"public function getPacketLength() : int {\n return $this->iPacketLength;\n }",
"public function getSize(): int\n {\n return $this->buffer->getSize();\n }",
"public function read($length)\n {\n $data = empty($length) ? '' : fread($this->stream, $length);\n if ($data === false) {\n throw new RuntimeException('Could not read stream');\n }\n return $data;\n }",
"public function readLine($length = 1024);",
"function getLength() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_LENGTH);\n\t}",
"public function length() {\r\n return filesize($this->fullName());\r\n }",
"public function getFullLength()\n {\n $cmd_length = 1;\n\n $rl_length = strlen($this->remaining_length_bytes);\n\n return $cmd_length + $rl_length + $this->remaining_length;\n }",
"protected function get_line_len()\n {\n return count($this->buffer);\n }",
"public function flowControlledLength()\n {\n $padding_len = ($this->padding_length) ? $this->padding_length + 1 : 0;\n return strlen($this->data) + $padding_len;\n }",
"function stream_read( $count ) {\r\n\t\tif ( ! isset( $this->data_ref ) ) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$ret = substr( $this->data_ref, $this->position, $count );\r\n\r\n\t\t$this->position += strlen( $ret );\r\n\t\treturn $ret;\r\n\t}",
"public function read($length)\n\t{\n\t\t$this->checkClosed();\n\t\t$buffer = '';\n\t\twhile (\\mb_strlen($buffer, '8BIT') < $length) {\n\t\t\t$result = \\socket_read($this->socket, $length - mb_strlen($buffer, '8BIT'));\n\t\t\tif (false === $result) {\n\t\t\t\t$this->throwException();\n\t\t\t}\n\t\t\t$buffer .= $result;\n\t\t}\n\t\treturn $buffer;\n\t}",
"public function stream_read($count) {\r\n\t\t$ret = substr($this->data, $this->pos, $count);\r\n\t\t$this->pos += strlen($ret);\r\n\t\t\r\n\t\treturn $ret;\r\n\t}",
"function length(): int;",
"public function getLength($atOffset = false);",
"public function length()\n {\n return $this->provider->length();\n }"
] | [
"0.7440475",
"0.7440475",
"0.7440475",
"0.73347795",
"0.7211564",
"0.7188012",
"0.6990548",
"0.6979004",
"0.6957159",
"0.69172305",
"0.69170964",
"0.690911",
"0.6899816",
"0.68776107",
"0.68767524",
"0.6876467",
"0.68642706",
"0.6862342",
"0.6862268",
"0.6862268",
"0.6862268",
"0.6861057",
"0.6843594",
"0.68414444",
"0.68243176",
"0.67762655",
"0.6764581",
"0.67384404",
"0.67179066",
"0.67026365",
"0.6687681",
"0.66820526",
"0.66820526",
"0.66820526",
"0.66820526",
"0.66820526",
"0.66820526",
"0.66820526",
"0.66820526",
"0.66707104",
"0.66564417",
"0.66521865",
"0.66220486",
"0.66124094",
"0.66124094",
"0.65966487",
"0.658234",
"0.65779144",
"0.65540886",
"0.65247405",
"0.6505894",
"0.649185",
"0.64876133",
"0.64860344",
"0.6483907",
"0.6474087",
"0.6472251",
"0.6471975",
"0.64595044",
"0.643664",
"0.64329726",
"0.64329726",
"0.64049476",
"0.6328145",
"0.63163906",
"0.6312599",
"0.63120353",
"0.6310724",
"0.6308522",
"0.63022375",
"0.63022375",
"0.62931883",
"0.6288618",
"0.62880963",
"0.6277609",
"0.6264458",
"0.62543726",
"0.6222899",
"0.6209342",
"0.6194497",
"0.6177175",
"0.6169078",
"0.6163405",
"0.61585474",
"0.61460745",
"0.61220425",
"0.6106682",
"0.61041456",
"0.609778",
"0.6096415",
"0.60960287",
"0.60821533",
"0.6067939",
"0.60650694",
"0.605433",
"0.60531765",
"0.60477006",
"0.6036991",
"0.603564",
"0.60295886",
"0.60221046"
] | 0.0 | -1 |
Read data length (2 bytes) | function op_pushdata2(&$stack, &$bytecode, &$return) {
$size = unpack('v', substr($bytecode, 0, 2))[1];
// Push data on the stack
array_push($stack, substr($bytecode, 2, $size));
// Skip the data we just pushed on stack
$bytecode = substr($bytecode, $size+2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function read($length);",
"public function read($length);",
"public function read($length);",
"public function readBytes($length) {}",
"public function read($length)\n {\n }",
"public function getLength()\n {\n return strlen($this->data);\n }",
"function getPayloadLength();",
"private function readData($length) {\n $result = '';\n while ($length > 0) {\n $bytesToRead = self::CHUNK_SIZE < $length\n ? self::CHUNK_SIZE : $length\n ;\n $result .= socket_read($this->communicationSocket, $bytesToRead);\n $length -= self::CHUNK_SIZE;\n }\n\n return $result;\n }",
"public function read($length) {\n $this->waitForData();\n return $this->readData($length);\n }",
"public static function sl($data)\n {\n return strlen($data);\n }",
"public function NextReadSize() {\n switch($this->state) {\n case INITIAL:\n case IN_HEADER:\n case ENDOFDATA:\n return 1;\n case DATA:\n return $this->length - $this->position;\n case SUCCESS:\n return 0;\n default:\n throw new Exception(\"Invalid decoder state $this->state\");\n }\n }",
"function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}",
"public function getLength();",
"public function get_data_length() {\n return $this->duration;\n }",
"public function getLengthBytes()\n {\n return $this->length_bytes;\n }",
"public function getBytesRead(): int\n {\n return $this->content->bytesRead();\n }",
"protected function _read($length) {\n $data = false;\n if (!feof($this->_socket)) {\n $data = fread($this->_socket, $length);\n }\n return $data;\n }",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"private function fread($length) {\n\t\t$data = fread($this->stream, $length);\n\t\t$this->contentIndex += strlen($data);\n\t\t$this->checkReadTimeout();\n\n\t\treturn $data;\n\t}",
"public function pipe($length)\n {\n $data = $this->connection->read($length);\n $this->buffer .= $data;\n\n return strlen($data);\n }",
"private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}",
"protected function getSize()\n {\n return strlen($this->data);\n }",
"abstract public function getLength();",
"function read_data_packet($socket, &$buffer) {\n\tread_from_socket($socket, $countSize, 1);\n\t// read data length\n\tread_from_socket($socket, $readCount, $countSize);\n\t$expectedReadCount = $readCount;\n\t// read data\n $readCount = read_from_socket($socket, $buffer, $readCount);\n\tif ($readCount == $expectedReadCount)\n\t return $readCount;\n\telse\n\t return FALSE;\n}",
"public function getLen()\n {\n return $this->_len;\n }",
"public function read($length) {\n\n $readArray = array($this->client);\n $writeArray = array();\n $errorArray = array();\n $count = swoole_client_select($readArray, $writeArray, $errorArray, 1);\n foreach($readArray as $client) {\n $data = $client->recv($length);\n }\n $dataArray = unpack(\"N\", $data);\n $length = $dataArray[1];\n $data = $length . substr($data, -$length);\n return $data;\n }",
"protected function nextRecordLength()\r\n\t{\r\n\t\tlist($size, $temp) = ['', ''];\r\n\t\t\r\n\t\twhile ($temp != \",\" and $this->hasNext()) {\r\n\t\t\t$size .= $temp;\r\n\t\t\t$temp = Bin::toStr($this->readBits());\r\n\t\t}\r\n\r\n\t\treturn intval($size);\r\n\t}",
"public function getLength() : int\n {\n return $this->b[$this->offset];\n }",
"public function stream_read(int $length)\n\t{\n\t\treturn fread($this->tempHandle, $length);\n\t}",
"public function read($len) {\n if (strlen($this->rbuffer_) > 0) {\n $ret = substr($this->rbuffer_, 0, $len);\n $this->rbuffer_ = substr($this->rbuffer_, $len);\n return $ret;\n }\n\n $data = $this->transport_->readAll(4);\n $array = unpack('Nlength', $data);\n $length = $array['length'];\n\n $this->rbuffer_ = $this->transport_->readAll($length);\n $ret = substr($this->rbuffer_, 0, $len);\n $this->rbuffer_ = substr($this->rbuffer_, $len);\n return $ret;\n }",
"private function getSize()\n {\n $this->seek($this->offset);\n\n return $this->readLong();\n }",
"public function length()\n {\n return strlen($this->buffer);\n }",
"public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}",
"public function getLength(): int;",
"public function getLength(): int;",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function read($length)\n {\n return fread($this->stream, $length);\n }",
"public function getLength()\r\n {\r\n return $this->length;\r\n }",
"public function getLength() {\r\n return $this->length;\r\n }",
"function getLength(): int\n {\n return $this->length;\n }",
"public function getLength() {\n return $this->_length;\n }",
"public function read($length)\n {\n return $this->fread($length);\n }",
"function getSize(): int {\n return \\strlen($this->buffer);\n }",
"function getContentLength(){\n\t\treturn $this->_OutputBuffer->getLength();\n\t}",
"public function downloadlength() {\n return $this->info['download_content_length'];\n }",
"public function read($length = null)\n {\n // TODO: Implement read() method.\n }",
"public function read($len) {\r\n\t\tif($len<0) {\r\n\t\t\tthrow new Curly_Stream_Exception('The given length '.$len.' is invalid for a read operation. Only positive values area valid.');\r\n\t\t}\r\n\t\t\r\n\t\t$read='';\r\n\t\t$readLen=0;\r\n\t\t\r\n\t\t// Read from every stream, until we have enough data\r\n\t\tforeach($this->_streams as $stream) {\r\n\t\t\t$read.=$stream->read($len-$readLen);\r\n\t\t\t\r\n\t\t\t// Enough data read\r\n\t\t\t$readLen=strlen($read);\r\n\t\t\tif($readLen==$len) {\r\n\t\t\t\treturn $read;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->shift();\r\n\t\t}\r\n\t\t\r\n\t\t// So, not enough data found, but return what we´ve got.\r\n\t\treturn $read;\r\n\t}",
"function stream_read( $count ) {\r\n\t\tif ( ! isset( $this->data_ref ) ) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$ret = substr( $this->data_ref, $this->position, $count );\r\n\r\n\t\t$this->position += strlen( $ret );\r\n\t\treturn $ret;\r\n\t}",
"public function read($start = 0, $length) {}",
"public function stream_read($count) {\r\n\t\t$ret = substr($this->data, $this->pos, $count);\r\n\t\t$this->pos += strlen($ret);\r\n\t\t\r\n\t\treturn $ret;\r\n\t}",
"public function getLength() {\n \n return $this->_length;\n }",
"public function length()\n {\n return count($this->__data);\n }",
"function Read($length=1) \r\n{ \r\nif(intval($length) <= 0) \r\n{ \r\n$this->LastError = \"Cannot read zero or less bytes\"; \r\nreturn null; \r\n} \r\n//** no connection is available to read from, no data can be read. \r\n\r\nelse if(!$this->isOpen()) \r\n{ \r\n$this->LastError = \"No connection available for reading\"; \r\nreturn null; \r\n} \r\nelse //** a valid connection identifier is available. \r\n{ \r\n$this->_SetTimeout(); //** ensure timeout is set. \r\nreturn fread($this->Socket, $length); //** attempt to read n-bytes. \r\n} \r\n}",
"public function readBytes($length, $pos = null) {}",
"public function readBytes($length, $pos = null) {}",
"public function get_data_length() {\n return $this->pages;\n }",
"public function hasDataLength(){\n return $this->_has(6);\n }",
"public function length();",
"public function length();",
"public function stream_read($count)\r\n {\r\n $ret = substr($this->_data, $this->_pos, $count);\r\n $this->_pos += strlen($ret);\r\n return $ret;\r\n }",
"public function read($length, $untilDataEnough = true)\n {\n $data = $this->peek($length, $untilDataEnough);\n\n if($data) {\n $this->buffer = substr($this->buffer, strlen($data));\n }\n\n return $data;\n }",
"public function readLine($length = 1024) {}",
"public function length() {\r\n return strlen($this->contents);\r\n }",
"private function readLong()\n {\n $long = unpack('V', $this->read(4));\n $long = (int) $long[1];\n\n return $long;\n }",
"public function length()\n {\n return $this->length;\n }",
"public function length() {\n \n return $this->getLength();\n }",
"public function readBytes($length, $pos = null);",
"public function getLen()\n {\n $value = $this->get(self::LEN);\n return $value === null ? (integer)$value : $value;\n }",
"private function readLong() {\n return\n ($this->readByte() << 56) +\n ($this->readByte() & 255 << 48) +\n ($this->readByte() & 255 << 40) +\n ($this->readByte() & 255 << 32) +\n ($this->readByte() & 255 << 24) +\n ($this->readByte() & 255 << 16) +\n ($this->readByte() & 255 << 8) +\n ($this->readByte() & 255 << 0);\n }",
"public function getContentLength() { return $this->content_length; }",
"public function read($length)\n {\n return false;\n }",
"public function readLine($length = 1024);",
"function getLength(): ?int;",
"function getLength() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_LENGTH);\n\t}",
"public function getLength()\n {\n return $this->int_length;\n }",
"public function getSize() {\n return 8 * (strlen(Util::base64url_decode($this->data['n'])) - 1);\n }",
"function labelLength($pointer) {\r\n $oldPointer = $pointer;\r\n \r\n // See how many uncompressed bytes to next end of label/pointer\r\n while(($this->dnsResponse[$pointer] != chr(0)) &&\r\n (ord($this->dnsResponse[$pointer]) < 192)) {\r\n $pointer++;\r\n }\r\n // If pointer include next ocet as well\r\n if(ord($this->dnsResponse[$pointer]) >= 192) {\r\n $pointer++; \r\n }\r\n // Count the ocet we are reading\r\n $pointer++;\r\n return $pointer - $oldPointer;\r\n }",
"function readLong();",
"public function getSize()\n {\n return $this->length;\n }",
"function getLength(){\n\t\t$out = 0;\n\t\tfor($i=0;$i<sizeof($this->_Items);$i++){\n\t\t\t$out = $out + $this->_Items[$i]->getLength();\n\t\t}\n\t\treturn $out;\n\t}",
"public function flowControlledLength()\n {\n $padding_len = ($this->padding_length) ? $this->padding_length + 1 : 0;\n return strlen($this->data) + $padding_len;\n }",
"public function read($length) {\n\t\tif (! $this->readable) {\n\t\t\tthrow new RuntimeException(\"Stream is not readable\");\n\t\t}\n\t\treturn fread($this->handle, $length);\n\t}",
"public function read($length)\n\t{\n\t\t$this->checkClosed();\n\t\t$buffer = '';\n\t\twhile (\\mb_strlen($buffer, '8BIT') < $length) {\n\t\t\t$result = \\socket_read($this->socket, $length - mb_strlen($buffer, '8BIT'));\n\t\t\tif (false === $result) {\n\t\t\t\t$this->throwException();\n\t\t\t}\n\t\t\t$buffer .= $result;\n\t\t}\n\t\treturn $buffer;\n\t}",
"public function getContentLength() {\r\n return $this->__contentLength;\r\n }",
"protected function getResourceLength(): int\n {\n if (null === $this->fileName) {\n return parent::getResourceLength();\n }\n\n if (substr($this->fileName, 0, 16) === 'compress.zlib://') {\n return filesize(substr($this->fileName, 16));\n } elseif (substr($this->fileName, 0, 17) === 'compress.bzip2://') {\n return filesize(substr($this->fileName, 17));\n }\n\n return parent::getResourceLength();\n }",
"function readString($length) {\n $d = unpack(\"A*\", $this->read($length));\n return $d[1];\n }",
"function readIntLength(): ?int {\n $f = $this->readInt1();\n if($f <= 250) {\n return $f;\n }\n \n if($f === 251) {\n return null;\n }\n \n if($f === 252) {\n return $this->readInt2();\n }\n \n if($f === 253) {\n return $this->readInt3();\n }\n \n return $this->readInt8();\n }",
"public function stream_read($count)\n {\n if (!$this->_open) {\n return false;\n }\n\n if (!($this->_mode & STREAM_VAR_READABLE)) {\n return false;\n }\n\n $data = substr($this->_pointer, $this->_pos, $count);\n $this->_pos = $this->_pos + strlen($data);\n return $data;\n }",
"public function read($len = 1024) {\n\t\treturn fread($this->fp, $len);\n\t}",
"public function length() : int;",
"public function getPacketLength() : int {\n return $this->iPacketLength;\n }"
] | [
"0.7304598",
"0.7304598",
"0.7304598",
"0.7094056",
"0.70483017",
"0.6960831",
"0.6831843",
"0.67855346",
"0.6713402",
"0.666936",
"0.666093",
"0.6636725",
"0.662885",
"0.6627719",
"0.6625154",
"0.66241837",
"0.6623308",
"0.661724",
"0.661724",
"0.661724",
"0.6617134",
"0.6607698",
"0.65719414",
"0.6562078",
"0.65617543",
"0.65433824",
"0.64588183",
"0.645781",
"0.6421612",
"0.6414409",
"0.6407062",
"0.63898754",
"0.63892066",
"0.6387015",
"0.6341305",
"0.6337507",
"0.6333442",
"0.6333442",
"0.6297081",
"0.6297081",
"0.6297081",
"0.6297081",
"0.6297081",
"0.6297081",
"0.6297081",
"0.6297081",
"0.6290871",
"0.6287652",
"0.6273352",
"0.62573934",
"0.6249416",
"0.62463224",
"0.6227741",
"0.6221492",
"0.62108076",
"0.6208128",
"0.61973083",
"0.61777306",
"0.61743635",
"0.61647886",
"0.61589897",
"0.61439544",
"0.61411566",
"0.6133735",
"0.6133735",
"0.6115055",
"0.611113",
"0.6108718",
"0.6108718",
"0.6091605",
"0.6059099",
"0.6043272",
"0.60369754",
"0.60333747",
"0.60326374",
"0.6029065",
"0.59993804",
"0.5993864",
"0.59877783",
"0.5983998",
"0.59605587",
"0.5956668",
"0.59459364",
"0.59387434",
"0.59314495",
"0.59229004",
"0.5908665",
"0.59065276",
"0.5896084",
"0.588543",
"0.5868162",
"0.58644605",
"0.5861234",
"0.5858977",
"0.5854628",
"0.58494896",
"0.58430916",
"0.5838747",
"0.58270454",
"0.58078426",
"0.57911474"
] | 0.0 | -1 |
Read data length (4 bytes) | function op_pushdata4(&$stack, &$bytecode, &$return) {
$size = unpack('V', substr($bytecode, 0, 4))[1];
// Push data on the stack
array_push($stack, substr($bytecode, 4, $size));
// Skip the data we just pushed on stack
$bytecode = substr($bytecode, $size+4);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function read($length);",
"public function read($length);",
"public function read($length);",
"function getPayloadLength();",
"public function getLength()\n {\n return strlen($this->data);\n }",
"public function readBytes($length) {}",
"public function read($length)\n {\n }",
"protected function getSize()\n {\n return strlen($this->data);\n }",
"function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}",
"public function get_data_length() {\n return $this->duration;\n }",
"public function getLengthBytes()\n {\n return $this->length_bytes;\n }",
"protected function nextRecordLength()\r\n\t{\r\n\t\tlist($size, $temp) = ['', ''];\r\n\t\t\r\n\t\twhile ($temp != \",\" and $this->hasNext()) {\r\n\t\t\t$size .= $temp;\r\n\t\t\t$temp = Bin::toStr($this->readBits());\r\n\t\t}\r\n\r\n\t\treturn intval($size);\r\n\t}",
"private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}",
"public function getLength();",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"private function readData($length) {\n $result = '';\n while ($length > 0) {\n $bytesToRead = self::CHUNK_SIZE < $length\n ? self::CHUNK_SIZE : $length\n ;\n $result .= socket_read($this->communicationSocket, $bytesToRead);\n $length -= self::CHUNK_SIZE;\n }\n\n return $result;\n }",
"public function getBytesRead(): int\n {\n return $this->content->bytesRead();\n }",
"public static function sl($data)\n {\n return strlen($data);\n }",
"public function NextReadSize() {\n switch($this->state) {\n case INITIAL:\n case IN_HEADER:\n case ENDOFDATA:\n return 1;\n case DATA:\n return $this->length - $this->position;\n case SUCCESS:\n return 0;\n default:\n throw new Exception(\"Invalid decoder state $this->state\");\n }\n }",
"public function getLen()\n {\n return $this->_len;\n }",
"public function read($length) {\n $this->waitForData();\n return $this->readData($length);\n }",
"public function read($len) {\n if (strlen($this->rbuffer_) > 0) {\n $ret = substr($this->rbuffer_, 0, $len);\n $this->rbuffer_ = substr($this->rbuffer_, $len);\n return $ret;\n }\n\n $data = $this->transport_->readAll(4);\n $array = unpack('Nlength', $data);\n $length = $array['length'];\n\n $this->rbuffer_ = $this->transport_->readAll($length);\n $ret = substr($this->rbuffer_, 0, $len);\n $this->rbuffer_ = substr($this->rbuffer_, $len);\n return $ret;\n }",
"function length(){\n\t\t//return strlen($this->_String4);\n\t\treturn Translate::Length($this->_String4,$this->getEncoding());\n\t}",
"abstract public function getLength();",
"private function fread($length) {\n\t\t$data = fread($this->stream, $length);\n\t\t$this->contentIndex += strlen($data);\n\t\t$this->checkReadTimeout();\n\n\t\treturn $data;\n\t}",
"protected function _read($length) {\n $data = false;\n if (!feof($this->_socket)) {\n $data = fread($this->_socket, $length);\n }\n return $data;\n }",
"public function length()\n {\n return strlen($this->buffer);\n }",
"public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}",
"public function pipe($length)\n {\n $data = $this->connection->read($length);\n $this->buffer .= $data;\n\n return strlen($data);\n }",
"public function getLength()\r\n {\r\n return $this->length;\r\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength() {\r\n return $this->length;\r\n }",
"public function getLength(): int;",
"public function getLength(): int;",
"public function getLength() : int\n {\n return $this->b[$this->offset];\n }",
"public function getLength() {\n return $this->_length;\n }",
"function getSize(): int {\n return \\strlen($this->buffer);\n }",
"function getLength(): int\n {\n return $this->length;\n }",
"private function getSize()\n {\n $this->seek($this->offset);\n\n return $this->readLong();\n }",
"public function hasDataLength(){\n return $this->_has(6);\n }",
"public function length()\n {\n return count($this->__data);\n }",
"public function getLength() {\n \n return $this->_length;\n }",
"public function read($length) {\n\n $readArray = array($this->client);\n $writeArray = array();\n $errorArray = array();\n $count = swoole_client_select($readArray, $writeArray, $errorArray, 1);\n foreach($readArray as $client) {\n $data = $client->recv($length);\n }\n $dataArray = unpack(\"N\", $data);\n $length = $dataArray[1];\n $data = $length . substr($data, -$length);\n return $data;\n }",
"public function get_data_length() {\n return $this->pages;\n }",
"public function downloadlength() {\n return $this->info['download_content_length'];\n }",
"public function length();",
"public function length();",
"function read_data_packet($socket, &$buffer) {\n\tread_from_socket($socket, $countSize, 1);\n\t// read data length\n\tread_from_socket($socket, $readCount, $countSize);\n\t$expectedReadCount = $readCount;\n\t// read data\n $readCount = read_from_socket($socket, $buffer, $readCount);\n\tif ($readCount == $expectedReadCount)\n\t return $readCount;\n\telse\n\t return FALSE;\n}",
"public function length() {\n \n return $this->getLength();\n }",
"public function length()\n {\n return $this->length;\n }",
"public function length() {\r\n return strlen($this->contents);\r\n }",
"function getContentLength(){\n\t\treturn $this->_OutputBuffer->getLength();\n\t}",
"public function read($length)\n {\n return fread($this->stream, $length);\n }",
"public function read($length)\n {\n return $this->fread($length);\n }",
"public function getSize() {\n return 8 * (strlen(Util::base64url_decode($this->data['n'])) - 1);\n }",
"public function read($length, $untilDataEnough = true)\n {\n $data = $this->peek($length, $untilDataEnough);\n\n if($data) {\n $this->buffer = substr($this->buffer, strlen($data));\n }\n\n return $data;\n }",
"private function getFileCount()\n {\n $this->seek($this->offset + 4);\n\n return $this->readLong();\n }",
"public function getContentLength() { return $this->content_length; }",
"public function getPacketLength() : int {\n return $this->iPacketLength;\n }",
"public function getSize()\n {\n return $this->length;\n }",
"public function read($start = 0, $length) {}",
"public function stream_read(int $length)\n\t{\n\t\treturn fread($this->tempHandle, $length);\n\t}",
"public function read($length = null)\n {\n // TODO: Implement read() method.\n }",
"function stream_read( $count ) {\r\n\t\tif ( ! isset( $this->data_ref ) ) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$ret = substr( $this->data_ref, $this->position, $count );\r\n\r\n\t\t$this->position += strlen( $ret );\r\n\t\treturn $ret;\r\n\t}",
"public function flowControlledLength()\n {\n $padding_len = ($this->padding_length) ? $this->padding_length + 1 : 0;\n return strlen($this->data) + $padding_len;\n }",
"public function getLength()\n {\n return $this->int_length;\n }",
"public function getContentLength() {\r\n return $this->__contentLength;\r\n }",
"public function read($len) {\r\n\t\tif($len<0) {\r\n\t\t\tthrow new Curly_Stream_Exception('The given length '.$len.' is invalid for a read operation. Only positive values area valid.');\r\n\t\t}\r\n\t\t\r\n\t\t$read='';\r\n\t\t$readLen=0;\r\n\t\t\r\n\t\t// Read from every stream, until we have enough data\r\n\t\tforeach($this->_streams as $stream) {\r\n\t\t\t$read.=$stream->read($len-$readLen);\r\n\t\t\t\r\n\t\t\t// Enough data read\r\n\t\t\t$readLen=strlen($read);\r\n\t\t\tif($readLen==$len) {\r\n\t\t\t\treturn $read;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->shift();\r\n\t\t}\r\n\t\t\r\n\t\t// So, not enough data found, but return what we´ve got.\r\n\t\treturn $read;\r\n\t}",
"public function getLen()\n {\n $value = $this->get(self::LEN);\n return $value === null ? (integer)$value : $value;\n }",
"public function readBytes($length, $pos = null) {}",
"public function readBytes($length, $pos = null) {}",
"function getLength(): ?int;",
"public function getHeaderLength()\n {\n return $this->headerLength;\n }",
"public function stream_read($count) {\r\n\t\t$ret = substr($this->data, $this->pos, $count);\r\n\t\t$this->pos += strlen($ret);\r\n\t\t\r\n\t\treturn $ret;\r\n\t}",
"protected function getResourceLength(): int\n {\n if (null === $this->fileName) {\n return parent::getResourceLength();\n }\n\n if (substr($this->fileName, 0, 16) === 'compress.zlib://') {\n return filesize(substr($this->fileName, 16));\n } elseif (substr($this->fileName, 0, 17) === 'compress.bzip2://') {\n return filesize(substr($this->fileName, 17));\n }\n\n return parent::getResourceLength();\n }",
"public function readLine($length = 1024) {}",
"function getLength(){\n\t\t$out = 0;\n\t\tfor($i=0;$i<sizeof($this->_Items);$i++){\n\t\t\t$out = $out + $this->_Items[$i]->getLength();\n\t\t}\n\t\treturn $out;\n\t}",
"function Read($length=1) \r\n{ \r\nif(intval($length) <= 0) \r\n{ \r\n$this->LastError = \"Cannot read zero or less bytes\"; \r\nreturn null; \r\n} \r\n//** no connection is available to read from, no data can be read. \r\n\r\nelse if(!$this->isOpen()) \r\n{ \r\n$this->LastError = \"No connection available for reading\"; \r\nreturn null; \r\n} \r\nelse //** a valid connection identifier is available. \r\n{ \r\n$this->_SetTimeout(); //** ensure timeout is set. \r\nreturn fread($this->Socket, $length); //** attempt to read n-bytes. \r\n} \r\n}",
"public function read($length)\n {\n return false;\n }",
"protected function get_line_len()\n {\n return count($this->buffer);\n }",
"public function length() : int;",
"public function getFieldLength()\n {\n return $this->FieldLength;\n }",
"public function length()\n {\n return $this->provider->length();\n }",
"function labelLength($pointer) {\r\n $oldPointer = $pointer;\r\n \r\n // See how many uncompressed bytes to next end of label/pointer\r\n while(($this->dnsResponse[$pointer] != chr(0)) &&\r\n (ord($this->dnsResponse[$pointer]) < 192)) {\r\n $pointer++;\r\n }\r\n // If pointer include next ocet as well\r\n if(ord($this->dnsResponse[$pointer]) >= 192) {\r\n $pointer++; \r\n }\r\n // Count the ocet we are reading\r\n $pointer++;\r\n return $pointer - $oldPointer;\r\n }",
"function ContentLength($bytesOfAudio)\n {\n // for the \"RIFF\" and the count following\n return $bytesOfAudio + 12 + strlen($this->fmt) + 8;\n }",
"public function length()\n\t{\n\t\treturn count($this->parts);\n\t}",
"function getSize() {\n\t\treturn $this->data_array['filesize'];\n\t}",
"public function getFullLength()\n {\n $cmd_length = 1;\n\n $rl_length = strlen($this->remaining_length_bytes);\n\n return $cmd_length + $rl_length + $this->remaining_length;\n }",
"public function getLength()\n {\n return filesize($this->fullPath);\n }",
"public function stream_read($count)\r\n {\r\n $ret = substr($this->_data, $this->_pos, $count);\r\n $this->_pos += strlen($ret);\r\n return $ret;\r\n }",
"public function getDataBytes()\n {\n return $this->dataBytes;\n }"
] | [
"0.7160893",
"0.7160893",
"0.7160893",
"0.70972085",
"0.7049751",
"0.6969215",
"0.69129896",
"0.6740731",
"0.67299795",
"0.6704213",
"0.67034036",
"0.6702364",
"0.66675776",
"0.66665596",
"0.6660938",
"0.6660504",
"0.6660504",
"0.6660504",
"0.66230345",
"0.6616208",
"0.6604783",
"0.66040397",
"0.65894794",
"0.6550855",
"0.6528195",
"0.64958155",
"0.6486421",
"0.6480013",
"0.64741874",
"0.64658976",
"0.6443824",
"0.6428328",
"0.6399821",
"0.63847697",
"0.63847697",
"0.63847697",
"0.63847697",
"0.63847697",
"0.63847697",
"0.63847697",
"0.63847697",
"0.6381223",
"0.6361841",
"0.6361841",
"0.6359564",
"0.635947",
"0.63247824",
"0.6308353",
"0.6279914",
"0.6267221",
"0.62632614",
"0.6258999",
"0.6247269",
"0.62193346",
"0.62169975",
"0.621216",
"0.621216",
"0.6206318",
"0.6191462",
"0.6183287",
"0.6168692",
"0.6146016",
"0.6134524",
"0.6133859",
"0.6090043",
"0.6085605",
"0.6080445",
"0.607417",
"0.6071564",
"0.6068336",
"0.60678387",
"0.60370153",
"0.60315406",
"0.60165757",
"0.597626",
"0.5958977",
"0.5950942",
"0.59339285",
"0.5933487",
"0.5929959",
"0.5929959",
"0.59196097",
"0.5910986",
"0.5902262",
"0.58959734",
"0.5895626",
"0.58891237",
"0.58811533",
"0.588076",
"0.58801955",
"0.5876379",
"0.58739084",
"0.58719826",
"0.58695996",
"0.5850403",
"0.5849275",
"0.58351356",
"0.58288467",
"0.5826863",
"0.5825294",
"0.58227694"
] | 0.0 | -1 |
We need to pop a value from the stack | function op_verify(&$stack, &$bytecode, &$return) {
if (count($stack) == 0) {
throw new CScriptNotValid();
}
$val = array_pop($stack);
// Check
$return = ($val === self::OP_TRUE);
// False is not poped from the stack
if (!$return) {
array_push($stack, $val);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop()\r\n\t{\r\n\t}",
"public function popNodeFromStack() {}",
"public function pop()\n\t{\n\t\treturn array_shift($this->stackArray);\n\t}",
"public function pop()\n {\n return array_shift($this->stack);\n }",
"public function pop(): int;",
"public function pop()\n {\n \n }",
"public function pop() {\r\n\t\treturn array_pop($this->stack);\r\n\t}",
"public function pop()\r\n {\r\n return array_pop($this->_stack);\r\n }",
"function pop() \n {\n if ($this->count > 0) {\n $this->count--;\n return $this->stack[$this->count];\n }\n return null;\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function decStackPointer() {}",
"public function decStackPointer() {}",
"public function pop() {\n if (count($this->stack) === 0) return null;\n if ($this->isEmpty()) return null;\n\n $this->size--;\n return $this->stack[$this->size];\n }",
"public function pop()\n {\n if ($this->isEmpty())\n {\n return null;\n }\n\n return array_shift($this->stack);\n }",
"public function pop() {\n if ($this->isEmpty()) {\n // trap for stack underflow\n throw new RunTimeException('Stack is empty!');\n } else {\n // pop item from the start of the array\n return array_shift($this->stack);\n }\n }",
"function _popNode () {\r\n $stack_count = count ($this->_stack);\r\n unset ($this->_stack[$stack_count-1]);\r\n return true;\r\n }",
"public function pop()\n {\n if ($this->count > 0) {\n return $this->stack[--$this->count];\n }\n\n return null;\n }",
"public function pop()\n {\n $value = $this->data[$this->currentLength - 1];\n $this->delete($this->currentLength - 1);\n return $value;\n }",
"public static function pop() : string\n {\n $count = (static::$stack);\n \n if ($count > 0) {\n $out = array_pop(static::$stack);\n } else {\n $out = '';\n }//end if\n \n return $out;\n \n }",
"protected function popControllerFromStack()\n {}",
"function yy_pop_parser_stack()\r\n {\r\n if (!count($this->yystack)) {\r\n return;\r\n }\r\n $yytos = array_pop($this->yystack);\r\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\r\n fwrite(self::$yyTraceFILE,\r\n self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .\r\n \"\\n\");\r\n }\r\n $yymajor = $yytos->major;\r\n self::yy_destructor($yymajor, $yytos->minor);\r\n $this->yyidx--;\r\n return $yymajor;\r\n }",
"public function pop()\n {\n $this->update();\n if (isset($this->data[0])) {\n $this->updateValueIfNeeded($this->data, sizeof($this->data) - 1);\n return array_pop($this->data);\n }\n return null;\n }",
"public function pop()\n {\n $current = $this->head;\n while ($current != null) \n {\n $current->next = null;\n }\n if (head == null) \n {\n echo \"underflow\\n\";\n }\n }",
"function pop()\n\t{\n\t\tglobal $argv;\n\t\treturn array_shift($argv);\n\t}",
"function yy_pop_parser_stack()\n {\n if (!count($this->yystack)) {\n return;\n }\n $yytos = array_pop($this->yystack);\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\n fwrite(self::$yyTraceFILE,\n self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] .\n \"\\n\");\n }\n $yymajor = $yytos->major;\n self::yy_destructor($yymajor, $yytos->minor);\n $this->yyidx--;\n return $yymajor;\n }",
"public function popNode();",
"function popEnd();",
"public function pop()\n\t{\n\t\treturn array_pop( $this->data );\n\t}",
"public function pop()\n {\n if (true === $this->isEmpty()) {\n throw new \\BadMethodCallException('Cannot pop element from empty stack.');\n }\n\n --$this->size;\n\n return \\array_pop($this->elements);\n }",
"public function pop()\n {\n // Don't do anything if we don't have any items.\n if ($this->length === 0) return null;\n\n // Pop the last item off the end of the list and return the value.\n $this->length--;\n return array_pop($this->list);\n }",
"public function popContext()\n {\n if (count($this->contextStack)) {\n $this->context = \\array_pop($this->contextStack);\n $this->showState = \\array_pop($this->showStack);\n }\n }",
"public function pop()\n {\n $bit = $this->get($this->size - 1);\n $this->size--;\n\n return $bit;\n }",
"public function pop($name);",
"function pop_no_keep_context()\n{\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = array_pop($NO_KEEP_CONTEXT_STACK);\n}",
"public function pop($default = null);",
"function popState(): void\n {\n if (array_pop($this->stateStack) === null) {\n throw new \\LogicException('The state stack is empty');\n }\n }",
"public function pop(): void\n {\n array_pop($this->bindings);\n }",
"public function pop()\n {\n while (!$this->qu1->isEmpty()) {\n $this->qu2->enqueue($this->qu1->dequeue());\n }\n $x = $this->qu2->dequeue();\n // transfer all elements of qu2 back to qu1\n while (!$this->qu2->isEmpty()) {\n $this->qu1->enqueue($this->qu2->dequeue());\n }\n return $x;\n }",
"public function pop(): stdClass\n {\n if($this->isEmpty()) {\n throw new StackEmptyException;\n }\n\n return array_pop($this->array);\n }",
"function pop() {\n return array_shift($this->queue);\n }",
"public function pop()\n {\n $ret = array_pop($this->calls);\n $this->seek($ret);\n return $ret;\n }",
"abstract public function pop($queue = null);",
"public function popProcessor()\n {\n }",
"public static function remove( $stack_name, $value_name = null )\n\t{\n\t\t\n\t\tif ( $value_name == null ) {\n\t\t\tunset( self::$stacks[ $stack_name ] );\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$stack = self::get_named_stack( $stack_name );\n\t\tif ( isset( $stack[$value_name] ) ) {\n\t\t\tunset( $stack[$value_name] );\n\t\t}\n\t\tself::$stacks[$stack_name] = $stack;\n\t\treturn $stack;\n\t}",
"public function pop()\n {\n return array_shift($this->items);\n }",
"private function popStack($n)\n {\n $this->stack = array_slice($this->stack, 0, -(2 * $n));\n $this->vStack = array_slice($this->vStack, 0, -$n);\n $this->lStack = array_slice($this->lStack, 0, -$n);\n }",
"public function pop()\n {\n return array_pop($this->array);\n }",
"public function pop() {\n if (empty($this->_elements)) {\n throw(new NoSuchElementException('Stack is empty'));\n }\n $element= array_shift($this->_elements);\n $this->_hash+= HashProvider::hashOf($element->hashCode());\n return $element;\n }",
"public function shift()\n {\n return array_shift($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->deck);\n }",
"public function peek() {\r\n\t\treturn $this->stack[count($this->stack)-1];\r\n\t}",
"public function pop()\n\t{\n\t\treturn array_pop($this->items);\n\t}",
"public function pop($queue);",
"public function pop($index = null);",
"function array_top($stack){\n\tif(empty($stack))\n\t\treturn NULL;\n\n\t$top = array_pop($stack);\n\tarray_push($stack, $top);\n\n\treturn $top;\n}",
"function pop()\n {\n return array_pop($this->items);\n }",
"public function clearStack() {}",
"public function pop($queue = null);",
"public function peek()\r\n {\r\n return end($this->_stack);\r\n }",
"function pop_entry()\n {\n $args = func_get_args();\n return call_user_func_array(array( &$this, 'popEntry' ), $args);\n }",
"public function pop()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n $tail = $this->top();\n $this->offsetUnset($tail->getKey());\n\n return $tail;\n }",
"public function popFromQueue()\n {\n $this->semId = sem_get($this->SEMKEY, 1);\n \n //get id of shared memory\n $this->shmId = shm_attach($this->SHMKEY, $this->MEMSIZE);\n \n if (!sem_acquire($this->semId))\n {\n $this->clear();\n throw new Exception();\n }\n \n $counter = shm_get_var($this->shmId, 1);\n if($counter < 2)\n {\n sem_release($this->semId);\n return false;\n }\n $counter--;\n \n $result = shm_get_var($this->shmId, $counter);\n \n if (!shm_put_var($this->shmId, 1, $counter))\n {\n $this->clear();\n throw new Exception();\n }\n \n sem_release($this->semId);\n \n return $result;\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->elements);\n }",
"public function pop() {\n return array_pop($this->errorCodes);\n }",
"private function checkStacks() {\n\t\t\t$o = end($this->openStack);\n\t\t\t$c = end($this->closeStack);\n\n\t\t\t// if last item at open stack is equal with last item at close stack\n\t\t\t// then remove those items from stacks\n\t\t\tif(isset($this->openHooks[$o]) && $this->openHooks[$o] == $c) {\n\t\t\t\tarray_pop($this->openStack);\n\t\t\t\tarray_pop($this->closeStack);\n\t\t\t}\n\t\t}",
"function array_pop(&$array)\n{\n}",
"function push($val) \n {\n $this->stack[$this->count] = $val;\n $this->count++;\n }",
"public function getStack(){\r\n return $this->stack;\r\n }",
"public function pop()\n {\n return array_pop($this->processors);\n }",
"public function pop () {\n if ($this->done()) {\n throw new Exception(\"already at end of tokens!\");\n }\n return array_shift($this->tokens);\n }",
"public function pop()\n {\n return array_pop($this->objects);\n }",
"public function pop(string $path): void\n {\n static::popPath($this->store, $path);\n }",
"public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }",
"public function lPop(): ?TaskObj\n {\n $data = Cache::getInstance()->deQueue('__spider');\n if($data instanceof TaskObj){\n return $data;\n }else{\n return null;\n }\n }",
"public function pop()\n\t{\n\t\tif(!$this->length()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$part = array_pop($this->parts);\n\n\t\tif((string)(int)$part == $part) {\n\t\t\treturn (int)$part;\n\t\t} else {\n\t\t\treturn $part;\n\t\t}\n\t}",
"private function pop_mods() \n {\n array_pop($this->nmods);\n }",
"public function &pop()\n {\n unset($this->_view);\n $count = count($this->_views);\n\n if ($count > 0) {\n unset($this->_views[$count-1]);\n if ($count > 1) {\n $result =& $this->_views[$count-2];\n $this->_view =& $result;\n } else {\n $result = null;\n }\n } else {\n $result = false;\n }\n\n return $result;\n }",
"private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }",
"public static function pop()\n {\n return <<<'LUA'\n-- Pop the first job off of the queue...\nlocal jobs = redis.call('zrange', KEYS[1], 0, 0)\n\nwhile #jobs > 0 do\n -- Check that no one has reserved the job\n if (redis.call('zrem', KEYS[1], jobs[1]) > 0) then\n -- Increment the attempt count and place job on the reserved queue...\n local reserved = cjson.decode(jobs[1])\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\n redis.call('lpop', KEYS[3])\n return {jobs[1], reserved}\n end\n jobs = redis.call('zrange', KEYS[1], 0, 0)\nend\n\nreturn {false, false}\nLUA;\n }",
"public function pop() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n // fetch first row\n $sql = \"SELECT * FROM \".$this->_dbtp.\"queue \".\n \"ORDER BY \".$this->_dbqp.\"key ASC\";\n $db->limit($sql, 1, 0);\n \n try {\n $res = $db->fetchRow($sql, array(), Zend_Db::FETCH_ASSOC);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n\n if (count($res) == 0) {\n $log->debug(\"Queue is empty.\");\n return null;\n }\n \n // delete row\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"key=?\"; \n try {\n $db->query($sql, $res[$this->_dbqp.'key']);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n \n $log->debug(\"Queue pop success!\");\n return $res;\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function pop()\r\n\t{\r\n\t\t$this->count--;\r\n\t\t$last = array_pop($this->elements);\r\n\t\t$this->rewind();\r\n\t\treturn $last;\r\n\t}",
"public function popProcessor()\n {\n if (!count($this->processors)) {\n throw new \\LogicException('You tried to pop from an empty processor stack.');\n }\n return array_shift($this->processors);\n }",
"function yy_r174()\n {\n $this->compiler->lex->yypopstate();\n $this->_retvalue = '';\n }",
"public function popContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\tif ($index >= 2) {\n\t\t\t// Use context n-1 and clean the last context\n\t\t\t$this->tpl_vars = &$this->context[$index-2];\n\t\t\tunset($this->context[$index-1]);\n\t\t} else if ($index == 1) {\n\t\t\t// Actual context is #0, clean it\n\t\t\t$this->context[0] = array();\n\t\t}\n\t}",
"public function pushBack($value) {\n $node = new Node($value);\n $this->tail->next = $node;\n $this->tail = $node;\n $this->size++;\n }",
"public function unshift($value): void {}"
] | [
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.7468564",
"0.73998153",
"0.739057",
"0.738034",
"0.72852546",
"0.72711134",
"0.726797",
"0.7131527",
"0.7105379",
"0.70022684",
"0.70022684",
"0.6796776",
"0.679463",
"0.67334366",
"0.6712507",
"0.6684874",
"0.6666974",
"0.66387904",
"0.6631612",
"0.6596775",
"0.6435603",
"0.6415378",
"0.64069945",
"0.6386271",
"0.63717765",
"0.6371439",
"0.63579327",
"0.6343882",
"0.6337278",
"0.62909794",
"0.6264399",
"0.62342244",
"0.6225028",
"0.6219904",
"0.62116164",
"0.6168014",
"0.616429",
"0.6162845",
"0.61584806",
"0.61569464",
"0.61460894",
"0.61299384",
"0.6060931",
"0.60571676",
"0.60415393",
"0.60278755",
"0.5982203",
"0.5966254",
"0.5885595",
"0.5872426",
"0.58615035",
"0.58589906",
"0.58575225",
"0.58484834",
"0.58431417",
"0.5825937",
"0.5824992",
"0.58127594",
"0.5799466",
"0.57572025",
"0.57494885",
"0.57287204",
"0.57143956",
"0.5700259",
"0.5700259",
"0.5700259",
"0.5700259",
"0.5694773",
"0.56640714",
"0.56495804",
"0.56323814",
"0.5610323",
"0.5603209",
"0.55840206",
"0.556313",
"0.5558666",
"0.55409724",
"0.55363166",
"0.5521416",
"0.54976654",
"0.54742897",
"0.5440088",
"0.54305553",
"0.5412016",
"0.5411454",
"0.540795",
"0.540795",
"0.5407515",
"0.5406845",
"0.5391475",
"0.5363494",
"0.53618413",
"0.5361171"
] | 0.0 | -1 |
We need to pop a value from the stack | function op_ripemd160(&$stack, &$bytecode, &$return) {
if (count($stack) == 0) {
throw new CScriptNotValid();
}
// Get value from the stack
$val = array_pop($stack);
// Hash value (ripemd160)
if (function_exists('hash')) {
$val = hash('ripemd160', $val, true);
} else if (function_exists('mhash')) {
$val = mhash(MHASH_RIPEMD160, $val);
} else {
throw new \Exception("Not implemented");
}
// Push hash on stack
array_push($stack, $val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop()\r\n\t{\r\n\t}",
"public function popNodeFromStack() {}",
"public function pop()\n\t{\n\t\treturn array_shift($this->stackArray);\n\t}",
"public function pop()\n {\n return array_shift($this->stack);\n }",
"public function pop(): int;",
"public function pop()\n {\n \n }",
"public function pop() {\r\n\t\treturn array_pop($this->stack);\r\n\t}",
"public function pop()\r\n {\r\n return array_pop($this->_stack);\r\n }",
"function pop() \n {\n if ($this->count > 0) {\n $this->count--;\n return $this->stack[$this->count];\n }\n return null;\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function decStackPointer() {}",
"public function decStackPointer() {}",
"public function pop() {\n if (count($this->stack) === 0) return null;\n if ($this->isEmpty()) return null;\n\n $this->size--;\n return $this->stack[$this->size];\n }",
"public function pop()\n {\n if ($this->isEmpty())\n {\n return null;\n }\n\n return array_shift($this->stack);\n }",
"public function pop() {\n if ($this->isEmpty()) {\n // trap for stack underflow\n throw new RunTimeException('Stack is empty!');\n } else {\n // pop item from the start of the array\n return array_shift($this->stack);\n }\n }",
"function _popNode () {\r\n $stack_count = count ($this->_stack);\r\n unset ($this->_stack[$stack_count-1]);\r\n return true;\r\n }",
"public function pop()\n {\n if ($this->count > 0) {\n return $this->stack[--$this->count];\n }\n\n return null;\n }",
"public function pop()\n {\n $value = $this->data[$this->currentLength - 1];\n $this->delete($this->currentLength - 1);\n return $value;\n }",
"public static function pop() : string\n {\n $count = (static::$stack);\n \n if ($count > 0) {\n $out = array_pop(static::$stack);\n } else {\n $out = '';\n }//end if\n \n return $out;\n \n }",
"protected function popControllerFromStack()\n {}",
"function yy_pop_parser_stack()\r\n {\r\n if (!count($this->yystack)) {\r\n return;\r\n }\r\n $yytos = array_pop($this->yystack);\r\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\r\n fwrite(self::$yyTraceFILE,\r\n self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .\r\n \"\\n\");\r\n }\r\n $yymajor = $yytos->major;\r\n self::yy_destructor($yymajor, $yytos->minor);\r\n $this->yyidx--;\r\n return $yymajor;\r\n }",
"public function pop()\n {\n $this->update();\n if (isset($this->data[0])) {\n $this->updateValueIfNeeded($this->data, sizeof($this->data) - 1);\n return array_pop($this->data);\n }\n return null;\n }",
"public function pop()\n {\n $current = $this->head;\n while ($current != null) \n {\n $current->next = null;\n }\n if (head == null) \n {\n echo \"underflow\\n\";\n }\n }",
"function pop()\n\t{\n\t\tglobal $argv;\n\t\treturn array_shift($argv);\n\t}",
"function yy_pop_parser_stack()\n {\n if (!count($this->yystack)) {\n return;\n }\n $yytos = array_pop($this->yystack);\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\n fwrite(self::$yyTraceFILE,\n self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] .\n \"\\n\");\n }\n $yymajor = $yytos->major;\n self::yy_destructor($yymajor, $yytos->minor);\n $this->yyidx--;\n return $yymajor;\n }",
"public function popNode();",
"function popEnd();",
"public function pop()\n\t{\n\t\treturn array_pop( $this->data );\n\t}",
"public function pop()\n {\n if (true === $this->isEmpty()) {\n throw new \\BadMethodCallException('Cannot pop element from empty stack.');\n }\n\n --$this->size;\n\n return \\array_pop($this->elements);\n }",
"public function pop()\n {\n // Don't do anything if we don't have any items.\n if ($this->length === 0) return null;\n\n // Pop the last item off the end of the list and return the value.\n $this->length--;\n return array_pop($this->list);\n }",
"public function popContext()\n {\n if (count($this->contextStack)) {\n $this->context = \\array_pop($this->contextStack);\n $this->showState = \\array_pop($this->showStack);\n }\n }",
"public function pop()\n {\n $bit = $this->get($this->size - 1);\n $this->size--;\n\n return $bit;\n }",
"public function pop($name);",
"function pop_no_keep_context()\n{\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = array_pop($NO_KEEP_CONTEXT_STACK);\n}",
"public function pop($default = null);",
"function popState(): void\n {\n if (array_pop($this->stateStack) === null) {\n throw new \\LogicException('The state stack is empty');\n }\n }",
"public function pop(): void\n {\n array_pop($this->bindings);\n }",
"public function pop()\n {\n while (!$this->qu1->isEmpty()) {\n $this->qu2->enqueue($this->qu1->dequeue());\n }\n $x = $this->qu2->dequeue();\n // transfer all elements of qu2 back to qu1\n while (!$this->qu2->isEmpty()) {\n $this->qu1->enqueue($this->qu2->dequeue());\n }\n return $x;\n }",
"public function pop(): stdClass\n {\n if($this->isEmpty()) {\n throw new StackEmptyException;\n }\n\n return array_pop($this->array);\n }",
"function pop() {\n return array_shift($this->queue);\n }",
"public function pop()\n {\n $ret = array_pop($this->calls);\n $this->seek($ret);\n return $ret;\n }",
"abstract public function pop($queue = null);",
"public function popProcessor()\n {\n }",
"public static function remove( $stack_name, $value_name = null )\n\t{\n\t\t\n\t\tif ( $value_name == null ) {\n\t\t\tunset( self::$stacks[ $stack_name ] );\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$stack = self::get_named_stack( $stack_name );\n\t\tif ( isset( $stack[$value_name] ) ) {\n\t\t\tunset( $stack[$value_name] );\n\t\t}\n\t\tself::$stacks[$stack_name] = $stack;\n\t\treturn $stack;\n\t}",
"public function pop()\n {\n return array_shift($this->items);\n }",
"private function popStack($n)\n {\n $this->stack = array_slice($this->stack, 0, -(2 * $n));\n $this->vStack = array_slice($this->vStack, 0, -$n);\n $this->lStack = array_slice($this->lStack, 0, -$n);\n }",
"public function pop()\n {\n return array_pop($this->array);\n }",
"public function pop() {\n if (empty($this->_elements)) {\n throw(new NoSuchElementException('Stack is empty'));\n }\n $element= array_shift($this->_elements);\n $this->_hash+= HashProvider::hashOf($element->hashCode());\n return $element;\n }",
"public function shift()\n {\n return array_shift($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->deck);\n }",
"public function peek() {\r\n\t\treturn $this->stack[count($this->stack)-1];\r\n\t}",
"public function pop()\n\t{\n\t\treturn array_pop($this->items);\n\t}",
"public function pop($queue);",
"public function pop($index = null);",
"function array_top($stack){\n\tif(empty($stack))\n\t\treturn NULL;\n\n\t$top = array_pop($stack);\n\tarray_push($stack, $top);\n\n\treturn $top;\n}",
"function pop()\n {\n return array_pop($this->items);\n }",
"public function clearStack() {}",
"public function pop($queue = null);",
"public function peek()\r\n {\r\n return end($this->_stack);\r\n }",
"function pop_entry()\n {\n $args = func_get_args();\n return call_user_func_array(array( &$this, 'popEntry' ), $args);\n }",
"public function pop()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n $tail = $this->top();\n $this->offsetUnset($tail->getKey());\n\n return $tail;\n }",
"public function popFromQueue()\n {\n $this->semId = sem_get($this->SEMKEY, 1);\n \n //get id of shared memory\n $this->shmId = shm_attach($this->SHMKEY, $this->MEMSIZE);\n \n if (!sem_acquire($this->semId))\n {\n $this->clear();\n throw new Exception();\n }\n \n $counter = shm_get_var($this->shmId, 1);\n if($counter < 2)\n {\n sem_release($this->semId);\n return false;\n }\n $counter--;\n \n $result = shm_get_var($this->shmId, $counter);\n \n if (!shm_put_var($this->shmId, 1, $counter))\n {\n $this->clear();\n throw new Exception();\n }\n \n sem_release($this->semId);\n \n return $result;\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->elements);\n }",
"public function pop() {\n return array_pop($this->errorCodes);\n }",
"private function checkStacks() {\n\t\t\t$o = end($this->openStack);\n\t\t\t$c = end($this->closeStack);\n\n\t\t\t// if last item at open stack is equal with last item at close stack\n\t\t\t// then remove those items from stacks\n\t\t\tif(isset($this->openHooks[$o]) && $this->openHooks[$o] == $c) {\n\t\t\t\tarray_pop($this->openStack);\n\t\t\t\tarray_pop($this->closeStack);\n\t\t\t}\n\t\t}",
"function array_pop(&$array)\n{\n}",
"function push($val) \n {\n $this->stack[$this->count] = $val;\n $this->count++;\n }",
"public function getStack(){\r\n return $this->stack;\r\n }",
"public function pop()\n {\n return array_pop($this->processors);\n }",
"public function pop () {\n if ($this->done()) {\n throw new Exception(\"already at end of tokens!\");\n }\n return array_shift($this->tokens);\n }",
"public function pop()\n {\n return array_pop($this->objects);\n }",
"public function pop(string $path): void\n {\n static::popPath($this->store, $path);\n }",
"public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }",
"public function lPop(): ?TaskObj\n {\n $data = Cache::getInstance()->deQueue('__spider');\n if($data instanceof TaskObj){\n return $data;\n }else{\n return null;\n }\n }",
"public function pop()\n\t{\n\t\tif(!$this->length()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$part = array_pop($this->parts);\n\n\t\tif((string)(int)$part == $part) {\n\t\t\treturn (int)$part;\n\t\t} else {\n\t\t\treturn $part;\n\t\t}\n\t}",
"private function pop_mods() \n {\n array_pop($this->nmods);\n }",
"public function &pop()\n {\n unset($this->_view);\n $count = count($this->_views);\n\n if ($count > 0) {\n unset($this->_views[$count-1]);\n if ($count > 1) {\n $result =& $this->_views[$count-2];\n $this->_view =& $result;\n } else {\n $result = null;\n }\n } else {\n $result = false;\n }\n\n return $result;\n }",
"private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }",
"public static function pop()\n {\n return <<<'LUA'\n-- Pop the first job off of the queue...\nlocal jobs = redis.call('zrange', KEYS[1], 0, 0)\n\nwhile #jobs > 0 do\n -- Check that no one has reserved the job\n if (redis.call('zrem', KEYS[1], jobs[1]) > 0) then\n -- Increment the attempt count and place job on the reserved queue...\n local reserved = cjson.decode(jobs[1])\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\n redis.call('lpop', KEYS[3])\n return {jobs[1], reserved}\n end\n jobs = redis.call('zrange', KEYS[1], 0, 0)\nend\n\nreturn {false, false}\nLUA;\n }",
"public function pop() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n // fetch first row\n $sql = \"SELECT * FROM \".$this->_dbtp.\"queue \".\n \"ORDER BY \".$this->_dbqp.\"key ASC\";\n $db->limit($sql, 1, 0);\n \n try {\n $res = $db->fetchRow($sql, array(), Zend_Db::FETCH_ASSOC);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n\n if (count($res) == 0) {\n $log->debug(\"Queue is empty.\");\n return null;\n }\n \n // delete row\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"key=?\"; \n try {\n $db->query($sql, $res[$this->_dbqp.'key']);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n \n $log->debug(\"Queue pop success!\");\n return $res;\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function pop()\r\n\t{\r\n\t\t$this->count--;\r\n\t\t$last = array_pop($this->elements);\r\n\t\t$this->rewind();\r\n\t\treturn $last;\r\n\t}",
"public function popProcessor()\n {\n if (!count($this->processors)) {\n throw new \\LogicException('You tried to pop from an empty processor stack.');\n }\n return array_shift($this->processors);\n }",
"function yy_r174()\n {\n $this->compiler->lex->yypopstate();\n $this->_retvalue = '';\n }",
"public function popContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\tif ($index >= 2) {\n\t\t\t// Use context n-1 and clean the last context\n\t\t\t$this->tpl_vars = &$this->context[$index-2];\n\t\t\tunset($this->context[$index-1]);\n\t\t} else if ($index == 1) {\n\t\t\t// Actual context is #0, clean it\n\t\t\t$this->context[0] = array();\n\t\t}\n\t}",
"public function pushBack($value) {\n $node = new Node($value);\n $this->tail->next = $node;\n $this->tail = $node;\n $this->size++;\n }",
"public function unshift($value): void {}"
] | [
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.7468404",
"0.73994184",
"0.7389957",
"0.73798776",
"0.7284741",
"0.7270938",
"0.7267691",
"0.7131278",
"0.7104731",
"0.7001997",
"0.7001997",
"0.67960066",
"0.679387",
"0.67325217",
"0.6711774",
"0.66842294",
"0.6666921",
"0.663799",
"0.66312844",
"0.65964276",
"0.64355916",
"0.6415329",
"0.6406507",
"0.63863206",
"0.6371673",
"0.63713664",
"0.63577193",
"0.63439405",
"0.63370633",
"0.6290334",
"0.6263879",
"0.6234277",
"0.6224462",
"0.62190515",
"0.6211668",
"0.61680645",
"0.6164609",
"0.61635196",
"0.61577624",
"0.6155989",
"0.6145807",
"0.61299115",
"0.60607034",
"0.6057235",
"0.60409594",
"0.6027253",
"0.5981285",
"0.59659857",
"0.58855546",
"0.5871709",
"0.58612835",
"0.58585125",
"0.5857051",
"0.58485055",
"0.58427083",
"0.582575",
"0.58244616",
"0.58123624",
"0.57994336",
"0.57571894",
"0.5748766",
"0.5728511",
"0.571416",
"0.56997824",
"0.56997824",
"0.56997824",
"0.56997824",
"0.56942743",
"0.56640655",
"0.5649246",
"0.56318736",
"0.5610923",
"0.56026953",
"0.558418",
"0.55631346",
"0.5558529",
"0.5541391",
"0.5535914",
"0.55211294",
"0.54970413",
"0.54735667",
"0.5439914",
"0.54305434",
"0.5411812",
"0.54112333",
"0.54084456",
"0.54084456",
"0.540706",
"0.54067284",
"0.53915244",
"0.53635067",
"0.53627294",
"0.53616846"
] | 0.0 | -1 |
We need to pop a value from the stack | function op_sha1(&$stack, &$bytecode, &$return) {
if (count($stack) == 0) {
throw new CScriptNotValid();
}
// Get value from the stack
$val = array_pop($stack);
// Hash value (sha1)
if (function_exists('hash')) {
$val = hash('sha1', $val, true);
} else if (function_exists('mhash')) {
$val = mhash(MHASH_SHA1, $val);
} else {
throw new \Exception("Not implemented");
}
// Push hash on stack
array_push($stack, $val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop()\r\n\t{\r\n\t}",
"public function popNodeFromStack() {}",
"public function pop()\n\t{\n\t\treturn array_shift($this->stackArray);\n\t}",
"public function pop()\n {\n return array_shift($this->stack);\n }",
"public function pop(): int;",
"public function pop()\n {\n \n }",
"public function pop() {\r\n\t\treturn array_pop($this->stack);\r\n\t}",
"public function pop()\r\n {\r\n return array_pop($this->_stack);\r\n }",
"function pop() \n {\n if ($this->count > 0) {\n $this->count--;\n return $this->stack[$this->count];\n }\n return null;\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function decStackPointer() {}",
"public function decStackPointer() {}",
"public function pop() {\n if (count($this->stack) === 0) return null;\n if ($this->isEmpty()) return null;\n\n $this->size--;\n return $this->stack[$this->size];\n }",
"public function pop()\n {\n if ($this->isEmpty())\n {\n return null;\n }\n\n return array_shift($this->stack);\n }",
"public function pop() {\n if ($this->isEmpty()) {\n // trap for stack underflow\n throw new RunTimeException('Stack is empty!');\n } else {\n // pop item from the start of the array\n return array_shift($this->stack);\n }\n }",
"function _popNode () {\r\n $stack_count = count ($this->_stack);\r\n unset ($this->_stack[$stack_count-1]);\r\n return true;\r\n }",
"public function pop()\n {\n if ($this->count > 0) {\n return $this->stack[--$this->count];\n }\n\n return null;\n }",
"public function pop()\n {\n $value = $this->data[$this->currentLength - 1];\n $this->delete($this->currentLength - 1);\n return $value;\n }",
"public static function pop() : string\n {\n $count = (static::$stack);\n \n if ($count > 0) {\n $out = array_pop(static::$stack);\n } else {\n $out = '';\n }//end if\n \n return $out;\n \n }",
"protected function popControllerFromStack()\n {}",
"function yy_pop_parser_stack()\r\n {\r\n if (!count($this->yystack)) {\r\n return;\r\n }\r\n $yytos = array_pop($this->yystack);\r\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\r\n fwrite(self::$yyTraceFILE,\r\n self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .\r\n \"\\n\");\r\n }\r\n $yymajor = $yytos->major;\r\n self::yy_destructor($yymajor, $yytos->minor);\r\n $this->yyidx--;\r\n return $yymajor;\r\n }",
"public function pop()\n {\n $this->update();\n if (isset($this->data[0])) {\n $this->updateValueIfNeeded($this->data, sizeof($this->data) - 1);\n return array_pop($this->data);\n }\n return null;\n }",
"public function pop()\n {\n $current = $this->head;\n while ($current != null) \n {\n $current->next = null;\n }\n if (head == null) \n {\n echo \"underflow\\n\";\n }\n }",
"function pop()\n\t{\n\t\tglobal $argv;\n\t\treturn array_shift($argv);\n\t}",
"function yy_pop_parser_stack()\n {\n if (!count($this->yystack)) {\n return;\n }\n $yytos = array_pop($this->yystack);\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\n fwrite(self::$yyTraceFILE,\n self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] .\n \"\\n\");\n }\n $yymajor = $yytos->major;\n self::yy_destructor($yymajor, $yytos->minor);\n $this->yyidx--;\n return $yymajor;\n }",
"public function popNode();",
"function popEnd();",
"public function pop()\n\t{\n\t\treturn array_pop( $this->data );\n\t}",
"public function pop()\n {\n if (true === $this->isEmpty()) {\n throw new \\BadMethodCallException('Cannot pop element from empty stack.');\n }\n\n --$this->size;\n\n return \\array_pop($this->elements);\n }",
"public function pop()\n {\n // Don't do anything if we don't have any items.\n if ($this->length === 0) return null;\n\n // Pop the last item off the end of the list and return the value.\n $this->length--;\n return array_pop($this->list);\n }",
"public function popContext()\n {\n if (count($this->contextStack)) {\n $this->context = \\array_pop($this->contextStack);\n $this->showState = \\array_pop($this->showStack);\n }\n }",
"public function pop()\n {\n $bit = $this->get($this->size - 1);\n $this->size--;\n\n return $bit;\n }",
"public function pop($name);",
"function pop_no_keep_context()\n{\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = array_pop($NO_KEEP_CONTEXT_STACK);\n}",
"public function pop($default = null);",
"function popState(): void\n {\n if (array_pop($this->stateStack) === null) {\n throw new \\LogicException('The state stack is empty');\n }\n }",
"public function pop(): void\n {\n array_pop($this->bindings);\n }",
"public function pop()\n {\n while (!$this->qu1->isEmpty()) {\n $this->qu2->enqueue($this->qu1->dequeue());\n }\n $x = $this->qu2->dequeue();\n // transfer all elements of qu2 back to qu1\n while (!$this->qu2->isEmpty()) {\n $this->qu1->enqueue($this->qu2->dequeue());\n }\n return $x;\n }",
"public function pop(): stdClass\n {\n if($this->isEmpty()) {\n throw new StackEmptyException;\n }\n\n return array_pop($this->array);\n }",
"function pop() {\n return array_shift($this->queue);\n }",
"public function pop()\n {\n $ret = array_pop($this->calls);\n $this->seek($ret);\n return $ret;\n }",
"abstract public function pop($queue = null);",
"public function popProcessor()\n {\n }",
"public static function remove( $stack_name, $value_name = null )\n\t{\n\t\t\n\t\tif ( $value_name == null ) {\n\t\t\tunset( self::$stacks[ $stack_name ] );\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$stack = self::get_named_stack( $stack_name );\n\t\tif ( isset( $stack[$value_name] ) ) {\n\t\t\tunset( $stack[$value_name] );\n\t\t}\n\t\tself::$stacks[$stack_name] = $stack;\n\t\treturn $stack;\n\t}",
"public function pop()\n {\n return array_shift($this->items);\n }",
"private function popStack($n)\n {\n $this->stack = array_slice($this->stack, 0, -(2 * $n));\n $this->vStack = array_slice($this->vStack, 0, -$n);\n $this->lStack = array_slice($this->lStack, 0, -$n);\n }",
"public function pop()\n {\n return array_pop($this->array);\n }",
"public function pop() {\n if (empty($this->_elements)) {\n throw(new NoSuchElementException('Stack is empty'));\n }\n $element= array_shift($this->_elements);\n $this->_hash+= HashProvider::hashOf($element->hashCode());\n return $element;\n }",
"public function shift()\n {\n return array_shift($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->deck);\n }",
"public function peek() {\r\n\t\treturn $this->stack[count($this->stack)-1];\r\n\t}",
"public function pop()\n\t{\n\t\treturn array_pop($this->items);\n\t}",
"public function pop($queue);",
"public function pop($index = null);",
"function array_top($stack){\n\tif(empty($stack))\n\t\treturn NULL;\n\n\t$top = array_pop($stack);\n\tarray_push($stack, $top);\n\n\treturn $top;\n}",
"function pop()\n {\n return array_pop($this->items);\n }",
"public function clearStack() {}",
"public function pop($queue = null);",
"public function peek()\r\n {\r\n return end($this->_stack);\r\n }",
"function pop_entry()\n {\n $args = func_get_args();\n return call_user_func_array(array( &$this, 'popEntry' ), $args);\n }",
"public function pop()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n $tail = $this->top();\n $this->offsetUnset($tail->getKey());\n\n return $tail;\n }",
"public function popFromQueue()\n {\n $this->semId = sem_get($this->SEMKEY, 1);\n \n //get id of shared memory\n $this->shmId = shm_attach($this->SHMKEY, $this->MEMSIZE);\n \n if (!sem_acquire($this->semId))\n {\n $this->clear();\n throw new Exception();\n }\n \n $counter = shm_get_var($this->shmId, 1);\n if($counter < 2)\n {\n sem_release($this->semId);\n return false;\n }\n $counter--;\n \n $result = shm_get_var($this->shmId, $counter);\n \n if (!shm_put_var($this->shmId, 1, $counter))\n {\n $this->clear();\n throw new Exception();\n }\n \n sem_release($this->semId);\n \n return $result;\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->elements);\n }",
"public function pop() {\n return array_pop($this->errorCodes);\n }",
"private function checkStacks() {\n\t\t\t$o = end($this->openStack);\n\t\t\t$c = end($this->closeStack);\n\n\t\t\t// if last item at open stack is equal with last item at close stack\n\t\t\t// then remove those items from stacks\n\t\t\tif(isset($this->openHooks[$o]) && $this->openHooks[$o] == $c) {\n\t\t\t\tarray_pop($this->openStack);\n\t\t\t\tarray_pop($this->closeStack);\n\t\t\t}\n\t\t}",
"function array_pop(&$array)\n{\n}",
"function push($val) \n {\n $this->stack[$this->count] = $val;\n $this->count++;\n }",
"public function getStack(){\r\n return $this->stack;\r\n }",
"public function pop()\n {\n return array_pop($this->processors);\n }",
"public function pop () {\n if ($this->done()) {\n throw new Exception(\"already at end of tokens!\");\n }\n return array_shift($this->tokens);\n }",
"public function pop()\n {\n return array_pop($this->objects);\n }",
"public function pop(string $path): void\n {\n static::popPath($this->store, $path);\n }",
"public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }",
"public function lPop(): ?TaskObj\n {\n $data = Cache::getInstance()->deQueue('__spider');\n if($data instanceof TaskObj){\n return $data;\n }else{\n return null;\n }\n }",
"public function pop()\n\t{\n\t\tif(!$this->length()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$part = array_pop($this->parts);\n\n\t\tif((string)(int)$part == $part) {\n\t\t\treturn (int)$part;\n\t\t} else {\n\t\t\treturn $part;\n\t\t}\n\t}",
"private function pop_mods() \n {\n array_pop($this->nmods);\n }",
"public function &pop()\n {\n unset($this->_view);\n $count = count($this->_views);\n\n if ($count > 0) {\n unset($this->_views[$count-1]);\n if ($count > 1) {\n $result =& $this->_views[$count-2];\n $this->_view =& $result;\n } else {\n $result = null;\n }\n } else {\n $result = false;\n }\n\n return $result;\n }",
"private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }",
"public static function pop()\n {\n return <<<'LUA'\n-- Pop the first job off of the queue...\nlocal jobs = redis.call('zrange', KEYS[1], 0, 0)\n\nwhile #jobs > 0 do\n -- Check that no one has reserved the job\n if (redis.call('zrem', KEYS[1], jobs[1]) > 0) then\n -- Increment the attempt count and place job on the reserved queue...\n local reserved = cjson.decode(jobs[1])\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\n redis.call('lpop', KEYS[3])\n return {jobs[1], reserved}\n end\n jobs = redis.call('zrange', KEYS[1], 0, 0)\nend\n\nreturn {false, false}\nLUA;\n }",
"public function pop() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n // fetch first row\n $sql = \"SELECT * FROM \".$this->_dbtp.\"queue \".\n \"ORDER BY \".$this->_dbqp.\"key ASC\";\n $db->limit($sql, 1, 0);\n \n try {\n $res = $db->fetchRow($sql, array(), Zend_Db::FETCH_ASSOC);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n\n if (count($res) == 0) {\n $log->debug(\"Queue is empty.\");\n return null;\n }\n \n // delete row\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"key=?\"; \n try {\n $db->query($sql, $res[$this->_dbqp.'key']);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n \n $log->debug(\"Queue pop success!\");\n return $res;\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function pop()\r\n\t{\r\n\t\t$this->count--;\r\n\t\t$last = array_pop($this->elements);\r\n\t\t$this->rewind();\r\n\t\treturn $last;\r\n\t}",
"public function popProcessor()\n {\n if (!count($this->processors)) {\n throw new \\LogicException('You tried to pop from an empty processor stack.');\n }\n return array_shift($this->processors);\n }",
"function yy_r174()\n {\n $this->compiler->lex->yypopstate();\n $this->_retvalue = '';\n }",
"public function popContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\tif ($index >= 2) {\n\t\t\t// Use context n-1 and clean the last context\n\t\t\t$this->tpl_vars = &$this->context[$index-2];\n\t\t\tunset($this->context[$index-1]);\n\t\t} else if ($index == 1) {\n\t\t\t// Actual context is #0, clean it\n\t\t\t$this->context[0] = array();\n\t\t}\n\t}",
"public function pushBack($value) {\n $node = new Node($value);\n $this->tail->next = $node;\n $this->tail = $node;\n $this->size++;\n }",
"public function unshift($value): void {}"
] | [
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.7468404",
"0.73994184",
"0.7389957",
"0.73798776",
"0.7284741",
"0.7270938",
"0.7267691",
"0.7131278",
"0.7104731",
"0.7001997",
"0.7001997",
"0.67960066",
"0.679387",
"0.67325217",
"0.6711774",
"0.66842294",
"0.6666921",
"0.663799",
"0.66312844",
"0.65964276",
"0.64355916",
"0.6415329",
"0.6406507",
"0.63863206",
"0.6371673",
"0.63713664",
"0.63577193",
"0.63439405",
"0.63370633",
"0.6290334",
"0.6263879",
"0.6234277",
"0.6224462",
"0.62190515",
"0.6211668",
"0.61680645",
"0.6164609",
"0.61635196",
"0.61577624",
"0.6155989",
"0.6145807",
"0.61299115",
"0.60607034",
"0.6057235",
"0.60409594",
"0.6027253",
"0.5981285",
"0.59659857",
"0.58855546",
"0.5871709",
"0.58612835",
"0.58585125",
"0.5857051",
"0.58485055",
"0.58427083",
"0.582575",
"0.58244616",
"0.58123624",
"0.57994336",
"0.57571894",
"0.5748766",
"0.5728511",
"0.571416",
"0.56997824",
"0.56997824",
"0.56997824",
"0.56997824",
"0.56942743",
"0.56640655",
"0.5649246",
"0.56318736",
"0.5610923",
"0.56026953",
"0.558418",
"0.55631346",
"0.5558529",
"0.5541391",
"0.5535914",
"0.55211294",
"0.54970413",
"0.54735667",
"0.5439914",
"0.54305434",
"0.5411812",
"0.54112333",
"0.54084456",
"0.54084456",
"0.540706",
"0.54067284",
"0.53915244",
"0.53635067",
"0.53627294",
"0.53616846"
] | 0.0 | -1 |
We need to pop a value from the stack | function op_sha256(&$stack, &$bytecode, &$return) {
if (count($stack) == 0) {
throw new CScriptNotValid();
}
// Get value from the stack
$val = array_pop($stack);
// Hash value (sha256)
if (function_exists('hash')) {
$val = hash('sha256', $val, true);
} else if (function_exists('mhash')) {
$val = mhash(MHASH_SHA256, $val);
} else {
throw new \Exception("Not implemented");
}
// Push hash on stack
array_push($stack, $val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop()\r\n\t{\r\n\t}",
"public function popNodeFromStack() {}",
"public function pop()\n\t{\n\t\treturn array_shift($this->stackArray);\n\t}",
"public function pop()\n {\n return array_shift($this->stack);\n }",
"public function pop(): int;",
"public function pop()\n {\n \n }",
"public function pop() {\r\n\t\treturn array_pop($this->stack);\r\n\t}",
"public function pop()\r\n {\r\n return array_pop($this->_stack);\r\n }",
"function pop() \n {\n if ($this->count > 0) {\n $this->count--;\n return $this->stack[$this->count];\n }\n return null;\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function decStackPointer() {}",
"public function decStackPointer() {}",
"public function pop() {\n if (count($this->stack) === 0) return null;\n if ($this->isEmpty()) return null;\n\n $this->size--;\n return $this->stack[$this->size];\n }",
"public function pop()\n {\n if ($this->isEmpty())\n {\n return null;\n }\n\n return array_shift($this->stack);\n }",
"public function pop() {\n if ($this->isEmpty()) {\n // trap for stack underflow\n throw new RunTimeException('Stack is empty!');\n } else {\n // pop item from the start of the array\n return array_shift($this->stack);\n }\n }",
"function _popNode () {\r\n $stack_count = count ($this->_stack);\r\n unset ($this->_stack[$stack_count-1]);\r\n return true;\r\n }",
"public function pop()\n {\n if ($this->count > 0) {\n return $this->stack[--$this->count];\n }\n\n return null;\n }",
"public function pop()\n {\n $value = $this->data[$this->currentLength - 1];\n $this->delete($this->currentLength - 1);\n return $value;\n }",
"public static function pop() : string\n {\n $count = (static::$stack);\n \n if ($count > 0) {\n $out = array_pop(static::$stack);\n } else {\n $out = '';\n }//end if\n \n return $out;\n \n }",
"protected function popControllerFromStack()\n {}",
"function yy_pop_parser_stack()\r\n {\r\n if (!count($this->yystack)) {\r\n return;\r\n }\r\n $yytos = array_pop($this->yystack);\r\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\r\n fwrite(self::$yyTraceFILE,\r\n self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .\r\n \"\\n\");\r\n }\r\n $yymajor = $yytos->major;\r\n self::yy_destructor($yymajor, $yytos->minor);\r\n $this->yyidx--;\r\n return $yymajor;\r\n }",
"public function pop()\n {\n $this->update();\n if (isset($this->data[0])) {\n $this->updateValueIfNeeded($this->data, sizeof($this->data) - 1);\n return array_pop($this->data);\n }\n return null;\n }",
"public function pop()\n {\n $current = $this->head;\n while ($current != null) \n {\n $current->next = null;\n }\n if (head == null) \n {\n echo \"underflow\\n\";\n }\n }",
"function pop()\n\t{\n\t\tglobal $argv;\n\t\treturn array_shift($argv);\n\t}",
"function yy_pop_parser_stack()\n {\n if (!count($this->yystack)) {\n return;\n }\n $yytos = array_pop($this->yystack);\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\n fwrite(self::$yyTraceFILE,\n self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] .\n \"\\n\");\n }\n $yymajor = $yytos->major;\n self::yy_destructor($yymajor, $yytos->minor);\n $this->yyidx--;\n return $yymajor;\n }",
"public function popNode();",
"function popEnd();",
"public function pop()\n\t{\n\t\treturn array_pop( $this->data );\n\t}",
"public function pop()\n {\n if (true === $this->isEmpty()) {\n throw new \\BadMethodCallException('Cannot pop element from empty stack.');\n }\n\n --$this->size;\n\n return \\array_pop($this->elements);\n }",
"public function pop()\n {\n // Don't do anything if we don't have any items.\n if ($this->length === 0) return null;\n\n // Pop the last item off the end of the list and return the value.\n $this->length--;\n return array_pop($this->list);\n }",
"public function popContext()\n {\n if (count($this->contextStack)) {\n $this->context = \\array_pop($this->contextStack);\n $this->showState = \\array_pop($this->showStack);\n }\n }",
"public function pop()\n {\n $bit = $this->get($this->size - 1);\n $this->size--;\n\n return $bit;\n }",
"public function pop($name);",
"function pop_no_keep_context()\n{\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = array_pop($NO_KEEP_CONTEXT_STACK);\n}",
"public function pop($default = null);",
"function popState(): void\n {\n if (array_pop($this->stateStack) === null) {\n throw new \\LogicException('The state stack is empty');\n }\n }",
"public function pop(): void\n {\n array_pop($this->bindings);\n }",
"public function pop()\n {\n while (!$this->qu1->isEmpty()) {\n $this->qu2->enqueue($this->qu1->dequeue());\n }\n $x = $this->qu2->dequeue();\n // transfer all elements of qu2 back to qu1\n while (!$this->qu2->isEmpty()) {\n $this->qu1->enqueue($this->qu2->dequeue());\n }\n return $x;\n }",
"public function pop(): stdClass\n {\n if($this->isEmpty()) {\n throw new StackEmptyException;\n }\n\n return array_pop($this->array);\n }",
"function pop() {\n return array_shift($this->queue);\n }",
"public function pop()\n {\n $ret = array_pop($this->calls);\n $this->seek($ret);\n return $ret;\n }",
"abstract public function pop($queue = null);",
"public function popProcessor()\n {\n }",
"public static function remove( $stack_name, $value_name = null )\n\t{\n\t\t\n\t\tif ( $value_name == null ) {\n\t\t\tunset( self::$stacks[ $stack_name ] );\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$stack = self::get_named_stack( $stack_name );\n\t\tif ( isset( $stack[$value_name] ) ) {\n\t\t\tunset( $stack[$value_name] );\n\t\t}\n\t\tself::$stacks[$stack_name] = $stack;\n\t\treturn $stack;\n\t}",
"public function pop()\n {\n return array_shift($this->items);\n }",
"private function popStack($n)\n {\n $this->stack = array_slice($this->stack, 0, -(2 * $n));\n $this->vStack = array_slice($this->vStack, 0, -$n);\n $this->lStack = array_slice($this->lStack, 0, -$n);\n }",
"public function pop()\n {\n return array_pop($this->array);\n }",
"public function pop() {\n if (empty($this->_elements)) {\n throw(new NoSuchElementException('Stack is empty'));\n }\n $element= array_shift($this->_elements);\n $this->_hash+= HashProvider::hashOf($element->hashCode());\n return $element;\n }",
"public function shift()\n {\n return array_shift($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->deck);\n }",
"public function peek() {\r\n\t\treturn $this->stack[count($this->stack)-1];\r\n\t}",
"public function pop()\n\t{\n\t\treturn array_pop($this->items);\n\t}",
"public function pop($queue);",
"public function pop($index = null);",
"function array_top($stack){\n\tif(empty($stack))\n\t\treturn NULL;\n\n\t$top = array_pop($stack);\n\tarray_push($stack, $top);\n\n\treturn $top;\n}",
"function pop()\n {\n return array_pop($this->items);\n }",
"public function clearStack() {}",
"public function pop($queue = null);",
"public function peek()\r\n {\r\n return end($this->_stack);\r\n }",
"function pop_entry()\n {\n $args = func_get_args();\n return call_user_func_array(array( &$this, 'popEntry' ), $args);\n }",
"public function pop()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n $tail = $this->top();\n $this->offsetUnset($tail->getKey());\n\n return $tail;\n }",
"public function popFromQueue()\n {\n $this->semId = sem_get($this->SEMKEY, 1);\n \n //get id of shared memory\n $this->shmId = shm_attach($this->SHMKEY, $this->MEMSIZE);\n \n if (!sem_acquire($this->semId))\n {\n $this->clear();\n throw new Exception();\n }\n \n $counter = shm_get_var($this->shmId, 1);\n if($counter < 2)\n {\n sem_release($this->semId);\n return false;\n }\n $counter--;\n \n $result = shm_get_var($this->shmId, $counter);\n \n if (!shm_put_var($this->shmId, 1, $counter))\n {\n $this->clear();\n throw new Exception();\n }\n \n sem_release($this->semId);\n \n return $result;\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->elements);\n }",
"public function pop() {\n return array_pop($this->errorCodes);\n }",
"private function checkStacks() {\n\t\t\t$o = end($this->openStack);\n\t\t\t$c = end($this->closeStack);\n\n\t\t\t// if last item at open stack is equal with last item at close stack\n\t\t\t// then remove those items from stacks\n\t\t\tif(isset($this->openHooks[$o]) && $this->openHooks[$o] == $c) {\n\t\t\t\tarray_pop($this->openStack);\n\t\t\t\tarray_pop($this->closeStack);\n\t\t\t}\n\t\t}",
"function array_pop(&$array)\n{\n}",
"function push($val) \n {\n $this->stack[$this->count] = $val;\n $this->count++;\n }",
"public function getStack(){\r\n return $this->stack;\r\n }",
"public function pop()\n {\n return array_pop($this->processors);\n }",
"public function pop () {\n if ($this->done()) {\n throw new Exception(\"already at end of tokens!\");\n }\n return array_shift($this->tokens);\n }",
"public function pop()\n {\n return array_pop($this->objects);\n }",
"public function pop(string $path): void\n {\n static::popPath($this->store, $path);\n }",
"public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }",
"public function lPop(): ?TaskObj\n {\n $data = Cache::getInstance()->deQueue('__spider');\n if($data instanceof TaskObj){\n return $data;\n }else{\n return null;\n }\n }",
"public function pop()\n\t{\n\t\tif(!$this->length()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$part = array_pop($this->parts);\n\n\t\tif((string)(int)$part == $part) {\n\t\t\treturn (int)$part;\n\t\t} else {\n\t\t\treturn $part;\n\t\t}\n\t}",
"private function pop_mods() \n {\n array_pop($this->nmods);\n }",
"public function &pop()\n {\n unset($this->_view);\n $count = count($this->_views);\n\n if ($count > 0) {\n unset($this->_views[$count-1]);\n if ($count > 1) {\n $result =& $this->_views[$count-2];\n $this->_view =& $result;\n } else {\n $result = null;\n }\n } else {\n $result = false;\n }\n\n return $result;\n }",
"private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }",
"public static function pop()\n {\n return <<<'LUA'\n-- Pop the first job off of the queue...\nlocal jobs = redis.call('zrange', KEYS[1], 0, 0)\n\nwhile #jobs > 0 do\n -- Check that no one has reserved the job\n if (redis.call('zrem', KEYS[1], jobs[1]) > 0) then\n -- Increment the attempt count and place job on the reserved queue...\n local reserved = cjson.decode(jobs[1])\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\n redis.call('lpop', KEYS[3])\n return {jobs[1], reserved}\n end\n jobs = redis.call('zrange', KEYS[1], 0, 0)\nend\n\nreturn {false, false}\nLUA;\n }",
"public function pop() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n // fetch first row\n $sql = \"SELECT * FROM \".$this->_dbtp.\"queue \".\n \"ORDER BY \".$this->_dbqp.\"key ASC\";\n $db->limit($sql, 1, 0);\n \n try {\n $res = $db->fetchRow($sql, array(), Zend_Db::FETCH_ASSOC);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n\n if (count($res) == 0) {\n $log->debug(\"Queue is empty.\");\n return null;\n }\n \n // delete row\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"key=?\"; \n try {\n $db->query($sql, $res[$this->_dbqp.'key']);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n \n $log->debug(\"Queue pop success!\");\n return $res;\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function pop()\r\n\t{\r\n\t\t$this->count--;\r\n\t\t$last = array_pop($this->elements);\r\n\t\t$this->rewind();\r\n\t\treturn $last;\r\n\t}",
"public function popProcessor()\n {\n if (!count($this->processors)) {\n throw new \\LogicException('You tried to pop from an empty processor stack.');\n }\n return array_shift($this->processors);\n }",
"function yy_r174()\n {\n $this->compiler->lex->yypopstate();\n $this->_retvalue = '';\n }",
"public function popContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\tif ($index >= 2) {\n\t\t\t// Use context n-1 and clean the last context\n\t\t\t$this->tpl_vars = &$this->context[$index-2];\n\t\t\tunset($this->context[$index-1]);\n\t\t} else if ($index == 1) {\n\t\t\t// Actual context is #0, clean it\n\t\t\t$this->context[0] = array();\n\t\t}\n\t}",
"public function pushBack($value) {\n $node = new Node($value);\n $this->tail->next = $node;\n $this->tail = $node;\n $this->size++;\n }",
"public function unshift($value): void {}"
] | [
"0.770251",
"0.770251",
"0.770251",
"0.770251",
"0.770251",
"0.770251",
"0.770251",
"0.770251",
"0.7468947",
"0.7398456",
"0.73898304",
"0.7379716",
"0.72852385",
"0.72713125",
"0.7267316",
"0.7130837",
"0.7104825",
"0.70015806",
"0.70015806",
"0.6794904",
"0.6792763",
"0.6732493",
"0.6711835",
"0.6684111",
"0.66663384",
"0.6637857",
"0.6631378",
"0.6596292",
"0.6435173",
"0.641462",
"0.6406898",
"0.63860875",
"0.6371809",
"0.63706446",
"0.6357439",
"0.63445497",
"0.6337007",
"0.6290602",
"0.62640685",
"0.62337697",
"0.6224633",
"0.6219253",
"0.6211476",
"0.61685854",
"0.6164194",
"0.61625654",
"0.6158648",
"0.61564046",
"0.61464655",
"0.61298174",
"0.60613155",
"0.6057675",
"0.6040061",
"0.60277927",
"0.5980586",
"0.5966106",
"0.5886231",
"0.58721656",
"0.5861489",
"0.5858599",
"0.5857283",
"0.5848725",
"0.58429253",
"0.58259237",
"0.58248156",
"0.58117265",
"0.5799612",
"0.57569647",
"0.57497716",
"0.5728512",
"0.5714687",
"0.5699985",
"0.5699985",
"0.5699985",
"0.5699985",
"0.5694616",
"0.5663702",
"0.56496453",
"0.5632366",
"0.56114846",
"0.56024003",
"0.5584051",
"0.556292",
"0.55586934",
"0.55408764",
"0.5536348",
"0.55214745",
"0.5497441",
"0.5473679",
"0.5440037",
"0.5430792",
"0.5412536",
"0.5412065",
"0.5407916",
"0.5407916",
"0.54076403",
"0.54068285",
"0.53912663",
"0.53637236",
"0.53624505",
"0.5361655"
] | 0.0 | -1 |
We need to pop a value from the stack | function op_hash160(&$stack, &$bytecode, &$return) {
if (count($stack) == 0) {
throw new CScriptNotValid();
}
// Get value from the stack
$val = array_pop($stack);
// Hash value (sha256, then ripemd160)
if (function_exists('hash')) {
$val = hash('ripemd160', hash('sha256', $val, true), true);
} else if (function_exists('mhash')) {
$val = mhash(MHASH_RIPEMD160, mhash(MHASH_SHA256, $val));
} else {
throw new \Exception("Not implemented");
}
// Push hash on stack
array_push($stack, $val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop()\r\n\t{\r\n\t}",
"public function popNodeFromStack() {}",
"public function pop()\n\t{\n\t\treturn array_shift($this->stackArray);\n\t}",
"public function pop()\n {\n return array_shift($this->stack);\n }",
"public function pop(): int;",
"public function pop()\n {\n \n }",
"public function pop() {\r\n\t\treturn array_pop($this->stack);\r\n\t}",
"public function pop()\r\n {\r\n return array_pop($this->_stack);\r\n }",
"function pop() \n {\n if ($this->count > 0) {\n $this->count--;\n return $this->stack[$this->count];\n }\n return null;\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function decStackPointer() {}",
"public function decStackPointer() {}",
"public function pop() {\n if (count($this->stack) === 0) return null;\n if ($this->isEmpty()) return null;\n\n $this->size--;\n return $this->stack[$this->size];\n }",
"public function pop()\n {\n if ($this->isEmpty())\n {\n return null;\n }\n\n return array_shift($this->stack);\n }",
"public function pop() {\n if ($this->isEmpty()) {\n // trap for stack underflow\n throw new RunTimeException('Stack is empty!');\n } else {\n // pop item from the start of the array\n return array_shift($this->stack);\n }\n }",
"function _popNode () {\r\n $stack_count = count ($this->_stack);\r\n unset ($this->_stack[$stack_count-1]);\r\n return true;\r\n }",
"public function pop()\n {\n if ($this->count > 0) {\n return $this->stack[--$this->count];\n }\n\n return null;\n }",
"public function pop()\n {\n $value = $this->data[$this->currentLength - 1];\n $this->delete($this->currentLength - 1);\n return $value;\n }",
"public static function pop() : string\n {\n $count = (static::$stack);\n \n if ($count > 0) {\n $out = array_pop(static::$stack);\n } else {\n $out = '';\n }//end if\n \n return $out;\n \n }",
"protected function popControllerFromStack()\n {}",
"function yy_pop_parser_stack()\r\n {\r\n if (!count($this->yystack)) {\r\n return;\r\n }\r\n $yytos = array_pop($this->yystack);\r\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\r\n fwrite(self::$yyTraceFILE,\r\n self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .\r\n \"\\n\");\r\n }\r\n $yymajor = $yytos->major;\r\n self::yy_destructor($yymajor, $yytos->minor);\r\n $this->yyidx--;\r\n return $yymajor;\r\n }",
"public function pop()\n {\n $this->update();\n if (isset($this->data[0])) {\n $this->updateValueIfNeeded($this->data, sizeof($this->data) - 1);\n return array_pop($this->data);\n }\n return null;\n }",
"public function pop()\n {\n $current = $this->head;\n while ($current != null) \n {\n $current->next = null;\n }\n if (head == null) \n {\n echo \"underflow\\n\";\n }\n }",
"function pop()\n\t{\n\t\tglobal $argv;\n\t\treturn array_shift($argv);\n\t}",
"function yy_pop_parser_stack()\n {\n if (!count($this->yystack)) {\n return;\n }\n $yytos = array_pop($this->yystack);\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\n fwrite(self::$yyTraceFILE,\n self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] .\n \"\\n\");\n }\n $yymajor = $yytos->major;\n self::yy_destructor($yymajor, $yytos->minor);\n $this->yyidx--;\n return $yymajor;\n }",
"public function popNode();",
"function popEnd();",
"public function pop()\n\t{\n\t\treturn array_pop( $this->data );\n\t}",
"public function pop()\n {\n if (true === $this->isEmpty()) {\n throw new \\BadMethodCallException('Cannot pop element from empty stack.');\n }\n\n --$this->size;\n\n return \\array_pop($this->elements);\n }",
"public function pop()\n {\n // Don't do anything if we don't have any items.\n if ($this->length === 0) return null;\n\n // Pop the last item off the end of the list and return the value.\n $this->length--;\n return array_pop($this->list);\n }",
"public function popContext()\n {\n if (count($this->contextStack)) {\n $this->context = \\array_pop($this->contextStack);\n $this->showState = \\array_pop($this->showStack);\n }\n }",
"public function pop()\n {\n $bit = $this->get($this->size - 1);\n $this->size--;\n\n return $bit;\n }",
"public function pop($name);",
"function pop_no_keep_context()\n{\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = array_pop($NO_KEEP_CONTEXT_STACK);\n}",
"public function pop($default = null);",
"function popState(): void\n {\n if (array_pop($this->stateStack) === null) {\n throw new \\LogicException('The state stack is empty');\n }\n }",
"public function pop(): void\n {\n array_pop($this->bindings);\n }",
"public function pop()\n {\n while (!$this->qu1->isEmpty()) {\n $this->qu2->enqueue($this->qu1->dequeue());\n }\n $x = $this->qu2->dequeue();\n // transfer all elements of qu2 back to qu1\n while (!$this->qu2->isEmpty()) {\n $this->qu1->enqueue($this->qu2->dequeue());\n }\n return $x;\n }",
"public function pop(): stdClass\n {\n if($this->isEmpty()) {\n throw new StackEmptyException;\n }\n\n return array_pop($this->array);\n }",
"function pop() {\n return array_shift($this->queue);\n }",
"public function pop()\n {\n $ret = array_pop($this->calls);\n $this->seek($ret);\n return $ret;\n }",
"abstract public function pop($queue = null);",
"public function popProcessor()\n {\n }",
"public static function remove( $stack_name, $value_name = null )\n\t{\n\t\t\n\t\tif ( $value_name == null ) {\n\t\t\tunset( self::$stacks[ $stack_name ] );\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$stack = self::get_named_stack( $stack_name );\n\t\tif ( isset( $stack[$value_name] ) ) {\n\t\t\tunset( $stack[$value_name] );\n\t\t}\n\t\tself::$stacks[$stack_name] = $stack;\n\t\treturn $stack;\n\t}",
"public function pop()\n {\n return array_shift($this->items);\n }",
"private function popStack($n)\n {\n $this->stack = array_slice($this->stack, 0, -(2 * $n));\n $this->vStack = array_slice($this->vStack, 0, -$n);\n $this->lStack = array_slice($this->lStack, 0, -$n);\n }",
"public function pop()\n {\n return array_pop($this->array);\n }",
"public function pop() {\n if (empty($this->_elements)) {\n throw(new NoSuchElementException('Stack is empty'));\n }\n $element= array_shift($this->_elements);\n $this->_hash+= HashProvider::hashOf($element->hashCode());\n return $element;\n }",
"public function shift()\n {\n return array_shift($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->deck);\n }",
"public function peek() {\r\n\t\treturn $this->stack[count($this->stack)-1];\r\n\t}",
"public function pop()\n\t{\n\t\treturn array_pop($this->items);\n\t}",
"public function pop($queue);",
"public function pop($index = null);",
"function array_top($stack){\n\tif(empty($stack))\n\t\treturn NULL;\n\n\t$top = array_pop($stack);\n\tarray_push($stack, $top);\n\n\treturn $top;\n}",
"function pop()\n {\n return array_pop($this->items);\n }",
"public function clearStack() {}",
"public function pop($queue = null);",
"public function peek()\r\n {\r\n return end($this->_stack);\r\n }",
"function pop_entry()\n {\n $args = func_get_args();\n return call_user_func_array(array( &$this, 'popEntry' ), $args);\n }",
"public function pop()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n $tail = $this->top();\n $this->offsetUnset($tail->getKey());\n\n return $tail;\n }",
"public function popFromQueue()\n {\n $this->semId = sem_get($this->SEMKEY, 1);\n \n //get id of shared memory\n $this->shmId = shm_attach($this->SHMKEY, $this->MEMSIZE);\n \n if (!sem_acquire($this->semId))\n {\n $this->clear();\n throw new Exception();\n }\n \n $counter = shm_get_var($this->shmId, 1);\n if($counter < 2)\n {\n sem_release($this->semId);\n return false;\n }\n $counter--;\n \n $result = shm_get_var($this->shmId, $counter);\n \n if (!shm_put_var($this->shmId, 1, $counter))\n {\n $this->clear();\n throw new Exception();\n }\n \n sem_release($this->semId);\n \n return $result;\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->elements);\n }",
"public function pop() {\n return array_pop($this->errorCodes);\n }",
"private function checkStacks() {\n\t\t\t$o = end($this->openStack);\n\t\t\t$c = end($this->closeStack);\n\n\t\t\t// if last item at open stack is equal with last item at close stack\n\t\t\t// then remove those items from stacks\n\t\t\tif(isset($this->openHooks[$o]) && $this->openHooks[$o] == $c) {\n\t\t\t\tarray_pop($this->openStack);\n\t\t\t\tarray_pop($this->closeStack);\n\t\t\t}\n\t\t}",
"function array_pop(&$array)\n{\n}",
"function push($val) \n {\n $this->stack[$this->count] = $val;\n $this->count++;\n }",
"public function getStack(){\r\n return $this->stack;\r\n }",
"public function pop()\n {\n return array_pop($this->processors);\n }",
"public function pop () {\n if ($this->done()) {\n throw new Exception(\"already at end of tokens!\");\n }\n return array_shift($this->tokens);\n }",
"public function pop()\n {\n return array_pop($this->objects);\n }",
"public function pop(string $path): void\n {\n static::popPath($this->store, $path);\n }",
"public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }",
"public function lPop(): ?TaskObj\n {\n $data = Cache::getInstance()->deQueue('__spider');\n if($data instanceof TaskObj){\n return $data;\n }else{\n return null;\n }\n }",
"public function pop()\n\t{\n\t\tif(!$this->length()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$part = array_pop($this->parts);\n\n\t\tif((string)(int)$part == $part) {\n\t\t\treturn (int)$part;\n\t\t} else {\n\t\t\treturn $part;\n\t\t}\n\t}",
"private function pop_mods() \n {\n array_pop($this->nmods);\n }",
"public function &pop()\n {\n unset($this->_view);\n $count = count($this->_views);\n\n if ($count > 0) {\n unset($this->_views[$count-1]);\n if ($count > 1) {\n $result =& $this->_views[$count-2];\n $this->_view =& $result;\n } else {\n $result = null;\n }\n } else {\n $result = false;\n }\n\n return $result;\n }",
"private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }",
"public static function pop()\n {\n return <<<'LUA'\n-- Pop the first job off of the queue...\nlocal jobs = redis.call('zrange', KEYS[1], 0, 0)\n\nwhile #jobs > 0 do\n -- Check that no one has reserved the job\n if (redis.call('zrem', KEYS[1], jobs[1]) > 0) then\n -- Increment the attempt count and place job on the reserved queue...\n local reserved = cjson.decode(jobs[1])\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\n redis.call('lpop', KEYS[3])\n return {jobs[1], reserved}\n end\n jobs = redis.call('zrange', KEYS[1], 0, 0)\nend\n\nreturn {false, false}\nLUA;\n }",
"public function pop() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n // fetch first row\n $sql = \"SELECT * FROM \".$this->_dbtp.\"queue \".\n \"ORDER BY \".$this->_dbqp.\"key ASC\";\n $db->limit($sql, 1, 0);\n \n try {\n $res = $db->fetchRow($sql, array(), Zend_Db::FETCH_ASSOC);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n\n if (count($res) == 0) {\n $log->debug(\"Queue is empty.\");\n return null;\n }\n \n // delete row\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"key=?\"; \n try {\n $db->query($sql, $res[$this->_dbqp.'key']);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n \n $log->debug(\"Queue pop success!\");\n return $res;\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function pop()\r\n\t{\r\n\t\t$this->count--;\r\n\t\t$last = array_pop($this->elements);\r\n\t\t$this->rewind();\r\n\t\treturn $last;\r\n\t}",
"public function popProcessor()\n {\n if (!count($this->processors)) {\n throw new \\LogicException('You tried to pop from an empty processor stack.');\n }\n return array_shift($this->processors);\n }",
"function yy_r174()\n {\n $this->compiler->lex->yypopstate();\n $this->_retvalue = '';\n }",
"public function popContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\tif ($index >= 2) {\n\t\t\t// Use context n-1 and clean the last context\n\t\t\t$this->tpl_vars = &$this->context[$index-2];\n\t\t\tunset($this->context[$index-1]);\n\t\t} else if ($index == 1) {\n\t\t\t// Actual context is #0, clean it\n\t\t\t$this->context[0] = array();\n\t\t}\n\t}",
"public function pushBack($value) {\n $node = new Node($value);\n $this->tail->next = $node;\n $this->tail = $node;\n $this->size++;\n }",
"public function unshift($value): void {}"
] | [
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.77021587",
"0.7468564",
"0.73998153",
"0.739057",
"0.738034",
"0.72852546",
"0.72711134",
"0.726797",
"0.7131527",
"0.7105379",
"0.70022684",
"0.70022684",
"0.6796776",
"0.679463",
"0.67334366",
"0.6712507",
"0.6684874",
"0.6666974",
"0.66387904",
"0.6631612",
"0.6596775",
"0.6435603",
"0.6415378",
"0.64069945",
"0.6386271",
"0.63717765",
"0.6371439",
"0.63579327",
"0.6343882",
"0.6337278",
"0.62909794",
"0.6264399",
"0.62342244",
"0.6225028",
"0.6219904",
"0.62116164",
"0.6168014",
"0.616429",
"0.6162845",
"0.61584806",
"0.61569464",
"0.61460894",
"0.61299384",
"0.6060931",
"0.60571676",
"0.60415393",
"0.60278755",
"0.5982203",
"0.5966254",
"0.5885595",
"0.5872426",
"0.58615035",
"0.58589906",
"0.58575225",
"0.58484834",
"0.58431417",
"0.5825937",
"0.5824992",
"0.58127594",
"0.5799466",
"0.57572025",
"0.57494885",
"0.57287204",
"0.57143956",
"0.5700259",
"0.5700259",
"0.5700259",
"0.5700259",
"0.5694773",
"0.56640714",
"0.56495804",
"0.56323814",
"0.5610323",
"0.5603209",
"0.55840206",
"0.556313",
"0.5558666",
"0.55409724",
"0.55363166",
"0.5521416",
"0.54976654",
"0.54742897",
"0.5440088",
"0.54305553",
"0.5412016",
"0.5411454",
"0.540795",
"0.540795",
"0.5407515",
"0.5406845",
"0.5391475",
"0.5363494",
"0.53618413",
"0.5361171"
] | 0.0 | -1 |
We need to pop a value from the stack | function op_hash256(&$stack, &$bytecode, &$return) {
if (count($stack) == 0) {
throw new CScriptNotValid();
}
// Get value from the stack
$val = array_pop($stack);
// Hash value (sha256, then sha256)
if (function_exists('hash')) {
$val = hash('sha256', hash('sha256', $val, true), true);
} else if (function_exists('mhash')) {
$val = mhash(MHASH_SHA256, mhash(MHASH_SHA256, $val));
} else {
throw new \Exception("Not implemented");
}
// Push hash on stack
array_push($stack, $val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop();",
"public function pop()\r\n\t{\r\n\t}",
"public function popNodeFromStack() {}",
"public function pop()\n\t{\n\t\treturn array_shift($this->stackArray);\n\t}",
"public function pop()\n {\n return array_shift($this->stack);\n }",
"public function pop(): int;",
"public function pop()\n {\n \n }",
"public function pop() {\r\n\t\treturn array_pop($this->stack);\r\n\t}",
"public function pop()\r\n {\r\n return array_pop($this->_stack);\r\n }",
"function pop() \n {\n if ($this->count > 0) {\n $this->count--;\n return $this->stack[$this->count];\n }\n return null;\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->stack);\n }",
"public function decStackPointer() {}",
"public function decStackPointer() {}",
"public function pop() {\n if (count($this->stack) === 0) return null;\n if ($this->isEmpty()) return null;\n\n $this->size--;\n return $this->stack[$this->size];\n }",
"public function pop()\n {\n if ($this->isEmpty())\n {\n return null;\n }\n\n return array_shift($this->stack);\n }",
"public function pop() {\n if ($this->isEmpty()) {\n // trap for stack underflow\n throw new RunTimeException('Stack is empty!');\n } else {\n // pop item from the start of the array\n return array_shift($this->stack);\n }\n }",
"function _popNode () {\r\n $stack_count = count ($this->_stack);\r\n unset ($this->_stack[$stack_count-1]);\r\n return true;\r\n }",
"public function pop()\n {\n if ($this->count > 0) {\n return $this->stack[--$this->count];\n }\n\n return null;\n }",
"public function pop()\n {\n $value = $this->data[$this->currentLength - 1];\n $this->delete($this->currentLength - 1);\n return $value;\n }",
"public static function pop() : string\n {\n $count = (static::$stack);\n \n if ($count > 0) {\n $out = array_pop(static::$stack);\n } else {\n $out = '';\n }//end if\n \n return $out;\n \n }",
"protected function popControllerFromStack()\n {}",
"function yy_pop_parser_stack()\r\n {\r\n if (!count($this->yystack)) {\r\n return;\r\n }\r\n $yytos = array_pop($this->yystack);\r\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\r\n fwrite(self::$yyTraceFILE,\r\n self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .\r\n \"\\n\");\r\n }\r\n $yymajor = $yytos->major;\r\n self::yy_destructor($yymajor, $yytos->minor);\r\n $this->yyidx--;\r\n return $yymajor;\r\n }",
"public function pop()\n {\n $this->update();\n if (isset($this->data[0])) {\n $this->updateValueIfNeeded($this->data, sizeof($this->data) - 1);\n return array_pop($this->data);\n }\n return null;\n }",
"public function pop()\n {\n $current = $this->head;\n while ($current != null) \n {\n $current->next = null;\n }\n if (head == null) \n {\n echo \"underflow\\n\";\n }\n }",
"function pop()\n\t{\n\t\tglobal $argv;\n\t\treturn array_shift($argv);\n\t}",
"function yy_pop_parser_stack()\n {\n if (!count($this->yystack)) {\n return;\n }\n $yytos = array_pop($this->yystack);\n if (self::$yyTraceFILE && $this->yyidx >= 0) {\n fwrite(self::$yyTraceFILE,\n self::$yyTracePrompt . 'Popping ' . self::$yyTokenName[$yytos->major] .\n \"\\n\");\n }\n $yymajor = $yytos->major;\n self::yy_destructor($yymajor, $yytos->minor);\n $this->yyidx--;\n return $yymajor;\n }",
"public function popNode();",
"function popEnd();",
"public function pop()\n\t{\n\t\treturn array_pop( $this->data );\n\t}",
"public function pop()\n {\n if (true === $this->isEmpty()) {\n throw new \\BadMethodCallException('Cannot pop element from empty stack.');\n }\n\n --$this->size;\n\n return \\array_pop($this->elements);\n }",
"public function pop()\n {\n // Don't do anything if we don't have any items.\n if ($this->length === 0) return null;\n\n // Pop the last item off the end of the list and return the value.\n $this->length--;\n return array_pop($this->list);\n }",
"public function popContext()\n {\n if (count($this->contextStack)) {\n $this->context = \\array_pop($this->contextStack);\n $this->showState = \\array_pop($this->showStack);\n }\n }",
"public function pop()\n {\n $bit = $this->get($this->size - 1);\n $this->size--;\n\n return $bit;\n }",
"public function pop($name);",
"function pop_no_keep_context()\n{\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = array_pop($NO_KEEP_CONTEXT_STACK);\n}",
"public function pop($default = null);",
"function popState(): void\n {\n if (array_pop($this->stateStack) === null) {\n throw new \\LogicException('The state stack is empty');\n }\n }",
"public function pop(): void\n {\n array_pop($this->bindings);\n }",
"public function pop()\n {\n while (!$this->qu1->isEmpty()) {\n $this->qu2->enqueue($this->qu1->dequeue());\n }\n $x = $this->qu2->dequeue();\n // transfer all elements of qu2 back to qu1\n while (!$this->qu2->isEmpty()) {\n $this->qu1->enqueue($this->qu2->dequeue());\n }\n return $x;\n }",
"public function pop(): stdClass\n {\n if($this->isEmpty()) {\n throw new StackEmptyException;\n }\n\n return array_pop($this->array);\n }",
"function pop() {\n return array_shift($this->queue);\n }",
"public function pop()\n {\n $ret = array_pop($this->calls);\n $this->seek($ret);\n return $ret;\n }",
"abstract public function pop($queue = null);",
"public function popProcessor()\n {\n }",
"public static function remove( $stack_name, $value_name = null )\n\t{\n\t\t\n\t\tif ( $value_name == null ) {\n\t\t\tunset( self::$stacks[ $stack_name ] );\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$stack = self::get_named_stack( $stack_name );\n\t\tif ( isset( $stack[$value_name] ) ) {\n\t\t\tunset( $stack[$value_name] );\n\t\t}\n\t\tself::$stacks[$stack_name] = $stack;\n\t\treturn $stack;\n\t}",
"public function pop()\n {\n return array_shift($this->items);\n }",
"private function popStack($n)\n {\n $this->stack = array_slice($this->stack, 0, -(2 * $n));\n $this->vStack = array_slice($this->vStack, 0, -$n);\n $this->lStack = array_slice($this->lStack, 0, -$n);\n }",
"public function pop()\n {\n return array_pop($this->array);\n }",
"public function pop() {\n if (empty($this->_elements)) {\n throw(new NoSuchElementException('Stack is empty'));\n }\n $element= array_shift($this->_elements);\n $this->_hash+= HashProvider::hashOf($element->hashCode());\n return $element;\n }",
"public function shift()\n {\n return array_shift($this->stack);\n }",
"public function pop()\n {\n return array_pop($this->deck);\n }",
"public function peek() {\r\n\t\treturn $this->stack[count($this->stack)-1];\r\n\t}",
"public function pop()\n\t{\n\t\treturn array_pop($this->items);\n\t}",
"public function pop($queue);",
"public function pop($index = null);",
"function array_top($stack){\n\tif(empty($stack))\n\t\treturn NULL;\n\n\t$top = array_pop($stack);\n\tarray_push($stack, $top);\n\n\treturn $top;\n}",
"function pop()\n {\n return array_pop($this->items);\n }",
"public function clearStack() {}",
"public function pop($queue = null);",
"public function peek()\r\n {\r\n return end($this->_stack);\r\n }",
"function pop_entry()\n {\n $args = func_get_args();\n return call_user_func_array(array( &$this, 'popEntry' ), $args);\n }",
"public function pop()\n {\n if ($this->isEmpty()) {\n throw new \\RuntimeException(sprintf('%s is empty', __CLASS__));\n }\n\n $tail = $this->top();\n $this->offsetUnset($tail->getKey());\n\n return $tail;\n }",
"public function popFromQueue()\n {\n $this->semId = sem_get($this->SEMKEY, 1);\n \n //get id of shared memory\n $this->shmId = shm_attach($this->SHMKEY, $this->MEMSIZE);\n \n if (!sem_acquire($this->semId))\n {\n $this->clear();\n throw new Exception();\n }\n \n $counter = shm_get_var($this->shmId, 1);\n if($counter < 2)\n {\n sem_release($this->semId);\n return false;\n }\n $counter--;\n \n $result = shm_get_var($this->shmId, $counter);\n \n if (!shm_put_var($this->shmId, 1, $counter))\n {\n $this->clear();\n throw new Exception();\n }\n \n sem_release($this->semId);\n \n return $result;\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->items);\n }",
"public function pop()\n {\n return array_pop($this->elements);\n }",
"public function pop() {\n return array_pop($this->errorCodes);\n }",
"private function checkStacks() {\n\t\t\t$o = end($this->openStack);\n\t\t\t$c = end($this->closeStack);\n\n\t\t\t// if last item at open stack is equal with last item at close stack\n\t\t\t// then remove those items from stacks\n\t\t\tif(isset($this->openHooks[$o]) && $this->openHooks[$o] == $c) {\n\t\t\t\tarray_pop($this->openStack);\n\t\t\t\tarray_pop($this->closeStack);\n\t\t\t}\n\t\t}",
"function array_pop(&$array)\n{\n}",
"function push($val) \n {\n $this->stack[$this->count] = $val;\n $this->count++;\n }",
"public function getStack(){\r\n return $this->stack;\r\n }",
"public function pop()\n {\n return array_pop($this->processors);\n }",
"public function pop () {\n if ($this->done()) {\n throw new Exception(\"already at end of tokens!\");\n }\n return array_shift($this->tokens);\n }",
"public function pop()\n {\n return array_pop($this->objects);\n }",
"public function pop(string $path): void\n {\n static::popPath($this->store, $path);\n }",
"public function pop()\n {\n if (empty($this->_data)) {\n require_once 'MC/Array/Exception.php';\n throw new MC_Array_Exception(\"Not enough elements for this \" .\n \"operation\");\n }\n \n return array_pop($this->_data);\n }",
"public function lPop(): ?TaskObj\n {\n $data = Cache::getInstance()->deQueue('__spider');\n if($data instanceof TaskObj){\n return $data;\n }else{\n return null;\n }\n }",
"public function pop()\n\t{\n\t\tif(!$this->length()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$part = array_pop($this->parts);\n\n\t\tif((string)(int)$part == $part) {\n\t\t\treturn (int)$part;\n\t\t} else {\n\t\t\treturn $part;\n\t\t}\n\t}",
"private function pop_mods() \n {\n array_pop($this->nmods);\n }",
"public function &pop()\n {\n unset($this->_view);\n $count = count($this->_views);\n\n if ($count > 0) {\n unset($this->_views[$count-1]);\n if ($count > 1) {\n $result =& $this->_views[$count-2];\n $this->_view =& $result;\n } else {\n $result = null;\n }\n } else {\n $result = false;\n }\n\n return $result;\n }",
"private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }",
"public static function pop()\n {\n return <<<'LUA'\n-- Pop the first job off of the queue...\nlocal jobs = redis.call('zrange', KEYS[1], 0, 0)\n\nwhile #jobs > 0 do\n -- Check that no one has reserved the job\n if (redis.call('zrem', KEYS[1], jobs[1]) > 0) then\n -- Increment the attempt count and place job on the reserved queue...\n local reserved = cjson.decode(jobs[1])\n reserved['attempts'] = reserved['attempts'] + 1\n reserved = cjson.encode(reserved)\n redis.call('zadd', KEYS[2], ARGV[1], reserved)\n redis.call('lpop', KEYS[3])\n return {jobs[1], reserved}\n end\n jobs = redis.call('zrange', KEYS[1], 0, 0)\nend\n\nreturn {false, false}\nLUA;\n }",
"public function pop() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n // fetch first row\n $sql = \"SELECT * FROM \".$this->_dbtp.\"queue \".\n \"ORDER BY \".$this->_dbqp.\"key ASC\";\n $db->limit($sql, 1, 0);\n \n try {\n $res = $db->fetchRow($sql, array(), Zend_Db::FETCH_ASSOC);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n\n if (count($res) == 0) {\n $log->debug(\"Queue is empty.\");\n return null;\n }\n \n // delete row\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"key=?\"; \n try {\n $db->query($sql, $res[$this->_dbqp.'key']);\n }\n catch(Exception $ex) {\n $log->err($ex);\n return null;\n }\n \n $log->debug(\"Queue pop success!\");\n return $res;\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function stack($value) {\n return $this->setProperty('stack', $value);\n }",
"public function pop()\r\n\t{\r\n\t\t$this->count--;\r\n\t\t$last = array_pop($this->elements);\r\n\t\t$this->rewind();\r\n\t\treturn $last;\r\n\t}",
"public function popProcessor()\n {\n if (!count($this->processors)) {\n throw new \\LogicException('You tried to pop from an empty processor stack.');\n }\n return array_shift($this->processors);\n }",
"function yy_r174()\n {\n $this->compiler->lex->yypopstate();\n $this->_retvalue = '';\n }",
"public function popContext() {\n\t\t// Count the number of contexts created\n\t\t$index = count($this->context);\n\n\t\tif ($index >= 2) {\n\t\t\t// Use context n-1 and clean the last context\n\t\t\t$this->tpl_vars = &$this->context[$index-2];\n\t\t\tunset($this->context[$index-1]);\n\t\t} else if ($index == 1) {\n\t\t\t// Actual context is #0, clean it\n\t\t\t$this->context[0] = array();\n\t\t}\n\t}",
"public function pushBack($value) {\n $node = new Node($value);\n $this->tail->next = $node;\n $this->tail = $node;\n $this->size++;\n }",
"public function unshift($value): void {}"
] | [
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.77019155",
"0.7468404",
"0.73994184",
"0.7389957",
"0.73798776",
"0.7284741",
"0.7270938",
"0.7267691",
"0.7131278",
"0.7104731",
"0.7001997",
"0.7001997",
"0.67960066",
"0.679387",
"0.67325217",
"0.6711774",
"0.66842294",
"0.6666921",
"0.663799",
"0.66312844",
"0.65964276",
"0.64355916",
"0.6415329",
"0.6406507",
"0.63863206",
"0.6371673",
"0.63713664",
"0.63577193",
"0.63439405",
"0.63370633",
"0.6290334",
"0.6263879",
"0.6234277",
"0.6224462",
"0.62190515",
"0.6211668",
"0.61680645",
"0.6164609",
"0.61635196",
"0.61577624",
"0.6155989",
"0.6145807",
"0.61299115",
"0.60607034",
"0.6057235",
"0.60409594",
"0.6027253",
"0.5981285",
"0.59659857",
"0.58855546",
"0.5871709",
"0.58612835",
"0.58585125",
"0.5857051",
"0.58485055",
"0.58427083",
"0.582575",
"0.58244616",
"0.58123624",
"0.57994336",
"0.57571894",
"0.5748766",
"0.5728511",
"0.571416",
"0.56997824",
"0.56997824",
"0.56997824",
"0.56997824",
"0.56942743",
"0.56640655",
"0.5649246",
"0.56318736",
"0.5610923",
"0.56026953",
"0.558418",
"0.55631346",
"0.5558529",
"0.5541391",
"0.5535914",
"0.55211294",
"0.54970413",
"0.54735667",
"0.5439914",
"0.54305434",
"0.5411812",
"0.54112333",
"0.54084456",
"0.54084456",
"0.540706",
"0.54067284",
"0.53915244",
"0.53635067",
"0.53627294",
"0.53616846"
] | 0.0 | -1 |
///////////////////////////////////////////////////// Script parsing Run a raw script with a specified stack | protected function runRawScript(&$stack, $raw_script) {
$return = null;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runSubStack() {\n\t$reconId=$_POST['reconId'];\n\t$maxjump=$_POST['maxjump'];\n\t$commit=$_POST['commit'];\n\t$description=$_POST['description'];\n\n\t/* *******************\n\tPART 2: Check for conflicts, if there is an error display the form again\n\t******************** */\n\tif (!$description) createSubStackForm(\"<B>ERROR:</B> Enter a brief description\");\n\tif (!$maxjump) createSubStackForm(\"<B>ERROR:</B> You must specify a maximum jump cutoff\");\n\tif (!$reconId) createSubStackForm(\"<B>ERROR:</B> You must specify a reconId\");\n\n\t/* *******************\n\tPART 3: Create program command\n\t******************** */\n\t$command =\"jumperSubStack.py \";\n\t$command.=\"--description=\\\"$description\\\" \";\n\t$command.=\"--max-jump=$maxjump \";\n\t$command.=\"--refinerunid=$reconId \";\n\t$command.= ($commit=='on') ? \"--commit \" : \"--no-commit \";\n\n\t/* *******************\n\tPART 4: Create header info, i.e., references\n\t******************** */\n\t// Add reference to top of the page\n\t$headinfo .= initModelRef(); // main init model ref\n\n\t/* *******************\n\tPART 5: Show or Run Command\n\t******************** */\n\n\t// submit command\n\t$errors = showOrSubmitCommand($command, $headinfo, 'makestack', $nproc);\n\t// if error display them\n\tif ($errors)\n\t\tcreateSubStackForm($errors);\n\texit;\n}",
"function parse() {\n\t\t$this->errno = 0;\n\t\t$this->errinfo = \"\";\n\t\t\n\t\tif( !$this->flagLoaded ) {\n\t\t\t$this->errno = -3;\n\t\t\treturn false;\n\t\t}\n\t\t$this->flagParsed = false;\n\t\tfor( $i = 0; $i < count($this->script); $i++ ) {\n\t\t\t$this->errinfo = \"Line: $i\";\n\t\t\tif( ($this->script[$i][0] == \"#\") &&\n\t\t\t (!strstr($this->script[$i],\"--[\")) &&\n\t\t\t (!strstr($this->script[$i],\"]--\")) ) {\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if( ($this->script[$i][0] == \"#\") &&\n\t\t\t (strstr($this->script[$i],\"--[\")) &&\n\t\t\t (strstr($this->script[$i],\"]--\")) ) {\n\t\t\t\t\n\t\t\t\t$arg = array();\n\t\t\t\t\n\t\t\t\t$j = $i + 1;\n\t\t\t\t\n\t\t\t\twhile ( ($j < count( $this->script )) &&\n\t\t\t\t ($this->script[$j][0] == \"#\") )\n\t\t\t\t\t$j++;\n\t\t\t\twhile ( ($j < count( $this->script )) &&\n\t\t\t\t (trim($this->script[$j]) ==\"\") )\n\t\t\t\t\t$j++;\n\t\t\t\t\n\t\t\t\tfor( ; ($j < count( $this->script )) && ($this->script[$j][0] != \"#\"); $j++) {\n\t\t\t\t\t$arg[] = $this->script[$j];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor( $j = count($arg) - 1; ($j >= 0) && (trim($arg[$j]) == \"\"); $j-- )\n\t\t\t\t\tunset( $arg[$j] );\n\t\t\t\t\n\t\t\t\t$arg = implode( \"\", $arg );\n\t\t\t\t$command = $this->extractCommand( $this->script[$i] );\n\t\t\t\t\t\t\t\t\n\t\t\t\tif( $command == \"SQL\" )\n\t\t\t\t{\n\t\t\t\t\t$this->sql = array_merge($this->sql, split_sql_file(trim($arg),';'));\n\t\t\t\t\t$this->flagSql = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( (trim($arg) == \"\") && ($command != \"CLOSE\") ) {\n\t\t\t\t\t$this->errno = -4;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $command == \"UNKNOWN\" ) {\n\t\t\t\t\t$this->errno = -5;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->commands[] = array( 'cmd' => $command, 'arg' => $arg );\n\t\t\t}\n\t\t}\n\t\t$this->flagParsed = true;\n\t\t$this->errinfo = \"\";\n\t\treturn true;\n\t}",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n\t{\n\t}",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {\n\t\t$utils = PHPCS_SecurityAudit\\Sniffs\\UtilsFactory::getInstance();\n\t\t$tokens = $phpcsFile->getTokens();\n $closer = $phpcsFile->findNext(T_BACKTICK, $stackPtr + 1, null, false, null, true);\n\t\tif (!$closer) {\n\t\t\treturn;\n\t\t}\n $s = $stackPtr + 1;\n\t\t$s = $phpcsFile->findNext(T_VARIABLE, $s, $closer);\n if ($s) {\n\t\t\t$msg = 'System execution with backticks detected with dynamic parameter';\n\t\t\tif ($utils::is_token_user_input($tokens[$s])) {\n\t\t\t\t$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrSystemExec');\n\t\t\t} else {\n\t\t\t\t$phpcsFile->addWarning($msg, $stackPtr, 'WarnSystemExec');\n\t\t\t}\n\t\t}\n\n\t}",
"public function parse()\n {\n while($this->token != Instructions::EOF)\n {\n $choice = $this->decode();\n \n $this->instrCount++;\n $this->stats->add_instr();\n \n switch($choice)\n {\n case Instructions::zeroParams:\n $this->parse_zero_fun();\n break;\n case Instructions::oneParamL:\n $this->parse_oneL_fun();\n break;\n case Instructions::oneParamS:\n $this->parse_oneS_fun();\n break;\n case Instructions::oneParamV:\n $this->parse_oneV_fun();\n break;\n case Instructions::twoParamVS:\n $this->parse_twoVS_fun();\n break;\n case Instructions::twoParamVT:\n $this->parse_twoVT_fun();\n break;\n case Instructions::threeParamLSS:\n $this->parse_threeLSS_fun();\n break;\n case Instructions::threeParamVSS:\n $this->parse_threeVSS_fun();\n break;\n \n case Instructions::EOF:\n $this->stats->sub_instr();\n break;\n \n case Instructions::unknownFun:\n fwrite(STDERR, \"Error! Calling undefined function! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(22);\n }\n }\n }",
"public static function fromRawSource(): self\n {\n return new self($_SERVER['argv'], $_SERVER);\n }",
"function sexpcode_parse_sexp($string, $offset, &$defs)\n{\n\n if ($string[$offset] != '{')\n return array(\"\", -1); /* parser fuck-up, not syntax error */\n\n ++$offset;\n $eos = strlen($string);\n global $sexpcode_tags;\n\n\n /* Retrieve the entire function expression first */\n\n $i = $offset;\n $n = 0;\n while ($i < $eos && $string[$i] != ' ' || $n != 0) {\n switch ($string[$i]) {\n case '{':\n ++$n;\n break;\n case '}':\n if (--$n < 0) return array(\"\", -1);\n break;\n }\n ++$i;\n }\n if ($i == $eos) return array(\"\", -1);\n $expr = substr($string, $offset, $i - $offset);\n $offset = $i + 1;\n\n\n /* Bun's special verbatim syntax. */\n\n if (preg_match('/^[^a-zA-Z0-9{}]/', $expr)) {\n $end = strpos($string, \" \" . $expr, $offset);\n\n return $end === false ? array(substr($string, $offset), $eos)\n : array(substr($string,\n $offset,\n $end - $offset),\n $end + strlen($expr) + 2);\n }\n\n\n /* Function definition */\n\n if ($expr == \"define\") {\n $i = $offset;\n while ($i < $eos && $string[$i] !== ' ')\n ++$i;\n if ($i == $eos) return array(\"\", -1);\n\n $alias = substr($string, $offset, $i - $offset);\n\n ++$i;\n $offset = $i;\n $n = 0;\n while ($i < $eos) {\n if ($string[$i] == '{')\n ++$n;\n elseif ($string[$i] == '}') {\n if ($n == 0) break;\n --$n;\n }\n ++$i;\n }\n if ($i == $eos) return array(\"\", -1);\n\n $expr = substr($string, $offset, $i - $offset);\n $offset = $i + 1;\n\n if (($defs[$alias] = sexpcode_get_tags($expr, $defs)) === false)\n return array(\"\", -1);\n\n return array(\"\", $offset);\n }\n\n\n /* And undefinition. */\n\n if ($expr == \"undefine\") {\n $i = $offset;\n while ($i < $eos && $string[$i] !== '}')\n ++$i;\n if ($i == $eos) return array(\"\", -1);\n\n $fun = substr($string, $offset, $i - $offset);\n if (array_key_exists($fun, $defs))\n unset($defs[$fun]);\n\n return array(\"\", $i + 1);\n }\n\n\n /* Regular function expression */\n\n if (($t = sexpcode_get_tags($expr, $defs)) === false)\n return array(\"\", -1);\n list($open, $close, $verbatim, $arity) = $t;\n\n for ($i = 1; $i <= $arity; ++$i) {\n if (($p = sexpcode_next_arg($string, $offset)) === false)\n return array(\"\", -1);\n list($arg, $offset) = $p;\n\n $open = str_replace('%' . $i . '%', $arg, $open);\n }\n\n\n $ret = $open;\n $i = $offset;\n $n = 0;\n\n while ($i < $eos) {\n switch ($string[$i]) {\n case '}':\n if ($n == 0) {\n return array($ret . substr($string,\n $offset,\n $i - $offset) . $close,\n $i + 1);\n } else --$n;\n break;\n\n case '{':\n if (!$verbatim) {\n $ret .= substr($string, $offset, $i - $offset);\n list($p, $i) = sexpcode_parse_sexp($string, $i, $defs);\n\n if ($i < 0) return array(\"\", -1);\n\n $ret .= $p;\n $offset = $i;\n --$i;\n } else ++$n;\n break;\n }\n ++$i;\n }\n\n\n /* User omitted closing braces; close his tags. */\n\n return array($ret . substr($string, $offset) . $close, $eos);\n}",
"function startText($parser,$data)\n\t{\n\t\tunset($parser);\n\n\t\t$parent_tempcode=array_pop($this->tempcode_stack);\n\t\t$parent_tempcode->attach($data);\n\t\tarray_push($this->tempcode_stack,$parent_tempcode);\n\t}",
"public function process(File $phpcsFile, $stackPtr)\r\n {\r\n // nothing to do here and will never be called\r\n }",
"public static function run($script)\n {\n $script = self::openTag($script);\n //\n $script = self::closeTag($script);\n //\n return $script;\n }",
"abstract public function parse(\\SHH\\Parser &$parser);",
"public function compile($stack)\r\n\t{\r\n\t\tif(empty($stack))\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif(is_array($stack) && isset($stack['name']))\r\n\t\t{\r\n\t\t\t$stack = array($stack);\r\n\t\t}\r\n\t\t\r\n\t\t$str = '';\r\n\t\tforeach((Array) $stack as $element)\r\n\t\t{\r\n\t\t\tif(is_string($element))\r\n\t\t\t{\r\n\t\t\t\t$str .= $this->parse_individual($element);\r\n\t\t\t}\r\n\t\t\telseif( ! empty($element))\r\n\t\t\t{\r\n\t\t\t\t$str .= $this->context->render_tag($element['name'], $element['args'], $element['content']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $str;\r\n\t}",
"private function processStack($stack_name)\n {\n foreach ($this->$stack_name as $action)\n {\n array_shift($this->$stack_name);\n\n // stack entry is an object, let's save it\n if (is_object($action) && $action instanceof BaseObject)\n {\n $action->save();\n }\n // stack entry is an sql query, let's execute it\n elseif (is_string($action))\n {\n $con = Propel::getConnection();\n $statement = $con->prepareStatement($action);\n $result = $statement->executeQuery();\n }\n else\n {\n $msg = sprintf('Unable to process %s stack entry: %s', $stack_name, serialize($action));\n throw new Exception($msg);\n }\n\n }\n }",
"public function process(File $phpcsFile, $stackPtr)\n {\n // no variable are in the string from here\n $tokens = $phpcsFile->getTokens();\n $qtString = $tokens[$stackPtr]['content'];\n // makes sure that it is about a double quote string,\n // since variables are not parsed out of double quoted string\n $open_qt_str = substr($qtString, 0, 1);\n\n // clean the enclosing quotes\n $qtString = substr($qtString, 1, strlen($qtString) - 1 - 1);\n\n if (0 === strcmp($open_qt_str, '\"')) {\n $this->processDoubleQuotedString($phpcsFile, $stackPtr, $qtString);\n } else if (0 === strcmp($open_qt_str, \"'\")) {\n $this->processSingleQuotedString($phpcsFile, $stackPtr, $qtString);\n }\n }",
"public function run()\n {\n// $this->parse();\n }",
"public abstract function exec();",
"function parse(){ // parsing template\n\t$loop_count = -1;\n\tif (func_num_args()>= 1){\n\t\t$proc_type = func_get_arg(0);\n\t\t//if (!in_array($proc_type, array(PT_ROOT, PT_IF, PT_FOR, PT_SILENT_IF, PT_SILENT_FOR, PT_FALSE_IF))) system_die('Invalid process type', 'Template->parse');\n\t} else {\n\t\tif ( (PT_COMPILE) && (isset($this->filename)) ) // file parsing\n\t\t{\n\t\t\tif (file_exists($this->filename . '.php'))\n\t\t\t\tif (filemtime($this->filename . '.php') > filemtime($this->filename))\n\t\t\t\t{\n\t\t\t\t\tinclude($this->filename . '.php');\n\t\t\t\t\t$this->result = $r;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t$nesting = 0;\n\t\t\t$tplc = '<?$r=\\'\\';';\n\t\t\tfor ($i=0; $i<count($this->template); $i++)\n\t\t\t{\n\t\t\t\t// process\n\t\t\t\t$line = trim($this->template[$i]);\n\t\t\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\t\t\t$result = array();\n\t\t\t\tif (preg_match(PT_START_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'for ($i' . $nesting . '=0;$i' . $nesting . '<intval(' . $this->get_var_ref($result[3], $nesting) . ');$i' . $nesting . '++){' . \"\\n\";\n\t\t\t\t\t\t$nesting++;\n\t\t\t\t\t}\n\t\t\t\t\telse // this line is IF opening tag\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'if ('.$result[2].'(bool)('.$this->get_var_ref($result[3], $nesting).')){' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} elseif (preg_match(PT_END_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}' . \"\\n\";\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t\t$nesting--;\n\t\t\t\t} elseif (preg_match(PT_MIDDLE_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}else{' . \"\\n\";\n\t\t\t\t} elseif (preg_match('/<%/', $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$j = 0;\n\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\twhile ($j<strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ($line[$j] == '<') && ($line[$j+1] == '%') )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_f_value(substr($line, $j), $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t$j += $dw;\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$tmp_str .= $line[$j];\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t\t$tplc .= '$r.=\"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($line, $nesting, $dw) . \".\\\"\\\\n\\\";\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tplc .= '?>';\n\t\t\t\n\t\t\t$fh = fopen($this->filename . '.php', 'wt');\n\t\t\tif ($fh)\n\t\t\t{\n\t\t\t\tfwrite($fh, $tplc);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsystem_die('Cannot save compiled template');\n\t\t\tinclude($this->filename . '.php');\n\t\t\t$this->result = $r;\n\t\t\treturn 0;\n\t\t} // if compile and filename\n\t\t$proc_type = PT_ROOT;\n\t\tunset($this->result);\n\t}\n\tif (func_num_args()> 1){\n\t\t$curr_pos = intval(func_get_arg(1));\n\t\tif (($proc_type == PT_FOR) && (func_num_args() < 3)) system_die('Undefined loop count (FOR process)', 'Template->parse');\n\t\tif (func_num_args()> 2) $loop_count = intval(func_get_arg(2));\n\t}\n\telse\n\t\t$curr_pos = 0;\n\t$succ_mode = false;\n\twhile ($curr_pos < sizeof($this->template)){\n\t\t$line = $this->template[$curr_pos]; // current line\n\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\tif (preg_match(PT_START_TAGS, $line, $result)){ // this line contains one of the START tags\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif ($result[1] == 'FOR'){\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){ // invalid FOR variable\n\t\t\t\t\t$error_msg = 'Invalid FOR statement counter named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type <= PT_FOR) $count = intval($this->get_var_val($result[3]));\n\t\t\t\t\t$this->system_vars['cycle_nesting']++;\n\t\t\t\t\t$nesting_saver = $this->system_vars['cycle_nesting'];\n\t\t\t\t\tif ($proc_type> PT_FOR) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($count == 0) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor ($c = 0; $c < $count; $c++){\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_counters'][$nesting_saver] = $c;\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_nesting'] = $nesting_saver;\n\t\t\t\t\t\t\t\t$last_pos = $this->parse(PT_FOR, $curr_pos + 1, $c); // create visible FOR process in loop\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$curr_pos = $last_pos;\n\t\t\t\t}\n\t\t\t} else { // this line is IF opening tag\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){\n\t\t\t\t\t$error_msg = 'Invalid IF statement variable named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type>PT_FOR) $curr_type = PT_SILENT_IF;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$var = (bool)$this->get_var_val($result[3]);\n\t\t\t\t\t\tif (strlen($result[2])> 0) $var = !$var;\n\t\t\t\t\t\t$curr_type = ($var)?PT_IF:PT_FALSE_IF;\n\t\t\t\t\t}\n\t\t\t\t\tif ($loop_count!=-1) $curr_pos = $this->parse($curr_type, $curr_pos+1, $loop_count); // create new IF process inside the loop\n\t\t\t\t\telse $curr_pos = $this->parse($curr_type, $curr_pos+1); // create new IF process\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(preg_match(PT_END_TAGS, $line, $result)){\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (((($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) && ($result[1] == 'FOR')) || ((($proc_type == PT_IF) || ($proc_type == PT_SILENT_IF) || ($proc_type == PT_FALSE_IF)) && ($result[1] == 'IF'))) {\n\t\t\t\tif (($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) $this->system_vars['cycle_nesting']--; // this one was the end of loop block\n\t\t\t\t$succ_mode = true;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$error_msg = 'Unexpected end of '.$result[1].' statement';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif(preg_match(PT_MIDDLE_TAGS, $line, $result)){ // this line contains one of the MIDDLE tags (ELSE probably)\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (($proc_type == PT_FALSE_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_IF;\n\t\t\t} elseif (($proc_type == PT_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_FALSE_IF;\n\t\t\t} elseif($proc_type != PT_SILENT_IF) { // ELSE inside non IF process or so\n\t\t\t\t$error_msg = 'Unexpected '.$result[1].' statement '.$proc_type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif ($proc_type <= PT_FOR){ // processing of visible contents\n\t\t\tif (!isset($this->result)) $this->result = '';\n\t\t\t\t$matches = array();\n\t\t\t\t$line_is_control = false;\n\n\t\t\t\tif (preg_match_all(PT_COUNTER_TAGS, $line, $matches)){ // We have counter tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[0] as $key => $val){ // process counters\n\t\t\t\t\t\tif ($loop_count >= 0) $replace[$key] = $loop_count + 1;\n\t\t\t\t\t\telse $replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\t\t\t\t// processing variables\n\n\t\t\t\tif (preg_match_all(PT_VARIABLE_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (strlen($matches[4][$key])> 0){ // process array variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]) && is_array($this->vars[$val]) && array_key_exists($matches[4][$key], $this->vars[$val])){\n\t\t\t\t\t\t\t\t\t$replace[$key] = $this->vars[$val][$matches[4][$key]];\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif (isset($this->vars[$val]) && is_object($this->vars[$val])) {\n\t\t\t\t\t\t\t\t \t$_obj = &$this->vars[$val];\n\t\t\t\t\t\t\t\t\t$_name = $matches[4][$key];\n\t\t\t\t\t\t\t\t\t$replace[$key] = $_obj->$_name;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\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\tif ($this->debug_mode) $this->show_notice($val.$matches[3][$key], 4); // show stupid notice\n\t\t\t\t\t\t\t\t$replace[$key] = ''; // and insert complete emptyness\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else{ // process common variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]))\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($val);\n\t\t\t\t\t\t\telseif (preg_match('/\\\\//', $val))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v_row = $this->Registry->_internal_get_value($val);\n\t\t\t\t\t\t\t\tif ( ($v_row !== false) && (!$v_row->eof()) ) {\n\t\t\t\t\t\t\t\t\t$out = $v_row->Rows[0]->Fields['value'];\n\t\t\t\t\t\t if ($v_row->Rows[0]->Fields['key_type'] == KEY_TYPE_IMAGE)\n\t\t\t\t\t\t\t\t\t\t$out = $GLOBALS['app']->template_vars['REGISTRY_WEB'] . $v_row->Rows[0]->Fields['id_path'] . '/' . $out;\n\t\t\t\t\t\t\t\t\t$replace[$key] = $out;\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\t$replace[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing ternary operators\n\n\t\t\t\tif (preg_match_all(PT_TERNARY_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (isset($this->vars[$val])){\n\t\t\t\t\t\t\t$var = (bool)$this->get_var_val($val);\n\t\t\t\t\t\t\tif (strlen($matches[1][$key])> 0) $var = !$var;\n\t\t\t\t\t\t\t$res_num = ($var)?4:6;\n\t\t\t\t\t\t\tif (isset($this->vars[$matches[$res_num][$key]])) {\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($matches[$res_num][$key]);\n\t\t\t\t\t\t\t\tif (strlen($matches[$res_num - 1][$key])> 0) $replace[$key] = htmlspecialchars($replace[$key]); // escape html entries\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($res_var, 1);\n\t\t\t\t\t\t\t\t$result[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // we have tag but haven't got variable\n\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val, 1); // curse them out in debug mode\n\t\t\t\t\t\t\t$replace[$key] = ''; // and insert pretty nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing controls\n\t\t\t\tif (preg_match_all(PT_CONTROL_TAGS, $line, $matches)){ // Yes! This line contains control definition\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[1] as $key => $name){ // go through the matches\n\t\t\t\t\t\tif (strlen($matches[3][$key])> 0) $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name), strtolower($matches[3][$key])); // here is control with id\n\t\t\t\t\t\telse $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name)); // here is control without id\n\t\t\t\t\t\tif (!is_null($tcontrol)){\n\t\t\t\t\t\t\t$tcontrol->parse_vars($matches[5][$key]);\n\t\t\t\t\t\t\tif (!$tcontrol->is_inited)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tcontrol->on_page_init();\n\t\t\t\t\t\t\t\t$tcontrol->is_inited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$replace[$key] = $tcontrol->process($loop_count);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace control statements with control results\n\t\t\t\t}\n\n\t\t\t\t// compress and delete blank lines\n\t\t\t\t$line = preg_replace('/[\\r\\n]*$/', '', trim($line));\n\t\t\t\tif (strlen($line)> 0) $this->result .= $line . \"\\n\";\n\t\t\t}\n\t\t\t$curr_pos++;\n\t\t}\n\n// And what we have here?\n\t\tif (!isset($error_msg) && ($proc_type != PT_ROOT) && !$succ_mode) $error_msg = 'Unexpected end of file'; // invalid template - show error\n\t\tif (isset($error_msg)){\n\t\t\t$error_txt = 'Template parsing error on line '.($curr_pos + 1);\n\t\t\tif (isset($this->filename))\t$error_txt .= ' of file \"'.$this->filename.'\"';\n\t\t\t$error_txt .= ' - '.$error_msg;\n\t\t\tsystem_die($error_txt, 'Template->parse'); // invalid template - show error\n\t\t}\n\t\tif ($proc_type == PT_ROOT)\n\t\t\tif (!isset($this->result))\n\t\t\t\t$this->result = ''; // probably there were one big false IF?\n\t\treturn $curr_pos; // HURRA! HURRA! This one is successfully completed!\n\t}",
"function runkit_lint($code)\n{\n}",
"function parse_args($argv,$argc){\n \n //Checking if help argument is present, if so, prints help\n if($argc == 2 && $argv[1] == \"--help\"){\n echo \"Nápověda pro skript v jazyce php pro provedení lexikální a syntaktické analýzy jazyka .IPPCode21\\n\";\n echo \"Verze php: 7.4.14\\n\";\n echo \"Spuštění skriptu: php parser.php <název souboru>\\n\";\n echo \"Výstup skriptu je xml soubor \\\"out.xml\\\"\\n\";\n echo \"Zobrazení nápovědy: php parser.php --help\\n\";\n exit(0);\n }\n //If argc > 1 (1st arg is program name, implicitly), searching for STATP extension parameters\n //Along with checking for arguments, checking formats and arguments order\n elseif($argc > 1){\n //Number of --stat parameters (must be at least 0)\n $n_of_stat = -1; \n //Array of permissions, it's size will be equal to number of --stat output files\n $permissions_array = array();\n //Allowed parameters (excluding --statp which is checked separately)\n $allowed_params = array(\"--loc\",\"--comments\",\"--labels\",\"--jumps\",\"--fwjumps\",\"--backjumps\",\n \"--badjumps\");\n \n //Used_filenames needs to be stored for latter repetition check. (There can't be 2\n // stat argument with same file name ) \n $used_filenames = array();\n for($i = 1; $i < $argc; $i = $i + 1)\n {\n //If --stat parameter with correct file name is present\n if(preg_match(\"/\\A--stats=.*\\z/\",$argv[$i])){\n $n_of_stat += 1; //increase number of --stat parameter\n $file_name = substr($argv[$i],8); //extract filename from parameter\n \n //If filename is used return File output error\n if (in_array($file_name,$used_filenames)){\n exit(ErrNums::FILE_OUTPUT_ERROR);\n }\n\n //If not open file and include it's name in used_filename array\n $file = fopen($file_name,'w');\n $used_filenames[$n_of_stat] = $file_name;\n \n //If file opening wasn't successful return File output error\n if(!$file){\n exit(ErrNums::FILE_OUTPUT_ERROR);\n }\n\n //Adding new Statistic permission to permission array (more in scripts/statistics.php)\n //Saving output file to permission array\n //Defining order array, which defines order of parameters (needed for correct output)\n $permissions_array[$n_of_stat] = new StatisticsPermissions();\n $permissions_array[$n_of_stat]->file = $file;\n $permissions_array[$n_of_stat]->order = array();\n }\n /*If argument isn't --stat, then it must be one of allowed_parameters\n If it is,argument is pushed to order array. If not, returns MISSING_PARAMETERS err */\n elseif (in_array($argv[$i],$allowed_params) && $n_of_stat >= 0){\n array_push($permissions_array[$n_of_stat]->order,$argv[$i]);\n }\n else{\n exit(ErrNums::MISSING_PARAMETERS);\n }\n }\n return $permissions_array;\n }\n}",
"function testParse()\n{\n global $tmpFiles1;\n global $tmpFiles2;\n global $parseFile;\n global $src;\n global $rc;\n global $html;\n global $failedParse;\n global $passedParse;\n\n # create body of html\n $body = $html->createElement(\"body\");\n $h = $html->createElement(\"h1\", \"This is script for testing parse.php and interpret.py scripts\");\n $body->appendChild($h);\n $p = $html->createElement(\"p\", \"Testing parse.php\");\n $body->appendChild($p);\n\n # find path to .rc files\n $tmp = explode(\"/\", explode(\".rc\", $rc[0], -1)[0]);\n $rcPath = explode($tmp[count($tmp)-1], $rc[0]);\n\n # create table\n $table = $html->createElement(\"table\");\n $tableAttribute = $html->createAttribute(\"style\");\n $tableAttribute->value = \"width:50%\";\n $table->appendChild($tableAttribute);\n $tr = $html->createElement(\"tr\");\n $th = $html->createElement(\"th\", \"Test name\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Test result\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"RC\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Expected RC\");\n $tr->appendChild($th);\n $table->appendChild($tr);\n $body->appendChild($table);\n\n exec(\"make\");\n foreach ($src as $source) {\n $sourceName = explode(\".src\", $source, -1);\n exec(\"./$parseFile < $source > $sourceName[0].tmp 2> /dev/null\",$output, $returnCode);\n\n # find test name\n $testName = explode(\"/\", $sourceName[0]);\n\n # create .rc file if it does not exist\n $rcFile = getRC($testName[count($testName)-1]);\n if ( $rcFile === null) {\n file_put_contents($rcPath[0].$testName[count($testName)-1].'.rc', 0);\n $rc[] = $rcPath[0].$testName[count($testName)-1].'.rc';\n }\n\n # check return code value\n if ($returnCode > 0) {\n $tr = $html->createElement(\"tr\");\n $td = $html->createElement(\"td\", $testName[count($testName)-1]);\n $tr->appendChild($td);\n\n $tmpRC = trim(file_get_contents($rcFile));\n if (intval($tmpRC) !== $returnCode) {\n $td = failedTableData();\n $failedParse++;\n } else {\n $td = successTableData();\n $passedParse++;\n }\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $returnCode);\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $tmpRC);\n $tr->appendChild($td);\n $tmpFiles1[] = $sourceName[0].'.tmp';\n } else {\n $tmpFiles2[] = $sourceName[0].'.tmp';\n }\n\n $table->appendChild($tr);\n }\n $body->appendChild($table);\n\n return $body;\n}",
"public function process( File $phpcsFile, $stackPtr ) {\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t$next = $phpcsFile->findNext( Tokens::$emptyTokens, $stackPtr + 1, null, true );\n\t\tif ( false === $next ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( T_FUNCTION === $tokens[ $next ]['code'] ) {\n\t\t\t$name = $tokens[ $phpcsFile->findNext( [ T_WHITESPACE ], $next + 1, null, true ) ]['content'];\n\t\t} else {\n\t\t\t$name = $tokens[ $phpcsFile->findNext( [ T_VARIABLE ], $next ) ]['content'];\n\t\t}\n\t\t$this->handleError( $phpcsFile, $stackPtr, 'Found', $name );\n\t}",
"protected function processVariableInString(File $phpcsFile, $stackPtr)\n {\n\n }",
"public function testPreparseCode()\n\t{\n\t\tforeach ($this->bbPreparse_tests as $testcase)\n\t\t{\n\t\t\t$test = $testcase[0];\n\t\t\t$expected = $testcase[1];\n\n\t\t\tpreparsecode($test);\n\n\t\t\t$this->assertEquals($expected, $test);\n\t\t}\n\t}",
"function execute( string $contents ): string;",
"function test363() : int {\n return ast\\parse_code(22, []);\n}",
"static private function phrase($html,$stack=array(),$current=null,$final=null){\n\t\t//echo var_export($stack);\n\t\tif(!is_null($final)&&sizeof($stack)==0){\n\t\t\treturn $final;\n\t\t}\n\t\tif (is_null($current)){\n\t\t\t$data=preg_match_r(\"/\\s*<!--\\s*(?<meta>.*)\\s*-->(?<next>.*)/Ai\",$html);\n\t\t\tif(sizeof($data)!=0){\n\t\t\t\t$html=$data[\"next\"];\n\t\t\t}\n\t\t}\n\t\tif(sizeof($stack)>=1){\n\t\t\tforeach(range(sizeof($stack)-1,0,-1) as $count){// do a callback to see if there are things that are unexpected :)\n\t\t\t\t$type_to_look_for_end_of=$stack[$count];\n\t\t\t\t$end_check=preg_match_r(\"/(?<inner_content>[^<]*)\\s*<\\s*\\/\\s*\".$type_to_look_for_end_of.\"\\s*>(?<next>.*)/siA\", $html);\n\t\t\t\tif(sizeof($end_check)>=1){\n\t\t\t\t\t//$inner_content=preg_split(\"/\\s*<\\s*\\/\\s*\".$type_to_look_for_end_of.\"\\s*>/\", $html,1)[0];//$end_check[\"inner_content\"];//@TODO apply secondary callback here\n\t\t\t\t\t$html=$end_check[\"next\"];\n\t\t\t\t\t//$current->add_content_string($inner_content);\n\t\t\t\t\t//go up x layer in tree and recall base val\n\t\t\t\t\t$current=$current->get_parents();//[$count];\n\t\t\t\t\t$current=$current[sizeof($current)-1-$count];\n\t\t\t\t\t$current->flatten();\n\t\t\t\t\t$stack=array_slice($stack,0,$count);//remove item from stack\n\t\t\t\t\treturn array($html,$stack,$current,$final);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$self_close_check=preg_match_r(\"/(?<inner_content>[^<]*)<\\s*\\/\\s*(?<end>\\w+)\\s*>/A\",$html);\n\t\t\tif(sizeof($self_close_check)>=1){\n\t\t\t\tif($stack[sizeof($stack)-2]==$self_close_check[\"end\"]){\n\t\t\t\t\t$inner_content=$self_close_check[\"inner_content\"];\n\t\t\t\t\t$current->add_content_string($inner_content);\n\t\t\t\t\t$current->self_closing=true;\n\t\t\t\t\t//go up 1 layer in tree and recall base\n\t\t\t\t\t$current=$current->get_parent();\n\t\t\t\t\tarray_pop($stack);//remove item from stack\n\t\t\t\t\treturn array($html,$stack,$current,$final);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//add check for tag stack close\n\t\t$first_match_group=preg_match_r(\"/(?<before>([^<]*(<!--)*)*)<\\s*(?<type>\\w+)\\s*(?<next>.*)/siA\",$html);\n\t\t$before=$first_match_group[\"before\"];\n\t\t$type=$first_match_group[\"type\"];\n\t\t$next=$first_match_group[\"next\"];\n\t\t/*\n\t\tArray indexes:\n\t\t[\"before\"]: string that appears before the '<' of a HTML tag.\n\t\t[\"type\"]: the type of the html tag in question\n\t\t[\"next\"]: following the type (including atributes)\n\t\tREGEX /(?<before>.+)<\\s{0,}(?<type>\\w+)\\s+(?<next>.+)/si\n\t\t\"(?<before>.*)\": set index 'before' for returnd array to all string charicters that are not a \"<\" charicter.(can be noting)\n\t\t\"<\": look for opening less than symbol.\n\t\t\"\\s{0,}\": look for any whitspace between the count of 0 and infinity\n\t\t\"(?<type>\\w+)\" collect a string of non punctual charicters\n\t\t\"\\s+\":expect whitespace charicters after the fact\n\t\t\"(?<next>.*)\" Captures everything after the type\n\t\t\"/siA\" 's' dot matches newline , i case insensitive, 'A' matches only at the start of string.\n\t\tSee: http://www.phpliveregex.com/p/erB\n\t\t*/\n\t\t$attr_to_add=array();\n\t\t$fail_safe=0;\n\t\twhile(true){//infinite loop\n\t\t\t$fail_safe++;\n\t\t\tif($fail_safe>50){\n\t\t\t\n\t\t\t\tthrow new Exception(\"Failed: to phrase html (malformed attributes) NOTE ALL SELF CLOSING TAGS MUST HAVE A '/>'\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\t$end_of_tag_check=preg_match_r(\"/\\s*((?<not_self_closing>>)|(?<self_closing>(\\/\\s*>)))(?<next>.*)/siA\",$next);\n\t\t\tif(sizeof($end_of_tag_check)>=1){// handle self closing if ending found\n\t\t\t\t\n\t\t\t\t$self_closing=$end_of_tag_check[\"self_closing\"];\n\t\t\t\t$not_self_closing=$end_of_tag_check[\"not_self_closing\"];\n\t\t\t\tif($self_closing!=\"\"){\n\t\t\t\t\t$self_closing=true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\n\t\t\t\t\t$self_closing=false;\n\t\t\t\t}\n\t\t\t\t$next=$end_of_tag_check[\"next\"];\n\t\t\t\tbreak;\n\t\t\t}\n\t\n\t\t\t$attr_data=preg_match_r(\"/\\s*(?<attr>(?:\\w|-|_)+)\\s*=\\s*(?<val>(?:\\\"(?:[^\\\"\\\\]|\\\\.)*\\\"|'(?:[^'\\\\]|\\\\.)*')\\s*)?(?<next>.*)/siA\", $next);#/\\s*(?<attr>(\\w|-|_)+)\\s*(=\\s*(?<val>(\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')\\s*)?(?<next>.*)/siA\n\t\t\t$attr_name=$attr_data[\"attr\"];\n\t\t\t$attr_val=\"\";\n\t\t\tif( isset($attr_data[\"val\"])){\n\t\t\t\t$attr_val=trim($attr_data[\"val\"],\"'\\\"\");\n\t\t\t}\n\t\t\t$next=$attr_data[\"next\"];\n\t\t\t$attr_to_add=array_merge($attr_to_add,array($attr_name=>$attr_val));\n\t\t}\n\t\tif($type===\"script\"||$type===\"style\"){\n\t\t\t$this->handle_extream_case($html);\n\t\t}\n\t\tif (is_null($final)){//if the final form of the tree is not set\n\t\t\t$final= new elem($type,\"\",$attr_to_add,false,$self_closing);//construct it\n\t\t\t$final->overide_master();\n\t\t\t$current=$final;//set current to it\n\t\t}\n\t\telse{\n\t\t\t$current=$current->add_content($type,\"\",$attr_to_add,false,$self_closing);//add elem obj to constructing tree and go up 1 level.\n\t\n\t\t}\n\t\t$current->insert_before($before);//dump before_data before it\n\t\tif($current->is_selfclosing()){\n\t\t\t$current=$current->get_parent();\n\t\t}\n\t\telse{\n\t\t\tarray_push($stack,$type);//add item to the stack\n\t\t}\n\t\treturn array($next,$stack,$current,$final);\n\t}",
"function runParser($filePath) {\n fileParser($filePath);\n\n fileNumberAdder();\n\n formatPrinter();\n}",
"protected function _script($tree) {\n\t\t\n\t\t\t$content = array();\n\n\t\t\tif (is_string($tree)) {\n\t\t\t\t$tree = addslashes($tree);\n\t\t\t\treturn \"\\$_text[] = \\\"{$tree}\\\";\";\n\t\t\t}\n\n\t\t\tif (count($tree['children'] > 0)) {\n\t\t\t\tforeach ($tree['children'] as $child) {\n\t\t\t\t\t$content[] = $this->_script($child);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($tree['parent'])) {\n\n\t\t\t\treturn $this->_implementation->handle($tree, implode($content));\n\t\t\t}\n\n\t\t\treturn implode($content);\n\t\t}",
"abstract public function execute($sourcecode, $language, $input, $files=null, $params=null);",
"function evaluate_postfix($tokens, array $vars = array()) \n {\n\n //if we didn't recieve any tokens \n if ($tokens == false) \n return false;\n\n //create a new stack, which we'll use to evaluate the \"postfix\" expression\n $stack = new mathscript_stack();\n\n //for each token in the postfix string\n foreach ($tokens as $token)\n {\n \n //if the token is an array, it represents a function; evaluate it\n if (is_array($token) && !array_key_exists('string', $token)) \n { \n //get the function name, and the amount of arguments specified\n $function_name = $token[MATHSCRIPT_FUNCTION_NAME];\n $arg_count = $token[MATHSCRIPT_ARGUMENT_COUNT];\n\n //handle constructed functions, which are written in PHP for use by the scripted language\n if ($this->extensions->function_exists($function_name))\n {\n //start a new array, which will hold the function arguments\n $args = array();\n\n //for($i = $arg_count - 1; $i >= 0 ; --$i)\n for($i = 0; $i < $arg_count; ++$i)\n {\n //pop the top element off the stack\n list($reference, $top) = $stack->pop();\n\n //if this function expects pass-by-refernce, the pass it a reference to the object\n if($this->extensions->function_argument_by_reference($function_name, $i))\n {\n //Note the lack of a check for existence. This allows us to _create_ variables by reference.\n \n //if our reference was supplied as a literal, use it as a pointer\n if(is_null($reference))\n $args[$i] =& $top;\n else\n $args[$i] =& $reference;\n }\n //add the new element to the arguments array\n else\n {\n //if we're trying to operate on an undefined variable, raise an error\n if(is_null($top))\n return $this->trigger_undefined_variable($reference);\n\n //otherwise, pass in the variable\n $args[$i] = $top;\n }\n\n }\n\n //Call the constructed function with the given arguments, and retrieve the results.\n $result = $this->extensions->call($function_name, array_reverse($args));\n\n //if the result of the given function was false, something went wrong internally\n //TODO: replace with exception?\n if($result === false)\n return $this->trigger('internal error in function '.$function_name);\n\n //push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n \n }\n //otherwise if this is a user (runtime) defined function, handle it \n elseif (array_key_exists($function_name, $this->user_functions)) \n {\n //extract the expected amount of function arguments\n $expected_args = count($this->user_functions[$function_name][MATHSCRIPT_ARGUMENTS]);\n\n //start a new associative array, which will map the argument _name_ to the given argument\n $args = array();\n \n //for each argument provided\n for ($i = $expected_args - 1; $i >= 0; $i--) \n {\n //pull a single argument from the top of the stack\n list($reference, $top) = $stack->pop();\n\n if(is_null($top))\n return $this->trigger_undefined_variable($reference);\n\n //get the name for the current argument\n $arg_name = $this->user_functions[$function_name][MATHSCRIPT_ARGUMENTS][$i];\n\n //and add the name/value pair to our array\n $args[$arg_name] = $top;\n }\n\n //take a snapshot of the current system state\n $initial_vars = $this->vars;\n\n //merge in the arguments as local variables\n $this->vars = array_merge($this->vars, $args);\n\n //evaluate the given function via recursion\n $result = $this->evaluate_postfix($this->user_functions[$function_name][MATHSCRIPT_FUNCTION_BODY]);\n\n //and discard any modifications to the variable space\n $this->vars = $initial_vars;\n\n //and push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n }\n }\n\n //handle binary operators\n elseif(!is_array($token) && array_key_exists($token, self::$operators) && self::$operators[$token]['arity'] == 2)\n {\n //pop two operands off the stack\n list($ref2, $op2) = $stack->pop();\n list($ref1, $op1) = $stack->pop();\n\n //if we didn't get an operand, throw an error\n if(is_null($op1))\n return $this->trigger_undefined_variable($ref1);\n if(is_null($op2))\n return $this->trigger_undefined_variable($ref2);\n\n //get the handler for the given operator\n $handler = self::$operators[$token]['handler'];\n\n //call the given handler to perform the operation\n $result = call_user_func($handler, $this, $op1, $op2);\n\n //and push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n }\n //handle unary operators\n elseif(!is_array($token) && array_key_exists($token, self::$operators) && self::$operators[$token]['arity'] == 1)\n {\n //pop the operand off the stack\n list($ref, $op) = $stack->pop();\n\n //get the handler for the given operator\n $handler = self::$operators[$token]['handler'];\n\n //if the operator is designed for pass-by-reference\n if(self::$operators[$token]['by_reference'])\n {\n //get a reference to the operand\n $arg =& $ref;\n }\n else\n {\n //if we didn't get an operand, throw an error\n if(is_null($op))\n return $this->trigger_undefined_variable($ref);\n\n //set the argument equal to the operand\n $arg = $op;\n }\n\n //call the given handler to perform the operation\n $result = call_user_func($handler, $this, $arg);\n\n //and push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n }\n \n //handle variables and literals\n else \n {\n //if the token is an array with a \"string\" key, it's a string- push the core string to the stack, directly\n if(is_array($token) && array_key_exists('string', $token))\n $stack->push(array(MATHSCRIPT_TYPE_LITERAL, $token['string']));\n\n //if we've recieved a numeric token, push it directly onto the stack\n elseif (is_numeric($token)) \n $stack->push(array(MATHSCRIPT_TYPE_LITERAL, $token));\n\n //if we've recieved a local variable, push its value onto the stack\n elseif (array_key_exists($token, $vars)) \n $stack->push(array($token, $vars[$token]));\n\n //if we've recieved a global variable, push its value onto the stack\n elseif (array_key_exists($token, $this->vars)) \n $stack->push(array($token, $this->vars[$token]));\n\n //otherwise, we have a variable of unknown value;\n //we'll push it onto the array as having the value null\n else \n $stack->push(array($token, null));\n //return $this->trigger(\"undefined variable '$token'\");\n }\n }\n\n // when we're out of tokens, the stack should have a single element: the final result\n if ($stack->count != 1) \n return $this->trigger('internal error: '.$stack->count.' values were left on the stack after execution.');\n\n //return the final result\n list($reference, $result) = $stack->pop();\n\n return $result;\n }",
"function _executeScripts($player_id, $shellscripts, $scripttype_id, $CAKEUSER=null){\r\n \r\n foreach($shellscripts as $current){\r\n $current['filename'] = 'scripttype'.$scripttype_id.'_' . uniqid($player_id) . '.sh'; // temporary random filename for script!\r\n foreach ($current['hosts'] as $host_id=>$host_ip) {\r\n// 1. Software pipe: put required software packets on required host via scp:\r\n $swRC = 0;\r\n if (strlen($current['deployment_package'])>0){\r\n $swPipeCommand = 'scp -F '.SSH_CONFIG.' '.PACKAGES.$current['deployment_package'].' root@'.$host_ip.':/tmp';\r\n passthru($swPipeCommand, $swRC);\r\n if ($swRC!=0){\r\n $debugInfo = array(\r\n 'message' => 'Error for software pipe of '.$current['deployment_package'].' on '.$host_ip, // if script pipe fails, abort! Scenario can not be run\r\n 'legend' => 'function _executeScripts()',\r\n 'command' => $swPipeCommand,\r\n 'rc' => 'RC = '.$swRC. ' for script pipe command' \r\n );\r\n return $debugInfo;\r\n }\r\n }\r\n \r\n// 2. script pipe: put the current script on that host:\r\n $RC = 0;\r\n // now write this script via ssh to the host:\r\n $pipeCommand = 'echo -e \\''.$current['script'].'\\' | ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"cat > /tmp/'.$current['filename'].';\"';\r\n passthru($pipeCommand, $RC);\r\n if ($RC!=0){\r\n $debugInfo = array(\r\n 'error' => 'Error for script pipe of '.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run \r\n 'legend'=>'scriptpipe',\r\n 'command'=>$pipeCommand,\r\n 'rc'=>'RC='.$RC.' for script '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n \r\n// 3. script execution:\r\n $execCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"chmod +x /tmp/'.$current['filename'].'; /tmp/'.$current['filename'].';\"';\r\n passthru($execCommand, $RC);\r\n // do not evaluate RC here, because for PLAYER_EVALUATION_SCRIPT it needs to be >0 -> see 4.a) below \r\n $rmCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"rm /tmp/'.$current['filename'].'\"';\r\n // ssh -qqF /var/www/nets-x/app/shellscripts/ssh_config [email protected] \"rm /tmp/scripttype5_148c54e63a5ffa.sh\"\r\n if (Configure::read('debug')<2){ // remove shell scripts if debug=={0,1}\r\n passthru($rmCommand, $rmRC);\r\n if ($rmRC!=0){\r\n $debugInfo = array(\r\n 'message'=> 'deletion of script failed.',\r\n 'legend' => 'function _executeScripts',\r\n 'command' => $rmCommand,\r\n 'rc' => 'RC='.$RC.' for deletion of '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n }\r\n \r\n// 4. Special cases:\r\n// a) Player eval script returns the Return Code RC:\r\n if ($scripttype_id==PLAYER_EVALUATION_SCRIPT){\r\n return $RC; // in this case return the return code for further processing in $this->evaluateScenario!\r\n } else if ($RC!=0){\r\n $debugInfo = array(\r\n 'message' => 'Error during execution of '.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run\r\n 'legend'=>'function _executeScripts',\r\n 'command'=>$execCommand,\r\n 'rc'=>'RC='.$RC.' during execution of '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n \r\n// b) execution of drone action (the script generated by drone setup script):\r\n if ($scripttype_id==DRONE_SETUP_SCRIPT){\r\n // drone script which was generated by the first\r\n // runs in background (&) even if drone user logs out (nohup).\r\n $droneRC = 0;\r\n\r\n //$execCommand = 'ssh -qqF '.SSH_CONFIG.' DRONE_'.$CAKEUSER.'@'.$host_ip.' \"nohup ./'.DRONE_SCRIPT.' &;\"';\r\n // bash befehl: ssh -qqF SSH_CONFIG DRONE_$CAKEUSER@$host_ip 'exit 0'\r\n $execCommand = 'ssh -qqF '.SSH_CONFIG.' DRONE_'.$CAKEUSER.'@'.$host_ip.' \\'exit 0\\''; \r\n //$execCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \\'su -c \"nohup /home/DRONE_'.$CAKEUSER.'/'.DRONE_SCRIPT.' &\" DRONE_'.$CAKEUSER.'\\'';\r\n\t\t\t\tpassthru($execCommand, $droneRC);\r\n\t\t\t\techo $droneRC;\r\n\t\t\t\t//exec($execCommand);\r\n\t\t\t\tif($droneRC != 0) {\r\n\t $debugInfo = array(\r\n\t 'message' => 'Error during execution of drone script'.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run\r\n\t 'legend'=>'function _executeScripts',\r\n\t 'command'=>$execCommand,\r\n\t 'rc'=>'RC='.$RC.' during execution of drone script '.$current['filename'].' on '.$host_ip\r\n\t );\r\n \treturn $debugInfo;\r\n\t\t\t\t}\r\n }\r\n }\r\n }\r\n return null; // if $debugInfo == null no error\r\n }",
"protected function processVariableInString(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n }",
"public function processRemapStack() {}",
"function arg_parse($argc, $argv){\n\n if($argc == 2 && ($argv[1] === \"--help\" || $argv[1] === \"-help\")){\n fwrite(STDIN,\n \"Usage: php7.3 test.php | --help | [--stats=file] [--loc] | [--comments] | [--labels] | [--jumps]\n Parser for .IPPcode19 language\\n\n --help help message\n --stats=file file which will contain code statistics\n --loc statistic for lines of code present in source file\n --comments statistic for commentaries present in source code\n --labels statistic for labels in source code\n --jumps statistic for jump instructions in source cod\n\n Parse will parse given input from STDIN and checks it lexical and syntax correctness.\n Through analysis parser also generates XML file as output to STDOUT. XML file consists\n of instructions and their operands writen in XML standard.\n \\n\");\n exit(0);\n }\n elseif($argc > 2 && $argv[1] === \"--help\"){\n fwrite(STDERR, \"ERROR : ARGUMENTS : multiple use of --help argumet\\n\");\n exit(10);\n }\n }",
"public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {\n\n $tokens = $phpcsFile->getTokens();\n\n // Skip tokens that are the names of functions or classes\n // within their definitions. For example:\n // function myFunction...\n // \"myFunction\" is T_STRING but we should skip because it is not a\n // function or method *call*.\n $functionName = $stackPtr;\n $ignoreTokens = PHP_CodeSniffer_Tokens::$emptyTokens;\n $ignoreTokens[] = T_BITWISE_AND;\n $functionKeyword = $phpcsFile->findPrevious( $ignoreTokens, ($stackPtr - 1), null, true );\n if ( $tokens[ $functionKeyword ]['code'] === T_FUNCTION || $tokens[ $functionKeyword ]['code'] === T_CLASS ) {\n return;\n }\n\n // If the next non-whitespace token after the function or method call\n // is not an opening parenthesis then it cant really be a *call*.\n $openBracket = $phpcsFile->findNext( PHP_CodeSniffer_Tokens::$emptyTokens, ($functionName + 1), null, true );\n if ( $tokens[ $openBracket ]['code'] !== T_OPEN_PARENTHESIS ) {\n return;\n }\n\n // No need to inspect functions with no arguments and no space\n if ( $tokens[ $openBracket + 1 ]['code'] === T_CLOSE_PARENTHESIS ) {\n return;\n }\n\n // Error for spaces present with no argument\n if ( $tokens[ $openBracket + 2 ]['code'] === T_CLOSE_PARENTHESIS ) {\n $this->_ensureNoSpace( $phpcsFile, $openBracket + 1, 'NoSpaceBetweenParensWithNoArgument' );\n }\n\n $closeBracket = $tokens[ $openBracket ]['parenthesis_closer'];\n\n $this->_ensureSpaceBefore( $phpcsFile, $closeBracket, 'SpaceBeforeCloseParens' );\n $this->_ensureSpaceAfter( $phpcsFile, $openBracket, 'SpaceAfterOpenParens' );\n\n $nextSeparator = $openBracket;\n while ( ( $nextSeparator = $phpcsFile->findNext( [ T_COMMA, T_VARIABLE, T_CLOSURE ], $nextSeparator + 1, $closeBracket ) ) !== false ) {\n\n if ( $tokens[ $nextSeparator ]['code'] === T_CLOSURE ) {\n $nextSeparator = $tokens[ $nextSeparator ]['scope_closer'];\n continue;\n }\n\n // Make sure the comma or variable belongs directly to this function call,\n // and is not inside a nested function call or array.\n $brackets = $tokens[ $nextSeparator ]['nested_parenthesis'];\n $lastBracket = array_pop( $brackets );\n if ( $lastBracket !== $closeBracket ) {\n continue;\n }\n\n if ( $tokens[ $nextSeparator ]['code'] === T_COMMA ) {\n $this->_ensureNoSpace( $phpcsFile, $nextSeparator - 1, 'SpaceBeforeComma' );\n $this->_ensureSpaceAfter( $phpcsFile, $nextSeparator, 'NoSpaceAfterComma' );\n }\n else {\n $nextToken = $phpcsFile->findNext( PHP_CodeSniffer_Tokens::$emptyTokens, $nextSeparator + 1, $closeBracket, true );\n if ( $nextToken !== false && $tokens[ $nextToken ]['code'] === T_EQUAL ) {\n $this->_ensureSpaceBefore( $phpcsFile, $nextToken, 'NoSpaceBeforeEquals' );\n $this->_ensureSpaceAfter( $phpcsFile, $nextToken, 'NoSpaceAfterEquals' );\n }\n } // else\n\n } // while comma, var or closure\n\n }",
"function script()\n {\n }",
"public function prog(){\n\n $this->capture('init;');\n\n try {\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n {\n $this->match($this->input,$this->getToken('IDENTIFIER'),self::$FOLLOW_IDENTIFIER_in_prog48); \n $this->match($this->input,$this->getToken('EOF'),self::$FOLLOW_EOF_in_prog50); \n\n }\n\n\n $this->capture('after;');\n\n }\n catch ( RecognitionException $exc ) {\n\n $this->capture('catch;');\n throw $exc;\n \n }\n catch(Exception $e) {\n\n $this->capture('finally;');\n \n throw $e;\n }\n\n $this->capture('finally;');\n \n\n return ;\n }",
"private function parse_args() {\n\t\t//exit;\t\t\n\t}",
"private function processString($stackPtr)\n {\n $activeListeners = array();\n foreach (self::$functionListeners as $listener) {\n $functionNames = $listener->registerFunctionNames();\n if (in_array($this->tokens[$stackPtr]['content'], $functionNames) === true) {\n $activeListeners[] = $listener;\n }\n }\n\n // No listener is interested in this function name, so return early.\n if (empty($activeListeners) === true) {\n return;\n }\n\n // Find the next non-empty token.\n $openBracket = $this->phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n\n if (!$this->isFunctionCall($stackPtr)) {\n return;\n }\n\n // Find the previous non-empty token.\n $search = PHP_CodeSniffer_Tokens::$emptyTokens;\n $search[] = T_BITWISE_AND;\n $previous = $this->phpcsFile->findPrevious($search, ($stackPtr - 1), null, true);\n if ($this->tokens[$previous]['code'] === T_FUNCTION) {\n // It's a function definition, not a function call.\n return;\n }\n\n if ($this->tokens[$previous]['code'] === T_OBJECT_OPERATOR) {\n // It's a method invocation, not a function call.\n return;\n }\n\n if ($this->tokens[$previous]['code'] === T_DOUBLE_COLON) {\n // It's a static method invocation, not a function call.\n return;\n }\n\n $this->functionCalls[$stackPtr] = array('openBracket' => $openBracket, 'closeBracket' => $this->tokens[$openBracket]['parenthesis_closer']);\n\n foreach ($activeListeners as $listener) {\n $listener->processFunctionCall($this, $stackPtr);\n }\n }",
"abstract protected function getStackPos(): int;",
"private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }",
"public function compose (string $script, zval $args)\n {\n }",
"function Process($parser, $text, $data)\r\n\t{\r\n\t\tob_start();\r\n\t\teval($data);\r\n\t\t$obj = &$this->GetCurrentObject();\r\n\t\t$obj->out .= ob_get_contents();\r\n\t\tob_end_clean();\r\n\t}",
"public function scanStack(Topic $topic, $stack, $why = \"\")\n {\n if (count($stack)) {\n $this->debug(\n \"scanning stack, $why, for topic \". $topic->name .':'. print_r($stack, true)\n );\n $desc = '';\n $var = '';\n $type = '';\n foreach ($stack as $fragment) {\n if (preg_match('/^([^ ]+)\\s+(\\$[^ ]+)\\s+(.+)$/', $fragment, $matches)) {\n $this->debug(\"fragment '$fragment' looks like an arg declaration\");\n $type = $matches[1];\n $var = $matches[2];\n $desc = $matches[3];\n } else {\n $this->debug(\"fragment '$fragment' seems to be just description\");\n $desc = $fragment;\n }\n\n if ($var) {\n if ($topic->hasArgument($var)) {\n $this->debug(\"Appending arg '$var' desc '$desc'\");\n $argument = $topic->getArgument($var);\n $argument->appendDescription($desc);\n $topic->setArgument($argument);\n } else {\n $this->debug(\"Adding argument '$var', '$type', '$desc;\");\n $topic->addArgument(\n array(\n 'name' => $var,\n 'type' => $type,\n 'description' => $desc\n )\n );\n }\n } else {\n $this->debug(\"Appending topic description '$desc'\");\n $topic->appendDescription($desc);\n }\n }\n }\n\n return $topic;\n }",
"function runkit_lint_file($filename)\n{\n}",
"public function run($input) {\n $stack = array();\n\n // Load data\n $this->runRawScript($stack, $input->raw_data);\n // Run script\n return $this->runRawScript($stack, $this->raw_data);\n }",
"public function run()\n {\n $post = file_get_contents($this->getInputFile());\n if (substr($post, 0, 5) == '<?xml') {\n //pingback\n $xs = xmlrpc_server_create();\n xmlrpc_server_register_method(\n $xs, 'pingback.ping', array($this, 'handlePingbackPing')\n );\n $out = xmlrpc_server_call_method($xs, $post, null);\n\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 200 OK');\n $resp->sendXml($out);\n\n } else if (isset($_POST['source']) && isset($_POST['target'])) {\n //webmention\n $res = $this->handleRequest($_POST['source'], $_POST['target']);\n $resp = $this->getWebmentionResponder();\n $resp->send($res);\n\n } else {\n //unknown\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 400 Bad Request');\n $resp->sendHeader('Content-Type: text/html');\n $resp->sendOutput($this->unknownRequest);\n }\n }",
"function getScript($filename)\n{\n\t\t$code = file_get_contents($filename);\n\t\t\t\n\t\t// Adds a check to report local copies back to the server\n\t\t$now = mktime();\n\t\t\n\t\t// The following is the equivalent of new Date().getTime():\n\t\t// eval('\\156\\145\\167\\40\\104\\141\\164\\145\\50\\51\\56\\147\\145\\164\\124\\151\\155\\145\\50\\51')\n\t\t// This is used to check if the cached/local copy is older than 12 months, which should\n\t\t// never be the case as the cache expires after 3 months and the timestamp is the\n\t\t// timestamp of delivery. If it is older the code will break by nullifying mxGraph.\n\t\t$now -= 63; // changes numbers so they can't be found\n\t\t$expire = KILL_EVAL_DELAY - 69; // changes numbers so they can't be found\n\t\t$check2 = \"if((eval('\\\\156\\\\145\\\\167\\\\40\\\\104\\\\141\\\\164\\\\145\\\\50\\\\51\\\\56\\\\147\\\\145\\\\164\\\\124\\\\151\\\\155\\\\145\\\\50\\\\51')/1000)-$now>$expire){mxGraph=function(){};}\";\t\n\t\t$code = str_replace(\"var mxCodecRegistry=\", \"$check2;var mxCodecRegistry=\", $code);\n\n\treturn $code;\n}",
"public function parse($src) { \n\t\t$this->lines = ''; \n\t\t$m = explode(\"\\n\",$src); \n\t\t\n\t\tforeach($m as $line) { \n\t\t\t$line = trim($line); \n\t\t\tif ($line!='') { \n\t\t\t\tif ($line[0]!='#') $this->lines[] = $line; \n\t\t\t} \n\t\t} \n\t\t\n\t\t$this->cursor = 0; \n\t\t$this->out = array(); \n\t\t$this->error_found = false; \n\t\twhile (!$this->eof()) { \n\t\t\t$rc = $this->parse_statement($this->out); \n\t\t\tif ($rc=='}') return 'Обнаружен неожиданный символ \"{\"'; \n\t\t\tif ($this->error_found) return $this->error_message; \n\t\t} \n\t\t\n\t\treturn $this->out; \n\t}",
"abstract public function run($args);",
"protected function processVariableInString(\n File $phpcsFile,\n $stackPtr\n ) {\n }",
"function drush_main() {\n require dirname(__DIR__) . '/drush.php';\n}",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n $this->phpcsFile = $phpcsFile;\n $this->tokens = $phpcsFile->getTokens();\n //print_r($this->tokens[$stackPtr]);\n if ($this->tokens[$stackPtr]['code'] == T_STRING) {\n $this->processString($stackPtr);\n } elseif (in_array($this->tokens[$stackPtr]['code'], array(T_ECHO, T_PRINT))) {\n $this->processOutput($stackPtr);\n } elseif ($this->tokens[$stackPtr]['code'] == T_VARIABLE) {\n $this->processVariable($stackPtr);\n } elseif ($this->tokens[$stackPtr]['code'] == T_CONSTANT_ENCAPSED_STRING || $this->tokens[$stackPtr]['code'] == T_DOUBLE_QUOTED_STRING) {\n $this->processEncapsedString($stackPtr);\n } elseif ($this->tokens[$stackPtr]['code'] == T_OBJECT_OPERATOR) {\n $nextPtr = $this->phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n $this->processObjectProperty($nextPtr);\n }\n }",
"abstract protected function _run();",
"abstract protected function _run();",
"public function testRunRuleParser()\n {\n $rules = [\n 'var1' => 'alpha|between:min=10,max=100',\n 'var2' => 'email',\n 'var3' => 'alpha',\n ];\n $rulesBag = $this->ruleParse->run($rules);\n $this->assertInstanceOf(Sparta\\RulesBag::class, $rulesBag);\n $this->assertEquals($rulesBag, $this->ruleParse->getRulesBag());\n }",
"public function process(Bracket $bracket);",
"abstract public function run(array $args=null);",
"public function exec() { \n $this->codeInjectionCheck();\n /* \n -s Don't add user site directory to sys.path.\n\n -S Disable the import of the module site and the site-dependent\n manipulations of sys.path that it entails.\n (think to create a black list of modules...)\n */ \n //$command = \"export PYTHONDUMPREFS=1 & \" . $this->kernelPath . \" -s -c '\" . $this->code . \"'\";\n $command = $this->kernelPath . \" -c '\" . $this->code . \"' \" . ($this->showSTDERR ? \" 2>&1 \" : \"\");\n $this->output = `$command`;\n }",
"private function exec() {\n extract($this->data);\n\n ob_start();\n $error = eval(' ?>' . $this->file .'<?php ');\n if($error === false) {\n ob_end_clean();\n throw new \\Exception('Error en la plantilla');\n }\n return ob_get_clean();\n }",
"public function get_parse_script()\n {\n return $this->parse_script;\n }",
"protected function _script($tree)\n {\n $content = [];\n\n if (is_string($tree)) {\n if ($tree == \"\") {\n return \"\";\n }\n $tree = addslashes($tree);\n return \"\\$_text[] = \\\"{$tree}\\\";\";\n }\n\n if (sizeof($tree[\"children\"]) > 0) {\n foreach ($tree[\"children\"] as $child) {\n $content[] = $this->_script($child);\n }\n }\n\n if (isset($tree[\"parent\"])) {\n return $this->_implementation->handle($tree, implode(\" \", $content));\n }\n\n return implode(\" \", $content);\n }",
"abstract protected function run_tests($code, $testcases);",
"function run($command);",
"public function script($script)\n\t{\n\t\t$this->last_selector = null;\n\n\t\tif (is_array($script))\n\t\t{\n\t\t\t$script = join(\"\\n\", $script);\n\t\t}\n\n\t\treturn $this->cmd(3, array(\n\t\t\t$script\n\t\t));\n\t}",
"function code ( $arguments = \"\" ) {\n $arguments = func_get_args ();\n $rc = new ReflectionClass('tcode');\n return $rc->newInstanceArgs ( $arguments );\n}",
"public function parse()\n {\n $latest_comment = false;\n $in_func = false;\n\n foreach ($this->_tokens as $token) {\n $id = $text = null;\n\n if (is_array($token)) {\n list($id, $text, $line) = $token;\n }\n if (T_WHITESPACE == $id) {\n continue;\n }\n\n if (T_STRING == $id && in_array($text, $this->_functionNames) && !$in_func) {\n $in_func = true;\n $paren_level = -1;\n $args = array();\n $func_name = $text;\n $func_line = $line;\n $func_comment = $latest_comment ? $latest_comment : '';\n\n $just_got_into_func = true;\n $latest_comment = false;\n continue;\n }\n\n if (!$in_func) {\n continue;\n }\n\n if ('(' == $token) {\n $paren_level++;\n\n if (0 == $paren_level) { // start of first argument\n $just_got_into_func = false;\n $current_argument = null;\n $current_argument_is_just_literal = true;\n }\n continue;\n }\n\n if ($just_got_into_func) {\n // there wasn't a opening paren just after the function name -- this means it is not a function\n $in_func = false;\n $just_got_into_func = false;\n }\n\n if (')' == $token) {\n if (0 == $paren_level) {\n $in_func = false;\n $args[] = $current_argument;\n $call = array('name' => $func_name, 'args' => $args, 'line' => $func_line);\n if ($func_comment) {\n $call['comment'] = $func_comment;\n }\n\n $fCall = new FunctionCallMeta($func_name, $args, $func_line, $this->getFilePath());\n $this->add($fCall);\n }\n\n $paren_level--;\n continue;\n }\n\n if (',' == $token && 0 == $paren_level) {\n $args[] = $current_argument;\n $current_argument = null;\n $current_argument_is_just_literal = true;\n continue;\n }\n\n if ((T_CONSTANT_ENCAPSED_STRING == $id || T_LNUMBER == $id || $id == T_DNUMBER || strtolower(\n $text\n ) == 'true' || strtolower($text) == 'false') && $current_argument_is_just_literal\n ) {\n // we can use eval safely, because we are sure $text is just a string literal\n eval('$current_argument = ' . $text . ';');\n continue;\n }\n\n if (strtolower($text) == 'null') {\n $current_argument = 'null';\n $current_argument_is_just_literal = true;\n continue;\n }\n\n $current_argument_is_just_literal = false;\n $current_argument = '{{complex}}';\n }\n }",
"public function pushStack($token) {}",
"function run(){\r\n\t\t $this->arg('auth-block', $this->authBlock());\r\n\t\t $this->arg('menu', $this->getMenu(4));\r\n\t\t $this->arg('left-menu', $this->leftMenu(171,false));\r\n\t\t $this->arg('menu-footer1', $this->getMenuFooter(200, false,false,\"w-220\"));\r\n\t\t $this->arg('menu-footer2', $this->getMenuFooter(201, false,false,\"w-220\"));\r\n\t\t $this->arg('menu-footer3', $this->getMenuFooter(202, false,false,\"w-160\"));\r\n\t\t $this->arg('menu-footer4', $this->getMenuFooter(203, false,false,\"w-120\"));\r\n\t\t $this->arg('menu-footer5', $this->getMenuFooter(204, false,false,\"w-160\"));\r\n\r\n\t\t $this->arg('news-list', $this->newsList(9, 8));\r\n//\t\t $this->arg('banners-list-1', $this->bannersList(2, 6, 7));\r\n\t\t $this->arg('banners-list-1', $this->getTopBanner());\r\n\t\t $this->arg('banners-list-2', $this->bannersList(22, 6, 7));\r\n\t\t $this->arg('voting-block', $this->votingBlock(12));\r\n\t\t $this->arg('langs', $this->getLangs());\r\n\t\t $this->arg('search', $this->search());\r\n\t }",
"function testTarget() {\n $stdin = json_encode(array('filter'=>'sql'));\n $exec = sprintf('echo %s | %s version --backend 2>/dev/null', self::escapeshellarg($stdin), UNISH_DRUSH);\n $this->execute($exec);\n $parsed = parse_backend_output($this->getOutput());\n $this->assertTrue((bool) $parsed, 'Successfully parsed backend output');\n $this->assertArrayHasKey('log', $parsed);\n $this->assertArrayHasKey('output', $parsed);\n $this->assertArrayHasKey('object', $parsed);\n $this->assertEquals(self::EXIT_SUCCESS, $parsed['error_status']);\n // This assertion shows that `version` was called and that stdin options were respected.\n $this->assertStringStartsWith(' Drush Version ', $parsed['output']);\n $this->assertEquals('Bootstrap to phase 0.', $parsed['log'][0]['message']);\n\n // Check error propogation by requesting an invalid command (missing Drupal site).\n $this->drush('core-cron', array(), array('backend' => NULL), NULL, NULL, self::EXIT_ERROR);\n $parsed = parse_backend_output($this->getOutput());\n $this->assertEquals(1, $parsed['error_status']);\n $this->assertArrayHasKey('DRUSH_NO_DRUPAL_ROOT', $parsed['error_log']);\n }",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n if ($this->functionData['processFlag'] != 1) {\n $this->createList();\n }\n $this->processToken($phpcsFile, $stackPtr);\n }",
"public function parse_command()\n {\n // 检查运行命令的参数\n global $argv;\n $start_file = $argv[0];\n // 命令\n $command = isset($argv[1]) ? trim($argv[1]) : '';\n // 子命令, 目前只支持-d -force\n $operations = isset($argv[2]) ? $argv[2] : '';\n // 根据命令做相应处理\n\n switch($command)\n {\n // 启动 phpspider\n case 'start':\n if ($operations === '-d') {\n config( [ \"swoole.settings.daemonize\" => true ] );\n }\n echo \"swoole development server started: <http://\".config( \"swoole.listen\" ).\":\".config( \"swoole.port\" ).\">\\n\";\n $swoole = $this->register(SwooleServiceProvider::class);\n $swoole->start();\n break;\n case 'stop':\n if ($operations === \"-force\"){\n config( [\"swoole.settings.pid_file\"=>'']);\n }\n $this->stopServer($start_file);\n break;\n case \"reload\":\n if($operations === \"-task\"){\n $sign = SIGUSR2;\n }else{\n $sign = SIGUSR1;\n }\n $this->reloadServer($sign);\n break;\n\n // 显示 phpspider 运行状态\n case 'status':\n exec(\"ps aux | grep $start_file\");\n break;\n // 未知命令\n default :\n echo \"Usage: php startfile.php {start|stop|status|reload}\\n\";\n break;\n }\n }",
"function mgd_preparse($code)\n{\n // Get style elements\n $code = preg_replace_callback(\"/<\\\\(([a-zA-Z0-9 _-]+)\\\\)>/\", 'mgd_element', $code);\n // Echo variables\n $code = preg_replace_callback(\"%&\\(([^)]*)\\);%i\", 'mgd_variable', $code);\n return $code;\n}",
"abstract protected function main(array $arguments);",
"function ret2code2data() {\n\t$this->chapitre(\"Return to .DATA\");\n\t$this->article(\"La zone data\", \" stocke les données globales statiques initialisées (dont la valeur est fournie lors de la compilation)\");\n\t$overflow = 100;\n\n\t$this->ssTitre(\"exec Programme\");\n\t$this->requette(\"$this->file_path rohff\");\n\t$this->note(\"la variable shellcode_date n'est appelée nulle part dans l'execution du programme\");\n\t$this->bin2data2size();$this->pause();\n\t$this->bin2data2content();$this->pause();\n\n\t$this->titre(\"Adresse de la variable shellcode_data\");\n\t$this->ssTitre(\"Via le script source\");\n\t$ret = trim($this->req_ret_str(\"$this->file_path AAAAAAAA | grep '0x' | cut -d : -f 2\"));$this->pause();\n\t$this->ssTitre(\"Via gdb\");\n\t$this->requette(\"gdb -q --batch -ex \\\"print &shellcode_data\\\" $this->file_path\");\n\t$this->requette(\"gdb -q --batch -ex \\\"info symbol $ret\\\" $this->file_path\");\n\t$this->ssTitre(\"Via nm\");\t$this->requette(\"nm $this->file_path | grep shellcode_data\");\t$this->pause();\n\t$offset_eip = $this->bin2offset4eip($overflow);\n\t$addr = $this->hex2rev_32($ret);\n\t$query = \"$this->file_path `python -c print'\\\"A\\\"*$offset_eip+\\\"$addr\\\"'`\";\n\t$this->requette($query);\n\t$this->pause();\n\t$this->notify(\"END .data Section\");\n}",
"public function execute($string){\n $string = trim($string);\n if(strpos($string, \"\\n\") !== -1){\n $lines = explode(\"\\n\",$string);\n //print_r($lines);\n $linemax = count($lines);\n $linecount = 0;\n $skipnext = false;\n foreach($lines as $line){\n if(strpos($line, \"s \") === 0){\n $sayvalue = str_replace(\"s \", \"\", $line);\n if($linecount != $linemax-1 && !$this->startswithcommand($lines[$linecount + 1])){\n $sayvalue .= $this->endofline . $lines[$linecount+1];\n }\n $sayvalue = strpos($sayvalue, '/lb/') !== -1 ? str_replace(\"/lb/\", $this->endofline, $sayvalue) : $sayvalue;\n //$endsay = $linecount < $linemax-1 ? $this->endofline : ($linecount == 0 ? $this->endofline : \"\");\n echo $sayvalue; // . $endsay;\n }\n $linecount++;\n }\n } else {\n if(strpos($string, \"s \") === 0){\n $sayvalue = strpos($string, '/lb/') !== -1 ? str_replace(\"/lb/\", $this->endofline,$string) : $string;\n echo str_replace(\"s \", \"\", $sayvalue);\n }\n }\n }",
"public function parse();",
"public function parse();",
"public function parse();",
"public function process_token( $stackPtr ) {\n\t\tif ( 'window' !== $this->tokens[ $stackPtr ]['content'] ) {\n\t\t\t// Doesn't begin with 'window', bail.\n\t\t\treturn;\n\t\t}\n\n\t\t$nextTokenPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $stackPtr + 1 ), null, true, null, true );\n\t\tif ( false === $nextTokenPtr ) {\n\t\t\treturn;\n\t\t}\n\t\t$nextToken = $this->tokens[ $nextTokenPtr ]['code'];\n\t\tif ( T_OBJECT_OPERATOR !== $nextToken && T_OPEN_SQUARE_BRACKET !== $nextToken ) {\n\t\t\t// No . or [' next, bail.\n\t\t\treturn;\n\t\t}\n\n\t\t$nextNextTokenPtr = $this->phpcsFile->findNext( Tokens::$emptyTokens, ( $nextTokenPtr + 1 ), null, true, null, true );\n\t\tif ( false === $nextNextTokenPtr ) {\n\t\t\t// Something went wrong, bail.\n\t\t\treturn;\n\t\t}\n\n\t\t$nextNextToken = \\str_replace( [ '\"', \"'\" ], '', $this->tokens[ $nextNextTokenPtr ]['content'] );\n\n\t\tif ( is_string( $nextNextToken ) && isset( $this->windowProperties[ $nextNextToken ] ) ) {\n\t\t\t$functionToken = $this->phpcsFile->findNext( Tokens::$functionNameTokens, ( $nextNextTokenPtr + 3 ) );\n\n\t\t\t// Wrapped in escape function.\n\t\t\tif ( isset( $this->tokens[ $nextTokenPtr ]['nested_parenthesis'] ) ) {\n\t\t\t\t$functionBefore = $this->phpcsFile->findNext( Tokens::$functionNameTokens, $stackPtr - 3 );\n\t\t\t\tif ( $this->isEscapeFunction( $functionBefore ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Followed by escape function.\n\t\t\tif ( $this->isEscapeFunction( $functionToken ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tparent::process_token( $stackPtr );\n\t}",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\r\n {\r\n $filename = $phpcsFile->getFilename();\r\n if ($filename === 'STDIN')\r\n {\r\n return;\r\n }\r\n $filename = basename($filename);\r\n $lowercaseFilename = strtolower($filename);\r\n if (strpos($filename, \"_\") > 0)\r\n {\r\n $data = array(\r\n $filename,\r\n $lowercaseFilename\r\n );\r\n $error = '\"%s\" 文件名不符合规范; 不建议出现下划线';\r\n $phpcsFile->addWarning($error, $stackPtr, 'NotFound', $data);\r\n }\r\n\r\n // Ignore the rest of the file.\r\n return ($phpcsFile->numTokens + 1);\r\n }",
"function lapa_compiler_php_code($act, $parser)\n{\n if ($act == 1) {\n $buff = '';\n if (!isset(LapaEngineParser::$_plugins_property['php_code'])) {\n LapaEngineParser::$_plugins_property['php_code'] = array();\n }\n $attr = $parser->parseDirectiveAttributes();\n $name = isset($attr['name']) ? $attr['name']: 'default';\n $parser->newStackCommand(array('php_code', $name));\n $parser->_outputNew();\n }else {\n if ( (!$stack_commands = $parser->getStackCommand() ) || $stack_commands[0] != 'php_code' ) {\n throw new LapaEngineException('Неверный вызов \"/php_code\" cтрока %s.', $parser->templateLine());\n }\n /* вырезали буффер php кода, его надо еще вернуть */\n $buff = $parser->_outputGet();\n /* создаем переменную с значением */ \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n $buff .= \"\\$_var_php_code['{$stack_commands[1]}'] = '\" . preg_replace(\"/(?!\\\\\\\\)\\\\'/\", '\\\\\\'','<?php ' . str_replace('\\\\', '\\\\\\\\',$buff) . ' ?>') . \"';\"; \n $parser->removeStackCommand(); \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n }\n return $buff;\n}",
"function createSubStackForm($extra=false, $title='subStack.py Launcher', $heading='Make a partial Stack') {\n\t$expId=$_GET['expId'];\n\t$projectId=getProjectId();\n\t$formAction=$_SERVER['PHP_SELF'].\"?expId=$expId\";\n\n\t$reconId = $_GET['reconId'];\n\tif (!$reconId) $reconId = $_POST['reconId'];\n\n\t//query the database for parameters\n\t$particle = new particledata();\n\t$numrecons = count($particle->getReconIdsFromSession($expId, true));\n\t$reconIds = $particle->getReconIdsFromSession($expId, false);\n\n\tif ($reconId) {\n\t\t$defrunname = 'squatstack'.$reconId;\n\t\t$formAction .= \"&reconId=$reconId\";\n\t} else {\n\t\t$defrunname = 'squatstack'.$numrecons;\n\t}\n\n\t// Set any existing parameters in form\n\t$description = ($_POST['description']) ? $_POST['description'] : '';\n\t$runname = ($_POST['runname']) ? $_POST['runname'] : $defrunname;\n\t$commitcheck = ($_POST['commit']=='on' || !$_POST['process']) ? 'checked' : '';\t\t\n\t$maxjump = ($_POST['maxjump']) ? $_POST['maxjump'] : 20;\n\n\t// get outdir path\n\t$sessiondata=getSessionList($projectId,$expId);\n\t$sessioninfo=$sessiondata['info'];\n\n\t// get path for submission\n\t$outdir=getBaseAppionPath($sessioninfo).'/stacks';\n\n\t$outdir = ($_POST['outdir']) ? $_POST['outdir'] : $outdir;\n\n\t$javafunctions .= writeJavaPopupFunctions('appion');\n\tprocessing_header($title,$heading,$javafunctions);\n\t// write out errors, if any came up:\n\tif ($extra) {\n\t\techo \"<font color='#cc3333' size='+2'>$extra</font>\\n<hr/>\\n\";\n\t}\n \n\techo\"<form name='viewerform' method='post' action='$formAction'>\\n\";\n\t\n\n\techo\"\n\t<TABLE BORDER=3 CLASS=tableborder>\";\n\techo\"\n\t<TR>\n\t\t<TD VALIGN='TOP'>\\n\";\n\n\t$basename = basename($classfile);\n\tif ($reconId) {\n\t\t$reconlink = \"reconreport.php?expId=$expId&reconId=$reconId\";\n\t\t$recondata = $particle->getReconInfoFromRefinementId($reconId);\n\t\t$stackId = $particle->getStackIdFromReconId($reconId);\n\t\techo\"<b>Reconstruction Run Information:</b> <ul>\\n\"\n\t\t\t.\"<li>Recon ID/Name: [ $reconId ] <a href='$reconlink'>$recondata[name]</a>\\n\"\n\t\t\t.\"<li>Recon Description: $recondata[description]\\n\"\n\t\t\t.\"<li>Stack ID: $stackId\\n\"\n\t\t\t.\"<input type='hidden' name='reconId' value='$reconId'>\\n\"\n\t\t\t.\"</ul>\\n\";\n\t} else if($reconIds) {\n\t\techo\"\n\t\tSelect Reconstruction Run:<br>\n\t\t<select name='reconId''>\\n\";\n\t\tforeach ($reconIds as $reconrunarray) {\n\t\t\t$localreconId = $reconrunarray['DEF_id'];\n\t\t\t$reconname=$reconrunarray['name'];\n\t\t\t$stackId = $particle->getStackIdFromReconId($localreconId);\n\t\t\t$totprtls=commafy($particle->getNumStackParticles($stackId));\n\t\t\techo \"<OPTION VALUE='$localreconId'\";\n\t\t\t// select previously set prtl on resubmit\n\t\t\techo \">$localreconId: $reconname ($totprtls particles)\";\n\t\t\techo \"</OPTION>\\n\";\n\t\t}\n\t\techo \"</SELECT>\\n\";\n\t\techo \"<br/><br/>\\n\";\n\t} else {\n\t\techo\"<font color='red'><b>No reconstructions for this session</b></font>\\n\";\n\t}\n\n\techo docpop('runname','<b>Run Name:</b> ');\n\techo \"<input type='text' name='runname' value='$runname' size='15'><br/><br/>\\n\";\n\n\techo docpop('outdir','<b>Output directory:</b>');\n\techo \"<br/>\\n\";\n\techo \"<input type='text' name='outdir' value='$outdir' size='40'>\\n\";\n\n\techo \"<br/><br/>\\n\";\n\n\t// Maximum Median Euler Jump\n\techo '<b>Maximum Median Euler Jump value:</b> ';\n\techo \"<br/>\\n<input type='text' name='maxjump' value='$maxjump' size='5'><br/>\\n\";\n\n\tif ($reconId) {\n\t\techo \"<img width='640' height='320' src='eulergraph.php?expId=$expId&hg=1&recon=$reconId&w=640&h=320'>\";\n\t\techo \"<br/>\\n\";\n\t}\n\techo \"<br/>\\n\";\n\n\techo \"<b>Description:</b><br />\\n\";\n\techo \"<textarea name='description' rows='2' cols='60'>$description</textarea>\\n\";\n\techo \"<br/>\\n\";\n\techo \"<br/>\\n\";\n\n\techo \"<input type='checkbox' name='commit' $commitcheck>\\n\";\n\techo docpop('commit','<b>Commit stack to database');\n\techo \"<br/>\\n\";\n\techo \"</td>\n </tr>\n <tr>\n <td align='center'>\n\t\";\n\techo \"<br/>\\n\";\n\techo getSubmitForm(\"Create SubStack\");\n\techo \"\n\t</td>\n\t</tr>\n </table>\n </form>\\n\";\n\n\techo appionRef();\n\n\tprocessing_footer();\n\texit;\n}",
"function startTag($parser, $data){\n global $currentTag;\n $currentTag = $data;\n}",
"public function process_token( $stackPtr ) {\n\t\tif ( $this->tokens[ $stackPtr ]['content'] !== 'innerHTML' ) {\n\t\t\t// Looking for .innerHTML only.\n\t\t\treturn;\n\t\t}\n\n\t\t$functionToken = $this->phpcsFile->findNext( Tokens::$functionNameTokens, ( $stackPtr + 1 ) );\n\n\t\tif ( $this->isEscapeFunction( $functionToken ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tparent::process_token( $stackPtr );\n\t}",
"protected function parse() {}",
"public function __construct(Stack $stack, StackDefinition $definition)\n {\n $this->stack = $stack;\n $this->definition = $definition;\n }",
"function __construct($raw, $start )\n\t{\n\t $this->raw = $raw;\n\t $this->start = $start;\n\n\t $this->process_raw_shortcode();\n\t}",
"public function process(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n\n $varName = $tokens[$stackPtr]['content'];\n if ($varName !== '$_REQUEST'\n && $varName !== '$_GET'\n && $varName !== '$_POST'\n && $varName !== '$_FILES'\n ) {\n return;\n }\n\n // The only place these super globals can be accessed directly is\n // in the getRequestData() method of the Security class.\n $inClass = false;\n foreach ($tokens[$stackPtr]['conditions'] as $i => $type) {\n if ($tokens[$i]['code'] === T_CLASS) {\n $className = $phpcsFile->findNext(T_STRING, $i);\n $className = $tokens[$className]['content'];\n if (strtolower($className) === 'security') {\n $inClass = true;\n } else {\n // We don't have nested classes.\n break;\n }\n } else if ($inClass === true && $tokens[$i]['code'] === T_FUNCTION) {\n $funcName = $phpcsFile->findNext(T_STRING, $i);\n $funcName = $tokens[$funcName]['content'];\n if (strtolower($funcName) === 'getrequestdata') {\n // This is valid.\n return;\n } else {\n // We don't have nested functions.\n break;\n }\n }//end if\n }//end foreach\n\n // If we get to here, the super global was used incorrectly.\n // First find out how it is being used.\n $globalName = strtolower(substr($varName, 2));\n $usedVar = '';\n\n $openBracket = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);\n if ($tokens[$openBracket]['code'] === T_OPEN_SQUARE_BRACKET) {\n $closeBracket = $tokens[$openBracket]['bracket_closer'];\n $usedVar = $phpcsFile->getTokensAsString(($openBracket + 1), ($closeBracket - $openBracket - 1));\n }\n\n $type = 'SuperglobalAccessed';\n $error = 'The %s super global must not be accessed directly; use Security::getRequestData(';\n $data = [$varName];\n if ($usedVar !== '') {\n $type .= 'WithVar';\n $error .= '%s, \\'%s\\'';\n $data[] = $usedVar;\n $data[] = $globalName;\n }\n\n $error .= ') instead';\n $phpcsFile->addError($error, $stackPtr, $type, $data);\n\n }",
"public function push()\n\t{\n\t\t// Snippet details\n\t\t$snippet \t= new CodeSnippit();\n\t\t$lib \t\t\t= new CodeSnippit_Library();\n\t\t\n\t\tforeach( $this -> snipts as $id => $snipt ) :\n\t\t\t$snippet -> title \t\t= $snipt -> description;\n\t\t\t$snippet -> tags \t\t\t= $snipt -> tags;\n\t\t\t$snippet -> code \t\t\t= $snipt -> code;\n\t\t\t$snippet -> type\t\t\t=\t0;\t// 0 - Normal, 1 - Question\n\t\t\t\n\t\t\t$codesnippit_categories = array(\n\t\t\t\t\"html\", \"css\", \"php\", \"rubyy\", \"asp\", \"Obj C\", \"wordpress\", \"joomla\", \"javascript\", \"drupal\", \"python\", \"perl\", \"13 ??\", \"sql\", \"java\", \"regex\", \"coldfusion\", \"18 ??\", \n\t\t\t\t\"htaccess\", \"actionscript\", \"codeigniter\", \"c#\", \"magento\", \"zend\", \"vb\", \"c++\", \"typo\", \"shell\", \"applescript\", \"linux\", \"c\", \"µformats\", \"cakephp\" );\n\t\t\t$category = array_search( $snipt -> lexer, $codesnippit_categories );\n\t\t\t$snippet -> category \t= $category ? $category : 3; // Default : PHP\n\t\t\t\n\t\t\tif( $lib -> push( CODESNIPPIT_USERNAME, CODESNIPPIT_PASSWORD, $snippet ) ) :\n\t\t\t\techo \"Snipt ${id} was successfully imported\\n\";\n\t\t\telse :\n\t\t\t\techo \"[ERROR] ErrorCode : {$lib->errorCode}\\tError Message : {$lib->errorMsg}\\n\";\n\t\t\t\techo \"[ERROR] Snipt ${id} could not be imported\\n\";\n\t\t\tendif;\n\t\tendforeach;\n\t\t\n\t\techo \"Importing completed....\\n\";\n\t}",
"protected function _parseTemplate() {}",
"function parseHTML(){\n\t\t$code = preg_replace_callback('~(href|src|codebase|url|action)\\s*=\\s*([\\'\\\"])?(?(2) (.*?)\\\\2 | ([^\\s\\>]+))~isx',array('self','parseExtURL'),$this->source);\n\t\t$code = preg_replace_callback('~(<\\s*style.*>)(.*)<\\s*/\\s*style\\s*>~iUs',Array('self','parseCSS'),$code);\n\t\t$code = preg_replace_callback('~(style\\s*=\\s*)([\\'\\\"])(.*)\\2~iUs',Array('self','parseStyle'),$code);\n\t\t$code = preg_replace_callback('~<script(\\s*.*)>(.*)<\\s*/\\s*script>~iUs',Array('self','parseScriptTag'),$code);\n\t\t$this->output = $code;\n\t}",
"function aac_import_drush_command() {\n $items['aac_import'] = array(\n 'callback' => 'drush_aac_import',\n 'description' => dt('Import data drupal'),\n 'examples' => array(\n 'simple' => dt('drush aac_import'),\n ),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,\n );\n return $items;\n}",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"public static function stack($msg = \"\")\n {\n if (!dmContext::hasInstance())\n {\n return self::simpleStack($msg);\n }\n\n dmContext::getInstance()->getConfiguration()->loadHelpers(array('Javascript', 'Tag'));\n\n $result = \"\";\n $trace = debug_backtrace();\n $traceId = \"pkSimpleBacktrace\" . dmString::random();\n $traceIdShow = $traceId . \"Show\";\n $traceIdHide = $traceId . \"Hide\";\n $result .= \"<div class='pkSimpleBacktrace'>stack $msg\" .\n link_to_function(\">>>\",\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceId').style.display = 'block'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'inline'\",\n array(\"id\" => $traceIdShow)) .\n link_to_function(\"<<<\",\n \"document.getElementById('$traceId').style.display = 'none'; \" .\n \"document.getElementById('$traceIdHide').style.display = 'none'; \" .\n \"document.getElementById('$traceIdShow').style.display = 'inline'\",\n array(\"id\" => $traceIdHide, \"style\" => 'display: none'));\n $result .= \"</div>\";\n $result .= \"<pre id='$traceId' style='display: none'>\\n\";\n $first = true;\n foreach ($trace as $element)\n {\n if ($first)\n {\n $first = false;\n }\n else\n {\n $result .= \"File: \" . $lastFile . \" function: \" . $element['function'] . \" line: \" .$lastLine . \"\\n\";\n }\n $lastFile = dmArray::get($element, 'file');\n $lastLine = dmArray::get($element, 'line');\n }\n $result .= \"</pre>\\n\";\n echo $result;\n }",
"function run_parse_py($path) {\n\tglobal $script_root;\n\n\t$cachePath = $path.'.zoojson';\n\tif (file_exists($cachePath) && filemtime($cachePath) > filemtime($path)) {\n\t\treturn file_get_contents($cachePath);\n\t}\n\n\t$json = run($script_root.'/parse.py '.escapeshellarg($path));\n\t// $json is an array of lines of output\n\t$json = implode('', $json);\n\tfile_put_contents($cachePath, $json);\n\treturn $json;\n}",
"abstract public function parse ();"
] | [
"0.6209875",
"0.5159944",
"0.50516796",
"0.5049321",
"0.49977317",
"0.49415466",
"0.49384597",
"0.49009112",
"0.48638225",
"0.48585474",
"0.4837272",
"0.4830505",
"0.48150834",
"0.48102474",
"0.47752997",
"0.47216263",
"0.47123265",
"0.46674982",
"0.46604148",
"0.46468744",
"0.46399334",
"0.46097842",
"0.46032497",
"0.4600946",
"0.45988652",
"0.4592973",
"0.4581743",
"0.4574606",
"0.456458",
"0.4548668",
"0.45416498",
"0.45331332",
"0.45304546",
"0.44945657",
"0.44893438",
"0.4486179",
"0.4473855",
"0.4465193",
"0.4452672",
"0.44522437",
"0.4449492",
"0.44132745",
"0.44114754",
"0.44114596",
"0.44042668",
"0.43971062",
"0.43967366",
"0.43831152",
"0.43695632",
"0.4364216",
"0.43432066",
"0.43391225",
"0.4332762",
"0.43302822",
"0.43302822",
"0.4325309",
"0.43202677",
"0.43174964",
"0.43160567",
"0.43059474",
"0.4305024",
"0.43029666",
"0.43014655",
"0.42915756",
"0.4285561",
"0.42819867",
"0.42807525",
"0.42806008",
"0.42791492",
"0.4278569",
"0.42779255",
"0.42712027",
"0.4270024",
"0.42686245",
"0.42599365",
"0.42561257",
"0.42535973",
"0.42535973",
"0.42535973",
"0.42468756",
"0.42452046",
"0.42421776",
"0.42334747",
"0.4230687",
"0.4230473",
"0.4229473",
"0.4221861",
"0.42194667",
"0.42153674",
"0.42080733",
"0.42053053",
"0.42041042",
"0.41985726",
"0.41958198",
"0.41958198",
"0.41958198",
"0.41958198",
"0.4194152",
"0.4193184",
"0.41925147"
] | 0.6518805 | 0 |
Run the specified script | public function run($input) {
$stack = array();
// Load data
$this->runRawScript($stack, $input->raw_data);
// Run script
return $this->runRawScript($stack, $this->raw_data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function script()\n {\n }",
"public static function run($script)\n {\n $script = self::openTag($script);\n //\n $script = self::closeTag($script);\n //\n return $script;\n }",
"protected function runScript(UpgradeScript $script)\n {\n set_error_handler(array($this, 'scriptErrorHandler'), E_ALL & ~E_STRICT & ~E_DEPRECATED);\n ob_start();\n try {\n $script->run($this);\n } catch (Exception $e) {\n $this->error(\"Exception: \" . $e->getMessage());\n }\n $out = ob_get_clean();\n if ($out) {\n $this->log(\"OUTPUT: $out\");\n }\n restore_error_handler();\n }",
"public abstract function exec();",
"public function run() {\n if (count($this->argv) <= 1) {\n echo \"No input command text file provided.\\n\";\n }\n foreach($this->argv as $key => $filePath) {\n if ($key === 0) {\n //Skipping first argument received from console as it is the filename of the script\n continue;\n }\n try {\n $this->executeCommands($this->getCommands($filePath));\n } catch (CommandFileNotFoundException $e) {\n echo $e->getMessage() . \"\\n\";\n }\n }\n }",
"protected function invokeScript() {\n $fileSystem = $this->system->getFileSystem();\n\n $directory = $fileSystem->getTemporaryFile();\n $directory->delete();\n $directory->create();\n $directoryAbsolute = $directory->getAbsolutePath();\n\n $this->appendOutput(\"# Created working directory \" . $directoryAbsolute);\n\n $cwd = getcwd();\n $exception = null;\n\n try {\n chdir($directoryAbsolute);\n\n $variables = $this->getCommandVariables($directoryAbsolute);\n\n $commands = array();\n if ($this->builder->getWillCheckout()) {\n $commands = array_merge($commands, $this->vcsManager->getCheckoutCommands());\n }\n $commands = array_merge($commands, explode(\"\\n\", $this->builder->getScript()));\n\n foreach ($commands as $command) {\n $command = $this->parseCommandVariables($command, $variables);\n\n $this->appendOutput($command);\n\n if (substr($command, 0, 3) == 'cd ') {\n chdir(substr($command, 3));\n\n continue;\n }\n\n // if (strpos($command, ' 2>') === false) {\n // $command .= ' 2>&1';\n // }\n\n $output = $this->system->executeInShell(array('export PATH=/usr/local/bin:/usr/bin:$PATH', $command), $code);\n if ($code != 0) {\n throw new Exception('Command returned code ' . $code . ': ' . $command);\n }\n\n $output = array_slice($output, 4);\n\n $this->appendCommandOutput($output);\n }\n } catch (Exception $exception) {\n $this->setException($exception);\n }\n\n chdir($cwd);\n $directory->delete();\n\n $this->appendOutput(\"# Deleted working directory \" . $directory->getAbsolutePath());\n }",
"abstract public function executeScript($path, $identifier, array &$data = [], array $engineArguments = []);",
"public function script($script)\n\t{\n\t\t$this->last_selector = null;\n\n\t\tif (is_array($script))\n\t\t{\n\t\t\t$script = join(\"\\n\", $script);\n\t\t}\n\n\t\treturn $this->cmd(3, array(\n\t\t\t$script\n\t\t));\n\t}",
"function run_script($command, string $language, string $file)\n{\n $bashOut = exec($command);\n return array($bashOut, $file, $language);\n}",
"protected function executeScript(string $script)\n {\n $this->useCamundaDatabase(function() use ($script) {\n try {\n DB::unprepared(\n $this->getScript($script)\n );\n }\n // Handle any exception during script execution.\n catch (Exception $e) {\n throw new Exception(\"An error occured while executing script [$script].\");\n }\n });\n }",
"function execute() {\n\t\tif (empty($this->args)) {\n\t\t\t$this->__interactive();\n\t\t}\n\n\t\tif (count($this->args) == 1) {\n\t\t\t$this->__interactive($this->args[0]);\n\t\t}\n\n\t\tif (count($this->args) > 1) {\n\t\t\t$type = Inflector::underscore($this->args[0]);\n\t\t\tif ($this->bake($type, $this->args[1])) {\n\t\t\t\t$this->out('done');\n\t\t\t}\n\t\t}\n\t}",
"function run($command);",
"public function run () {\n\t\trequire_once $this->pluginFile;\n\t}",
"public function executeScript($file, $database)\n {\n if($database != 'simpledb')\n return;\n\n $status = include $file;\n return $status;\n }",
"public function run(string $command);",
"public function run() {\n\t\t$this->checkForHelp();\n\n\t\ttry {\n\t\t\t$this->getAndRunTasks();\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\t$this->printException($e);\n\t\t}\n\t}",
"function run($script): Promise\n{\n return factory()->run($script);\n}",
"public function callPageRunCmd()\n {\n $script = $this->rootDir . '/excmd/asrorz.php';\n $params = 'cores/page/run --app=' . $this->newName;\n $phpcmd = 'php ' . $script . ' ' . $params;\n Az::debug($phpcmd, 'command to launch: ');\n $r = shell_exec($phpcmd);\n Az::debug($phpcmd, 'command executed: ');\n Az::debug($r, 'command result: ');\n }",
"public function run($textCommand);",
"public function do_tests()\n {\n foreach ($this->tests as $test) {\n $test->do_test($this->parse_script, $this->interpret_script);\n }\n }",
"public function run($command);",
"public function run($command);",
"public function run()\n {\n $steps = ['listcatimage','listcatthumb'];\n //get argument passed to shell script\n $step = $this->getArg('step');\n if (in_array($step, $steps)) {\n $this->$step();\n } else {\n echo \"STEP MUST BE ONE OF THESE:\\n\";\n foreach ($steps as $s) {\n echo $s.\",\\n\";\n }\n }\n }",
"public abstract function run();",
"public abstract function run();",
"public function execute($id, $script)\n\t{\n\t\treturn $this->connection()->post('execute', array(\n\t\t\t'value' => $script,\n\t\t\t'id' => $id,\n\t\t));\n\t}",
"function startscripts($path){\n\t\t global $run_updateScripts;\n\t\t $list = getManifest($path);\n\t\tif(!empty($list)){\n\t\t\t $commands = gencommands($path, $list);\n\t\t\t $error_commands = array();\n\t\t\t foreach($commands as $command){\n\t\t\t\t $output = array();\n\t\t\t\t exec($command, $output, $result);\n\t\t\t\t if($result > 0){\n\t\t\t\t\t $error_commands[] = $command; \n\t\t\t\t\t debug(\"Failed to execute [$command]\");\n\t\t\t\t\t debug(\"Error Message :-\");\n\t\t\t\t\t foreach($output as $message){\n\t\t\t\t\t\t debug(\"$message\");\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t else{\n\t\t\t\t\t debug(\"Successfuly executed [$command]\");\n\t\t\t\t }\n\t\t\t\t\t \n\t\t\t}\n\t\t\t$fh = fopen($path.\"/.processed\",\"w\");\n\t\t\tforeach($error_commands as $command){\n\t\t\t\tfputs($fh,$command.\"\\n\");\n\t\t\t}\n\t\t\tfclose($fh);\n\t\t\t$run_updateScripts = 1;\n\t\t}\n\t}",
"public static function run(): void;",
"protected function _run(array $args)\n { \n $this->_scriptName = $args[0];\n \n $requestedTaskName = isset($args[1]) ? $args[1] : null;\n \n if ( ! $requestedTaskName || $requestedTaskName == 'help') {\n $this->printTasks(null, $requestedTaskName == 'help' ? true : false);\n return;\n }\n \n if ($requestedTaskName && isset($args[2]) && $args[2] === 'help') {\n $this->printTasks($requestedTaskName, true);\n return;\n }\n\n if (! $this->taskNameIsRegistered($requestedTaskName, $taskClassName)) {\n throw new Doctrine_Cli_Exception(\"The task \\\"{$requestedTaskName}\\\" has not been registered\");\n }\n\n $taskInstance = $this->createTaskInstance($taskClassName, $this);\n $this->setTaskInstance($taskInstance);\n $this->executeTask($taskInstance, $this->prepareArgs(array_slice($args, 2)));\n }",
"public function execute(InputInterface $input, OutputInterface $output)\n {\n $source = $this->loadFiles($input->getArgument('source'));\n\n $this->rivescript->load($source);\n\n $loadedSource = explode('/', $input->getArgument('source'));\n $loadedSource = end($loadedSource);\n\n $output->writeln('RiveScript Interpreter (PHP) -- Interactive Console v2.0');\n $output->writeln('--------------------------------------------------------');\n $output->writeln('RiveScript Version: 2.0');\n $output->writeln('Currently Loaded Source: '.$loadedSource);\n $output->writeln('');\n $output->writeln('You are now chatting with a RiveScript bot. Type a message and press Return');\n $output->writeln('to send it. When finished, type \"/quit\" to exit the interactive console.');\n $output->writeln('');\n\n $this->waitForUserInput($input, $output);\n }",
"private function execute()\n\t{\n\t\t// set working dir and cli path\n\t\t$this->workingDir = getcwd();\n\t\t$this->cliPath = $this->argv[0];\n\n\t\t// get home directory\n\t\t$this->getHomeDir();\n\t}",
"public function run()\n {\n $sql_file = public_path('4farh_ecom_world.sql');\n\n $db = [\n 'host' => '127.0.0.1',\n 'database' => '4farh_ecom',\n 'username' => 'root',\n 'password' => null,\n ];\n\n exec(\"mysql --user={$db['username']} --password={$db['password']} --host={$db['host']} --database={$db['database']} < $sql_file \");\n }",
"public function run()\n {\n $items = $this->app->args->getParams('wild');\n list($proj, $env) = SettingFiles::extractProjEnv($items);\n\n $key = $proj . \".\" . $env;\n if (!Check::fileExists($key)) {\n $msg = Facilitator::onNoFileFound($proj, $env);\n \n $this->app->display($msg, 0);\n return;\n }\n\n $settings = SettingFiles::getObject($key);\n $rsync = new Rsync($settings);\n\n $msg = Facilitator::rsyncBanner($proj, $env, $rsync->cmd);\n $this->app->inline($msg);\n\n if ($this->app->args->simulate) {\n $msg = 'Simulation mode' . \"\\n\";\n\n $this->app->display($msg, 0);\n return;\n }\n\n $rsync->run();\n }",
"function run()\r\n {\r\n }",
"public function exec() { \n $this->codeInjectionCheck();\n /* \n -s Don't add user site directory to sys.path.\n\n -S Disable the import of the module site and the site-dependent\n manipulations of sys.path that it entails.\n (think to create a black list of modules...)\n */ \n //$command = \"export PYTHONDUMPREFS=1 & \" . $this->kernelPath . \" -s -c '\" . $this->code . \"'\";\n $command = $this->kernelPath . \" -c '\" . $this->code . \"' \" . ($this->showSTDERR ? \" 2>&1 \" : \"\");\n $this->output = `$command`;\n }",
"abstract public function execute($sourcecode, $language, $input, $files=null, $params=null);",
"public function execute()\n {\n $this->run();\n }",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"public function run();",
"abstract public function run($command);",
"public function Execute()\n {\n // i.e. --> $this->OBJ_TOUCHPOINTS->AddScript();\n \n // === Load tabs into window\n echo \"<div style='width:800px;'></div>\";\n $this->LoadTabs();\n }",
"abstract public function register_script();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"abstract public function run();",
"function run();",
"function run();",
"public function run(): int\n {\n $this->workspace->reset();\n\n // wait for the promise of the run-scripts method\n $exitCodes = wait ( $this->runScripts());\n\n // if all exit codes were 0 (success) return 0. \n // > 1 indicates failure.\n return array_sum($exitCodes);\n }",
"public function run()\n {\n echo \"run\";\n }",
"public function executeScript($local_file) {\n // connect\n $this->ssh = new Net_SSH2($this->address, $this->port, SSH_TIMEOUT);\n if (!$this->ssh->login($this->login, $this->password)) {\n $msg = 'Login to remote host device failed.' ;\n $this->response->setWs(SSH_ERR_LOGIN_CODE, $msg, true);\n return $this->response;\n }\n\n // connect\n $this->sftp = new Net_SFTP($this->address, $this->port, SSH_TIMEOUT);\n if (!$this->sftp->login($this->login, $this->password)) {\n $msg = 'Login to remote host device failed.';\n $this->response->setWs(SSH_ERR_LOGIN_CODE, $msg, true);\n return $this->response;\n }\n\n // copy file\n if(!$this->sftp->put(MySSH::REMOTE_FILE, $local_file, NET_SFTP_LOCAL_FILE)){\n $msg = 'Copying script to remote file failed.';\n $this->response->setWs(SSH_ERR_COPY_CODE, $msg, true);\n return $this->response;\n }\n\n // get outputs\n $execStr = 'chmod +x '.MySSH::REMOTE_FILE.' && '.\n 'nohup ./'.MySSH::REMOTE_FILE.' >out 2>/dev/null </dev/null';\n $cleanUp ='cat out 2>/dev/null && '.\n 'rm -r out 2>/dev/null &&'.\n 'rm -r '.MySSH::REMOTE_FILE.' 2>/dev/null';\n $scriptOutput = $this->ssh->exec($execStr);\n $exitCode= $this->ssh->getExitStatus();\n $scriptOutput .= $this->ssh->exec($cleanUp);\n //echo \"XXX=\" . $exitCode;\n $this->response->setCmd($scriptOutput, $exitCode);\n\n return $this->response;\n }",
"abstract function run();",
"public function runTestTask()\n\t{\n\t\t$this->runTask(1);\n\t}",
"public function run() {\n\t\t$this->preRun();\n\n\t\t$this->changeTags();\n\n\t\t$this->postRun();\n\t}",
"public function execute()\n\t{\n\t\t$this->run();\n\t}",
"function main() {\n\t\tif (!$this->_registerPid()) {\n\t\t\t$this->out('Unable to register Pid');\n\t\t\t$this->_stop();\n\t\t}\n\t\tif (file_exists($this->params['working'] . DS . '.autotest')) {\n\t\t\tinclude($this->params['working'] . DS . '.autotest');\n\t\t}\n\t\tif (!empty($this->params['notify'])) {\n\t\t\t$this->settings['notify'] = $this->params['notify'];\n\t\t}\n\t\tif (!empty($this->params['mode'])) {\n\t\t\t$this->settings['mode'] = $this->params['mode'];\n\t\t}\n\t\t$suffix = '';\n\t\tif (!empty($this->settings['mode'])) {\n\t\t\t$suffix = ' (' . $this->settings['mode'] . ' mode)';\n\t\t}\n\n\t\tNotify::$method = $this->settings['notify'];\n\t\t$this->addHooks();\n\t\tNotify::message('Autopilot Starting', 'in ' . APP_DIR . $suffix, 0, false);\n\t\t$this->buildPaths();\n\t\t$this->run();\n\t}",
"public function run($aArgs){\n\t\n\t\t/*include common library*/\n\t\t$this->library(\"common\");\n\t\t\n\t\t/*check if session start*/\n\t\t$this->library(\"checkLogin\");\n\t\n\t\t/*for the exec functions*/\n\t\t$this->library(\"tinymce\");\n\t\tTinymce::init();\n\t\t$sAction = Common::getParam('action');\n\t\t$sAction = $sAction != \"\" ? \"exec\" . ucwords($sAction) : \"execSchedule\";\n\t\t$this->$sAction($aArgs);\n\t\t\n\t}",
"public function run(Command $command);",
"public function runProcess($guid);",
"abstract public function run() ;",
"public static function run() {\n\t}",
"public function run()\n {\n $command = implode(' && ', [\n sprintf(\n \"%s --config %s --ext .js %s\",\n storage_path('app/tools/node_modules/.bin/eslint'),\n storage_path('app/tools/m2/dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/.eslintrc-magento'),\n /*escapeshellarg(*/$this->getPath() . '/view/**'/*)*/\n )\n ]);\n return Terminal::exec($command);\n }",
"function run_task_by_filename($filename) {\n $task = $this->get_task_by_filename($filename);\n if ($task) {\n $this->run_task($task);\n }\n }",
"static function start($app_directory = NULL, $arg = NULL) {\n \n matrix::get_status();\n avr::status();\n \n self::$script_command = $app_directory . '/third_party/kb/builds/rtl443/build/src/rtl_433 -a -D 2>&1';\n self::$process = proc_open(self::$script_command, self::$descriptorspec, self::$pipes);\n\n if (is_resource(self::$process)) {\n while (!self::$do_quit && !feof(self::$pipes[1])) {\n $in = fgets(self::$pipes[1]);\n $trimmed = trim($in);\n self::process_input($trimmed);\n }\n } else {\n itach::l('NOT RESOURCE....');\n }\n }",
"function _executeScripts($player_id, $shellscripts, $scripttype_id, $CAKEUSER=null){\r\n \r\n foreach($shellscripts as $current){\r\n $current['filename'] = 'scripttype'.$scripttype_id.'_' . uniqid($player_id) . '.sh'; // temporary random filename for script!\r\n foreach ($current['hosts'] as $host_id=>$host_ip) {\r\n// 1. Software pipe: put required software packets on required host via scp:\r\n $swRC = 0;\r\n if (strlen($current['deployment_package'])>0){\r\n $swPipeCommand = 'scp -F '.SSH_CONFIG.' '.PACKAGES.$current['deployment_package'].' root@'.$host_ip.':/tmp';\r\n passthru($swPipeCommand, $swRC);\r\n if ($swRC!=0){\r\n $debugInfo = array(\r\n 'message' => 'Error for software pipe of '.$current['deployment_package'].' on '.$host_ip, // if script pipe fails, abort! Scenario can not be run\r\n 'legend' => 'function _executeScripts()',\r\n 'command' => $swPipeCommand,\r\n 'rc' => 'RC = '.$swRC. ' for script pipe command' \r\n );\r\n return $debugInfo;\r\n }\r\n }\r\n \r\n// 2. script pipe: put the current script on that host:\r\n $RC = 0;\r\n // now write this script via ssh to the host:\r\n $pipeCommand = 'echo -e \\''.$current['script'].'\\' | ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"cat > /tmp/'.$current['filename'].';\"';\r\n passthru($pipeCommand, $RC);\r\n if ($RC!=0){\r\n $debugInfo = array(\r\n 'error' => 'Error for script pipe of '.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run \r\n 'legend'=>'scriptpipe',\r\n 'command'=>$pipeCommand,\r\n 'rc'=>'RC='.$RC.' for script '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n \r\n// 3. script execution:\r\n $execCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"chmod +x /tmp/'.$current['filename'].'; /tmp/'.$current['filename'].';\"';\r\n passthru($execCommand, $RC);\r\n // do not evaluate RC here, because for PLAYER_EVALUATION_SCRIPT it needs to be >0 -> see 4.a) below \r\n $rmCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \"rm /tmp/'.$current['filename'].'\"';\r\n // ssh -qqF /var/www/nets-x/app/shellscripts/ssh_config [email protected] \"rm /tmp/scripttype5_148c54e63a5ffa.sh\"\r\n if (Configure::read('debug')<2){ // remove shell scripts if debug=={0,1}\r\n passthru($rmCommand, $rmRC);\r\n if ($rmRC!=0){\r\n $debugInfo = array(\r\n 'message'=> 'deletion of script failed.',\r\n 'legend' => 'function _executeScripts',\r\n 'command' => $rmCommand,\r\n 'rc' => 'RC='.$RC.' for deletion of '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n }\r\n \r\n// 4. Special cases:\r\n// a) Player eval script returns the Return Code RC:\r\n if ($scripttype_id==PLAYER_EVALUATION_SCRIPT){\r\n return $RC; // in this case return the return code for further processing in $this->evaluateScenario!\r\n } else if ($RC!=0){\r\n $debugInfo = array(\r\n 'message' => 'Error during execution of '.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run\r\n 'legend'=>'function _executeScripts',\r\n 'command'=>$execCommand,\r\n 'rc'=>'RC='.$RC.' during execution of '.$current['filename'].' on '.$host_ip\r\n );\r\n return $debugInfo;\r\n }\r\n \r\n// b) execution of drone action (the script generated by drone setup script):\r\n if ($scripttype_id==DRONE_SETUP_SCRIPT){\r\n // drone script which was generated by the first\r\n // runs in background (&) even if drone user logs out (nohup).\r\n $droneRC = 0;\r\n\r\n //$execCommand = 'ssh -qqF '.SSH_CONFIG.' DRONE_'.$CAKEUSER.'@'.$host_ip.' \"nohup ./'.DRONE_SCRIPT.' &;\"';\r\n // bash befehl: ssh -qqF SSH_CONFIG DRONE_$CAKEUSER@$host_ip 'exit 0'\r\n $execCommand = 'ssh -qqF '.SSH_CONFIG.' DRONE_'.$CAKEUSER.'@'.$host_ip.' \\'exit 0\\''; \r\n //$execCommand = 'ssh -qqF '.SSH_CONFIG.' root@'.$host_ip.' \\'su -c \"nohup /home/DRONE_'.$CAKEUSER.'/'.DRONE_SCRIPT.' &\" DRONE_'.$CAKEUSER.'\\'';\r\n\t\t\t\tpassthru($execCommand, $droneRC);\r\n\t\t\t\techo $droneRC;\r\n\t\t\t\t//exec($execCommand);\r\n\t\t\t\tif($droneRC != 0) {\r\n\t $debugInfo = array(\r\n\t 'message' => 'Error during execution of drone script'.$current['filename'].' on '.$host_ip, // if one script fails, abort! Scenario can not be run\r\n\t 'legend'=>'function _executeScripts',\r\n\t 'command'=>$execCommand,\r\n\t 'rc'=>'RC='.$RC.' during execution of drone script '.$current['filename'].' on '.$host_ip\r\n\t );\r\n \treturn $debugInfo;\r\n\t\t\t\t}\r\n }\r\n }\r\n }\r\n return null; // if $debugInfo == null no error\r\n }",
"function run($branch, $revision, $what='default', $all=null)\n{\n\tglobal $caldavtester;\n\n\tif ($what === false) $what = 'default';\t// default of optional argument\n\n\t$tester = $caldavtester;\n\tif ($all) $tester = str_replace('--print-details-onfail', '--always-print-request --always-print-response', $caldavtester);\n\n\tforeach(scripts($what, true) as $script)\n\t{\n\t\t$cmd = $tester.' '.escapeshellarg($script);\n\t\terror_log($cmd);\n\t\tif (($fp = popen($cmd, 'r')))\n\t\t{\n\t\t\timport($branch, $revision, $fp);\n\t\t\tfclose($fp);\n\t\t}\n\t}\n}",
"static public function updateScript()\n {\n if ($GLOBALS['session']->get('ingo', 'script_generate')) {\n try {\n $ingo_script = self::loadIngoScript();\n\n /* Generate and activate the script. */\n self::activateScript($ingo_script->generate(),\n false,\n $ingo_script->additionalScripts());\n } catch (Ingo_Exception $e) {\n $GLOBALS['notification']->push(_(\"Script not updated.\"), 'horde.error');\n }\n }\n }",
"public function run(){}",
"public function run() {\r\n\t\tYii::app()->clientScript->registerCoreScript(\"jquery\");\r\n\t\tYii::app()->clientScript->registerCoreScript(\"jquery.ui\");\r\n\t\tif (YII_DEBUG) {\r\n\t\t\t$files = $this->listFiles();\r\n\t\t\t$time = $_SERVER['REQUEST_TIME'];\r\n\t\t\tforeach ($files as $filename => $url) {\r\n\t\t\t\tYii::app()->clientscript->registerScriptFile($url.\"?v=\".$time,CClientScript::POS_END); \r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tYii::app()->clientScript->registerScriptFile($this->applicationUrl.\"/compiled.js\",CClientScript::POS_END);\r\n\t\t}\r\n\t\r\n\t\t$script = \"Yii.createApplication('Application',appConfig);\";\r\n\t\t$script .= \"Yii.app().getRequest()._csrfToken = '\". Yii::app()->request->csrfToken . \"';\\n\";\r\n\t\t$script .= \"Yii.app().run()\";\r\n\t\tYii::app()->clientScript->registerScript(\"YiiJS:run()\",$script,CClientScript::POS_END);\r\n\t\t\r\n\t\t\r\n\t}",
"function run()\n {\n if (count($this->args) <= 1) {\n $this->help();\n } else {\n switch ($this->args[1]) {\n case \"migrate\":\n $this->createMigrations();\n if (!isset($this->args[2]) || $this->args[2] != '--seed')\n break;\n case \"seed\":\n $this->createSeeds();\n break;\n case \"migrate:drop\":\n $this->dropMigrations();\n break;\n case \"seed:drop\":\n $this->dropSeeds();\n break;\n default:\n $this->help();\n break;\n }\n }\n }",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"public function run() {\n\t\t$this->loader->run();\n\t}",
"function ejecutaScript($usuario, $host, $keyUser, $script) {\n // $usuario = usuario que hace el login\n // $host = host sobre el que se hace el login\n // $keyUser = key del usuario\n // $script = nombre del fichero .sh (ha de tener .sh, permisos y todo en orden)\n\n // Hacemos el login\n $ssh = login($usuario, $host, $keyUser);\n\n $ssh -> write($script.\"\\n\");\n }",
"public static function main() {\n\t\tTestRunner::run( self::suite() );\n\t}",
"abstract protected function _run();"
] | [
"0.6396461",
"0.63678336",
"0.6296484",
"0.6067574",
"0.60033673",
"0.5988951",
"0.59344095",
"0.591913",
"0.5868546",
"0.58566266",
"0.58457357",
"0.58051",
"0.57499707",
"0.5749748",
"0.56936795",
"0.5693443",
"0.5676991",
"0.5608339",
"0.55458915",
"0.5534354",
"0.5516509",
"0.5516509",
"0.5487687",
"0.5471268",
"0.5471268",
"0.5468979",
"0.546249",
"0.54546607",
"0.5417875",
"0.5385294",
"0.5368761",
"0.5362892",
"0.53625196",
"0.53575736",
"0.5357296",
"0.53518635",
"0.534914",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.53423923",
"0.5339185",
"0.5338008",
"0.53351426",
"0.5335015",
"0.5335015",
"0.5335015",
"0.5335015",
"0.5335015",
"0.5335015",
"0.5335015",
"0.5335015",
"0.5331125",
"0.5331125",
"0.53255314",
"0.53132176",
"0.53058285",
"0.52892065",
"0.5278277",
"0.52782595",
"0.5277965",
"0.5276493",
"0.5272532",
"0.52650166",
"0.524757",
"0.5239276",
"0.5236433",
"0.52343434",
"0.5220784",
"0.5209194",
"0.5206158",
"0.5203558",
"0.51995707",
"0.5198045",
"0.5181255",
"0.5176919",
"0.5166159",
"0.5166159",
"0.5166159",
"0.5166159",
"0.5166159",
"0.5166159",
"0.5166159",
"0.5166159",
"0.5166159",
"0.51565516",
"0.5155497",
"0.51511645"
] | 0.52971864 | 69 |
Run the database seeds. | public function run()
{
$this->execute(function ($item) {
$item = $item->merge([
'is_default' => $item->get('is_default') ?: false,
]);
if (User::find($item->get('user_id'))) {
Address::insert($item->toArray());
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }",
"public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }",
"public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }",
"public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }",
"public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }",
"public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }",
"public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}",
"public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }",
"public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }",
"public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }",
"public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }",
"public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }",
"public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }",
"public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}",
"public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }",
"public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }",
"public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }",
"public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }",
"public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }",
"public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }",
"public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }",
"public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }",
"public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }",
"public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}",
"public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }",
"public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }",
"public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }"
] | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.7841468",
"0.7834583",
"0.7827792",
"0.7819104",
"0.78088796",
"0.7802872",
"0.7802348",
"0.78006834",
"0.77989215",
"0.7795819",
"0.77903426",
"0.77884805",
"0.77862066",
"0.7778816",
"0.7777486",
"0.7765202",
"0.7762492",
"0.77623445",
"0.77621746",
"0.7761383",
"0.77606887",
"0.77596676",
"0.7757001",
"0.7753607",
"0.7749522",
"0.7749292",
"0.77466977",
"0.7729947",
"0.77289546",
"0.772796",
"0.77167094",
"0.7714503",
"0.77140456",
"0.77132195",
"0.771243",
"0.77122366",
"0.7711113",
"0.77109736",
"0.7710777",
"0.7710086",
"0.7705484",
"0.770464",
"0.7704354",
"0.7704061",
"0.77027386",
"0.77020216",
"0.77008796",
"0.7698617",
"0.76985973",
"0.76973504",
"0.7696405",
"0.7694293",
"0.7692694",
"0.7691264",
"0.7690576",
"0.76882726",
"0.7687433",
"0.7686844",
"0.7686498",
"0.7685065",
"0.7683827",
"0.7679184",
"0.7678287",
"0.76776296",
"0.76767945",
"0.76726556",
"0.76708084",
"0.76690495",
"0.766872",
"0.76686716",
"0.7666299",
"0.76625943",
"0.7662227",
"0.76613766",
"0.7659881",
"0.7656644",
"0.76539344",
"0.76535016",
"0.7652375",
"0.7652313",
"0.7652022"
] | 0.0 | -1 |
Method returning the class name | public function __toString()
{
return __CLASS__;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClassName();",
"public function getClassName();",
"public function getClassName() ;",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName()\n {\n return __CLASS__;;\n }",
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}",
"public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}",
"public function getClassName() { return __CLASS__; }",
"public static function getClassName() {\n\t\treturn get_called_class();\n\t}",
"public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }",
"public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}",
"public static function getClassName()\n {\n return get_called_class();\n }",
"public function getClassName()\n {\n return $this->class;\n }",
"public function getClassName()\n {\n return $this->class;\n }",
"public static function className() : string {\n return get_called_class();\n }",
"public function getName()\n {\n return __CLASS__;\n }",
"public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}",
"public function getClassName()\n {\n return $this->class_name;\n }",
"public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}",
"public function getName(): string\n {\n return __CLASS__;\n }",
"public static function getClassName() {\n return get_called_class();\n }",
"public function getClassname(){\n\t\treturn $this->classname;\n\t}",
"public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}",
"public function getClassName()\n {\n return $this->_sClass;\n }",
"public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}",
"protected function getClassName(): string\n {\n return $this->className;\n }",
"public static function getClassName() {\n return self::$className;\n }",
"public function getClassName(): string;",
"public function getClassName() : string;",
"public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }",
"public function getClassName() : string\n {\n return $this->className;\n }",
"public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }",
"public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}",
"public function getClassName() : string\n {\n\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public static function staticGetClassName()\n {\n return __CLASS__;\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() {\n\t\treturn $this->className;\n\t}",
"public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }",
"public function getClassName() {\n\t\treturn $this->_className;\n\t}",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }",
"function getClassName()\n {\n // TODO: Implement getClassName() method.\n }",
"public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }",
"function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }",
"public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }",
"public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }",
"public function getClass()\n {\n return $this->_className;\n }",
"private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }",
"public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}",
"public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }",
"public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }",
"private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }",
"public function getClass(): string\n {\n return $this->class;\n }",
"public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }",
"public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}",
"public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }",
"public function getName(){\n\t\treturn get_class($this);\n\t}",
"public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }",
"public static function className()\n\t{\n\t\treturn static::class;\n\t}",
"public function toClassName(): string\n {\n return ClassName::full($this->name);\n }",
"public function getName()\n {\n return static::CLASS;\n }",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"function getName()\n {\n return get_class($this);\n }",
"public function className(): string\n {\n return $this->taskClass->name();\n }",
"public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }",
"function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}",
"public function getName() {\n return get_class($this);\n }",
"public function getName() {\n return get_class($this);\n }",
"public function toString()\n {\n return __CLASS__;\n }",
"public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}",
"public function getNamespacedName()\n {\n return get_class();\n }",
"protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}",
"protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }",
"function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}",
"public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}",
"public function __toString() {\n\t\treturn $this->className();\n\t}",
"public static function name()\n {\n return lcfirst(self::getClassShortName());\n }"
] | [
"0.87522393",
"0.87522393",
"0.8751158",
"0.87397957",
"0.87397957",
"0.87397957",
"0.87397957",
"0.8731564",
"0.8696754",
"0.8673495",
"0.8638432",
"0.8615335",
"0.8603119",
"0.8566906",
"0.8562364",
"0.8555002",
"0.85503733",
"0.85503733",
"0.85425884",
"0.8533183",
"0.8529981",
"0.85237026",
"0.8502733",
"0.8493115",
"0.8491238",
"0.8488943",
"0.8484194",
"0.847459",
"0.8441478",
"0.8418852",
"0.8399611",
"0.83950585",
"0.83949184",
"0.83853173",
"0.8378261",
"0.837777",
"0.8372544",
"0.8355432",
"0.8355432",
"0.83479965",
"0.8325877",
"0.8325877",
"0.8312873",
"0.83027107",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.82474744",
"0.8242934",
"0.8202995",
"0.8185409",
"0.8184752",
"0.81829107",
"0.81829107",
"0.8176191",
"0.81761754",
"0.8162896",
"0.8142928",
"0.81323636",
"0.8062757",
"0.80528253",
"0.8045769",
"0.8033823",
"0.8026215",
"0.8001116",
"0.79949147",
"0.79779136",
"0.79672754",
"0.7957633",
"0.790449",
"0.78617185",
"0.7860126",
"0.7847096",
"0.78195953",
"0.7817044",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.77821547",
"0.7761565",
"0.77588034",
"0.7747239",
"0.77409905",
"0.77409905",
"0.7710985",
"0.76808393",
"0.7670475",
"0.76640886",
"0.76514393",
"0.76499707",
"0.76323646",
"0.76005036",
"0.75937456"
] | 0.0 | -1 |
Saves the entity to the database. | public function save($entity) {
throw new NotImplementedException;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 }",
"public function save($entity);",
"public function save($entity);",
"public function save($entity);",
"public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }",
"public function save() {\n return $this->entity->save();\n }",
"public function save(): void\n {\n $this->em->persist($this->model);\n $this->em->flush();\n }",
"public function save(Entity $entity): void\n {\n $this->db->save($entity);\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 if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }",
"public function save()\n {\n $this->persist($this->state);\n }",
"public function saveModel($entity){\n $this->entityManager->persist($entity);\n $this->entityManager->flush();\n }",
"public function save()\n {\n $data = $this->getSaveData();\n $errorString = '<h5 class=\"alert-heading\">Can\\'t save ' . $this->entityName . ' because of the following problems:</h5>';\n\n $errors = $this->checkRequiredColumns( $data );\n if ( !empty( $errors ) ) {\n return $this->addError( $errorString . HTMLTags::getListGroup( $errors ) );\n }\n\n if ( defined( 'DEBUG' ) && DEBUG === true ) {\n $dataToSave = !empty( $data ) ? $this->getDataHTMLTable( $data ) : 'None';\n $this->messages->add(\n 'Entity - ' . $this->entityName\n . '<br>Changed - ' . print_r( $this->changed, true )\n . '<br>Data to save - ' . $dataToSave\n . '<br>All column properties - ' . $dataToSave,\n 'info'\n );\n }\n $errors = $this->healthCheck();\n if ( !empty( $errors ) ) {\n return $this->addError( $errorString . HTMLTags::getListGroup( $errors ) );\n }\n if ( $this->exists ) {\n return $this->updateDBRow( $data );\n }\n $addRow = $this->addDBRow( $data );\n if ( is_int( $addRow ) ) {\n $this->id = $addRow;\n $this->exists = true;\n }\n return $addRow;\n }",
"public function saveEntity($entity)\n\t{\n\t\t$entityManager = $this->getDoctrine()->getManager();\n\t $entityManager->persist($entity);\n\t $entityManager->flush();\n\t}",
"protected function saveEntity($entity)\n {\n $this->om->persist($entity);\n $this->om->flush($entity);\n }",
"public function save($entity) : bool;",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"public function save()\n\t{\n\t\t$this->copyAttributesToValues() ;\n\t\tif( $this->factory )\n\t\t{\n\t\t\tswitch( $this->todo )\n\t\t\t{\n\t\t\t\tcase 1: // Insert\n\t\t\t\t\tif( $this->factory->insertObjectIntoDB( $this ) ) $this->state = \"inserted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 2: // update\n\t\t\t\t\tif( $this->factory->updateObjectIntoDB( $this ) ) $this->state = \"updated\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 3: // delete\n\t\t\t\t\tif( $this->factory->deleteObjectIntoDB( $this ) ) $this->state = \"deleted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}",
"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 final function save() {\n }",
"public function persist();",
"public function save()\n {\n }",
"public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }",
"function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\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();",
"public function saveHokodoEntity(HokodoEntityInterface $hokodoEntity): void;",
"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() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public final function save()\n {\n }",
"function save()\n {\n $this->form_validation->set_rules($this->_get_rules());\n\n if($this->form_validation->run()){\n $entity = $this->_from_form();\n $this->data['save'] = $this->model->insert_entry($entity);\n $this->data['action_performed'] = 'save';\n $this->success($entity);\n }\n else {\n $this->create();\n }\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 persist($entity)\n {\n }",
"public function save()\n {\n $this->hasTableName();\n $pk = $this->pk;\n $condition = \"\";\n if ($this->isNew) {\n $sql = \"INSERT INTO \" . $this->table_name . \" SET \";\n $update = '';\n } else {\n if (!isset($this->$pk))\n throw new Exception('Update em objeto sem chave definida', 403);\n\n $sql = \"UPDATE \" . $this->table_name . \" SET \";\n $update = \" WHERE `\" . $this->pk . \"` = '\" . $this->$pk . \"'\";\n }\n foreach ($this->rules() as $key => $validation) {\n if ($this->validateField($key, $validation) && isset($this->$key) && $this->$key != \"\") {\n $sql .= \" `\" . $key . \"` = '\" . $this->$key . \"',\";\n $condition .= \" `\" . $key . \"` = '\" . $this->$key . \"' AND\";\n }\n }\n if (!$this->getErrors()) {\n $sql = substr($sql, 0, -1) . $update;\n if (Database::dbactionf($sql)) {\n if ($this->isNew) {\n $this->$pk = Database::lastID();\n $this->persisted();\n }\n return true;\n }\n }\n return false;\n }",
"public function save()\r\n {\r\n \r\n }",
"public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\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}",
"public function save() {\n $db = self::getDbConnection();\n $table = static::getTable();\n $data = get_object_vars($this);\n if ($table == 'posts') {\n $data['name'] = Service::get('session')->userEmail;\n }\n\n if (isset($data['id'])) {\n $query = $db->prepare($this->getUpdateString($data, $table));\n } else {\n $query = $db->prepare($this->getInsertString($data, $table));\n }\n\n if (!$query->execute()) {\n throw new DatabaseException('Cant save object');\n }\n }",
"public function postPersist($entity);",
"public function save() {\n }",
"public function save() {\n }",
"public function persist() {}",
"public abstract function save();",
"public function save( LogEntity $logEntity );",
"public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function save() {\n\n $data = array(\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'metatitle' => $this->getMetatitle(),\n 'metakeywords' => $this->getMetakeywords(),\n 'metadescription' => $this->getMetadescription()\n );\n $data['parent_id'] = 0; // by default it is 0, becouse right now there is no use of parent id in this application\n if (null === ($id = $this->getId())) {\n unset($data['id']);\n $data['status'] = 1;\n return $this->getMapper()->getDbTable()->insert($data);\n } else {\n $data['status'] = $this->getStatus();\n return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n }\n\n }",
"public function save()\r\n {\r\n //\r\n }",
"public function save() {\n }",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"public function save() {\n if ($this->id) {\n return $this->update();\n } else {\n return $this->insert();\n }\n }",
"public function save()\n {\n // For V2.0\n }",
"public function saveToDB()\n {\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function 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 function save()\n {\n //\n }",
"public function save()\n\t{\n\n\t}",
"public function save($entity, $context) {\n unset($entity->id);\n $entity->is_new = TRUE;\n entity_save($this->entityType, $entity);\n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function markAsPersisted(): void;",
"public function save()\n {\n \treturn FactoryAbastract::dao(get_class($this))->save($this);\n }",
"public function save()\n {\n // datos obligatorios para la insercion/modificacion\n $data = [\n \"propietario\" => $this->owner,\n \"estado\" => $this->state,\n \"nombre\" => $this->name\n ];\n\n // datos opcionales, que pueden no estar establecidos para la \n // insercion/modificacion\n if (isset($this->description)) $data[\"descripcion\"] = $this->description;\n\n // si idProduct no es null, entonces es un update\n if (isset($this->idProduct))\n return $this->dao->update($data, [\"idProducto\" => $this->idProduct]);\n\n // sino, es un insert\n return $this->dao->insert($data);\n }",
"protected function saveNew($entity)\n {\n $this->em->persist($entity);\n $this->update();\n }",
"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 {\n }",
"public function save()\n {\n }",
"public function persist()\n {\n //\n }",
"public function persist()\n {\n }",
"public function save(GameLocation $entity)\n {\n $em = $this->getEntityManager();\n\n $em->persist($entity);\n $em->flush();\n }",
"public function save($entity)\n {\n $this->model->save($entity);\n return $this->findOne($entity->id);\n }",
"public function save()\n {\n return;\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 testPersistSavesEntityToDatabase(): void\n {\n $entityFactoryManager = $this->getEntityFactoryManager([\n 'Tests\\EoneoPay\\Externals\\ORM\\Stubs\\Factories\\\\' => 'Tests\\EoneoPay\\Externals\\ORM\\Stubs'\n ]);\n\n $entity = $entityFactoryManager->create(EntityStub::class);\n self::assertNull($entity->getEntityId());\n\n $entity = $entityFactoryManager->persist(EntityStub::class);\n self::assertNotNull($entity->getEntityId());\n }",
"public function entitySave($entity) {\n return waywire_video_save($entity);\n }"
] | [
"0.7910169",
"0.771441",
"0.771441",
"0.771441",
"0.76996315",
"0.76428115",
"0.7398375",
"0.739107",
"0.7290663",
"0.7217688",
"0.72003764",
"0.7198998",
"0.71093726",
"0.7078092",
"0.70455694",
"0.7043248",
"0.70213723",
"0.70213723",
"0.70204556",
"0.69832087",
"0.6949409",
"0.68933547",
"0.6874917",
"0.6867903",
"0.6861929",
"0.68606323",
"0.68580055",
"0.6851586",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.6848999",
"0.68487924",
"0.68439984",
"0.68282264",
"0.6796398",
"0.6790123",
"0.67718655",
"0.6750199",
"0.6746706",
"0.674173",
"0.6739998",
"0.67237765",
"0.6721497",
"0.6705427",
"0.6693872",
"0.66916627",
"0.66743135",
"0.66645634",
"0.66645634",
"0.6655627",
"0.66470385",
"0.6625347",
"0.66089356",
"0.6607858",
"0.65967643",
"0.6592107",
"0.658908",
"0.658908",
"0.658908",
"0.658908",
"0.658908",
"0.65810287",
"0.65804935",
"0.65192324",
"0.6511141",
"0.65105754",
"0.6507326",
"0.64995015",
"0.64979184",
"0.64858395",
"0.64751047",
"0.64741623",
"0.6473661",
"0.64563125",
"0.6440744",
"0.64332795",
"0.64332795",
"0.6426945",
"0.6425352",
"0.6424867",
"0.6418173",
"0.6417497",
"0.6412636",
"0.640611",
"0.6404152"
] | 0.6823492 | 49 |
Returns the total number of entities. | public function getCount() {
return $this->db->fetchColumn("SELECT COUNT(id) FROM $this->table");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function count()\n {\n return count($this->entities);\n }",
"public function count()\n {\n return count($this->entities);\n }",
"public function countEntities(): int;",
"public function getTotal()\n\t{\n\t\t\n\t\treturn count($this->findAll());\n\t}",
"public static function totalNumber()\n {\n return (int)self::find()->count();\n }",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"public function total(): int\n {\n return count($this->all());\n }",
"public function totalCount();",
"public function totalCount();",
"public function count()\n {\n return $this->getTotalItemCount();\n }",
"public function count()\n {\n $count = Doctrine_Query::create()\n ->select('COUNT(id) as total')\n ->from('Zfplanet_Model_Entry')\n ->fetchone();\n return $count->total;\n }",
"protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}",
"public function countItems() {\n\t\t$count = elgg_get_entities([\n\t\t\t'types' => 'object',\n\t\t\t'subtypes' => 'notification',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\treturn $count;\n\t}",
"function fetchTotalObjectCount()\n {\n $db = eZDB::instance();\n $objectCount = array();\n $objectCount = $db->arrayQuery( \"SELECT COUNT(*) AS count FROM ezcontentobject\" );\n $totalObjectCount = $objectCount[0][\"count\"];\n return $totalObjectCount;\n }",
"public function getCount()\n {\n if (null === $this->count) {\n $qb = clone $this->getQueryBuilder();\n $query = $qb->addSelect('count(e.id) as total_count');\n $result = $query->getQuery()->execute();\n $this->count = $result[0]['total_count'];\n }\n return $this->count;\n }",
"public function count() {\r\n return count($this->objects);\r\n }",
"public function totalEntries()\n\t{\n\t\t$count = craft()->formBuilder2_entry->getTotalEntries();\n\t\treturn $count;\n\t}",
"public function count() {\r\n if (is_null($this->objectcount)) {\r\n $this->fetchData();\r\n }\r\n return $this->objectcount;\r\n }",
"public function getProcessedEntitiesCount()\n {\n return $this->_processedEntitiesCount;\n }",
"public function getTotalItemCount();",
"public function getTotalEntries()\n {\n return $this->totalEntries;\n }",
"public function getTotal() {\n\t\treturn $this->find('count', array(\n\t\t\t'contain' => false,\n\t\t\t'recursive' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__,\n\t\t\t'cacheExpires' => '+24 hours'\n\t\t));\n\t}",
"private function getCountAllResults()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('count(' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');\n $qb->from($this->metadata->getName(), $this->tableName);\n\n $this->setWhereCallbacks($qb);\n\n return (int) $qb->getQuery()->getSingleScalarResult();\n }",
"public function count(): int\n\t{\n\t\treturn count($this->all());\n\t}",
"public function count()\n {\n return count($this->entries);\n }",
"public function countEm()\n {\n $qb = $this->createQueryBuilder('g');\n $qb->select('count(g.id) AS counter');\n $query = $qb->getQuery();\n return $query->getSingleScalarResult();\n }",
"public function count() {\n\t\treturn count($this->getData());\n\t}",
"public function count()\n\t{\n\t\treturn $this->_totalItemCount;\n\t}",
"public function count()\n {\n return $this->createStandardQueryBuilder()->count()->getQuery()->execute();\n }",
"public function count() {\r\n\r\n return $this->total_size;\r\n\r\n }",
"public function count()\n\t{\n\t\treturn $this->getParentObject()->count();\n\t}",
"function getTotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_total))\n\t\t{\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}",
"function getTotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_total))\n\t\t{\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}",
"function getTotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_total))\n\t\t{\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}",
"static public function getTotalCount()\n\t{\n\t\treturn self::$count;\n\t}",
"public function getTotalCount()\n {\n return $this->totalCount;\n }",
"public function countEntries()\n\t{\n\t\treturn count($this->_results);\n\t}",
"public function count()\n {\n return $this->size();\n }",
"public function count() : int\n {\n return count($this->entries);\n }",
"final public function count(): int\n {\n return count($this->all());\n }",
"public function size()\n {\n return count($this->getCollection());\n }",
"public function getTotal()\n {\n if ( empty ( $this->_total ) ) {\n $query = $this->_buildQuery();\n $this->_total = $this->_getListCount($query);\n }\n\n return $this->_total;\n }",
"public function getTotalNumberOfResults();",
"function getTotal()\n\t{\n\t\tif (empty($this->_total)) {\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\t\treturn $this->_total;\n\t}",
"function getTotal() {\n\t\tif (empty($this->_total)) {\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}",
"public function count()\n {\n return $this->queryResult->getSize();\n }",
"public function getTotalCount()\n\t{\n\t\treturn $this->totalCount;\n\t}",
"public function getTotalCount()\n {\n return $this->provider->totalCount;\n }",
"public function count()\n {\n return count($this->countable);\n }",
"public function countItems() : int\n {\n return $this->model->count();\n }",
"public static function getCount()\n\t{\n\t\treturn self::find()->count();\n\t}",
"public function count()\n {\n return count($this->getResults());\n }",
"public function count()\n {\n return $this->iterator->count();\n }",
"public function count()\n {\n return $this->items()->count();\n }",
"public function count()\r\n {\r\n\t\tif ( null === $this->totalResults )\r\n\t\t{\r\n\t\t\t$this->warmUp();\r\n\t\t}\r\n\r\n\t\treturn $this->totalResults;\r\n\t}",
"public function count()\n {\n return $this->getCount();\n }",
"public function count(): int\n {\n return $this->content()->sum('quantity');\n }",
"function getTotal()\n\t{\n\t\tif (empty($this->_total)) {\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query); \n\t\t}\n\t\treturn $this->_total;\n\t}",
"public function getTotal()\n\t{\n $rows = (new \\yii\\db\\Query())\n ->select('*')\n ->from($this->table)\n ->all();\n\t\treturn count($rows);\n\t}",
"function getTotal() {\r\n\t\tif (empty ( $this->_total )) {\r\n\t\t\t$query = $this->_buildQuery ();\r\n\t\t\t$this->_total = $this->_getListCount ( $query );\r\n\t\t}\r\n\t\treturn $this->_total;\r\n\t}",
"public function getTotal(): int\n {\n if (isset($this->contents)) {\n return count($this->contents);\n }\n\n return 0;\n }",
"public function getTotalItemCount()\n {\n return $this->totalItemCount;\n }",
"public function countAll()\n {\n return $this->createQuery()->execute()->count();\n }",
"public function countAll() : int\n {\n $result = $this->em->createQueryBuilder()->select('count(u.username)')\n ->from(User::class, 'u')\n ->getQuery()->getSingleScalarResult();\n\n return intval($result);\n }",
"public function countAll()\n {\n return $this->getModel()->count();\n }",
"public function count(): int\n\t{\n\t\treturn $this->paginator->count();\n\t}",
"public function getNumberOfEntries()\n {\n return $this->numberOfEntries;\n }",
"public function countEntityTotal($dimensions=array()) {\n $query = array(\"dimensions\" => $dimensions);\n $url = $this->urlWrapper() . URLResources::QUERY_COUNT_ENTITY_TOTAL;\n return $this->makeRequest($url, \"POST\", 0, $query);\n }",
"public function count()\n\t{\n\t\treturn $this->getCount();\n\t}",
"public function count()\n {\n return $this->model->paginate(1, $this->select)->total();\n }",
"function getTotal()\r\n{\r\n if (empty($this->_total))\r\n {\r\n $query = $this->_buildQuery();\r\n $this->_total = $this->_getListCount($query);\r\n }\r\n \r\n return $this->_total;\r\n}",
"public function count()\n\t{\n\t\treturn $this->all()->count();\n\t}",
"public function getTotalItems()\n {\n return intval($this->property('limit'));\n }",
"public function count(): int\n {\n return count( $this->toArray() );\n }",
"public function totalNumRows()\n {\n try {\n\n $sql = 'SELECT DISTINCT gil.id_item\n FROM geocontexter.gc_item AS gil\n '.$this->_sql_tables.'\n WHERE gil.title ILIKE ?\n '.$this->_sql_in_id_list;\n\n $res = $this->query($sql, array($this->search . '%'));\n return (int)count($res);\n\n } catch(\\Exception $e) {\n throw $e;\n }\n }",
"public function count()\n {\n return $this->items->count();\n }",
"public function count()\n {\n return $this->items->count();\n }",
"public function getTotalItemCount()\n\t{\n\t\treturn $this->_totalItemCount;\n\t}",
"public function count() {\r\n return count($this->data);\r\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 countArticle()\n {\n $count = $this->doctrine->getRepository('BlogArticleBundle:Article')->countArticle();\n\n return $count;\n }",
"public function count()\n {\n $this->prepareCount(true);\n\n return $this->idsCount;\n }",
"public function getEntryCount() {}",
"public function count()\n {\n return $this->client->count($this->compile())['count'];\n }",
"public function count()\r\n {\r\n return count($this->data);\r\n }",
"public function count(): int\n {\n return count($this->data);\n }",
"public function count()\n {\n return $this->pager->count();\n }",
"public function count()\n {\n return $this->getChildsObject()->count();\n }",
"public function count() {\n\t\treturn count($this->data);\n\t}",
"public static function getCount()\n {\n return static::find()->count();\n }",
"public function count()\n {\n return count( $this->data );\n }",
"public function findCount()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT t.number, COUNT(f.id) as cnt\n FROM GazMainBundle:Finance f\n LEFT JOIN f.terminal t\n LEFT JOIN f.clientSale cs\n\t\t\t\t\t\t\tLEFT JOIN f.clientBuy cb\n\t\t\t\t\t\t\tWHERE f.financeType = FALSE\n\t\t\t\t\t\t\tGROUP BY t.number\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }",
"public function getCount()\n {\n return $this->doQuery(null, false, false)->count();\n }",
"public function count()\r\n {\r\n return count($this->items);\r\n }",
"function count()\n\t{\n\t\treturn count($this->getGoods());\n//\t\treturn count($this->getSESSION()[$this->sessionsGoodsKey]);\n\t}"
] | [
"0.8469821",
"0.8469821",
"0.8394718",
"0.7754625",
"0.7671319",
"0.76633185",
"0.76633185",
"0.76633185",
"0.7645126",
"0.75958246",
"0.75958246",
"0.7417429",
"0.7408964",
"0.73922515",
"0.7380344",
"0.7377535",
"0.7373872",
"0.7366266",
"0.736534",
"0.73604345",
"0.7352632",
"0.7351062",
"0.7344265",
"0.733278",
"0.73113436",
"0.72941184",
"0.72934264",
"0.7273602",
"0.726812",
"0.72680604",
"0.72381914",
"0.72328514",
"0.72306347",
"0.7220667",
"0.7220667",
"0.7220667",
"0.7217752",
"0.7211405",
"0.72085816",
"0.7208163",
"0.71938884",
"0.7190768",
"0.7178963",
"0.7166677",
"0.7159853",
"0.7151376",
"0.71509516",
"0.71446633",
"0.7143861",
"0.71436614",
"0.7139623",
"0.71374744",
"0.71343803",
"0.7132867",
"0.71294147",
"0.7123382",
"0.71198684",
"0.71178484",
"0.7116597",
"0.7115527",
"0.711484",
"0.7113765",
"0.7111083",
"0.7109817",
"0.7102165",
"0.7101356",
"0.7099726",
"0.70990103",
"0.70956665",
"0.7094036",
"0.7085229",
"0.7083467",
"0.70834446",
"0.7082092",
"0.7077599",
"0.70744187",
"0.7070473",
"0.7061823",
"0.7061823",
"0.7059905",
"0.70590323",
"0.70558995",
"0.70558995",
"0.70558995",
"0.70558995",
"0.70558995",
"0.7054029",
"0.7051492",
"0.7048688",
"0.7045808",
"0.7044787",
"0.7033917",
"0.7032553",
"0.7028971",
"0.70230144",
"0.7019151",
"0.70184374",
"0.70110077",
"0.7009598",
"0.7005171",
"0.7002933"
] | 0.0 | -1 |
Search in names of entities | public function search($query) {
$queryBuilder = $this->db->createQueryBuilder();
$queryBuilder
->select('c.*')
->from($this->table, 'c');
$queryBuilder->where("c.`name` LIKE :query");
$queryBuilder->setParameter(':query', "%$query%");
$queryBuilder->orderBy('c.sequence', 'ASC');
return $this->queryBuilderToEntities($queryBuilder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findEntityByNameAll($q){\r\n\t\t$this->recursive = 0;\r\n\t\t$entities = $this->query(\"SELECT * \r\n\t\t\tFROM entities AS Entity \r\n\t\t\tWHERE Entity.name LIKE '%$q%' AND Entity.active = '1'\");\r\n\t\t/*\r\n\t\t$entities = $this->query(\"SELECT * \r\n\t\t\tFROM entities AS Entity \r\n\t\t\tWHERE Entity.name LIKE '%$q%' \r\n\t\t\tAND EXISTS (SELECT u.id FROM users AS u WHERE u.entity_id = Entity.id)\");\r\n\t\t\r\n\t\t*/\r\n\t\treturn $entities;\r\n\t}",
"public function findEntityByName($q){\r\n\t\t$this->recursive = 0;\r\n\t\t/*\r\n\t\t$entities = $this->query(\"SELECT * \r\n\t\t\tFROM entities AS Entity \r\n\t\t\tWHERE Entity.name LIKE '%$q%'\");\r\n\t\t*/\r\n\t\t$entities = $this->query(\"SELECT * \r\n\t\t\tFROM entities AS Entity \r\n\t\t\tWHERE Entity.name LIKE '%$q%' \r\n\t\t\tAND EXISTS (SELECT u.id FROM users AS u WHERE u.entity_id = Entity.id)\");\r\n\t\t\r\n\t\treturn $entities;\r\n\t}",
"public function findEntityIdsByName($q){\r\n\t\t$this->recursive = 0;\r\n\t\t$entities = $this->find('list', array(\r\n\t\t\t'fields' => array('Entity.id'),\r\n\t\t\t'conditions' => array(\r\n\t\t\t\t'Entity.name LIKE' => '%'.$q.'%',\r\n\t\t\t\t'Entity.active' => 1,\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\t\treturn $entities;\r\n\t}",
"public function searchByName($query);",
"function search() {}",
"public function search();",
"public function search();",
"public function search(){}",
"public function findByName(String $name);",
"public function hasEntity($name);",
"public function searchEntities($request)\n {\n return $this->start()->uri(\"/api/entity/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"public function findByName($name);",
"public function findByName($name);",
"public function findByName($name);",
"public function seachByName($query)\n {\n return $this->model->where('name', 'like', \"%\" . $query . \"%\");\n }",
"function search()\n\t{}",
"function search()\n\t{}",
"public function search($name)\n {\n //\n $objects = Object::where('name','LIKE',\"%$name%\")->get(['id','name']);\n return response()->json( $objects );\n }",
"public function search($param)\n {\n $query = $this->createQueryBuilder('s')\n ->where('s.name LIKE :param')\n ->orWhere('s.resume LIKE :param')\n ->setParameter('param',\"%$param%\")\n ->getQuery();\n\n return $query->getResult();\n }",
"public function findAllEntities();",
"public function search($name)\n {\n return Item::where('title', 'like','%' .$name. '%')->orWhere('sku', 'like','%' .$name. '%')->orWhere('ebay_item_id', 'like','%' .$name. '%')->get();\n\n \n }",
"static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }",
"public function search()\n\t{\n\t\t\n\t}",
"public function get_entities();",
"public function findBy($search);",
"public function searchAll($input)\n {\n \n }",
"public function getEntity($name);",
"public function search($search);",
"public function getSearch();",
"function searchTableStatique() {\n include_once('./lib/config.php');\n $table = $_POST['table'];\n $tableStatique = Doctrine_Core::getTable($table);\n $columnNames = $tableStatique->getColumnNames();\n $req = '';\n $param = array();\n $premierPassage = true;\n foreach ($columnNames as $columnName) {\n if ($columnName != 'id') {\n $req .= $premierPassage ? $columnName.' like ? ' : 'and '.$columnName.' like ? ';\n $param[] = $_POST[$columnName].'%';\n $premierPassage = false;\n }\n }\n $search = $tableStatique->findByDql($req, $param);\n echo generateContenuTableStatiqueEntab($table, $tableStatique, $search);\n}",
"public function search($input)\r\n {\r\n return $this->db->table(self::TABLE)->ilike('name', '%' . $input . '%')->asc('name')->findAll();\r\n }",
"public function Search($objeto);",
"public function searchByName($params) {\n\t\t$name = gv($params, 'name');\n\t\t$array_of_name = explode(' ', $name);\n\t\t$first_name = gv($array_of_name, 0);\n\t\t$middle_name = (str_word_count($name) > 2) ? gv($array_of_name, 1) : '';\n\t\t$last_name = gv($array_of_name, (str_word_count($name) > 2) ? 2 : 1);\n\n\t\t$page_length = gv($params, 'page_length', config('config.page_length'));\n\n\t\treturn $this->employee->with('employeeTerms', 'employeeDesignations', 'employeeDesignations.designation', 'employeeDesignations.designation.employeeCategory')->filterByFirstName($first_name)->filterByMiddleName($middle_name)->filterByLastName($last_name)->orderBy('first_name', 'asc')->orderBy('last_name', 'asc')->paginate($page_length);\n\t}",
"public function searchUserByName($name){\r\n $result = $this->DB->fetchAll('select * from user where name like ?',array(\"%{$name}%\"));\r\n return $this->formatResult($result);\r\n }",
"public static function find_all($entity_data) {\n $search_results = array();\n $entities = call_user_func(array($entity_data['entity_name'], 'all')); \n foreach ($entities as $key => $entity) {\n $entity_data = EntityAPIUtils::entity_to_data($entity_data, $entity, false);\n array_push($search_results, $entity_data);\n }\n return $search_results;\n }",
"public static function find($name);",
"public static function find($name);",
"function findByName($name) {\n \t$str_len = strlen($name);\n \ttrim($name);\n \t$name = str_replace('category', '', strtolower($name));\n \t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM commoditycategory WHERE LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') \";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage($result);\n\t\treturn $result; \n\t}",
"public function searchByName($name){\n $projections=$this->getAllProjectionsGroup();\n $arrayFinded = array();\n foreach ($projections as $value) {\n $movie=$value->getMovie();\n if (stripos($movie->getTitle(),$name)!==false)\n {\n array_push($arrayFinded,$value);\n }\n }\n return $arrayFinded; \n }",
"public function SearchByName(Request $request)\n\t{\n\t\t$searchString = trim(Input::get('searchString'));\n\t\t$negative = false;\n\t\t$primary = false;\n\t\t$secondary = false;\n\t\t$searchClassifier = null;\n\t\t\n\t\t//Pull the negative out\n\t\tif ($searchString[0] == \"-\")\n\t\t{\n\t\t\t$negative = true;\n\t\t\t$searchString = trim(substr($searchString, 1));\n\t\t}\n\t\t\n\t\t//Pull primary and secondary out\n\t\t$flag_marker = strpos($searchString, ':');\n\t\tif ($flag_marker !== false)\n\t\t{\n\t\t\t$flag = strtolower(substr($searchString, 0, $flag_marker));\n\t\t\t\n\t\t\tif ($flag == \"primary\")\n\t\t\t{\n\t\t\t\t$primary = true;\n\t\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t\t}\n\t\t\telse if ($flag == \"secondary\")\n\t\t\t{\n\t\t\t\t$secondary = true;\n\t\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//Pull targeting out\n\t\t$flag_marker = strpos($searchString, ':');\n\t\tif ($flag_marker !== false)\n\t\t{\n\t\t\t//Get the contents before the \":\" to check for search clarifiers\n\t\t\t$searchClassifier = strtolower(substr($searchString, 0, $flag_marker));\n\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t}\n\t\t\n\t\t$values = array();\n\t\tif ($searchClassifier == \"artist\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::ArtistLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"artist:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"character\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::CharacterLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"character:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"scanalator\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::ScanalatorLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"series\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::SeriesLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"series:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"tag\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::TagLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"tag:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"language\")\n\t\t{\n\t\t\t$languages = Language::where('languages.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'languages.id', '=', 'collections.language_id')->select('languages.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($languages as $language)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($language, \"language:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"rating\")\n\t\t{\n\t\t\t$ratings = Rating::where('ratings.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'ratings.id', '=', 'collections.rating_id')->select('ratings.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($ratings as $rating)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($rating, \"rating:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"status\")\n\t\t{\n\t\t\t$statuses = Status::where('statuses.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'statuses.id', '=', 'collections.status_id')->select('statuses.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($statuses as $status)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($status, \"status:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\t\n\t\t\t//Get artists with total\n\t\t\t$artists = Artist::where('artists.name', 'like', '%' . $searchString . '%')->leftjoin('artist_collection', 'artists.id', '=', 'artist_collection.artist_id')->select('artists.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$artists = $artists->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"artist:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global artist aliases with total\n\t\t\t$global_artist_aliases = ArtistAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('artists', 'artists.id', '=', 'artist_alias.artist_id')->leftjoin('artist_collection', 'artists.id', '=', 'artist_collection.artist_id')->select('artist_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_artist_aliases = $global_artist_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"artist:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get characters with total\n\t\t\t$characters = Character::where('characters.name', 'like', '%' . $searchString . '%')->leftjoin('character_collection', 'characters.id', '=', 'character_collection.character_id')->select('characters.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$characters = $characters->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"character:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\n\t\t\t//Get global character aliases with total\n\t\t\t$global_character_aliases = CharacterAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('characters', 'characters.id', '=', 'character_alias.character_id')->leftjoin('character_collection', 'characters.id', '=', 'character_collection.character_id')->select('character_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$global_character_aliases = $global_character_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"character:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\n\t\t\t//Get scanalators with total\n\t\t\t$scanalators = Scanalator::where('scanalators.name', 'like', '%' . $searchString . '%')->leftjoin('chapter_scanalator', 'scanalators.id', '=', 'chapter_scanalator.scanalator_id')->select('scanalators.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$scanalators = $scanalators->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global scanalator aliases with total\n\t\t\t$global_scanalator_aliases = ScanalatorAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('scanalators', 'scanalators.id', '=', 'scanalator_alias.scanalator_id')->leftjoin('chapter_scanalator', 'scanalators.id', '=', 'chapter_scanalator.scanalator_id')->select('scanalator_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_scanalator_aliases = $global_scanalator_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get series with total\n\t\t\t$series = Series::where('series.name', 'like', '%' . $searchString . '%')->leftjoin('collection_series', 'series.id', '=', 'collection_series.series_id')->select('series.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$series = $series->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"series:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global series aliases with total\n\t\t\t$global_series_aliases = SeriesAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('series', 'series.id', '=', 'series_alias.series_id')->leftjoin('collection_series', 'series.id', '=', 'collection_series.series_id')->select('series_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_series_aliases = $global_series_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"series:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\n\t\t\t//Get global tags with total\n\t\t\t$tags = Tag::where('tags.name', 'like', '%' . $searchString . '%')->leftjoin('collection_tag', 'tags.id', '=', 'collection_tag.tag_id')->select('tags.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$tags = $tags->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"tag:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global tag aliases with total\n\t\t\t$global_tag_aliases = TagAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('tags', 'tags.id', '=', 'tag_alias.tag_id')->leftjoin('collection_tag', 'tags.id', '=', 'collection_tag.tag_id')->select('tag_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_tag_aliases = $global_tag_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"tag:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$languages = Language::where('languages.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'languages.id', '=', 'collections.language_id')->select('languages.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$languages = $languages->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"language:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$ratings = Rating::where('ratings.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'ratings.id', '=', 'collections.rating_id')->select('ratings.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$ratings = $ratings->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"rating:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$statuses = Status::where('statuses.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'statuses.id', '=', 'collections.status_id')->select('statuses.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$statuses = $statuses->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"status:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$matches = collect();\n\t\t\t$matches->push($artists);\n\t\t\t$matches->push($global_artist_aliases);\n\t\t\t$matches->push($characters);\n\t\t\t$matches->push($global_character_aliases);\n\t\t\t$matches->push($scanalators);\n\t\t\t$matches->push($global_scanalator_aliases);\n\t\t\t$matches->push($series);\n\t\t\t$matches->push($global_series_aliases);\n\t\t\t$matches->push($tags);\n\t\t\t$matches->push($global_tag_aliases);\n\t\t\t$matches->push($languages);\n\t\t\t$matches->push($ratings);\n\t\t\t$matches->push($statuses);\t\t\t\n\t\t\n\t\t\t$matches = $matches->flatten(1);\n\t\t\t$matches = $matches->sortByDesc('total');\n\t\t\t$typeAheadCollection = $matches->take(5)->pluck('name');\n\t\t\n\t\t\t$typeAheadCollection = $typeAheadCollection->sort();\n\t\t\t\n\t\t\tforeach ($typeAheadCollection as $typeAhead)\n\t\t\t{\n\t\t\t\tarray_push($values, ['value' => $typeAhead, 'label' => $typeAhead]);\n\t\t\t}\t \n\t\t}\n\t\t\n\t\treturn $values;\n\t}",
"public function test_searchName() {\n\t\t$this->testAction('/disease/search/Acute%20tubular%20necrosis', array('method' => 'get'));\n\t\t$returnedDisease = $this->vars['diseases']['Disease'];\n\n\t\t$this->assertEquals(1, count($this->vars['diseases']));\n\t}",
"function nameSearch($query, $names){\n \t$result = array_search($query, $names);\n \t\n \t//$result === FALSE ? 'FALSE':'TRUE';\n \tif($result === FALSE){\n \treturn FALSE;\n }\n \telse {\n \t\treturn TRUE;\n\n \t}\n }",
"public function actionSearch($name)\n {\n \t$name = isset($name) ? $name : '';\n \t$list = array();\n \t$name = trim($name); \n \tif($name != '')\n \t{\n \t\t$query = JobpositionBase::find()->select(['id', 'title', 'status'])->where(['status' => 1])->andWhere(['like' , 'title', $name])\n \t\t->orderBy(['title' => SORT_ASC]);\n \t\t//echo $query->createCommand()->sql; exit;\n \t\t$list = $query->all();\n \t}\n \telse {\n \t\techo 'no name!';\n \t}\n \t \n \tif(count($list) == 0)\n \t{\n \t\techo Yii::t('app', 'keine Ergebnisse');\n \t\texit;\n \t}\n \t \n \tforeach ($list as $item)\n \t{\n \t\techo '<li data-id=\"' . $item->id . '\">' . $item->title . '</li>';\n \t}\n \texit;\n }",
"public function searchEntityTypes($request)\n {\n return $this->start()->uri(\"/api/entity/type/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"public function search($params = []);",
"static function searchArtists($search){\n $search = \"%\".$search.\"%\";\n $req = \"SELECT *\n FROM \".DB::$tableArtists.\"\n WHERE `nom_artist` LIKE :query\n LIMIT 0 , 7\";\n $query = DB::$db->prepare($req);\n $query->bindParam(':query', $search, PDO::PARAM_STR);\n $query->execute();\n $result = [];\n while($data = $query->fetch()){\n $Artist = new Artist();\n $Artist->id = $data['id_artist'];\n $Artist->name = $data['nom_artist'];\n\n $result[] = $Artist;\n }\n return $result;\n }",
"public static function search() {\n\n $string = Input::get('string');\n\n $results = Artist::Where('name', 'like', \"$string%\")->get();\n\n return ($results->toArray());\n }",
"public function search($input)\n {\n return $this->db->table(self::TABLE)->ilike('name', '%'.$input.'%')->asc('name')->findAll();\n }",
"public abstract function find_users($search);",
"public function search($q);",
"public function searchEntitiesByIds($ids)\n {\n return $this->start()->uri(\"/api/entity/search\")\n ->urlParameter(\"ids\", $ids)\n ->get()\n ->go();\n }",
"private function searchableNames()\n {\n $pests = Pest::all();\n\n $searchableNames = new SearchableName();\n\n foreach(range(1,300) as $index)\n {\n SearchableName::create([\n\n 'searchable_type' => 'App\\Models\\Pest',\n\n 'name' => $this->faker->word . ' ' . $this->faker->colorName\n ]);\n }\n\n $searchableNamesIds = $searchableNames->pests()->lists('id')->toArray();\n\n foreach(range(1,400) as $index) {\n\n $pests[rand(1, 199)]->searchableNames()->attach($this->faker->randomElement($searchableNamesIds));\n }\n }",
"public function getEntityName();",
"public function find($input);",
"public function search(Request $request)\n\t{\n\t\tif ($request->input(\"action\")==\"person_name\")\n\t\t{\t\n\t\t\t$name=PersonInfo::where('nationalid','LIKE', '%' . $request->input(\"person_name\"). '%')->orWhere('name','LIKE', '%' . $request->input(\"person_name\"). '%')->get();\n\t\n\t\t\treturn $name;\n\t\t}\n\t}",
"public function test_search_by_name()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search_by_name('index.php');\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n }",
"function search($keywords)\r\n {\r\n\r\n }",
"public function _search($name)\n {\n $result = $this->like('nama_pelanggan', $name)\n ->select('nama_pelanggan')\n ->limit(10)\n ->get()\n ->getResult();\n return $result;\n }",
"function listAllWithSearch($term) \r\n {\r\n\r\n $newTerm = \"%\".$term.\"%\";\r\n\r\n //new PDOAgent\r\n $p = new PDOAgent(\"mysql\", DB_USER, DB_PASS, DB_HOST, DB_NAME);\r\n\r\n //Connect to the Database\r\n $p->connect();\r\n\r\n //Setup the Bind Parameters\r\n $bindParams = [\"term\"=>$newTerm];\r\n \r\n //Get the results of the insert query (rows inserted)\r\n $results = $p->query(\"SELECT * FROM Coaches WHERE coachFName LIKE :term OR\r\n coachLName LIKE :term OR salary LIKE :term OR teamName LIKE :term \r\n OR dateStarted LIKE :term OR endOfContract LIKE :term;\", $bindParams);\r\n \r\n //Disconnect from the database\r\n $p->disconnect();\r\n \r\n //Return the objects\r\n return $results;\r\n }",
"public function search($query);",
"function searchRecipe($text=false){\n\t\t$filter=false;\n\t\tif($text!=false){\n\t\t\t$filter=\"Name like '%$text%'\";\n\t\t}\n\t\t\n\t\treturn $this->getRecipe($filter);\n\t}",
"public static function search() {\n\n $string = Input::get('string');\n\n $results = Genre::Where('name_de', 'like', \"$string%\")->get();\n\n return ($results->toArray());\n }",
"public function searchArticleAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n $name = $request->request->get('name');\n $reqFields = $request->request->all();\n\n $tags = $this->get('article_service')->getTagsSearchArray($reqFields);\n if($name != NULL)\n $result = $em->getRepository('AppBundle:Article')->getBySearchTN($tags,$name);\n else if($name == NULL && !empty($tags)){\n $result = $em->getRepository('AppBundle:Article')->getBySearchT($tags);\n } else {\n $result = $em->getRepository('AppBundle:Article')->findAll();\n }\n\n\n $tags = $em->getRepository('AppBundle:Tag')->findAll();\n return $this->render('public/index.html.twig', array(\n 'articles' => $result,\n 'tags' => $tags,\n ));\n }",
"public function getSearch($parameters = array());",
"public function search(array $data)\n {\n// $this->searchWhere($data);\n// ver($this->entity, d);\n }",
"private function setSearchstring(){\n $search_req = $this->main->getArrayFromSearchString($_GET['content_search']);\n\n $searchstring = '';\n\n foreach($search_req as $key => $val){\n if(strlen($val) > 0){\n $searchstring .= \"`name` LIKE '%\".DB::quote($val).\"%' OR \";\n };\n };\n\n $searchstring .= \"`name` LIKE '%\".DB::quote($_GET['content_search']).\"%'\";\n\n return $searchstring;\n }",
"public function search($str) {\n\t\t$sql = \"SELECT * FROM teams WHERE (\";\n\t\t$sql .= \"name like ? \";\n\t\t$sql .= \"OR colour like ?)\";\n\t\t$stmt = $this->dbManager->prepareQuery($sql);\n\t\t\n\t\t$this->dbManager->bindValue($stmt, 1, '%'.$str.'%', $this->dbManager->STRING_TYPE );\n\t\t$this->dbManager->bindValue($stmt, 2, '%'.$str.'%', $this->dbManager->STRING_TYPE );\n\t\t\n\t\t$this->dbManager->executeQuery($stmt);\n\t\t$rows = $this->dbManager->fetchResults ( $stmt );\n\t\t\n\t\treturn ($rows);\n\t}",
"public function listByNameAction()\n {\n $em = $this->getDoctrine()->getManager();\n $request = $this->get('request');\n $name = $request->get('nameVille');\n $entities = $em->getRepository('GarnetTaxiBeBundle:Endroit')->listByName($name);\n\n return $this->render('GarnetTaxiBeBundle:Common:autocomplete.html.twig', array(\n 'entities' => $entities\n ));\n }",
"public function filterExists(string $name);",
"function testOrgSearchByNameDoesNotContain() {\n\t\t$this->setUrl('/search/advanced?r=org&q[gen_name][op]=DOES+NOT+CONTAIN&q[gen_name][value]=crm');\n\t\t$this->app->go();\n\t\t$this->assertPattern('/id=\"qb_gen_name\"/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$this->assertIsA($collection, 'Omelette_OrganisationCollection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Default Company', 'Tictacle DRM', 'XXX Co'));\n\t}",
"public function find();",
"public function searchEnNormalTag(Request $request){\n $letters = $request->q;\n $normal_tags = EnTag::where('tag_type', 1)->where('deletable',1)->where('approval', 1)->where('tag_name', 'LIKE', '%' . $letters . '%')->select('tag_slug as id', 'tag_name as name')->get();\n return $normal_tags->toArray();\n }",
"public static function search_by_name($search, $start = 0, $limit = -1) {\n\t\t$ls = \"\";\n\t\t$start = (int)$start;\n\t\t$limit = (int)$limit;\n\t\tif($start >= 0 && $limit > 0) {\n\t\t\t$ls = \" LIMIT $start, $limit\";\n\t\t}\n\t\t$sth = database::$dbh -> prepare(\"SELECT `key_status`.`id`, `key_status`.`name` FROM `key_status` WHERE name LIKE :search\" . self::SORT_CLAUSE . $ls . \";\");\n\t\t$sth -> execute(array('search' => \"%\".$search.\"%\"));\n\t\t$rows = $sth -> fetchAll(PDO::FETCH_NUM);\n\t\t$ret = array();\n\t\tforeach($rows as $row) {\n\t\t\t$assoc = self::row_to_assoc($row);\n\t\t\t$ret[] = new key_status_model($assoc);\n\t\t}\n\t\treturn $ret;\n\t}",
"public function get_titles($input) {\n $input = \"%\" . $input . \"%\";\n $stmt = $this->DB->prepare ( \"SELECT * FROM `titles` WHERE name_year LIKE :input\" );\n $stmt->bindParam ( 'input', $input );\n $stmt->execute ();\n return $stmt->fetchAll ( PDO::FETCH_ASSOC );\n\n // TODO: Complete this function so it returns all rows\n // where the parameter is found as a substring, case insensitive\n\n\n\n\n\n }",
"public function search()\n {\n\n }",
"public function search()\n {\n\n }",
"static public function SearchMultipleEntity($SearchTerm)\r\n\t{\r\n\t\t$likeClause = \"LIKE '%\" . strtolower($SearchTerm) . \"%' \";\r\n\r\n\t\t$whereClause .= \"WHERE \tLOWER (TagText) LIKE {$likeClause} \";\r\n\r\n\t\t$returnValue = self::PerformSearch($whereClause);\r\n\r\n\t\treturn $returnValue;\r\n\t}",
"public abstract function find();",
"public function smartSearchAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n $requestString = $request->get('q');\n $entities = $em->getRepository('PlantBundle:Plant')->findAllByPlantName($requestString);\n if(!$entities) {\n $result['entities']['error'] = \"no result\";\n } else {\n $result['entities'] = $this->getRealEntities($entities);\n }\n\n return new Response(json_encode($result));\n }",
"public function findStudent()\n {\n //$search = '%'.$search.'%';\n $dql = \"SELECT ae FROM ABCIsystemBundle:AbcMembers ae WHERE ae.idCard like'__02%' and ae.status='active'\";\t\n $repositorio = $this->getEntityManager()->createQuery($dql);\n return $repositorio->getResult();\t\n }",
"public function searchForArtists($criteria){\n\t\t//\n\t\t$artists = Artists::where(function ($query) use($criteria){\n\t\t\t$query->where('artists.name','like','%'.$criteria.'%');\n\t\t})->select('artists.*')->get();\n\t\treturn $artists;\n\t}",
"function get_search($search)\n\t{\n\t\treturn $this->name . \" LIKE '%\" . $search. \"%'\";\n\t}",
"public function searchUser(){\n $this->validate(request(),[\n 'name' => 'required'\n ]);\n $users =User::where('name',request('name'))->orWhere('name', 'like', '%' . request('name') . '%')->get();\n return response()->json($users);\n }",
"function find_product_by_title($product_name){\n global $db;\n $p_name = remove_junk($db->escape($product_name));\n $sql = \"SELECT name FROM products WHERE name like '%$p_name%' LIMIT 5\";\n $result = find_by_sql($sql);\n return $result;\n }",
"public function searchProduct(Request $request){\n\n $searchKey = $request->term;\n $products = farmproduct::where('productName','LIKE','%'.$searchKey.'%')->get();\n $result='';\n \n if(count($products)==0){\n $result[] = 'No matches found.';\n }else{\n foreach($products as $product){\n $result[] = $product->productName;\n }\n }\n return $result;\n }",
"public function searchPageAction(){\n // Get entity Manager\n $em = $this->get('doctrine')->getManager();\n\n\t$searchTxt = $_POST['search'];\n\n\n\t$films = $em->createQuery('SELECT f FROM VideotechBundle:Film f\n\t \t\t\t\t WHERE f.title like :search')\n ->setParameter('search', '%' . $searchTxt . '%')\n\t\t ->execute();\n\n\n $categories = $em->createQuery('SELECT c FROM VideotechBundle:Category c\n\t \t\t\t\t WHERE c.name like :search')\n ->setParameter('search', '%' . $searchTxt . '%')\n\t\t ->execute();\n\n // Render display\n return $this->render('@Videotech/Film/search.twig', array(\n \"films\" => $films,\n\t \"categories\" => $categories\n ));\n }",
"public function testFindAllByName()\n {\n $this->assertCount(2, $this->appService->findAllByName('api'));\n }",
"public function autocompleteSearch($q){\n $query = \"SELECT `id`, `name` FROM `\".$this->current_module_table.\"` WHERE \";\n\n $searchStringArray = $this->main->getArrayFromSearchString($q);\n\n $where = '';\n\n foreach($searchStringArray as $key => $val){\n if(strlen($val) > 0){\n $where .= \"`name` LIKE '%\".DB::quote($val).\"%' OR \";\n };\n };\n\n if(strlen($where) > 0){\n $where .= \"`name` LIKE '%\".DB::quote($q).\"%'\";\n };\n\n if($where == ''){\n return null;\n }else{\n $query .= $where;\n };\n\n $sql = $this->main->db->query($query);\n\n $result = $q.\"\\n\";\n\n while($req = mysql_fetch_assoc($sql)){\n if(strlen($req['name']) > 0){\n $result .= $req['name'].\"\\n\";\n };\n };\n\n return $result;\n }",
"function resourcesSearch($args)\n {\n if(!array_key_exists('search', $args))\n {\n throw new Exception('Parameter search is not defined', MIDAS_INVALID_PARAMETER);\n }\n $userDao = $this->_getUser($args);\n\n $order = 'view';\n if(isset($args['order']))\n {\n $order = $args['order'];\n }\n return $this->Component->Search->searchAll($userDao, $args['search'], $order);\n }",
"function search() {\n // ...\n }",
"abstract protected function getEntityClassNames();",
"function _search($field, $key)\n\t{\n\t\tswitch ($field)\n\t\t{\n\t\t\tcase 'name':\n\t\t\t{\n\t\t\t\t$this->db->where('MATCH(tag.name) AGAINST(\\'\"'.$this->db->escape_str($key).'\"\\' IN BOOLEAN MODE)');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"function getEntityByAcronym($server, $args) { \n // get args\n list($e_name, $idstr) = $args;\n\n $personnel =& PersonnelDB::getInstance();\n $store_name = getEntityStore(strtolower($e_name));\n $entities = array();\n\n // get entity objects for set of ids passed\n $ids = array_unique(explode(',', $idstr));\n \n foreach ($ids as $id) {\n if ($entity = $personnel->$store_name->getByAcronym($id)) {\n $entities[] = $entity;\n }\n }\n\n // return serialized output\n return serializeEntities($entities, $server->contentType);\n}",
"private function search_for_name($string)\r\n\t{\r\n\t\t$search_string = '%' . $string . '%';\r\n\t\t$results = array();\r\n\t\tglobal $dbCon;\r\n\r\n\t\t$sql = \"SELECT id FROM student WHERE concat(firstname, ' ', lastname) LIKE ?;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('s', $search_string);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($student_id); //Get ResultSet\r\n\t\twhile ($stmt->fetch())\r\n\t\t{\r\n\t\t\t$results[] = $student_id;\r\n\t\t}\r\n\t\t$stmt->close();\r\n\r\n\t\treturn $results;\r\n\t}",
"public function searchAction()\n {\n $user_id = $this->getSecurityContext()->getUser()->getId();\n $drive = $this->_driveHelper->getRepository()->getDriveByUserId($user_id);\n\n $q = $this->getScalarParam('q');\n // $hits = $this->getResource('drive.file_indexer')->searchInDrive($q, $drive->drive_id);\n $hits = $this->getResource('drive.file_indexer')->search($q);\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\n echo '<strong>', $hits->hitCount, '</strong> hits<br/>';\n foreach ($hits->hits as $hit) {\n $file = $this->_driveHelper->getRepository()->getFile($hit->document->file_id);\n if (empty($file)) {\n echo 'Invalid file ID: ', $hit->document->file_id;\n }\n if ($file && $this->_driveHelper->isFileReadable($file)) {\n echo '<div>', '<strong>', $file->name, '</strong> ', $this->view->fileSize($file->size), '</div>';\n }\n }\n exit;\n }",
"public function func_search() {}",
"public function setNameSearch($name = NULL){\n\t\t$this->nameSearch = $name ? $name : \"Procurar \".$this->name;\n\t}",
"public function search($term = null);",
"public function search_by_name($query, $limit = null, $offset = 0) {\n $where = '`'.$this->table()->info('name').'`.`displayname` LIKE ?';\n $arg = '%'. $query .'%';\n return $this->_all_where($where, $arg, $limit, $offset);\n }",
"function mentionMeXMLHTTPnameSearch()\n{\n\tglobal $mybb, $db, $cache;\n\n\tif (!$mybb->input['search']) {\n\t\texit;\n\t}\n\n\t$originalName = trim($mybb->input['search']);\n\t$name = $db->escape_string($originalName);\n\t$name = strtr($name,\n\t\tarray(\n\t\t\t'%' => '=%',\n\t\t\t'=' => '==',\n\t\t\t'_' => '=_')\n\t\t);\n\n\t$fieldList = 'username';\n\tif ($mybb->settings['mention_show_avatars']) {\n\t\t$fieldList .= ', avatar';\n\t}\n\n\t$fullText = '';\n\tif ($mybb->settings['mention_full_text_search']) {\n\t\t$fullText = '%';\n\t}\n\n\t$query = $db->simple_select('users', $fieldList, \"username LIKE '{$fullText}{$name}%' ESCAPE '='\");\n\n\tif ($db->num_rows($query) == 0) {\n\t\texit;\n\t}\n\n\t$names = array();\n\twhile ($user = $db->fetch_array($query)) {\n\t\t$username = mb_strtolower($user['username']);\n\t\tif (($fullText === '' &&\n\t\t\tsubstr($username, 0, strlen($originalName)) === $originalName) ||\n\t\t\t($fullText &&\n\t\t\tstrpos($username, $originalName) !== -1)) {\n\t\t\t$names[$username] = $user;\n\t\t}\n\t}\n\n\tif (empty($names)) {\n\t\texit;\n\t}\n\t$json = json_encode($names);\n\n\t// send our headers.\n\theader('Content-type: application/json');\n\techo($json);\n\texit;\n}"
] | [
"0.72114223",
"0.7179519",
"0.6487015",
"0.6480356",
"0.6384758",
"0.6278017",
"0.6278017",
"0.61967134",
"0.6110235",
"0.6025805",
"0.5920057",
"0.59189105",
"0.59189105",
"0.59189105",
"0.5876035",
"0.5823349",
"0.5823349",
"0.5822153",
"0.5812715",
"0.57990354",
"0.573268",
"0.57142043",
"0.57131165",
"0.5708105",
"0.5705048",
"0.5700979",
"0.56775373",
"0.56705976",
"0.5660893",
"0.56541294",
"0.5653022",
"0.56441224",
"0.5640948",
"0.5637128",
"0.56311554",
"0.56162024",
"0.56162024",
"0.5611478",
"0.5607102",
"0.56067103",
"0.55994654",
"0.5592679",
"0.5581728",
"0.557026",
"0.5564145",
"0.55565864",
"0.55540526",
"0.5547247",
"0.55261195",
"0.55138576",
"0.5511893",
"0.5508889",
"0.5504565",
"0.5487131",
"0.5483603",
"0.5475605",
"0.54744655",
"0.5467095",
"0.5464328",
"0.5463858",
"0.5459797",
"0.5452496",
"0.5441929",
"0.54344636",
"0.5429307",
"0.5422956",
"0.5416847",
"0.54152906",
"0.5413808",
"0.54125535",
"0.54101944",
"0.5405373",
"0.54041773",
"0.54036516",
"0.5387099",
"0.5387099",
"0.5383829",
"0.537463",
"0.537135",
"0.53712964",
"0.5366773",
"0.5360374",
"0.5357244",
"0.5353942",
"0.5347168",
"0.5346046",
"0.5336726",
"0.53282744",
"0.5327797",
"0.53211933",
"0.53204614",
"0.53141016",
"0.5312159",
"0.5297635",
"0.5285304",
"0.52589905",
"0.5252713",
"0.52516174",
"0.5241093",
"0.5239157"
] | 0.5547524 | 47 |
Returns an entity matching the supplied id. | public function find($id) {
$data = $this->db->fetchAssoc("SELECT * FROM $this->table WHERE id = ?", [ $id ]);
return $data ? $this->build($data) : FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findEntityById($id)\n {\n if (isset($this->entities[$id])) {\n return $this->entities[$id];\n }\n }",
"public function find($id)\n { \n $entity = $this->_find($id);\n return $entity;\n }",
"public function findEntity($id);",
"private function getEntity($id) {\n // when the request uses the internal id the given id starts with an underscore\n if(substr($id, 0, 1) == '_') {\n // get entity via _internal_id\n return Entity::findOrFail(substr($id, 1));\n } else {\n // get entity via GIS id\n return Entity::where('id', $id)->firstOrFail();\n }\n }",
"protected function getEntityById($id)\n {\n return $this->getEntityByTypeAndId($this->getEntityName(), $id);\n }",
"public function findById($id)\n {\n return $this->getEntityRepository()->find($id);\n }",
"public function findById($id)\n {\n $data = $this->adapter->select(array($this->entityIdColumnName => $id));\n\n if (isset($data[0])) {\n // Create new entity and populate data\n $entity = new $this->entityClass();\n $entity->setData($data[0]);\n\n // Return entity object\n return $entity;\n }\n\n return null;\n }",
"public function find($id)\n {\n // Reading from cache first\n if ($this->_cache->has($id)) {\n return $this->_cache->get($id);\n }\n \n $prepSql = \"SELECT {$this->_columnNames} FROM `{$this->_tableName}` \"\n . \"WHERE `id` = ?\";\n $pstmt = $this->_prepare($prepSql);\n $bindings = [$id];\n\n $pstmt->execute($bindings);\n \n $dbRecord = $pstmt->fetch(\\PDO::FETCH_ASSOC);\n $pstmt->closeCursor();\n $entity = $this->_toEntity($dbRecord);\n \n // Now that we have retrieved the Entity, let's add it to the cache\n $this->_cache->set($id, $entity);\n \n return $entity;\n }",
"public function find(int $id)\n { // attention pour cette interpolation il faut des doubles guillemets.\n $query = $this->pdo->prepare(\"SELECT * FROM {$this->table} WHERE id = :id\");\n $query->execute(['id' => $id]);\n $entity = $query->fetch();\n return $entity;\n }",
"public function find($id)\n {\n $prepSql = \"SELECT {$this->_columnNames} FROM `{$this->_tableName}` \"\n . 'WHERE `id` = ? ';\n $pstmt = $this->_prepare($prepSql);\n $bindings = [$id];\n\n $pstmt->execute($bindings);\n \n $dbRecord = $pstmt->fetch(\\PDO::FETCH_ASSOC);\n $pstmt->closeCursor();\n \n $entity = $this->_toEntity($dbRecord);\n \n return $entity;\n }",
"public function find($id)\n {\n return $this->getRepository()->find($id);\n }",
"public function find($id)\n {\n return $this->getRepository()->find($id);\n }",
"public function find($id)\n {\n return $this->getRepository()->find($id);\n }",
"public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }",
"public function load($id) {\n\t\t$this->logger->debug('[EntityManager]Loading Entity with id '.$id);\n\t\treturn $this->getRepository()\n\t\t->find($id);\n\t}",
"public function get($id)\n\t{\n\t\t// Getting by ID?\n\t\tif (is_numeric($id))\n\t\t{\n\t\t\treturn $this->get_by('entities.id', $id);\n\t\t}\n\n\t\t// Retrieve by username.\n\t\tif (is_string($id))\n\t\t{\n\t\t\treturn $this->get_by('entities.username', $id);\n\t\t}\n\n\t\t// Fall-back to get_by method.\n\t\treturn $this->get_by($id);\n\t}",
"public function find($id) {\r\n\t\t// Tries first the identity cache\r\n\t\tif($this->_hasIdentity($id)) {\r\n\t\t\treturn $this->_getIdentity($id);\r\n\t\t}\r\n\t\t// Else get entity from table\r\n\t\t$rowset = $this->_getGateway()->find($id);\r\n\t\tif(count($rowset)) {\r\n\t\t\treturn $this->_rowToEntity($rowset->current());\r\n\t\t}\r\n\t}",
"public function findById($id)\n {\n return $this->findOneBy(['id' => $id]);\n }",
"public function byId($id)\n\t{\n\t\treturn $this->getMyRepository()->find($id);\n\t}",
"public static function findById($id);",
"public function findOneById($id)\n {\n $entity = $this->getRepository()->findOneBy([\n 'id' => $id,\n 'deleted' => false,\n ]);\n\n if (null === $entity) {\n throw new ZeniumException('Resource not found.', ZeniumStatusCode::RESOURCE_NOT_FOUND);\n }\n\n return $entity;\n }",
"public function getById($id) {\n return $this->getBy(id, \"id\");\n }",
"public function getById(string $id);",
"public function getById(int $id): EntityInterface\n {\n }",
"public function find($id)\r\n {\r\n return $this->repository->find($id);\r\n }",
"public function byId($id)\n\t{\n\t\treturn $this->find('id', $id)->first();\n\t}",
"public function GetById( $id )\n {\n return $this->genericRepository->GetById( $id );\n }",
"public static function find($id);",
"public function find($id)\n {\n return $this->findOneBy(['id' => $id]);\n }",
"public function getOne($id)\n {\n return $this->repository->find($id);\n }",
"protected function fetchEntity(string $id): EntityInterface\n {\n $table = $this->loadModel();\n Assert::isInstanceOf($table, Table::class);\n\n $primaryKey = $table->getPrimaryKey();\n if (! is_string($primaryKey)) {\n throw new UnsupportedPrimaryKeyException();\n }\n\n try {\n $entity = $table->find()\n ->where([$table->aliasField($primaryKey) => $id])\n ->enableHydration(true)\n ->firstOrFail();\n Assert::isInstanceOf($entity, EntityInterface::class);\n\n return $entity;\n } catch (Exception $e) {\n // $id is a UUID, re-throwing the exception as we cannot fetch the record by lookup field(s)\n if (Validation::uuid($id)) {\n throw $e;\n }\n }\n\n /**\n * Try to fetch record by lookup field(s)\n *\n * @var \\Cake\\Datasource\\EntityInterface\n */\n $entity = $table->find()\n ->applyOptions(['lookup' => true, 'value' => $id])\n ->enableHydration(true)\n ->firstOrFail();\n\n return $entity;\n }",
"public function getById($id)\n {\n return $this->repository->getById($id);\n }",
"public function find($entity, $id) {\n if (!$this->getClient())\n $this->setError('Could not access Bullhorn API Client');\n // create query\n $request = new stdClass;\n $request->session = $this->getSessionKey();\n $request->entityName = $entity;\n $request->id = new SoapVar($id, XSD_INT, 'int', \"http://www.w3.org/2001/XMLSchema\");\n // do query\n try {\n $response = $this->getClient()->find($request);\n } catch (SoapFault $fault) {\n $this->setError($fault->getMessage());\n }\n // return\n return $response->return->dto;\n }",
"public function find($id)\n {\n\n $prepSql = \"SELECT {$this->_columnNames} FROM `{$this->_tableName}` \"\n . \"WHERE `id` = ?\";\n $pstmt = $this->_prepare($prepSql);\n $bindings = [$id];\n\n $pstmt->execute($bindings);\n\n $dbRecord = $pstmt->fetch(\\PDO::FETCH_ASSOC);\n $pstmt->closeCursor();\n return $this->_toEntity($dbRecord);\n }",
"public function getById( $id );",
"public function find($id)\n {\n return $this->repository->find($id);\n }",
"public function findOne(int $id): ?Entity\n {\n return $this->findOneBy([\n 'id' => $id,\n ]);\n }",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"public function getById($id);",
"protected function findEntity($id, $repositoryName=\"\")\n {\n return $this->getRepository($repositoryName)->find($id);\n }",
"public function retrieve($entityName, $id);",
"public static function find($id)\n {\n return self::findOneBy(['id' => $id]);\n }",
"public function getById($id): ?IEntity;",
"public function findOne($id)\n {\n // Before callback method call\n if (method_exists($this, 'beforeFindOne')) {\n $this->beforeFindOne($id);\n }\n\n $entity = $this->getRepository()->find($id);\n\n // After callback method call\n if (method_exists($this, 'afterFindOne')) {\n $this->afterFindOne($id, $entity);\n }\n\n return $entity;\n }",
"public function findById(int $id)\n {\n try {\n $entity = $this->model->select($this->columns)\n ->orderBy($this->order, $this->sort)\n ->with($this->relationships)\n ->findOrFail($id);\n } catch (Exception $e) {\n Log::error($e->getMessage());\n\n return false;\n }\n\n return $entity;\n }",
"public function find($id)\n {\n return $this->repo->find($id);\n }",
"public function find($id)\n {\n return $this->repo->find($id);\n }",
"public function read($id)\n {\n return $this->getEntityManager()->find($this->getEntityClassName(), $id);\n }",
"public static function findById($id)\n {\n return static::findOne(['id' => $id]);\n }",
"public function get_by_id($id)\r\n\t{\r\n\t\treturn $this->findByPoperty(array($this->id_field => $id));\r\n\t}",
"public function getById($id)\n {\n return $this->getBy('id', (int)$id);\n }",
"public function get(string $id);",
"public static function findById($id)\n {\n return static::findOne(['id' => $id]);\n }",
"public function find($id)\n {\n return $this->service->find($id);\n }",
"public function get($id)\n {\n return $this->repository->find($id);\n }",
"public function get($id)\n {\n return $this->repository->find($id);\n }",
"public function get($id)\n {\n return $this->repository->find($id);\n }",
"public function find($entityName, $id) {\n return $this->setEntity($entityName)->entityRepository->find($id);\n }",
"public function getOneById($id)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn $this->requireOneById($id);\n\t\t}\n\t\tcatch (EntityNotFoundException $e)\n\t\t{\n\t\t\tthrow new ResourceNotFoundException(($this->getTableMap())->getName() . ' with id ' . $id);\n\t\t}\n\t}",
"public function find($entity_id);",
"public function getById(int $id);",
"public static function get($id)\n {\n \treturn FactoryAbastract::dao(get_called_class())->findById($id);\n }",
"public function retrieveById($id);",
"public function find(int $id): EntityInterface\n {\n return parent::find($id) ?: new CategoryEntity();\n }",
"public function findById($id)\n {\n return $this->model->find($id);\n }",
"public function findById($id)\n {\n return $this->model->find($id);\n }",
"public function findById($id)\n {\n return $this->model->find($id);\n }",
"public function find($id)\n {\n return $this->mainRepository->find($id);\n }",
"public function offsetGet($id)\n {\n foreach ($this->entities as $entity) {\n if ($entity->getId() === $id) {\n return $entity;\n }\n }\n\n return null;\n }",
"public static function fetchById($id) {\n return static::fetchByKey(self::ID_KEY, $id);\n }",
"public function getOne($id)\n {\n return $this->find(\"id\", $id);\n }",
"static public function find($id) {\n return static::getMapper()->find($id);\n }",
"public function find($id) {\n return $this->model->find($id);\n }",
"abstract public function getById($id);",
"abstract public function getById($id);",
"public function find($id)\n {\n return $this->model->find($id);\n }",
"public function whereId(string $id): object;",
"public function getById($id)\n {\n return self::where('id', (int) $id)->first();\n }",
"public function GetById($id);",
"public function GetById($id);",
"function getById($id) {\n\t\treturn $this->getMapper()->getById($id);\n\t}",
"public function findOne($id)\n {\n return $this->model->find($id);\n }",
"public function findById ($id);",
"public abstract function getById($id);",
"public function encontrarPorId($id) {\n $idInteiro = (int) $id;\n\n $entidade = $this->getEntityManager()->find($this->getEntity(), $idInteiro);\n if (!$entidade) {\n throw new Exception(\"Não foi encontrado a entidade de id = {$idInteiro}\");\n }\n return $entidade;\n }",
"public function get($id);",
"public function get($id);",
"public function get($id);"
] | [
"0.84376955",
"0.8400213",
"0.8399446",
"0.83531815",
"0.8223296",
"0.8074879",
"0.79789895",
"0.7923617",
"0.79197025",
"0.7907693",
"0.7818537",
"0.7818537",
"0.7818537",
"0.7803702",
"0.7778698",
"0.77648526",
"0.7704424",
"0.76404154",
"0.76231784",
"0.7613495",
"0.7594887",
"0.75786895",
"0.75450647",
"0.75450546",
"0.7537788",
"0.752105",
"0.7519539",
"0.7517378",
"0.7500491",
"0.74944556",
"0.74785507",
"0.74778026",
"0.7459015",
"0.7457561",
"0.7446232",
"0.7442449",
"0.74348813",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.7421964",
"0.74211615",
"0.7410645",
"0.74106264",
"0.7408256",
"0.7387152",
"0.7371429",
"0.7357735",
"0.7357735",
"0.73521984",
"0.734697",
"0.7331545",
"0.73303956",
"0.732108",
"0.7320982",
"0.7320533",
"0.7316656",
"0.7316656",
"0.7316656",
"0.7308523",
"0.7306258",
"0.7296375",
"0.7293268",
"0.72911364",
"0.7291131",
"0.7283807",
"0.7282026",
"0.7282026",
"0.7282026",
"0.7277676",
"0.72707766",
"0.7241249",
"0.7238334",
"0.7236997",
"0.7236904",
"0.7228587",
"0.7228587",
"0.72270465",
"0.7219094",
"0.72135586",
"0.72043717",
"0.72043717",
"0.71970433",
"0.7190569",
"0.7186124",
"0.7185771",
"0.7185666",
"0.71833557",
"0.71833557",
"0.71833557"
] | 0.0 | -1 |
Returns a collection of entities. | public function findAll($conditions = [], $orderBy = [], $limit = NULL, $offset = 0) {
$queryBuilder = $this->db->createQueryBuilder();
$queryBuilder
->select('c.*')
->from($this->table, 'c')
->setFirstResult($offset);
$parameters = [];
foreach ($conditions as $key => $value) {
$parameters[':' . $key] = $value;
$where = $queryBuilder->expr()->eq('c.' . $key, ':' . $key);
$queryBuilder->andWhere($where);
}
$queryBuilder->setParameters($parameters);
if (count($orderBy) > 0) {
foreach ($orderBy as $key => $value) {
$queryBuilder->orderBy('c.' . $key, $value);
}
}
if ($limit !== NULL) {
$queryBuilder->setMaxResults($limit);
}
return $this->queryBuilderToEntities($queryBuilder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function entities(): Collection;",
"public function getEntities()\n {\n return $this->entities;\n }",
"public function all(): \\app\\domain\\interfaces\\EntityCollection {\n $collection = new \\app\\domain\\interfaces\\EntityCollection;\n \n return $collection;\n }",
"public function getEntities();",
"public function getEntities();",
"public function getEntities() {\n return $this->entities;\n }",
"public function getEntities()\n\t{\n\t\treturn $this->entities;\n\t}",
"public function findAllEntities();",
"public function getEntities()\n {\n return $this->_entities;\n }",
"public function getAllEntities();",
"public function getEntities()\n {\n return $this->getRepository()->findBy([], ['discipline' => 'ASC']);\n }",
"public function get_entities();",
"protected function getEntities() {\n $query = $this->getStorage()->getQuery();\n $keys = $this->entityType->getKeys();\n\n $query->condition($keys['bundle'], $this->bundle)\n ->sort($keys['id']);\n\n $bundle = $this->entityManager->getStorage($this->entityType->getBundleEntityType())\n ->load($this->bundle);\n\n $pager_settings = $bundle->getPagerSettings();\n if (!empty($pager_settings['page_parameter']) && !empty($pager_settings['page_size_parameter'])) {\n $query->pager($pager_settings['default_limit']);\n }\n\n return $this->getStorage()->getResultEntities($query->execute());\n }",
"public function get() : Collection\n {\n $records = $this->applyScopes()->query->get();\n $records = $this->getTree()->loadInto($records);\n\n return $this->mapper->makeEntities($records);\n }",
"public function getEntities(): array;",
"protected function getEntities()\n {\n if (!$this->entities) {\n // indirectly initializes the entities property\n $this->initializeChoices();\n }\n\n return $this->entities;\n }",
"public function load()\r\n\t{\r\n\t\t$entities = $this->query($this->entity, $this->relation)->getResults($this->relation);\r\n\t\t\r\n\t\t$this->loaded = true;\r\n\r\n\t\treturn $entities;\r\n\t}",
"public function getAll()\n {\n $resultSet = $this->oMapper->getAll();\n\n $className = get_class($this);\n\n// $return = array();\n $dto = new EntityDTO($this->oDb, $this->oLogger);\n foreach ($resultSet as $key => $row) {\n $obj = new $className($dto);\n $obj->fillByObject($row);\n\n $this->aCollection[] = $obj;\n }\n unset($resultSet);\n\n return $this->aCollection;\n }",
"public function findAll()\n {\n return $this->getEntityRepository()->findAll();\n }",
"public function getAllEntities(): array\n {\n $entities = [];\n foreach ($this->getAllClassNames() as $className) {\n $entities[] = $this->getEntityMetadata($className);\n }\n return $entities;\n }",
"public function getAll() {\n\t\t\n\t\t$entities = array();\n\t\t$rows = $this->fetchAll();\n\t\tforeach($rows as $row) {\n\t\t\t$entities[] = new UserEntity($row);\n\t\t}\n\t\treturn $entities;\n\t\t\n\t}",
"public function getList()\n {\n return array('entities' => $this->entities);\n }",
"public function entities()\n {\n return $this->belongsToMany('App\\Entity')->withTimestamps();\n }",
"public function showEntities()\n {\n return Entity::paginate(10);\n }",
"public function all()\n {\n $prepSql = \"SELECT {$this->_columnNames} FROM `{$this->_tableName}`\";\n $pstmt = $this->_prepare($prepSql);\n\n $pstmt->execute();\n\n $resultSet = $pstmt->fetchAll(\\PDO::FETCH_ASSOC);\n $pstmt->closeCursor();\n\n $collection = [];\n foreach ($resultSet as $dbRecord) {\n $entity = $this->_toEntity($dbRecord);\n $collection[] = $entity;\n }\n return $collection;\n }",
"function getEntityList()\n\t{\n\t\tif($this->entityList === null)\n\t\t{\n\t\t\t$event = new \\Bitrix\\Main\\Event('main', 'onUserTypeEntityOrmMap');\n\t\t\t$event->send();\n\n\t\t\tforeach($event->getResults() as $eventResult)\n\t\t\t{\n\t\t\t\tif($eventResult->getType() == \\Bitrix\\Main\\EventResult::SUCCESS)\n\t\t\t\t{\n\t\t\t\t\t$result = $eventResult->getParameters(); // [ENTITY_ID => 'SomeTable']\n\t\t\t\t\tforeach($result as $entityId => $entityClass)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(mb_substr($entityClass, 0, 1) !== '\\\\')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entityClass = '\\\\' . $entityClass;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->entityList[$entityId] = $entityClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->entityList;\n\t}",
"public function getEntities()\n {\n /** @var \\Umc\\Base\\Model\\Core\\Module $module */\n if ($module = $this->_coreRegistry->registry('current_module')) {\n return $module->getEntities();\n }\n return [];\n }",
"public function findAll()\n {\n $sql = \"SELECT rowid, * FROM USER\";\n $result = $this->getDb()->fetchAll($sql);\n $entities = array();\n foreach ($result as $row) {\n $id = $row['rowid'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n return $entities;\n }",
"public function findAll()\n {\n return $this->findBy(array());\n }",
"public function retrieve()\n {\n return $this->getRepository()->findAll();\n }",
"public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }",
"public function getEntities()\n {\n $st = self::execute(\n 'SELECT id AS `eid`,\n name AS `entityid`,\n revisionNr AS `revisionid`,\n `created`\n FROM `'. $this->getTablePrefix() .'connection`;'\n );\n\n if ($st === false) {\n \\SimpleSAML\\Logger::error('JANUS: Error fetching all entities');\n return false;\n }\n\n $rs = $st->fetchAll(PDO::FETCH_ASSOC);\n\n return $rs;\n }",
"public function findAll() {\n $sql = \"select * from eventtype order by num_ET\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $entities = array();\n foreach ($result as $row) {\n $id = $row['num_ET'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n return $entities;\n }",
"public function get_entities()\n\t{\t\n\t\t$query = $this->db->get('entity_types');\n\t\treturn $query->result_array();\n\t}",
"public function findAll()\n {\n return $this->getRepository()->findAll();\n }",
"public function findAll()\n {\n return $this->getRepository()->findAll();\n }",
"public function findAll()\n {\n return $this->getRepository()->findAll();\n }",
"public function findAll()\n {\n $sql = \"select * from comments order by created_at\";\n $result = $this->getDb()->fetchAll($sql);\n\n $entities = [];\n foreach ($result as $row)\n {\n $id = $row['id'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n\n return $entities;\n }",
"function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }",
"public function findAll()\n {\n\n return $this->createQueryBuilder('p')\n ->select('p')\n ->getQuery()\n ->getResult()\n ;\n }",
"public function testFetchEntities() {\n\t\t// find('all') with entitiy => true.\n\t\t$result = $this->Post->entities();\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 3);\n\t\t$this->assertTrue(is_a($result[0], 'PostEntity'));\n\t\t$this->assertEqual($result[2]->title, 'again');\n\n\t\t// 2. allEntities is alias for entities.\n\n\t\t$result = $this->Post->allEntities();\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 3);\n\t\t$this->assertTrue(is_a($result[0], 'PostEntity'));\n\t\t$this->assertEqual($result[2]->title, 'again');\n\t}",
"public function findAll()\n {\n return $this->createQuery()->execute();\n }",
"public function getEntities(Request $request)\n {\n return $this->repo->getEntities($request->get('model'));\n }",
"public function getAll() : Collection;",
"public function findAll() {\n\t\treturn $this->createQuery()->execute();\n\t}",
"public static function getAll() {\n $entities = [];\n $sqlResult = DatabaseConnection::getResult(\"SELECT * FROM \" . static::$table);\n\n foreach($sqlResult as $row) {\n $object = new static();\n foreach($row as $property => $value) {\n $object -> $property = $value;\n }\n\n $entities[] = $object;\n }\n\n return $entities;\n }",
"public function all()\n {\n return $this->repository->findAll();\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 all()\n {\n return $this->resource::collection(\n $this->repository->all()\n );\n }",
"public function getEntityListAttribute()\n {\n return $this->entities->pluck('id')->all();\n }",
"public function index()\n {\n return Entity::all();\n }",
"public function get_many() {\n return $this->get_all();\n }",
"public function getAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('c.*')\n ->from('computers', 'c');\n\n $statement = $queryBuilder->execute();\n $computersData = $statement->fetchAll();\n $computerEntityList = null;\n foreach ($computersData as $computerData) {\n $computerEntityList[$computerData['id']] = new Computer($computerData['id'], $computerData['marque'], $computerData['prix'], $computerData['idUser']);\n }\n\n return $computerEntityList;\n }",
"public function loadAll(): PostCollection\n {\n return new PostCollection(...FakeDataForToy::singleton()->getPostEntities());\n }",
"public function findAll()\n {\n return $this->createQueryBuilder()\n ->sort('createdAt', 'desc')\n ->getQuery()\n ->execute();\n }",
"public function getQuestionsEntities() : array;",
"public function getAll()\n {\n return iterator_to_array($this->repository->findAll());\n }",
"public function getIterator()\n {\n return new ArrayIterator($this->entities);\n }",
"public function findAll()\n {\n $hydrator = $this->_hydrator;\n $className = $this->_class->getName();\n $result = $this->_em->getConnexionDriver()->findAll($this->_class);\n return array_map(function ($item) use ($hydrator, $className) {\n return $hydrator->hydrate($item, new $className());\n }, $result);\n }",
"public function getAll()\n {\n return $this->findAll();\n }",
"public function getReconstitutedEntities() {}",
"public function findAll() {\n $sql = \"select * from user\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $entities = array();\n foreach ($result as $row) {\n $id = $row['user_email'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n return $entities;\n }",
"public function findAll()\n {\n return $this->findWithFilters();\n }",
"public function index()\n {\n $enities = PageEntity::with('collections')->get();\n\n return $enities;\n }",
"public function getIdentities()\n {\n }",
"public function index()\n {\n $categories = Category::all();\n $categories->each(function ($categories) {\n $categories->entity;\n });\n return new CategoryCollection($categories);\n }",
"public function getAll()\n\t{\n\t\treturn $this->getMyRepository()->findAll();\n\t}",
"public function findAll()\n {\n $conn = $this->getEntityManager()\n ->getConnection();\n\n $sql = ' select * from travel t';\n\n $stmt = $conn->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll();\n }",
"public function getAll(){\n //old : \n // $events = $this->events;\n // return $events;\n $repo = $this->om->getRepository(Event::class); \n return $repo->findAll();\n }",
"public function findAll();",
"public function findAll();",
"public function findAll();",
"public function findAll();",
"public function findAll();",
"public function findAll();",
"public function findAll();",
"public function findAll();",
"public function getAll()\n\t{\n\t\treturn new Collection($this->items);\n\t}",
"function fetchEntorno() {\n\n $entornos = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM entorno\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id = $row['id'];\n $nombre = $row['nombre'];\n $entorno = new Entorno($id, $nombre);\n array_push($entornos, $entorno);\n }\n\n return $entornos;\n }",
"public function getCollection() {\n return $this->gateway->find(\n $this->getFilter(),\n $this->order,\n $this->relations,\n $this->pager,\n !$this->excludeRepo\n );\n }",
"public function getAll()\n {\n return $this->get();\n }",
"public function getIterator()\n {\n return new Iterator($this->entities);\n }",
"public function findAll() {\n $sql = \"select * from t_playlist order by media_id desc\";\n $result = $this->getDb()->fetchAll($sql);\n \n // Convert query result to an array of domain objects\n $entities = array();\n foreach ($result as $row) {\n $id = $row['media_id'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n return $entities;\n }",
"public function findAll()\n {\n return $this->find([], ['name' => 'ASC']);\n }",
"public function getAll()\r\n\t{\r\n\t\treturn $this->findAll();\r\n\t}",
"public function getCollection();",
"public function getCollection();",
"public function getCollection();",
"public function getCollection();",
"protected function filterEntities()\n {\n $ignored = $this->codebase->getIgnored();\n\n $entities = new Collection($this->createEntities());\n $entities = $entities->filter(function (AbstractAnalyzedEntity $entity) use ($ignored) {\n return !Str::contains($entity->name, $ignored);\n });\n\n return $entities;\n }",
"public function all()\n {\n return $this->repository->all();\n }",
"public function all()\n {\n return $this->repository->all();\n }",
"public function getEntities(array $params = array());",
"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 myFindAll(): array\n {\n $qb = $this->_em->createQueryBuilder()\n ->select('s')\n ->from($this->_entityName, 's')\n ->innerJoin('s.provider', 'p')\n ->addSelect('p')\n ->innerJoin('p.logos','l')\n ->addSelect('l')\n ->orderBy('s.releaseDate','DESC');\n\n return $qb->getQuery()\n ->getResult();\n }",
"public function getAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('l.*')\n ->from('lignes', 'l');\n\n $statement = $queryBuilder->execute();\n $lignesData = $statement->fetchAll();\n foreach ($lignesData as $ligneData) {\n $ligneEntityList[$ligneData['id']] = new ligne($ligneData['id'], $ligneData['nom']);\n }\n\n return $ligneEntityList;\n }",
"public function articles()\n {\n return $this->morphedByMany('App\\Article', 'taggable');\n }",
"public function getAll(): Collection\n {\n return $this->model->all();\n }",
"abstract protected function getEntitiesToSync();"
] | [
"0.86801857",
"0.8186973",
"0.81494045",
"0.81318367",
"0.81318367",
"0.81242186",
"0.80317646",
"0.79952824",
"0.7993389",
"0.78646517",
"0.77584064",
"0.77419114",
"0.7675455",
"0.76561856",
"0.76349044",
"0.7605882",
"0.73373246",
"0.7242199",
"0.72343415",
"0.7185048",
"0.71439564",
"0.71106464",
"0.70867795",
"0.7085727",
"0.70428884",
"0.70372367",
"0.7026764",
"0.6915359",
"0.6891594",
"0.68657345",
"0.68530166",
"0.6773449",
"0.6750325",
"0.67417747",
"0.67331845",
"0.67331845",
"0.67331845",
"0.6729308",
"0.6713889",
"0.66810226",
"0.6677899",
"0.6670631",
"0.6663152",
"0.6639967",
"0.6630892",
"0.6606399",
"0.6595601",
"0.6564239",
"0.65537953",
"0.65460145",
"0.6523986",
"0.6515937",
"0.6515102",
"0.6507556",
"0.64923614",
"0.647856",
"0.6460637",
"0.6456799",
"0.64548606",
"0.64509106",
"0.6441439",
"0.6427291",
"0.64251626",
"0.641979",
"0.640928",
"0.6404885",
"0.6395425",
"0.6385619",
"0.63848495",
"0.6381835",
"0.6381835",
"0.6381835",
"0.6381835",
"0.6381835",
"0.6381835",
"0.6381835",
"0.6381835",
"0.63814706",
"0.63759345",
"0.63734686",
"0.63719517",
"0.6371294",
"0.6368373",
"0.6366719",
"0.6366192",
"0.6364401",
"0.6364401",
"0.6364401",
"0.6364401",
"0.6354557",
"0.63538015",
"0.63538015",
"0.63528115",
"0.63512003",
"0.63512003",
"0.63512003",
"0.6343269",
"0.63418764",
"0.63115317",
"0.63081086",
"0.630153"
] | 0.0 | -1 |
Inserts HTML for meta box, including all existing attachments | function os_selectfile_meta_box_html() {
global $post;
echo '<input type="hidden" name="os_selectfile_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />'; // Use nonce for verification
echo '<p id="os-selectfile-ajax">';
echo '<label for="os_selectfile_file"></label>';
echo '<select name="os_selectfile_file" id="os_selectfile_file">';
echo '<option value="">-</option>';
$val = get_post_meta($post->ID, 'os_selectfile_file', true);
$q = get_posts('post_type=attachment&post_mime_type=application&posts_per_page=-1&orderby=title&order=ASC&post_parent='.$post->ID);
foreach ($q as $obj) {
echo '<option value="'.$obj->ID.'"';
echo $obj->ID == $val ? 'selected="selected"' : '';
echo '>';
echo $obj->post_title;
//echo ' ('.str_replace("application/", "", $obj->post_mime_type).')';
echo '</option>';
}
echo '</select>';
echo '</p>';
echo '<p>';
echo '<a href="media-upload.php?post_id='.$post->ID.'&TB_iframe=1" class="button button-highlighted thickbox">Upload File</a>';
echo ' <a href="#" id="os-selectfile-ajaxclick" class="button">Refresh</a>';
echo ' <span id="os-selectfile-loading" style="display:none;"><img src="images/loading.gif" alt="Loading..." style="vertical-align:middle" /></span>';
echo '</p>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listing_pdf_box_add_meta() {\n\tadd_meta_box( 'pdf-box', 'Listing Attachments', 'listing_pdf_box_meta', 'listing', 'normal', 'default' );\n}",
"function my_attachments( $attachments ) {\n $fields = array( \n array(\n 'name' => 'caption', // unique field name\n 'type' => 'text', // registered field type\n 'label' => __( 'Caption', 'attachments' ), // label to display\n 'default' => 'caption', // default value upon selection\n )\n );\n\n $args = array(\n\n // title of the meta box (string)\n 'label' => 'Gallery Images',\n\n // all post types to utilize (string|array)\n 'post_type' => array( 'lwa_feature', 'lwa_news'),\n\n // meta box position (string) (normal, side or advanced)\n 'position' => 'advanced',\n\n // meta box priority (string) (high, default, low, core)\n 'priority' => 'high',\n\n // allowed file type(s) (array) (image|video|text|audio|application)\n 'filetype' => array('image'),\n\n // include a note within the meta box (string)\n 'note' => '',\n\n // append to the list\n 'append' => true,\n\n // text for 'Attach' button in meta box (string)\n 'button_text' => __( 'Add to gallery', 'attachments' ),\n\n // text for modal 'Attach' button (string)\n 'modal_text' => __( 'Add', 'attachments' ),\n\n // which tab should be the default in the modal (string) (browse|upload)\n 'router' => 'browse',\n\n 'post_parent' => true,\n\n // fields array\n 'fields' => $fields,\n\n );\n\n $attachments->register( 'my_attachments', $args ); // unique instance name\n}",
"function idem_pop_up_inner_add_meta_box()\n{\n add_meta_box(\n 'idem-pop-up-inner-meta-box', // id, used as the html id att\n __( 'Idem Pop Up Inner Meta Box' ), // meta box title, like \"Page Attributes\"\n 'idem_pop_up_inner_meta_box_cb', // callback function, spits out the content\n 'idem_pop_up', // post type or page. We'll add this to pages only\n 'side', // context (where on the screen)\n 'low' // priority, where should this go in the context?\n );\n}",
"function idem_pop_up_add_meta_box()\n{\n add_meta_box(\n 'idem-pop-up-meta-box', // id, used as the html id att\n __( 'Idem Pop Up' ), // meta box title, like \"Page Attributes\"\n 'idem_pop_up_meta_box_cb', // callback function, spits out the content\n 'page', // post type or page. We'll add this to pages only\n 'side', // context (where on the screen)\n 'high' // priority, where should this go in the context?\n );\n}",
"public static function add_meta_box() {\n add_meta_box(\n 'link_meta', // Unique ID\n 'Properties', // Box title\n [self::class, 'meta_html'], // Content callback, must be of type callable\n \"link\" // Post type\n );\n }",
"function my_attachments( $attachments )\n{\n $fields = array(\n array(\n 'name' => 'title', // unique field name\n 'type' => 'text', // registered field type\n 'label' => __( 'Title', 'attachments' ), // label to display\n 'default' => 'title', // default value upon selection\n ),\n array(\n 'name' => 'caption', // unique field name\n 'type' => 'textarea', // registered field type\n 'label' => __( 'Caption', 'attachments' ), // label to display\n 'default' => 'caption', // default value upon selection\n ),\n );\n\n $args = array(\n\n // title of the meta box (string)\n 'label' => 'Anexos de imagem',\n\n // all post types to utilize (string|array)\n 'post_type' => array( 'post', 'page','solucao','projeto' ),\n\n // meta box position (string) (normal, side or advanced)\n 'position' => 'normal',\n\n // meta box priority (string) (high, default, low, core)\n 'priority' => 'high',\n\n // allowed file type(s) (array) (image|video|text|audio|application)\n 'filetype' => array('image, text'), // no filetype limit\n\n // include a note within the meta box (string)\n 'note' => 'Anexe arquivos de imagem aqui!',\n\n // by default new Attachments will be appended to the list\n // but you can have then prepend if you set this to false\n 'append' => true,\n\n // text for 'Attach' button in meta box (string)\n 'button_text' => __( 'Anexe imagens', 'attachments' ),\n\n // text for modal 'Attach' button (string)\n 'modal_text' => __( 'Anexos', 'attachments' ),\n\n // which tab should be the default in the modal (string) (browse|upload)\n 'router' => 'browse',\n\n // whether Attachments should set 'Uploaded to' (if not already set)\n\t'post_parent' => false,\n\n // fields array\n 'fields' => $fields,\n\n );\n\n $attachments->register( 'my_attachments', $args ); // unique instance name\n}",
"function create_meta_box() {\n\tif ( function_exists('add_meta_box') ) {\n\t\tadd_meta_box( 'new-meta-boxes', '<div class=\"icon-small\"></div> '.PEXETO_THEMENAME.' PAGE SETTINGS', 'new_meta_boxes', 'page', 'normal', 'high' );\n\t}\n}",
"function addMeta() {\n\t\n\tif( class_exists('acf') ) {\n\n\t$meta_description = get_field('meta_description', 'option');\n\t$meta_keywords = get_field('meta_keywords', 'option');\n\t$meta_author = get_field('meta_author', 'option');\n\t$meta_og_image = get_field('meta_og_img', 'option');\n\t$meta_img_full = $meta_og_image['url'];\n\n\t}\n\n\tif ( $meta_description ) {\n\t\techo '<meta name=\"description\" content=\"'.$meta_description.'\">'; \n\t}\n\n\tif ( $meta_keywords ) {\n\t\techo '<meta name=\"keywords\" content=\"'.$meta_keywords.'\">'; \n\t}\n\n\tif ( $meta_author ) {\n\t\techo '<meta name=\"author\" content=\"'.$meta_author.'\">'; \n\t}\n\n\tif ( $meta_og_image ) {\n\t\techo '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\techo '<meta property=\"og:image\" content=\"'.$meta_img_full.'\" />';\n\t}\n\n}",
"function thmplt_carousel_slide_meta(){\r\n\tadd_meta_box(\"thmplt_carousel_meta_box1\", \"Slide Settings\", \"thmplt_carousel_slide_settings_html\", \"thmplt_carousel\", \"normal\", \"high\");\r\n\tadd_meta_box(\"thmplt_carousel_meta_box2\", \"Slide Images\", \"thmplt_carousel_slide_settings_html2\", \"thmplt_carousel\", \"normal\", \"high\");\r\n}",
"public function meta_box_html() {\r\n // Use nonce for verification\r\n wp_nonce_field( plugin_basename( __FILE__ ), self::NONCE_KEY );\r\n $old_meta_value = get_post_meta(get_the_ID(), self::URL_META_KEY, true);\r\n\r\n $key = self::URL_META_KEY;\r\n\r\n $html = <<<EOT\r\n<label for=\"$key\">The address of the downloadable resource</label>\r\n<input type=\"text\" id=\"$key\" name=\"$key\" placeholder=\"Paste it in or click the button below\" style=\"width:100%\" value=\"$old_meta_value\" />\r\n<a href=\"#\" id=\"ah-dl-res-upload\" class=\"button-primary\" style=\"margin-top:10px\">Upload or Select Resource</a>\r\nEOT;\r\n echo $html;\r\n }",
"public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}",
"public function register_meta_box() {\r\n add_meta_box( self::POST_TYPE . '-meta', 'Downloadable Resource URL', array ($this, 'meta_box_html'), self::POST_TYPE, 'side', 'default', '');\r\n }",
"public function meta_box_content()\n {\n global $post_id;\n $fields = get_post_custom($post_id);\n $field_data = $this->get_custom_fields_settings();\n\n $html = '';\n\n $html .= '<input type=\"hidden\" name=\"' . $this->token . '_nonce\" id=\"' . $this->token . '_nonce\" value=\"' . wp_create_nonce(plugin_basename($this->dir)) . '\" />';\n\n if (0 < count($field_data)) {\n $html .= '<table class=\"form-table\">' . \"\\n\";\n $html .= '<tbody>' . \"\\n\";\n\n $html .= '<input id=\"' . $this->token . '_post_id\" type=\"hidden\" value=\"' . $post_id . '\" />';\n\n foreach ($field_data as $k => $v) {\n $data = $v['default'];\n $placeholder = $v['placeholder'];\n $type = $v['type'];\n if (isset($fields[$k]) && isset($fields[$k][0])) {\n $data = $fields[$k][0];\n }\n\n if ($type == 'text') {\n $html .= '<tr valign=\"top\"><th scope=\"row\"><label for=\"' . esc_attr($k) . '\">' . $v['name'] . '</label></th><td>';\n $html .= '<input style=\"width:100%\" name=\"' . esc_attr($k) . '\" id=\"' . esc_attr($k) . '\" placeholder=\"' . esc_attr($placeholder) . '\" type=\"text\" value=\"' . esc_attr($data) . '\" />';\n $html .= '<p class=\"description\">' . $v['description'] . '</p>' . \"\\n\";\n $html .= '</td><tr/>' . \"\\n\";\n } elseif ($type == 'posts') {\n $html .= '<tr valign=\"top\"><th scope=\"row\"><label for=\"' . esc_attr($k) . '\">' . $v['name'] . '</label></th><td>';\n $html .= '<select style=\"width:100%\" name=\"' . esc_attr($k) . '\" id=\"' . esc_attr($k) . '\">';\n $html .= '<option value=\"\">Select a Page to Use</option>';\n\n // Query posts\n global $post;\n $args = [\n 'posts_per_page' => 20,\n 'post_type' => $v['default'],\n 'post_status' => 'publish'\n ];\n $custom_posts = get_posts($args);\n foreach ($custom_posts as $post) : setup_postdata($post);\n $link = str_replace(home_url(), '', get_permalink());\n $selected = '';\n if ($link == $data) {\n $selected = 'selected';\n }\n\n $html .= '<option value=\"' . $link . '\" ' . $selected . '>' . get_the_title() . '</option>';\n endforeach;\n wp_reset_postdata();\n\n $html .= '</select><p class=\"description\">' . $v['description'] . '</p>' . \"\\n\";\n $html .= '</td><tr/>' . \"\\n\";\n } elseif ($type == 'select') {\n $html .= '<tr valign=\"top\"><th scope=\"row\"><label for=\"' . esc_attr($k) . '\">' . $v['name'] . '</label></th><td>';\n $html .= '<select style=\"width:100%\" name=\"' . esc_attr($k) . '\" id=\"' . esc_attr($k) . '\">';\n foreach ($v['options'] as $option) {\n $selected = '';\n if ($option == $data) {\n $selected = 'selected';\n }\n\n $html .= '<option value=\"' . $option . '\" ' . $selected . '>' . ucfirst($option) . '</option>';\n }\n $html .= '</select>';\n if ($k == 'area') {\n $area_custom_val = '';\n if (isset($fields['area_custom'])) {\n $area_custom_val = 'value=\"' . esc_attr($fields['area_custom'][0]) . '\"';\n }\n $html .= '<input type=\"text\" name=\"area_custom\" id=\"area_custom\" ' . $area_custom_val . ' placeholder=\"Your Custom Area\" style=\"width:100%;display:none;\">';\n }\n $html .= '<p class=\"description\">' . $v['description'] . '</p>' . \"\\n\";\n $html .= '</td><tr/>' . \"\\n\";\n } elseif ($type == 'upload') {\n $html .= '<tr valign=\"top\"><th scope=\"row\"><label for=\"' . esc_attr($k) . '\">' . $v['name'] . '</label></th><td><input type=\"button\" class=\"button\" id=\"upload_media_file_button\" value=\"' . __('Upload Image', $this->token) . '\" data-uploader_title=\"Choose an image\" data-uploader_button_text=\"Insert image file\" /><input name=\"' . esc_attr($k) . '\" type=\"text\" id=\"upload_media_file\" class=\"regular-text\" value=\"' . esc_attr($data) . '\" />' . \"\\n\";\n $html .= '<p class=\"description\">' . $v['description'] . '</p>' . \"\\n\";\n $html .= '</td><tr/>' . \"\\n\";\n } elseif ($type == 'hidden') {\n $html .= '';\n } else {\n $default_color = '';\n $html .= '<tr valign=\"top\"><th scope=\"row\"><label for=\"' . esc_attr($k) . '\">' . $v['name'] . '</label></th><td>';\n $html .= '<input name=\"' . esc_attr($k) . '\" id=\"primary_color\" class=\"quiz-color\" type=\"text\" value=\"' . esc_attr($data) . '\"' . $default_color . ' />';\n $html .= '<p class=\"description\">' . $v['description'] . '</p>' . \"\\n\";\n $html .= '</td><tr/>' . \"\\n\";\n }\n\n $html .= '</td><tr/>' . \"\\n\";\n }\n\n $html .= '</tbody>' . \"\\n\";\n $html .= '</table>' . \"\\n\";\n }\n\n echo $html;\n }",
"public function render_meta_box_content($post)\r\n {\r\n\r\n // Add an nonce field so we can check for it later.\r\n wp_nonce_field('miu_inner_custom_box', 'miu_inner_custom_box_nonce');\r\n\r\n // Use get_post_meta to retrieve an existing value from the database.\r\n $value = get_post_meta($post->ID, 'miu_images', true);\r\n\r\n $metabox_content = '<div id=\"miu_images\"></div><input type=\"button\" onClick=\"addRow()\" value=\"Ajouter Emplacement\" class=\"button\" />';\r\n echo $metabox_content;\r\n\r\n $images = unserialize($value);\r\n\r\n $script = \"<script>\r\n itemsCount= 0;\";\r\n if (!empty($images))\r\n {\r\n foreach ($images as $image)\r\n {\r\n $script.=\"addRow('{$image}');\";\r\n }\r\n }\r\n $script .=\"</script>\";\r\n echo $script;\r\n }",
"public function add_meta_box() {\n\t\tif (count($post_types = $this->get_post_types())) {\n\t\t\t$this->load_textdomain();\n\t\t\tforeach ($post_types as $post_type)\n\t\t\t\tadd_meta_box('im8_additional_css_box', __(\"Additional CSS\", 'im8-additional-css'), array($this, 'print_meta_box'), $post_type, 'normal', 'high');\n\t\t}\n\t}",
"function add_custom_meta_boxes() {\n\n\t// Define the custom attachment for posts\n\tadd_meta_box(\n\t\t'wp_custom_attachment',\n\t\t'Attach a File',\n\t\t'wp_custom_attachment',\n\t\t'resources',\n\t\t'normal'\n\t);\n\n}",
"public function add_meta_boxes()\n \t{\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('wp_plugin_template_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray($this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\t\t\t\t\n \t}",
"protected function addMeta() {\n foreach ($this->meta_info as $key => $meta) {\n $this->header.=\"<meta name='\" . $key . \"' content='\" . $meta . \"' /> \\n\";\n }\n }",
"function attachment_submitbox_metadata()\n {\n }",
"function add_meta_box() {\t\t\n\t\t\t/* Gets available public post types. */\n\t\t\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\t\t\t\n\t\t\t$post_types = apply_filters( 'remove_youtube_white_label_meta_box', $post_types );\n\t\t\t\n\t\t\t/* For each available post type, create a meta box on its edit page if it supports '$prefix-post-settings'. */\n\t\t\tforeach ( $post_types as $type ) {\n\t\t\t\t/* Add the meta box. */\n\t\t\t\tadd_meta_box( self::DOMAIN . \"-{$type->name}-meta-box\", __( 'YouTube Embed Shortcode Creator (does not save meta)', self::DOMAIN ), array( $this, 'meta_box' ), $type->name, 'side', 'default' );\n\t\t\t}\n\t\t}",
"function add() {\n foreach ($this->_meta_box['pages'] as $page) {\n add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n }\n }",
"function add() {\n foreach ($this->_meta_box['pages'] as $page) {\n add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n }\n }",
"function pz_add_custom_meta_box()\n{\n add_meta_box(\n 'custom_meta_box',\n 'Custom Image Metabox',\n 'pz_custom_meta_box_callbacks',\n 'page', // page, post etc.\n 'normal',\n 'high');\n}",
"function add() {\n\t\tforeach ($this->_meta_box['pages'] as $page) {\n\t\t\tadd_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n\t\t}\n\t}",
"static function media_templates() { ?>\n<script id=\"tmpl-wp-form-attachment-field\" type=\"text/html\">\n<div class=\"attachment-container\">\n\t<img src=\"{{ data.type == 'image' ? data.url : data.icon }}\" />\n</div>\n<label>\n\t<span><?php esc_html_e( \"ID:\", 'wp-forms-api' ); ?></span>\n\t<input type=\"text\" name=\"{{ data.input_name }}\" class=\"wp-form-attachment-id\" value=\"{{ data.id }}\" />\n</label>\n<label>\n\t<span><?php esc_html_e( \"Title:\", 'wp-forms-api' ); ?></span>\n\t<input type=\"text\" value=\"{{ data.title }}\" readonly=\"readonly\" />\n</label>\n<label>\n\t<a href=\"{{ data.link }}\" target=\"_blank\"><?php __( \"View\", 'wp-forms-api' ); ?></a>\n</label>\n<# if(data.url) { #><span class=\"attachment-delete\"></span><# } #>\n<p>\n<# if(data.editLink) { #><a href=\"{{ data.editLink }}\">Edit</a> <# } #>\n<# if(data.url) { #><a href=\"{{ data.url }}\">View</a><# } #>\n</p>\n</script>\n\t<?php\n\t}",
"public function addMetaBox()\r\n {\r\n add_meta_box($this->id, esc_html__($this->title, 'firalabs-tv-show'), array(\r\n $this,\r\n 'render'\r\n ), 'firalabs_tv_show', $this->context, 'default');\r\n }",
"public function display_meta_box() {\n\t\t\n\t\tinclude_once( 'views/q-and-a-admin.php' );\n }",
"function metabox_scripts() { ?>\n\t<script src=\"http://code.jquery.com/jquery-1.4.5.min.js\"></script>\n\t<script type=\"text/javascript\">\n\t\n\tjQuery(function() {\n\t\tvar imgDiv = jQuery('#img_uploads'),\n\t\t\tsize = jQuery('#img_uploads .attchmt').size() + 1;\t\t\t\n\t\tjQuery('.addImage').live('click', function() {\n\t\t\tjQuery('<div id=\"' + size + '\" class=\"attchmt\"><table class=\"attach-table\" width=\"100%\" cellpadding=\"3\" cellspacing=\"2\"><tr><td><span class=\"req\">*</span><?php _e('Image:'); ?></td><td colspan=\"2\"><input type=\"file\" name=\"a_image\" /></td></tr><tr><td><label><span class=\"req\">*</span><?php _e('Title:'); ?> </label></td><td><input type=\"text\" name=\"a_title[]\" /></td><td rowspan=\"4\" valign=\"top\" align=\"center\"><div class=\"prevImage\"><div align=\"center\"></div></div></td></tr><tr><td><label><?php _e('Alt Text:'); ?></label></td><td><input type=\"text\" name=\"a_alt[]\" /></td></tr><tr><td><label><?php _e('Content:'); ?></label></td><td><input type=\"text\" name=\"a_content[]\" /></td></tr><tr><td><label><?php _e('Caption:'); ?></label></td><td><input type=\"text\" id=\"a_excerpt\" name=\"a_excerpt[]\" /></td></tr></table><a class=\"saveImage button\" href=\"#\"><?php _e('Save Image'); ?></a><a class=\"remImage button\" href=\"#\"><?php _e('Remove Image'); ?></a><a href=\"#\" class=\"addImage button fr\"><?php _e('Attach Another Image'); ?></a></div>')\n\t\t\t\t.fadeIn('slow').prependTo(imgDiv);\n\t\t\tsize++;\n\t\t\treturn false;\n\t\t});\n\t\tjQuery('.remImage').live('click', function() {\n\t\t\tif( size > 1 ) {\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'delete_attachment',\n\t\t\t\t\t\tatt_ID: jQuery(this).parents('.attchmt').find('#att_ID').val(),\n\t\t\t\t\t\t_ajax_nonce: jQuery('#nonce').val(),\n\t\t\t\t\t\tpost_type: 'attachment'\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function( html ) {\n\t\t\t\t\t\talert( html );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tjQuery(this).parents('.attchmt').fadeOut('slow').detach();\n\t\t\t\tjQuery(this).parents('.attchmt').siblings('#addImage').detach();\n\t\t\t\tsize--;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t});\n\t</script>\t\n\t<?php\n}",
"function rs_meta_box()\n{\n add_meta_box('rs_focus', 'Destaque na home', 'rs_focus', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post_region', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'event', 'side');\n}",
"public function addCustomBox() {\n add_meta_box( \n $this->post_type . '_meta',\n __( self::getLabel($this->post_type) . ' Meta', $this->post_type . '_meta' ),\n array($this, 'innerCustomBox'),\n $this->post_type,\n $this->fields_location, \n $this->fields_priority\n ); \n }",
"function render_meta_box_content( $post ) {\n $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );\n $user_analytics_info = get_post_meta( $post->ID, 'user_analytics_info', true ) ? get_post_meta( $post->ID, 'user_analytics_info', true ) : array();\n ?>\n <table class=\"form-table wpuf-user-analytics-listing\">\n <thead>\n <tr>\n <th><?php _e( 'User info title', 'wpuf-pro' ); ?></th>\n <th><?php _e( 'Value', 'wpuf-pro' ); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php foreach ( $user_analytics_info as $key => $value ): ?>\n <tr>\n <td><strong><?php echo ucfirst( str_replace( '_', ' ', $key ) ); ?></strong></td>\n <td><?php echo $value; ?></td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n <style>\n .wpuf-user-analytics-listing td {\n font-size: 13px;\n }\n .wpuf-user-analytics-listing td, .wpuf-user-analytics-listing th {\n padding: 5px 8px;\n }\n </style>\n <?php\n }",
"function coolRahulSoni_meta_box_add()\n{\n add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );\n}",
"function fzproject_meta_box()\n{\n add_meta_box('fzproject_meta_box', 'New portfolio item', 'display_fzproject_meta_box', 'fzproject_post', 'normal', 'high');\n}",
"function add_attachment(){\n\tadd_action( 'admin_head', 'metabox_styles' );\n\tadd_action( 'admin_head', 'metabox_scripts' );\n\tadd_meta_box( 'img-uploads', __( 'Add Attachments' ), 'add_attachments', 'product', 'normal', 'high' );\n}",
"function meta_html($post)\n {\n $view = new Xby2BaseView(get_post_meta($post->ID));\n $view->addInput('text', 'link-label', 'Label: ', 'label', 'regular-text');\n $view->addInput('text', 'link-link', 'Link: ', 'link', 'large-text');\n $view->addInput('text', 'link-priority', 'Priority: ', 'priority', 'regular-text');\n $view->displayForm();\n }",
"function attachment_submit_meta_box($post)\n {\n }",
"function clonemaker_add_meta_box(){\r\n add_meta_box(\r\n 'clonemaker',\r\n 'Clone a Page',\r\n 'add_post_list',\r\n 'page',\r\n 'side'\r\n );\r\n\r\n\r\n}",
"function logo_meta_box() {\n add_meta_box(\n 'logo_meta_box', // $id\n 'Extras', // $title\n 'show_logo_meta_box', // $callback\n 'logo', // $logo\n 'normal', // $context\n 'high'); // $priority\n}",
"function os_selectfile_add_meta_box() {\n\t//for general\n\tadd_meta_box('os_selectfile_meta_box', 'Select File', 'os_selectfile_meta_box_html', '', 'side');\n}",
"final public function add_meta_boxes()\n {\n foreach ((array)$this->GetHooks() as $hook) :\n if (!$hook['edit']) {\n continue;\n }\n foreach ((array)$hook['permalink'] as $post_type) :\n remove_meta_box('tagsdiv-' . $this->Archive, $post_type, 'side');\n remove_meta_box($this->Archive . 'div', $post_type, 'side');\n endforeach;\n endforeach;\n }",
"public static function add_meta_box() {\n add_meta_box( \"CBMTheme\", \"CBM Theme Meta Box\", \"CBMAdmin::posts_page\" );\n }",
"function ipr_meta_box() {\n\tglobal $post_ID;\n\n\t$feedtitle = get_post_meta($post_ID, 'ipr_feedtitle', true);\n\t$feedurl = get_post_meta($post_ID, 'ipr_feedurl', true);\n\t$feednumitems = get_post_meta($post_ID, 'ipr_feednumitems', true);\n\n\techo \"<input type=\\\"hidden\\\" name=\\\"ipr_nonce\\\" id=\\\"ipr_nonce\\\" value=\\\"\" . wp_create_nonce(md5(plugin_basename(__FILE__))) . \"\\\" />\";\n?>\n\t\t<table id=\"newmeta1\">\n\t\t\t<tr><th>Feed Title</th><td><input type=\"text\" size=\"60\" tabindex=\"900\" id=\"ipr_feedtitle\" name=\"ipr_feedtitle\" value=\"<?php echo $feedtitle;?>\"></td></tr>\n\t\t\t<tr><th>Feed URL</th><td><input type=\"text\" size=\"60\" tabindex=\"901\" id=\"ipr_feedurl\" name=\"ipr_feedurl\" value=\"<?php echo $feedurl;?>\"></td></tr>\n\t\t</table>\n\n\t<?php\n\t}",
"public static function add_meta_box() {\n\t\tadd_meta_box( 'sponsor-meta', __( 'Sponsor Meta', self::$text_domain ), array( __CLASS__, 'do_meta_box' ), self::$post_type_name , 'normal', 'high' );\n\t}",
"function add_meta_box() {\n global $post;\n\n $post_types = get_post_types( array( 'public' => true ) );\n\n if ( !empty( $post ) ) {\n if ( $this->check_user_analytics_exist( $post ) ) {\n foreach ( $post_types as $post_type ) {\n add_meta_box( 'show_user_analytics', __( 'Post Author Analytics Info', 'wpuf-pro' ), array( $this, 'render_meta_box_content' ), $post_type, 'advanced', 'high' );\n }\n }\n }\n }",
"function m_custom_meta() {\r\n add_meta_box( 'sm_meta', __( 'Featured Posts', 'sm-textdomain' ), 'sm_meta_callback', 'post' );\r\n add_meta_box( 'mm_meta', __( 'Main Posts', 'sm-textdomain' ), 'mm_meta_callback', 'post' );\r\n\r\n}",
"function ahr_add_meta_box() {\r\n \r\n add_meta_box( 'ahr', 'Advaned https redirect', 'ahr_render_meta_box', null, 'normal', 'high', null );\r\n \r\n}",
"function greater_jackson_habitat_extra_metabox_content() {\n\t\n\tgreater_jackson_habitat_do_field_textarea( array(\n\t\t'name' => 'gjh_extra',\n\t\t'group' => 'gjh_extra',\n\t\t'wysiwyg' => true,\n\t) );\n\t\n\tgreater_jackson_habitat_init_field_group( 'gjh_extra' );\n\t\n}",
"private function do_meta_box( $title = '', $contents = '' ) {\n\t\t?>\n\t\t<div class=\"postbox\">\n\t\t\t<h3 class=\"hndle\"><?php echo $title ?></h3>\n\t\t\t<div class=\"inside\">\n\t\t\t\t<?php echo $contents; ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"public function video_meta_boxes() {\n add_meta_box(\n 'metainfo',\n 'Meta Information',\n array($this, 'video_meta_information'),\n 'video',\n 'normal',\n 'high'\n );\n add_meta_box(\n 'featured_image_help',\n 'Note',\n array($this, 'video_featured_image_help'),\n 'video',\n 'side',\n 'low'\n );\n }",
"public static function create_meta_box() {\n\t\t$content_types_array = self::_get_active_content_types();\n\t\tforeach ( $content_types_array as $content_type ) {\n\t\t\tadd_meta_box( 'custom-content-type-mgr-custom-fields'\n\t\t\t\t, __('Custom Fields', CCTM::txtdomain )\n\t\t\t\t, 'StandardizedCustomFields::print_custom_fields'\n\t\t\t\t, $content_type\n\t\t\t\t, 'normal'\n\t\t\t\t, 'high'\n\t\t\t\t, $content_type \n\t\t\t);\n\t\t}\n\t}",
"function image_media_send_to_editor($html, $attachment_id, $attachment)\n {\n }",
"function meta_box_horse_gallery() {\n\tglobal $meta_box_portfolio_images, $post;\n \t\n\techo '<p style=\"padding:10px 0 0 0;\">'.__('These settings enable you to manage the images displayed in the portfolio. Upload your images and use \"Manage Images\" to edit, reorder and delete images.', 'my_theme').'</p>';\n\n\techo '<table class=\"form-table my-custom-table\">';\n \n\tforeach ($meta_box_portfolio_images['fields'] as $field) {\n\t\n\t\t// get current post meta data\n\t\tif (isset ($field['id']))\n\t\t\t$meta = get_post_meta($post->ID, $field['id'], true);\n\t\t\t\n\t\tswitch ($field['type']) { \n\t\t\t\n\t\t\t\t//If Attachments\n\t\t\tcase 'attachments':\n\t\t\t\techo '<tr style=\"border-top:1px solid #eeeeee;\">',\n\t\t\t\t'<th style=\"width:25%\"><label><strong>', $field['name'], '</strong><span style=\"display:block; color:#666; margin:5px 0 0 0; line-height: 18px;\">'. $field['desc'].'</span></label></th>',\n\t\t\t\t'<td>';\n\t\t\t\t\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type' => \t\t'attachment',\n\t\t\t\t\t'post_status' => \t\t'inherit',\n\t\t\t\t\t'post_parent' => \t\t$post->ID,\n\t\t\t\t\t'post_mime_type' => \t'image',\n\t\t\t\t\t'posts_per_page' => \t'-1',\n\t\t\t\t\t'order' => \t\t\t'ASC',\n\t\t\t\t\t'orderby' => \t\t'menu_order',\n\t\t\t\t\t'exclude' => \t\tget_post_thumbnail_id()\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$intro = '<p><a href=\"media-upload.php?post_id=' . $post->ID .'&type=image&TB_iframe=1&width=640&height=715\" id=\"add_images\" class=\"thickbox\" title=\"' . __( 'Upload Images', 'my_theme' ) . '\">' . __( 'Upload Images', 'my_theme' ) . '</a> | <a href=\"media-upload.php?post_id=' . $post->ID .'&type=image&tab=gallery&TB_iframe=1&width=640&height=715\" id=\"manage_images\" class=\"thickbox\" title=\"' . __( 'Manage Images', 'my_theme' ) . '\">' . __( 'Manage Images', 'my_theme' ) . '</a></p>';\n\t\t\t\techo $intro;\n\t\t\t\t\n\t\t\t\t$return = '';\n\t\t\t\t$attachments = get_posts( $args );\n\t\t\t\t\n\t\t\t\t\t$return .= '<div id=\"meta-horse-gallery-attachments\">';\n\t\t\t\t\t\tif( empty( $attachments ) )\n\t\t\t\t\t\t\t$return .= '<p>'. __('No images.','my_theme'). '</p>';\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tforeach( $attachments as $image ):\n\t\t\t\t\t\t\t\t$thumbnail = wp_get_attachment_image_src( $image->ID, 'thumbnail');\n\t\t\t\t\t\t\t\t$return .= '<img style=\"margin-right:5px;\" width=\"100\" height=\"100\" src=\"' . $thumbnail[0] . '\" alt=\"' . apply_filters('the_title', $image->post_title). '\"/>';\n\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t}\n\t\t\t\t\t$return .= '</div>';\n\t\t\t\techo $return;\n\t\t\t\t\n\t\t\t\techo \t'</td>',\n\t\t\t\t'</tr>';\t\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\n\t}\n \n\techo '</table>';\n\t\n\t// create a custom nonce for submit verification later\n\techo '<input type=\"hidden\" name=\"meta_horse_gallery_noncename\" value=\"' . wp_create_nonce(__FILE__) . '\" />';\n}",
"function create_meta_post_box() {\n\tif ( function_exists('add_meta_box') ) {\n\t\tadd_meta_box( 'new-meta-post-boxes', '<div class=\"icon-small\"></div> '.PEXETO_THEMENAME.' POST SETTINGS', 'new_meta_post_boxes', 'post', 'normal', 'high' );\n\t}\n}",
"function attachment_id3_data_meta_box($post)\n {\n }",
"function education_information_meta_box() {\n\t// P1: CSS id\n\t// P2: mata box title\n\t// P3: callback function\n\t// P4: post type this meta box is associated with\n\t// P5: priority level (optional)\n\t// P6: callback function arguments (optional)\n add_meta_box( 'education-information-meta-box', 'Education Information', 'education_information_meta_box_callback', 'education' );\n}",
"public function print_metadata_box($post) {\n // presses save, the application will check that the nonce field is still declared and\n // that is the same that the one provided here. If they don't match, probably something\n // nasty happened (or maybe just there was a bug).\n wp_nonce_field('makigas_metabox_video', 'makigas_metabox_nonce');\n\n // Put the fields.\n $this->print_field( $post, '_video_id', __( 'Video ID', 'makigas-videoman' ) );\n $this->print_field( $post, '_episode', __( 'Episode Number', 'makigas-videoman' ) );\n $this->print_field( $post, '_length', __( 'Length', 'makigas-videoman' ) );\n }",
"public function create_meta_box() {\n\t\tadd_meta_box( 'slider_meta', 'Example metabox', array( $this, 'slider_meta_fields_callback' ), [ 'Page', 'post' ] );\n\n\t}",
"public function custom_meta_add() {\n\t\tif( !$this->options->show_on || in_array(get_the_id(), $this->options->show_on ) ){\n\t\t\tforeach( $this->options->display_on as $post_type ){\n\t\t\t\tadd_meta_box(\n\t\t\t\t\t$this->unique_key, // Unique Key\n\t\t\t\t\t$this->options->title ? esc_html__( $this->options->title ) : 'Related Content', //Title\n\t\t\t\t\tarray(&$this, 'custom_meta_render' ), // Callback (builds html)\n\t\t\t\t\t$post_type, // Post type\n\t\t\t\t\t$this->options->context, // Context\n\t\t\t\t\t$this->options->priority, // Priority\n\t\t\t\t\t$callback_args = null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t}",
"function tower_register_meta_boxes() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n $meta = $custom_type['meta'];\n add_meta_box(\n $meta['handle'],\n $meta['title'],\n $meta['callback'],\n $key\n );\n }\n}",
"public \tfunction\tmeta($content, $file) {\n\t\t\t//Ensure that this is loaded only for this plugin. \n\t\t\tif ($file == plugin_basename(__FILE__)) {\n\t\t\t\t//Append HTML content to the metadata. \n\t\t\t\t$content[]\t=\tsprintf('<a href=\"%s\" target=\"_blank\">%s</a>', \n\t\t\t\t\t\t\"options-general.php?page=FrozenPlugin-settings\", \n\t\t\t\t\t\t__('Plugin Settings'));\n\t\t\t\t$content[]\t=\tsprintf('<a href=\"%s\" target=\"_blank\">%s</a>', \n\t\t\t\t\t\t\"https://github.com/mookman288/FrozenPlugin\", \n\t\t\t\t\t\t__('Author'));\n\t\t\t}\n\t\t\n\t\t\t//Return content.\n\t\t\treturn $content;\n\t\t}",
"public function add_meta_boxes()\n \t{\n\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('WP_Custom_Login_Profile_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray(&$this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\n\n \t}",
"function ilusix_my_custom_meta_box_callback( $post ) {\n global $myMetaBoxActionId;\n global $myMetaBoxNonceId;\n\n // Set a nonce\n wp_nonce_field( $myMetaBoxActionId, $myMetaBoxNonceId );\n\n $metaBoxContent = ilusix_get_my_meta_box_content( $post->ID );\n\n // Output\n include_once( 'my_meta_box_html.php' );\n}",
"public function apb_add_meta_boxes() {\r\n\t}",
"public function innerCustomBox( $post ) {\n global $post;\n // Use nonce for verification\n wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );\n echo '<table class=\"widefat\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">';\n //Add this to work with Custom Javascript that needs image dir. \n echo '<span id=\"bloginfo\" stylesheet_dir_uri=\"' . get_template_directory_uri() . '\" style=\"display: none\">';\n // The actual fields for data entry\n //Iterate through the array. Will expand or contract as fields are added in the database (through scraper).\n foreach($this->meta_box_fields as $field => $label):\n echo self::formatFields($post, $field, $label, $this->meta_box_fields_formats[$field] );\n endforeach;\n echo \"</table>\";\n \n }",
"function buildCustomPostWidgets()\n {\n // add_meta_box( $id, $title, $callback, $screen, $context, $priority, $callback_args );\n add_meta_box( 'cover_image_meta_box', 'Add an Image', array($this,'selectImageMetaBox'), 'playscripts', 'normal', 'high' );\n add_meta_box( 'cover_sound_meta_box', 'Add a Sound', array($this,'selectSoundMetaBox'), 'playscripts', 'normal', 'high' );\n }",
"function add_your_fields_meta_box(){\r\nadd_meta_box(\r\n'your_fields_meta_box',// $id\r\n'Auteur',// $title\r\n'show_your_fields_meta_box',// $callback\r\n'Livre',// $screen\r\n'normal',// $context\r\n'high'// $priority\r\n);\r\n}",
"public function render_meta_box_content( $post ) {\n\t\tinclude_once $this->plugin->path . 'views/view-metabox-publish.php';\n\t}",
"function ilusix_my_custom_meta_box() {\n global $myMetaBoxPostTypes;\n\n foreach($myMetaBoxPostTypes as $postType) {\n add_meta_box(\n 'my_custom_meta_box_identifier' . '-' . $postType,\n 'Meta box title',\n 'ilusix_my_custom_meta_box_callback',\n $postType,\n 'normal',\n 'default'\n );\n }\n}",
"public function register_meta() {\r\n\t\t\tforeach($this->customFields as $customField){\r\n\t\t\t\tadd_meta_box( 'ecf-'.$customField['name'], __( $customField['title'], 'exlist' ), $customField['callback'], $postTypes , 'advanced', 'high', $type = array($customField['name'], $customField['title'], $customField['type']) );\r\n\t\t\t}\r\n }",
"function ihs_display_custom_script_meta_boxes( $post ) {\n\n\t\t/**\n\t\t * Use nonce for verification.\n\t\t * This will create a hidden input field with id and name as 'ihs_add_script_nonce_name' and unique nonce input value.\n\t\t */\n\t\twp_nonce_field( plugin_basename( __FILE__ ), 'ihs_add_script_nonce_name' );\n\n\t\t// The function get_post_meta retrieves an existing value from the database and use the value for the form.\n\t\t$header_meta_value = get_post_meta( $post->ID, 'ihs_add_script_header_meta', true );\n\t\t$footer_meta_value = get_post_meta( $post->ID, 'ihs_add_script_footer_meta', true );\n\t\t?>\n\t\t<div class=\"postbox\">\n\t\t\t<div class=\"inside\">\n\t\t\t\t<table width=\"100%\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"ihs-add-script-header\">\n\t\t\t\t\t\t\t\t\t<?php _e( \"add script / style to be added to the header of the page\", 'add-post-script-plugin' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label for=\"\"><textarea id=\"ihs-add-script-header\" class=\"ihs-add-script-header\" name=\"ihs-add-script-header\" size=\"25\"><?php echo $header_meta_value ?></textarea></label>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"ihs-add-script-header\">\n\t\t\t\t\t\t\t\t\t<?php _e( \"add script to be added to the footer of the page before the </body> ( Only put javascript codes here )\", 'ihs-add-script-footer' ); ?>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label for=\"\">\n\t\t\t\t\t\t\t\t\t<textarea id=\"ihs-add-script-footer\" class=\"ihs-add-script-footer\" name=\"ihs-add-script-footer\" size=\"25\"><?php echo $footer_meta_value ?></textarea>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p><?php _e( \"You should put the style code with the script tags<code> <style> the code </style></code>\", 'add-post-script-plugin' ); ?></p>\n\t\t\t\t\t\t\t<p><?php _e( \"You should put the script code with the script tags<code> <script type='text/javascript'> the code </script></code>\", 'add-post-script-plugin' ); ?></p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"public function add_meta_boxes()\n {\n\n $this->_add_bitly_meta_box();\n\n }",
"public function add_meta_box() {\n\t\tadd_meta_box(\n\t\t\t 'related_posts_meta_box'\n\t\t\t,__( 'Related Posts', self::LANG )\n\t\t\t,array( &$this, 'render_meta_box_content' )\n\t\t\t,'post'\n\t\t\t,'advanced'\n\t\t\t,'high'\n\t\t);\n\t}",
"function embedpage_add_meta_box() {\n $screens = ['post', 'page'];\n foreach ($screens as $screen) {\n add_meta_box(\n 'embedpage_code', // Unique ID\n __('Code to embed this content', 'embedpage'), // Box title\n 'embedpage_meta_box_content', // Content callback, must be of type callable\n $screen // Post type\n );\n }\n}",
"public function setup_meta_box( $options ) {\n\t\t\n\t\t\t//add_meta_box\n\t\t\n\t\t}",
"function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}",
"function pg_add_custom_box() {\r\n\tif( function_exists( 'add_meta_box' )) {\r\n\t\tadd_meta_box( 'pg_custom_box_1', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'page', 'normal', 'high' );\r\n\t\tadd_meta_box( 'pg_custom_box_2', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'post', 'normal', 'high' );\r\n\t}\r\n}",
"function wck_add_meta(){\n\t\tparent::wck_add_meta();\n\t}",
"function add_adrotate_meta_box_to_page(){\n\t\tadd_meta_box(\"page_adrotate_block-meta\",\"AdRotate Block\",\"page_adrotate_block\",\"page\",\"side\",\"high\");\n\t\tadd_meta_box(\"page_adrotate_block-meta\",\"AdRotate Block\",\"page_adrotate_block\",\"social_conference\",\"side\",\"high\");\n\t\tadd_meta_box(\"page_adrotate_block-meta\",\"AdRotate Block\",\"page_adrotate_block\",\"social_exhibition\",\"side\",\"high\");\n\t}",
"function ev_gallery_show_box() {\n\tglobal $ev_gallery_metabox, $post;\n\t\n\t// Use nonce for verification\n\techo '<input type=\"hidden\" name=\"ev_gallery_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n\t\n\techo '<table class=\"form-table\">';\n\n\tforeach ($ev_gallery_metabox['fields'] as $field) {\n\t\t// get current post meta data\n\t\t$meta = get_post_meta($post->ID, $field['id'], true);\n\t\t\n\t\techo '<tr>',\n\t\t\t\t'<th style=\"width:20%; vertical-align:middle;\"><label for=\"', $field['id'], '\" style=\"font-size:15px; color:#464646; text-shadow:0px 1px 0px #fff; font-family: Georgia, \\'Times New Roman\\', Times\">', $field['name'], '</label></th>',\n\t\t\t\t'<td>';\n\t\tswitch ($field['type']) {\n\t\t\tcase 'text':\n\t\t\t\techo '<input type=\"text\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n\t\t\t\t\t'<br />', $field['desc'];\n\t\t\t\tbreak;\n\t\t}\n\t\techo \t'<td>',\n\t\t\t'</tr>';\n\t}\n\t\n\techo '</table>';\n\t\n}",
"function aerospace101_build_meta_box( $post ) {\n\twp_nonce_field( basename( __FILE__ ), 'aerospace101_meta_box_nonce' );\n\n\n // Retrieve current value of fields\n $current_sources = get_post_meta( $post->ID, '_post_sources', true );\n\t$current_is_featured = get_post_meta( $post->ID, '_post_is_featured', true );\n\n\n\t?>\n\n\t<div class='inside'>\n\t\t<h3><?php _e( 'Is Featured?', 'aerospace' ); ?></h3>\n\t\t<p>\n\t\t\t<input type=\"checkbox\" name=\"is_featured\" value=\"1\" <?php checked( $current_is_featured, '1' ); ?> /> Is Featured?\n\t\t</p>\n\n\t\t<h3><?php esc_html_e( 'Sources', 'aerospace' ); ?></h3>\n\t\t<p>\n\t\t\t<?php\n\t\t\t\twp_editor(\n\t\t\t\t\t$current_sources,\n\t\t\t\t\t'post_sources',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'media_buttons' => false,\n\t\t\t\t\t\t'textarea_name' => 'sources',\n\t\t\t\t\t\t'teeny' => false,\n\t\t\t\t\t\t'tinymce' => array(\n\t\t\t\t\t\t\t'menubar' => false,\n\t\t\t\t\t\t\t'toolbar1' => 'bold,italic,underline,strikethrough,subscript,superscript,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink',\n\t\t\t\t\t\t\t'toolbar2' => 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</p>\n\n\n\t</div>\n\t<?php\n}",
"public function append_media_upload_form() {\n \n ?>\n <!-- Add from Media Library -->\n <a href=\"#\" class=\"envira-media-library button\" title=\"<?php _e( 'Click Here to Insert from Other Image Sources', 'envira-gallery' ); ?>\" style=\"vertical-align: baseline;\">\n <?php _e( 'Select Files from Other Sources', 'envira-gallery' ); ?>\n </a>\n\n <!-- Progress Bar -->\n <div class=\"envira-progress-bar\">\n <div class=\"envira-progress-bar-inner\"></div>\n <div class=\"envira-progress-bar-status\">\n <span class=\"uploading\">\n <?php _e( 'Uploading Image', 'envira-gallery' ); ?>\n <span class=\"current\">1</span>\n <?php _e( 'of', 'envira-gallery' ); ?>\n <span class=\"total\">3</span>\n </span>\n\n <span class=\"done\"><?php _e( 'All images uploaded.', 'envira-gallery' ); ?></span>\n </div>\n </div>\n <?php\n\n }",
"public function print_meta_box($post) {\n\t\twp_nonce_field(basename(__FILE__), $this->nonce);\n\t\t?>\n\t\t<p>\n\t\t\t<?php _e(\"Here you can select an additional CSS file or define additional CSS styles which should be loaded for this post or page.<br/><b>In order to show up here, the CSS files have to be located in the \\\"/css\\\" sub-folder of your theme.</b>\", 'im8-additional-css'); ?>\n\t\t</p>\n\t\t<table class=\"form-table\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t<label for=\"im8_additional_css_file\">\n\t\t\t\t\t\t\t<?php _e(\"Additional CSS file\", 'im8-additional-css'); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select id=\"im8_additional_css_file\" name=\"im8_additional_css_file\">\n\t\t\t\t\t\t\t<option value=\"-1\">\n\t\t\t\t\t\t\t\t<?php _e(\"None\", 'im8-additional-css'); ?>\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif (file_exists($path = get_stylesheet_directory().'/css/')) {\n\t\t\t\t\t\t\t\t$additional_css_file = get_post_meta($post->ID, 'im8_additional_css_file', true);\n\t\t\t\t\t\t\t\tforeach (glob($path.'*.css') as $file) {\n\t\t\t\t\t\t\t\t\t$file = substr($file, strlen($path));\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $file; ?>\" <?php selected($file, $additional_css_file); ?>>\n\t\t\t\t\t\t\t\t\t\t<?php echo $file; ?>\n\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t<label for=\"im8_additional_css\">\n\t\t\t\t\t\t\t<?php _e(\"Additional CSS styles\", 'im8-additional-css'); ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<textarea id=\"im8_additional_css\" name=\"im8_additional_css\" class=\"widefat\" rows=\"10\"><?php echo get_post_meta($post->ID, 'im8_additional_css', true); ?></textarea>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<?php\n\t\t$this->unload_textdomain();\n\t}",
"function myplugin_add_meta_box() {\n\tadd_meta_box( 'mod_date', 'Last modified on: ', 'modified_callback', 'location', 'side','high');\n}",
"public function kiwip_add_meta_box(){\t\t\t\n\t\tadd_meta_box(\n\t\t\t$this->id,\n\t\t\t$this->title,\n\t\t\tarray(&$this, 'kiwip_metabox_callback'),\n\t\t\t$this->cpt_name,\n\t\t\t$this->context,\n\t\t\t$this->priority\n\t\t);\n\t}",
"public function render_meta_box_content( $post ) {\n \n // Add an nonce field so we can check for it later.\n wp_nonce_field( 'myplugin_inner_custom_box', 'myplugin_inner_custom_box_nonce' );\n \n // Use get_post_meta to retrieve an existing value from the database.\n $heading_one = get_post_meta( $post->ID, '_my_meta_value_key_one', true );\n $heading_two = get_post_meta( $post->ID, '_my_meta_value_key_two', true );\n $heading_three = get_post_meta( $post->ID, '_my_meta_value_key_three', true );\n $heading_four = get_post_meta( $post->ID, '_my_meta_value_key_four', true );\n $heading_five = get_post_meta( $post->ID, '_my_meta_value_key_five', true );\n $heading_six = get_post_meta( $post->ID, '_my_meta_value_key_six', true );\n \n // Display the form, using the current value.\n ?>\n <label for=\"heading_one\">\n <?php _e( 'Heading One', 'textdomain' ); ?>\n </label>\n <input type=\"text\" id=\"heading_one\" name=\"heading_one\" value=\"<?php echo esc_attr( $heading_one ); ?>\" size=\"25\" />\n <label for=\"heading_two\">\n <?php _e( 'Heading Two', 'textdomain' ); ?>\n </label>\n <input type=\"text\" id=\"heading_two\" name=\"heading_two\" value=\"<?php echo esc_attr( $heading_two ); ?>\" size=\"25\" />\n <label for=\"heading_three\">\n <?php _e( 'Heading Three', 'textdomain' ); ?>\n </label>\n <input type=\"text\" id=\"heading_three\" name=\"heading_three\" value=\"<?php echo esc_attr( $heading_three ); ?>\" size=\"25\" /><br/>\n <label for=\"heading_four\">\n <?php _e( 'Heading Four', 'textdomain' ); ?>\n </label>\n <input type=\"text\" id=\"heading_four\" name=\"heading_four\" value=\"<?php echo esc_attr( $heading_four ); ?>\" size=\"25\" />\n <label for=\"heading_five\">\n <?php _e( 'Heading Five', 'textdomain' ); ?>\n </label>\n <input type=\"text\" id=\"heading_five\" name=\"heading_five\" value=\"<?php echo esc_attr( $heading_five ); ?>\" size=\"25\" />\n <label for=\"heading_six\">\n <?php _e( 'Heading Six', 'textdomain' ); ?>\n </label>\n <input type=\"text\" id=\"heading_six\" name=\"heading_six\" value=\"<?php echo esc_attr( $heading_six ); ?>\" size=\"25\" />\n <?php\n }",
"public static function registerMetaBoxes() {}",
"Function Wp_meta_box_store(){\n\n\t$mult_posts = array( 'post', 'page' );\n\n\tforeach ($mult_posts as $mult_post) {\n\t\tadd_meta_box(\n\t\t\t'meta_box_id', \t\t\t\t\t# metabox id\n\t\t\t__('Author Bio', 'textdomain'),\t# Title \n\t\t\t'wp_meta_box_call_back_func_store', \t# Callback Function \n\t\t\t$mult_post, \t\t\t\t\t# Post Type\n\t\t\t'normal'\t\t\t\t\t\t# textcontent\n\t\t);\n\t}\n\t\n}",
"function add_meta_boxes()\n {\n }",
"public function render_meta_box_content( $post ) {\n\n\t\t// Add an nonce field so we can check for it later.\n\t\twp_nonce_field( 'customify_page_settings', 'customify_page_settings_nonce' );\n\t\t$values = array();\n\t\tforeach ( $this->field_builder->get_all_fields() as $key => $f ) {\n\t\t\tif ( 'multiple_checkbox' == $f['type'] ) {\n\t\t\t\tforeach ( (array) $f['choices'] as $_key => $label ) {\n\t\t\t\t\t$value = get_post_meta( $post->ID, '_customify_' . $_key, true );\n\t\t\t\t\t$values[ $_key ] = $value;\n\t\t\t\t}\n\t\t\t} elseif ( $f['name'] ) {\n\t\t\t\t$values[ $f['name'] ] = get_post_meta( $post->ID, '_customify_' . $f['name'], true );\n\t\t\t}\n\t\t}\n\n\t\t$this->field_builder->set_values( $values );\n\t\t$this->field_builder->render();\n\n\t}",
"function page_setup_metabox_content( $post ){\n\twp_nonce_field( 'mptheme_layout_save_meta_box', 'mptheme_page_setup_meta_box_nonce' );\n\n\t/*\n\t * Use get_post_meta() to retrieve an existing value\n\t * from the database and use the value for the form.\n\t */\n\t$mptheme_page_setup_show_heading = get_post_meta( $post->ID, 'mptheme_page_setup_show_heading', true );\n\n\tif(!$mptheme_page_setup_show_heading){\n\t\t$mptheme_page_setup_show_heading = 'true';\n\t}\n\t?>\n\t\t<p class=\"post-attributes-label-wrapper\">\n\t\t\t<label class=\"post-attributes-label\"> <?php _e( 'Show page heading', 'mptheme' ); ?> </label>\n\t\t</p>\n\t\t<select name=\"mptheme_page_setup_show_heading\">\n\t\t\t<option value=\"true\" <?php echo selected( $mptheme_page_setup_show_heading, 'true', false); ?>> <?php _e( 'Enable', 'mptheme' ); ?></option>\n\t\t\t<option value=\"false\" <?php echo selected( $mptheme_page_setup_show_heading, 'false', false); ?>> <?php _e( 'Disable', 'mptheme' ); ?></option>;\n\t\t</select>\n\n\t<?php\n\t// if Revolution Slider is available uset can select an slider for the page\n\tif(class_exists('RevSliderAdmin')) {\n\t\tglobal $wpdb;\n\n\t\t$rs = $wpdb->get_results( \n\t\t\t\"\n\t\t\tSELECT id, title, alias\n\t\t\tFROM \".$wpdb->prefix.\"revslider_sliders\n\t\t\tORDER BY id ASC LIMIT 100\n\t\t\t\"\n\t\t);\n\t\t$revsliders = array(array(\n\t\t\t'value' => 'no_slider',\n\t\t\t'label' => 'No Slider'\n\t\t));\n\t\tif ($rs) {\n\t\t\t$_ri = 1;\n\t\t\tforeach ( $rs as $slider ) {\n\t\t\t\t$revsliders[$_ri]['value'] = $slider->alias;\n\t\t\t\t$revsliders[$_ri]['label'] = $slider->title;\n\t\t\t\t$_ri++;\n\t\t\t}\n\t\t} else {\n\t\t\t$revsliders[\"No sliders found\"] = 0;\n\t\t}\n\n\t\tif(count($revsliders)>0 ){\n\t\t\t// Get the saved slider\n\t\t\t$mptheme_page_setup_revslider = get_post_meta( $post->ID, 'mptheme_page_setup_revslider', true );\n\n\t\t\tif(!$mptheme_page_setup_revslider){\n\t\t\t\t$mptheme_page_setup_revslider = 'no_slider';\n\t\t\t}\n\n\t\t?>\n\n\t\t\t<p class=\"post-attributes-label-wrapper\">\n\t\t\t\t<label class=\"post-attributes-label\"> <?php _e( 'Show hero Revolution Slider insted of heading?', 'mptheme' ); ?> </label>\n\t\t\t</p>\n\t\t\t<select name=\"mptheme_page_setup_revslider\">\n\t\t\t\t<?php for ($i=0; $i < count($revsliders); $i++) { ?>\n\t\t\t\t\t<option value=\"<?php echo $revsliders[$i][\"value\"] ?>\" <?php echo selected( $mptheme_page_setup_revslider, $revsliders[$i][\"value\"], false); ?>><?php echo $revsliders[$i][\"label\"] ?></option>\n\t\t\t\t<?php } ?>\n\t\t\t</select>\n\n\t\t<?php }\n\t}\n\t?>\n\n\t<?php\n}",
"private function initMetaBox(){\n\t\t$path = get_template_directory() . '/sub/customfield/';\n\t\tif(function_exists('of_get_option')){\n\t\t\tif(of_get_option('is-seo',true)){\n\t\t\t\tnew WPO_MetaBox(array(\n\t\t\t\t 'id' => 'wpo_seo',\n\t\t\t\t 'title' => $this->l('SEO Fields'),\n\t\t\t\t 'types' => array('page','portfolio','post','video'),\n\t\t\t\t 'priority' => 'high',\n\t\t\t\t 'template' => $path . 'seo.php',\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_template',\n\t\t 'title' => $this->l('Advanced Configuration'),\n\t\t 'types' => array('page'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'page-advanced.php'\n\t\t));\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_pageconfig',\n\t\t 'title' => $this->l('Page Configuration'),\n\t\t 'types' => array('page'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'page.php',\n\t\t));\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_post',\n\t\t 'title' => $this->l('Embed Options'),\n\t\t 'types' => array('post','video'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'post.php',\n\t\t));\n\t}",
"function pavi_post_meta_boxes_setup() {\n add_action( 'add_meta_boxes', 'pavi_textarea_meta_boxes' );\n\n /* Save post meta on the 'save_post' hook. */\n add_action( 'save_post', 'pavi_save_post_class_meta', 10, 2 );\n}",
"public static function cpt_meta_box_markup( $object, $item ) {\n\t\t$info = self::build_cpt_info( $item );\n\t\t$meta_key = $info[\"meta_key\"];\n\t\t$nonce_key = $info[\"nonce_key\"];\n\t\t$cpt_type = $info[\"cpt_type\"];\n\t\t$cpt_form_field = $info[\"cpt_form_field\"] . \"[]\";\n\t\t$current_ids = self::get_by_type_and_page( $item, $object->ID );\n\t\t//$current_ids = get_post_meta($object->ID, $meta_key, true);\n\t\t$all_items = self::get_all( $item );\n\n\t\twp_nonce_field( basename( __FILE__ ), $nonce_key );\n\t\techo \"<div class='evo_cpt_list'>\";\n\t\tself::log_obect( $current_ids );\n\t\tif ( $current_ids ) {\n\t\t\tforeach ( $current_ids as $id ) {\n\t\t\t\techo sprintf( \"<div class=\\\"current_cpts\\\">%s<input type=\\\"hidden\\\" name=\\\"{$cpt_form_field}\\\" value=\\\"%s\\\" /><div class=\\\"evo_remove\\\"></div></div>\\n\", $all_items[ $id ]->post_title, $id );\n\t\t\t}\n\n\t\t}\n\t\techo \"</div>\";\n\t\techo '<div class=\"evo_select_callout\">';\n\t\techo \"<select name='evo_new_{$item}_id'>\";\n\t\techo \"<option value='select'>Select a {$info[\"cpt_text\"]}</option>\";\n\t\tif ( $all_items ) {\n\t\t\tforeach ( $all_items as $item ) {\n\t\t\t\techo sprintf( \"<option value=\\\"%s\\\">%s</option>\", $item->ID, $item->post_title );\n\t\t\t}\n\t\t}\n\n\t\techo '</select>';\n\t\techo \"<div data-field-name='{$cpt_form_field}' class='evo_add_cpt'></div>\";\n\t\techo '</div>';\n\t}",
"function action_custom_box()\n {\n add_meta_box(\n $this->plugin->config['meta']['box-name'],\n 'Protect Content',\n [$this, 'custom_box_html'],\n ['page', 'post'],\n 'normal',\n 'high'\n );\n }",
"public function add_meta_boxes() {\n add_meta_box( 'wc-product-label-gallery', __( 'Label gallery', 'wc-label-gallery' ), array( $this, 'gallery_output' ), 'product', 'side', 'low' );\n }",
"function MetaBox()\n\t{\n\t\t\n\t\t// wordpress global\n\t\tglobal $post;\n\n\t\t// grab meta data, if it exists\n\t\t$tlsp_text = get_post_meta( $post->ID, 'tlsp_text', true );\n\n\t\t// use a nonce for verification\n\t\twp_nonce_field( plugin_basename(__FILE__), 'tlsp_noncename' );\n\t\t\n\t\t// this is the html for the metabox\n\t\t$security = 1;\n\t\tinclude( 'metabox-html.php' );\n\t\t$security = 0;\n\t\t\n\t}",
"function fumseck_pagemeta() {\n\t\n\t// Initialize\n\t\n\t$output = '';\n\tglobal $post;\n\t$post_id = $post->ID;\n\t\n\t\n\t// Get metadata for the page from WordPress\n\t\n\t$post_title = get_the_title($post_id);\n\t$post_permalink = get_permalink($post_id);\n\t\n\t$post_has_featured_image = has_post_thumbnail( $post_id );\n\t\n\tif( $post_has_featured_image ) {\n\t\t$post_featured_image_large = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large'); // [URL, w, h, resized?]\n\t};\n\t\n\t$post_summary = wp_strip_all_tags( get_field( '_summary', $post_id, true ));\n\t\n\t\n\tif ( ! $post_summary ) {\t\t// if no summary, try a manual excerpt\n\t\t$post_summary = $post->post_excerpt;\n\t};\t// TODO: do something if there's no manual excerpt either\n\n\t\n\t// Static metadata\n\t\n\t$output .= '<meta name=\"twitter:site\" content=\"@gpaumier\"><meta name=\"twitter:creator\" content=\"@gpaumier\">';\t\n\t$output .= '<meta name=\"twitter:domain\" content=\"guillaumepaumier.com\">';\t\n\t$output .= '<meta property=\"fb:admins\" content=\"710543474\" />';\n\t//$output .= '<meta property=\"fb:admins\" content=\"579323492087704\" />';\n\t$output .= '<meta property=\"article:author\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t$output .= '<meta property=\"article:publisher\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t\n\t$output .= '<meta property=\"og:type\" content=\"article\" />'; // TODO: be more specific\n\t\n\t// Common metadata\n\t\n\t$output .= '<meta property=\"og:site_name\" content=\"' . get_bloginfo( 'name' ) . '\"/>';\n\t\n\t$output .= '<meta name=\"twitter:title\" content=\"' . $post_title . '\">';\n\t$output .= '<meta property=\"og:title\" content=\"' . $post_title . '\"/>';\n\t\n\t\n\t$output .= '<meta property=\"og:url\" content=\"' . $post_permalink . '\" />';\n\t\n\t\n\t$output .= '<meta property=\"og:description\" content=\"' . $post_summary . '\" />';\n\t\n\t// TODO: add locale\n\t\n\tif ( get_post_format( $post_id ) === 'image' ) {\n\t\t\n\t\t$output .= '<meta name=\"twitter:card\" content=\"photo\">';\n\t\t$output .= '<meta name=\"twitter:image\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:width\" content=\"' . $post_featured_image_large[1] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:height\" content=\"' . $post_featured_image_large[2] . '\">';\n\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\n\t} else {\t// Not a photo\n\t\t\n\t\t$output .= '<meta name=\"twitter:description\" content=\"' . $post_summary . '\">';\n\t\t\n\t\tif( $post_has_featured_image ) {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary_large_image\">';\n\t\t\t$output .= '<meta name=\"twitter:image:src\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t\t$output .= '<meta property=\"og:image\" content=\"' . $post_featured_image_large[0] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary\">';\n\t\t}\n\t\t\n\t};\n\t\n\n\techo $output;\n}",
"public static function add_meta_boxes() {\n\t\tadd_meta_box( 'replycontextdiv', __( 'Use post to reply to other articles?', 'reply_context' ), array( 'ReplyContextPlugin', 'reply_context_meta_box' ) );\n\t}",
"function _display_gallery_meta( $post ) {\n\t\tinclude( 'includes/metaboxes/gallery.php' );\n\t}",
"private function updateMetas() {\n if( is_null($this->Metas) )\n $this->Metas = array();\n\n $this->Metas[0] = '<meta http-equiv=\"Content-Type\" content=\"' . $this->ContentType . '; charset=' . $this->Charset . '\" />';\n }",
"function page_attributes_meta_box($post)\n {\n }"
] | [
"0.6577897",
"0.6379991",
"0.6283517",
"0.62778354",
"0.62731653",
"0.6250863",
"0.6211844",
"0.62058085",
"0.619171",
"0.61892635",
"0.6163055",
"0.6161752",
"0.6149466",
"0.6132921",
"0.60884535",
"0.6076199",
"0.6075508",
"0.60625476",
"0.6004063",
"0.59992754",
"0.59895074",
"0.59895074",
"0.59842783",
"0.59775585",
"0.5973617",
"0.5968987",
"0.59685636",
"0.5967073",
"0.5964986",
"0.5958909",
"0.5946367",
"0.5943711",
"0.59308493",
"0.5927739",
"0.59277016",
"0.59242976",
"0.5922978",
"0.59174746",
"0.5905626",
"0.5902696",
"0.5896042",
"0.5888305",
"0.5885143",
"0.58818287",
"0.5880347",
"0.58659077",
"0.58611506",
"0.58489144",
"0.58460027",
"0.58310217",
"0.58294904",
"0.58249676",
"0.58238834",
"0.58127385",
"0.5811094",
"0.58092064",
"0.58049",
"0.58041894",
"0.58020294",
"0.58016366",
"0.5799775",
"0.5793938",
"0.5782624",
"0.57772666",
"0.576355",
"0.57596403",
"0.5757587",
"0.5747277",
"0.5746717",
"0.5744567",
"0.57415307",
"0.5735762",
"0.573122",
"0.5730687",
"0.572931",
"0.57246685",
"0.57101375",
"0.56942314",
"0.56940895",
"0.5689839",
"0.5688367",
"0.56868595",
"0.5683731",
"0.5683617",
"0.5683031",
"0.5680455",
"0.56687254",
"0.56674516",
"0.5659907",
"0.56585383",
"0.5657542",
"0.5656309",
"0.56537503",
"0.5652361",
"0.56505376",
"0.5650271",
"0.5647761",
"0.56441844",
"0.5641037",
"0.5638566",
"0.56376296"
] | 0.0 | -1 |
Creates meta box on all Posts and Pages | function os_selectfile_add_meta_box() {
//for general
add_meta_box('os_selectfile_meta_box', 'Select File', 'os_selectfile_meta_box_html', '', 'side');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function add_meta_box() {\n add_meta_box( \"CBMTheme\", \"CBM Theme Meta Box\", \"CBMAdmin::posts_page\" );\n }",
"public function add_meta_boxes()\n \t{\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('wp_plugin_template_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray($this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\t\t\t\t\n \t}",
"function tower_register_meta_boxes() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n $meta = $custom_type['meta'];\n add_meta_box(\n $meta['handle'],\n $meta['title'],\n $meta['callback'],\n $key\n );\n }\n}",
"public function registerMetaBoxes()\n\t {\n\t \t$dataMetas = self::getDataMetas();\n\n\t \tif ( !empty($dataMetas) ) {\n\t \t\tforeach ($dataMetas as $key => $meta) {\n\t \t\t\t/* CHECK IF HAS PAGES */\n\t \t\t\tif ( isset($meta[\"_pages\"]) && !empty($meta[\"_pages\"][0]) ) {\n\t \t\t\t\tself::createMetasPages($meta);\n\t \t\t\t}\n\n\t \t\t\t/* POSTS TYPES REGISTER METAS */\n\t \t\t\tif ( isset($meta[\"_posts_types\"]) && !empty($meta[\"_posts_types\"][0]) ) {\n\t \t\t\t\tself::createMetasPostTypes($meta);\n\t \t\t\t}\n\n\t \t\t\t/* CHECK IF ALL POSTS IS true */\n\t \t\t\tif ( isset($meta[\"_all_posts\"]) && $meta['_all_posts'] == 'yes' ) {\n\t \t\t\t\tself::createMetasPosts($meta);\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t }",
"public static function createMetaBox() {\r\n add_meta_box( \r\n \\WPDisablePage\\Setup::PLUGIN_ID, // Metabox ID\r\n \\WPDisablePage\\Setup::PLUGIN_NAME, // Metabox Name\r\n array( __CLASS__, 'createView' ), // Metabox Callback\r\n apply_filters( strtolower( \\WPDisablePage\\Setup::PLUGIN_ID ) . '__post_types', self::POST_TYPES ), // Metabox Post Types\r\n self::POSITION, // Metabox Position\r\n self::PRIORITY // Metabox Priority\r\n );\r\n }",
"function create_meta_box() {\n\tif ( function_exists('add_meta_box') ) {\n\t\tadd_meta_box( 'new-meta-boxes', '<div class=\"icon-small\"></div> '.PEXETO_THEMENAME.' PAGE SETTINGS', 'new_meta_boxes', 'page', 'normal', 'high' );\n\t}\n}",
"public function create_meta_box() {\n\t\tadd_meta_box( 'slider_meta', 'Example metabox', array( $this, 'slider_meta_fields_callback' ), [ 'Page', 'post' ] );\n\n\t}",
"public function add_meta_boxes()\n \t{\n\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('WP_Custom_Login_Profile_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray(&$this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\n\n \t}",
"public function add_meta_boxes() {\r\n\t\tadd_meta_box( 'zakra-page-setting', esc_html__( 'Page Settings', 'zakra' ), 'Zakra_Meta_Box_Page_Settings::render', array(\r\n\t\t\t'post',\r\n\t\t\t'page',\r\n\t\t) );\r\n\t}",
"function ilusix_my_custom_meta_box() {\n global $myMetaBoxPostTypes;\n\n foreach($myMetaBoxPostTypes as $postType) {\n add_meta_box(\n 'my_custom_meta_box_identifier' . '-' . $postType,\n 'Meta box title',\n 'ilusix_my_custom_meta_box_callback',\n $postType,\n 'normal',\n 'default'\n );\n }\n}",
"function create_meta_post_box() {\n\tif ( function_exists('add_meta_box') ) {\n\t\tadd_meta_box( 'new-meta-post-boxes', '<div class=\"icon-small\"></div> '.PEXETO_THEMENAME.' POST SETTINGS', 'new_meta_post_boxes', 'post', 'normal', 'high' );\n\t}\n}",
"Function Wp_meta_box_store(){\n\n\t$mult_posts = array( 'post', 'page' );\n\n\tforeach ($mult_posts as $mult_post) {\n\t\tadd_meta_box(\n\t\t\t'meta_box_id', \t\t\t\t\t# metabox id\n\t\t\t__('Author Bio', 'textdomain'),\t# Title \n\t\t\t'wp_meta_box_call_back_func_store', \t# Callback Function \n\t\t\t$mult_post, \t\t\t\t\t# Post Type\n\t\t\t'normal'\t\t\t\t\t\t# textcontent\n\t\t);\n\t}\n\t\n}",
"function agnosia_post_meta_boxes_setup() {\r\n\r\n\t\t/* Add meta boxes on the 'add_meta_boxes' hook. */\r\n\t\tadd_action( 'add_meta_boxes', 'agnosia_add_post_meta_boxes' );\r\n\r\n\t\t/* Save post meta on the 'save_post' hook. */\r\n\t\tadd_action( 'save_post', 'agnosia_save_post_meta', 10 , 2 );\r\n\r\n\t}",
"function rs_meta_box()\n{\n add_meta_box('rs_focus', 'Destaque na home', 'rs_focus', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post_region', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'event', 'side');\n}",
"public static function create_meta_box() {\n\t\t$content_types_array = self::_get_active_content_types();\n\t\tforeach ( $content_types_array as $content_type ) {\n\t\t\tadd_meta_box( 'custom-content-type-mgr-custom-fields'\n\t\t\t\t, __('Custom Fields', CCTM::txtdomain )\n\t\t\t\t, 'StandardizedCustomFields::print_custom_fields'\n\t\t\t\t, $content_type\n\t\t\t\t, 'normal'\n\t\t\t\t, 'high'\n\t\t\t\t, $content_type \n\t\t\t);\n\t\t}\n\t}",
"function toolbox_portfolio_meta_boxes_setup() {\n /* Add meta boxes on the 'add_meta_boxes' hook. */\n add_action( 'add_meta_boxes', 'toolbox_add_portfolio_meta_box' );\n\n /* Save post meta on the 'save_post' hook. */\n add_action( 'save_post', 'toolbox_portfolio_save_info', 10, 2 );\n}",
"public static function add_meta_box() {\n add_meta_box(\n 'link_meta', // Unique ID\n 'Properties', // Box title\n [self::class, 'meta_html'], // Content callback, must be of type callable\n \"link\" // Post type\n );\n }",
"public function register_meta_box() {\n\n\t\t\tadd_meta_box($this->slug, $this->options['title'], array($this, 'setup_meta_box'), $this->screen, $this->options['context'], $this->options['priority']);\n\t\t\tremove_meta_box('postcustom', $this->screen, 'normal');\n\t\t}",
"function create_meta_box() {\n\n\tglobal $postmetas;\n\t\n\tif(!isset($_GET['post_type']) OR empty($_GET['post_type']))\n\t{\n\t\tif(isset($_GET['post']) && !empty($_GET['post']))\n\t\t{\n\t\t\t$post_obj = get_post($_GET['post']);\n\t\t\t$_GET['post_type'] = $post_obj->post_type;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_GET['post_type'] = 'post';\n\t\t}\n\t}\n\t\n\tif ( function_exists('add_meta_box') && isset($postmetas) && count($postmetas) > 0 ) { \n\t\tforeach($postmetas as $key => $postmeta)\n\t\t{\n\t\t\tif($_GET['post_type']==$key)\n\t\t\t{\n\t\t\t\tadd_meta_box( 'metabox', ucfirst($key).' Options', 'new_meta_box', $key, 'side', 'high' ); \n\t\t\t}\n\t\t}\n\t}\n\n}",
"function mobile_kiosk_post_meta_boxes_setup() {\n\t// hook adding the meta boxes \n\tadd_action( 'add_meta_boxes', 'mobile_kiosk_add_post_meta_boxes' );\n\t\n\t// Hook saving the meta boxes\n\tadd_action('save_post', 'mobile_kiosk_save_post_meta_boxes', 10, 2);\n}",
"function add() {\n foreach ($this->_meta_box['pages'] as $page) {\n add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n }\n }",
"function add() {\n foreach ($this->_meta_box['pages'] as $page) {\n add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n }\n }",
"function add() {\n\t\tforeach ($this->_meta_box['pages'] as $page) {\n\t\t\tadd_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n\t\t}\n\t}",
"public function registerMetaBox() {\n\n add_meta_box(\n 'post-clone',\n 'Clone',\n array($this, 'buildForm'),\n self::$post_types,\n 'side',\n 'low');\n }",
"public function apb_add_meta_boxes() {\r\n\t}",
"function pavi_post_meta_boxes_setup() {\n add_action( 'add_meta_boxes', 'pavi_textarea_meta_boxes' );\n\n /* Save post meta on the 'save_post' hook. */\n add_action( 'save_post', 'pavi_save_post_class_meta', 10, 2 );\n}",
"public function register_meta_boxes()\n {\n }",
"function wck_settings_page_add_meta_boxes() {\r\n global $post;\r\n\t\tdo_action( 'add_meta_boxes', $this->hookname, $post );\r\n\t}",
"function m_custom_meta() {\r\n add_meta_box( 'sm_meta', __( 'Featured Posts', 'sm-textdomain' ), 'sm_meta_callback', 'post' );\r\n add_meta_box( 'mm_meta', __( 'Main Posts', 'sm-textdomain' ), 'mm_meta_callback', 'post' );\r\n\r\n}",
"function add_meta_box() {\n global $post;\n\n $post_types = get_post_types( array( 'public' => true ) );\n\n if ( !empty( $post ) ) {\n if ( $this->check_user_analytics_exist( $post ) ) {\n foreach ( $post_types as $post_type ) {\n add_meta_box( 'show_user_analytics', __( 'Post Author Analytics Info', 'wpuf-pro' ), array( $this, 'render_meta_box_content' ), $post_type, 'advanced', 'high' );\n }\n }\n }\n }",
"public function add_meta_boxes()\n {\n\n $this->_add_bitly_meta_box();\n\n }",
"function create_meta_box() {\r\r\n global $key;\r\r\n\r\r\n if( function_exists( 'add_meta_box' ) ) {\r\r\n add_meta_box( 'new-page-boxes', ' Page Options', 'page_meta_boxes', 'page', 'normal', 'high' );\r\r\n add_meta_box( 'new-portfolio-boxes', ' Portfolio Options', 'portfolio_meta_boxes', 'portfolio', 'normal', 'high' );\r\r\n add_meta_box( 'new-slideshow-boxes', ' Slideshow Options', 'slideshow_meta_boxes', 'slideshow', 'normal', 'high' );\r\r\n add_meta_box( 'new-post-boxes', ' Post Options', 'post_meta_boxes', 'post', 'normal', 'high' );\r\r\n }\r\r\n}",
"function add_meta_boxes()\n {\n }",
"function myplugin_add_meta_box()\r\n{\r\n\r\n $screens = array('dp_template');\r\n\r\n foreach ($screens as $screen) {\r\n\r\n add_meta_box(\r\n 'dp_template_id',\r\n __('My Post Section Title', DP_TEXTDOMAN),\r\n 'dp_template_meta_box_callback',\r\n $screen\r\n );\r\n }\r\n}",
"public function createMetasPages($meta)\n\t {\n\t \tif ( isset($_GET['post']) || isset($_POST['post_ID']) )\n\t\t \t$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];\n\t\t else\n\t\t \t$post_id = null;\n\n\t\t $nameMetaBox = '';\n\t\t $titleMetaBox = '';\n\t\t $noInputs = '';\n\t\t $noEditors = '';\n\t\t $imgFeatured = '';\n\t\t $videoFeatured = '';\n\t\t $documentFeatured = '';\n\t\t $gallery = '';\n\n\t\t if (isset($meta['_title_meta_box'])) {\n\t\t \t$titleMetaBox = $meta['_title_meta_box'];\n\t\t }\n\n\t\t if (isset($meta['_no_inputs'])) {\n\t\t \t$noInputs = $meta['_no_inputs'];\n\t\t }\n\t\t \t\n\t\t if (isset($meta['_no_editors'])) {\n\t\t \t$noEditors = $meta['_no_editors'];\n\t\t }\n\n\t\t if (isset($meta['_name_meta_box'])) {\n\t\t \t$nameMetaBox = $meta['_name_meta_box']; \t\n\t\t }\n\n\t\t if ( isset($meta['_img_featured']) && $meta['_img_featured'] == 'yes' ) {\n\t\t \t$imgFeatured = $meta['_img_featured']; \t\n\t\t }\n\n\t\t if ( isset($meta['_video_featured']) && $meta['_video_featured'] == 'yes' ) {\n\t\t \t$videoFeatured = $meta['_video_featured']; \t\n\t\t }\n\n\t\t if ( isset($meta['_document_featured']) && $meta['_document_featured'] == 'yes' ) {\n\t\t \t$documentFeatured = $meta['_document_featured']; \t\n\t\t }\n\n\t\t if ( isset($meta['_gallery']) && $meta['_gallery'] == 'yes' ) {\n\t\t \t$gallery = $meta['_gallery']; \t\n\t\t }\n\n\t\t foreach ($meta['_pages'] as $key => $value) {\n\t\t \t$createMeta = false;\n\t\t \tif ($post_id == $value) {\n\t\t \t\t$createMeta = true;\n\t\t \t} else if( $value == 'all' ) {\n\t\t \t\t$createMeta = true;\n\t\t \t}\n\n\t\t \tif ($createMeta) {\n\t\t \t\tself::addMetaBox($nameMetaBox, $titleMetaBox, 'page' , $noInputs, $noEditors, $imgFeatured, $videoFeatured, $documentFeatured, $gallery);\n\t\t \t}\n\t\t }\n\t }",
"function AP_Meta_Box_Setup() {\n\tadd_action('add_meta_boxes','AP_Meta_Box_Add');\n\n\tadd_action( 'save_post', 'AP_Meta_Box_Save', 10, 2 );\n}",
"private function add_meta_boxes() {\n\t\t$post_types = $this->post->get_types();\n\n\t\tforeach ( $post_types as $post_type => $value ) {\n\t\t\tadd_meta_box( 'subway_comment_metabox',\n\t\t\t\tesc_html__( 'Memberships Discussion', 'subway' ),\n\t\t\t\tfunction ( $post ) {\n\t\t\t\t\t$this->discussion( $post );\n\t\t\t\t},\n\t\t\t\t$post_type, 'side', 'high'\n\t\t\t);\n\t\t\tadd_meta_box( 'subway_visibility_metabox',\n\t\t\t\tesc_html__( 'Memberships Access', 'subway' ),\n\t\t\t\tfunction ( $post ) {\n\t\t\t\t\t$this->visibility( $post );\n\t\t\t\t},\n\t\t\t\t$post_type, 'side', 'high'\n\t\t\t);\n\t\t}\n\n\t}",
"public static function add_meta_box() {\n\t\tadd_meta_box( 'sponsor-meta', __( 'Sponsor Meta', self::$text_domain ), array( __CLASS__, 'do_meta_box' ), self::$post_type_name , 'normal', 'high' );\n\t}",
"private function initMetaBox(){\n\t\t$path = get_template_directory() . '/sub/customfield/';\n\t\tif(function_exists('of_get_option')){\n\t\t\tif(of_get_option('is-seo',true)){\n\t\t\t\tnew WPO_MetaBox(array(\n\t\t\t\t 'id' => 'wpo_seo',\n\t\t\t\t 'title' => $this->l('SEO Fields'),\n\t\t\t\t 'types' => array('page','portfolio','post','video'),\n\t\t\t\t 'priority' => 'high',\n\t\t\t\t 'template' => $path . 'seo.php',\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_template',\n\t\t 'title' => $this->l('Advanced Configuration'),\n\t\t 'types' => array('page'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'page-advanced.php'\n\t\t));\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_pageconfig',\n\t\t 'title' => $this->l('Page Configuration'),\n\t\t 'types' => array('page'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'page.php',\n\t\t));\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_post',\n\t\t 'title' => $this->l('Embed Options'),\n\t\t 'types' => array('post','video'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'post.php',\n\t\t));\n\t}",
"function mobile_kiosk_add_post_meta_boxes() {\n\t\n\t// Gallery Options\n\tadd_meta_box(\n\t\t'gallery-options',\n\t\tesc_html__( 'Gallery Options', 'gallery-options' ),\n\t\t'mobile_kiosk_gallery_options_meta_box', \n\t\t'kioskgallery', \n\t\t'normal', \n\t\t'high' \n\t);\n\t\n\t// Gallery Slides\n\tadd_meta_box(\n\t\t'gallery-slides',\n\t\tesc_html__( 'Gallery Slides', 'gallery-slides' ),\n\t\t'mobile_kiosk_gallery_slides_meta_box', \n\t\t'kioskgallery', \n\t\t'normal', \n\t\t'low' \n\t);\n\t\n}",
"public function add_meta_boxes() {\n\t\tadd_meta_box(\n\t\t\t$this->plugin_slug . '-post-metabox',\n\t\t\tesc_html__( 'Review Settings', $this->plugin_slug ),\n\t\t\tarray( $this, 'review_settings_view' ),\n\t\t\t'post',\n\t\t\t'normal',\n\t\t\t'core'\n \t \t);\n\t}",
"public function add_meta_boxes() {\n\t\t// Create the Slide Meta Boxes\n\t\tadd_meta_box( 'justart-slider-slide-settings-group', 'Slides', array( $this, 'create_slide_settings_meta_box' ), 'justart-slider', 'normal', 'default' );\n\t\tadd_filter( 'postbox_classes_justart-slider-slide-settings-group', array( $this, 'add_metabox_classes' ) );\n\t\t\n\t\t// Create the Shortcode Meta Box\n\t\tadd_meta_box( 'justart-slider-shortcode-group', 'Shortcode', array( $this, 'create_shortcode_meta_box' ), 'justart-slider', 'side', 'high' );\n\t\t\n\t\t// Create the Global Settings Meta Box\n\t\tadd_meta_box( 'justart-slider-global-settings-group', 'Global settings', array( $this, 'create_global_settings_meta_box' ), 'justart-slider', 'side', 'default' );\n\t}",
"function caviar_add_meta_box() {\n\n\t$screens = array('page' );\n\n\tforeach ( $screens as $screen ) {\n\n\t\tadd_meta_box(\n\t\t\t'caviar_sectionid',\n\t\t\tesc_html__( 'Caviar Metabox Field Example', 'caviar_textdomain' ),\n\t\t\t'caviar_meta_box_callback',\n\t\t\t$screen\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'caviar_2',\n\t\t\tesc_html__( 'Caviar Metabox 2', 'caviar_textdomain' ),\n\t\t\t'caviar_meta_box2_callback',\n\t\t\t$screen\n\t\t);\n\t}\n}",
"public function register_meta() {\r\n\t\t\tforeach($this->customFields as $customField){\r\n\t\t\t\tadd_meta_box( 'ecf-'.$customField['name'], __( $customField['title'], 'exlist' ), $customField['callback'], $postTypes , 'advanced', 'high', $type = array($customField['name'], $customField['title'], $customField['type']) );\r\n\t\t\t}\r\n }",
"function register_and_do_post_meta_boxes($post)\n {\n }",
"function add_post_meta_boxes() {\n\n\t\t\tadd_meta_box(\n\t\t\t\t'video-post', // Unique ID\n\t\t\t\tesc_html__( 'Video Post' ), // Title\n\t\t\t\tarray( 'VWvideoShare', 'post_meta_box'), // Callback function\n\t\t\t\t'video', // Admin page (or post type)\n\t\t\t\t'normal', // Context\n\t\t\t\t'high' // Priority\n\t\t\t);\n\t\t}",
"public function register_meta_box() {\r\n add_meta_box( self::POST_TYPE . '-meta', 'Downloadable Resource URL', array ($this, 'meta_box_html'), self::POST_TYPE, 'side', 'default', '');\r\n }",
"function pz_add_custom_meta_box()\n{\n add_meta_box(\n 'custom_meta_box',\n 'Custom Image Metabox',\n 'pz_custom_meta_box_callbacks',\n 'page', // page, post etc.\n 'normal',\n 'high');\n}",
"function ncl_post_meta_boxes_setup() {\n\n\t/* Add meta boxes on the 'add_meta_boxes' hook. */\n\tadd_action( 'add_meta_boxes', 'ncl_add_post_meta_boxes' );\n\n\t/* Save post meta on the 'save_post' hook. */\n\tadd_action( 'save_post', 'ncl_save_current_location_meta', 10, 2 );\n}",
"function registry_post_meta_boxes_setup() {\n\n /* Add meta boxes on the 'add_meta_boxes' hook. */\n add_action( 'add_meta_boxes', 'registry_add_post_meta_boxes', 1 );\n\n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_info_meta', 10, 2 );\n \n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_num_meta', 10, 2 );\n \n}",
"public function kiwip_add_meta_box(){\t\t\t\n\t\tadd_meta_box(\n\t\t\t$this->id,\n\t\t\t$this->title,\n\t\t\tarray(&$this, 'kiwip_metabox_callback'),\n\t\t\t$this->cpt_name,\n\t\t\t$this->context,\n\t\t\t$this->priority\n\t\t);\n\t}",
"function add_post_meta_box( ) {\n\t\t\tadd_meta_box('Course-Information', __( 'Course Information', $this->plugin_domain), array($this, 'setup_meta_english'), 'public-courses', 'normal', 'high');\n\t\t\tadd_meta_box('Arabic-Translations', __( 'Arabic Translations', $this->plugin_domain), array($this, 'setup_meta_translation'), 'public-courses', 'normal', 'high');\n\t\t\tadd_meta_box('Course-Dates', __( 'Course Dates', $this->plugin_domain), array($this, 'setup_meta_dates'), 'public-courses', 'normal', 'high');\n\t\t}",
"function pvplugin_add_meta_box() {\n\t\n\t$screens = array( 'policy' );\n\t\n\tforeach ( $screens as $screen ) {\n\t\n\t\tadd_meta_box(\n\t\t\t'myplugin_sectionid',\n\t\t\t__( 'Custom Meta Box', 'policy_library_plugin' ),\n\t\t\t array( &$this, 'pvplugin_meta_box_callback' ),\n\t\t\t$screen\n\t\t);\n\t\t\n\t\tadd_meta_box(\n\t\t\t'myplugin_side_sectionid',\n\t\t\t__( 'Policy Expire', 'policy_library_plugin' ),\n\t\t\t array( &$this, 'pvplugin_side_meta_box_callback' ),\n\t\t\t$screen,'side','high'\n\t\t);\n\t\t\n\t}\n\t}",
"function axiom_init_pagebuilder_meta_box(){\n // add custom sidebar metabox to following types\n $types = array('page', 'axi_product', 'portfolio', 'service', 'staff');\n \n foreach ($types as $key => $value) {\n add_meta_box(\"axiom_pagebuilder_metabox\", \n __(\"Smart Page Builder\", 'default'), \n \"axiom_display_pagebuilder_meta\", \n $value, \n \"normal\", \n \"high\");\n }\n \n // Save custom sidebar meta\n add_action('save_post', 'axiom_save_pagebuilder_data');\n \n}",
"public function meta_boxes() {\n\n\t\t// Add TEAM Assignemtns meta box into Team custom post type.\n\t\tadd_meta_box(\n\t\t\t'wpcd_team_detail',\n\t\t\t__( 'Team Assignments', 'wpcd' ),\n\t\t\tarray( $this, 'render_team_details_meta_box' ),\n\t\t\t'wpcd_team',\n\t\t\t'advanced',\n\t\t\t'low'\n\t\t);\n\n\t}",
"function clonemaker_add_meta_box(){\r\n add_meta_box(\r\n 'clonemaker',\r\n 'Clone a Page',\r\n 'add_post_list',\r\n 'page',\r\n 'side'\r\n );\r\n\r\n\r\n}",
"function pg_add_custom_box() {\r\n\tif( function_exists( 'add_meta_box' )) {\r\n\t\tadd_meta_box( 'pg_custom_box_1', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'page', 'normal', 'high' );\r\n\t\tadd_meta_box( 'pg_custom_box_2', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'post', 'normal', 'high' );\r\n\t}\r\n}",
"public static function registerMetaBoxes() {}",
"function liblynx_add_meta_box()\n{\n $screens = array('post', 'page');\n\n foreach ($screens as $screen) {\n add_meta_box(\n 'liblynx_metabox',\n __('LibLynx Connect', 'liblynx_metabox'),\n 'liblynx_meta_box_callback',\n $screen\n );\n }\n}",
"function coolRahulSoni_meta_box_add()\n{\n add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );\n}",
"function fzproject_meta_box()\n{\n add_meta_box('fzproject_meta_box', 'New portfolio item', 'display_fzproject_meta_box', 'fzproject_post', 'normal', 'high');\n}",
"function df_meta_boxes( ) {\n\t\tglobal $post, $df_box_objects;\n\t\tforeach( $df_box_objects as $df_box ) {\n\t\t\t\n\t\t\t//Get current post type. If is a revision - get parent post type.\n\t\t\t$post_type = get_post_type( $post->ID );\n\t\t\tif( $post_type == 'revision' ) {\n\t\t\t\tglobal $post;\n\t\t\t\t$post_type = get_post_type( $post->post_parent );\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif( in_array( $post_type, $df_box->post_types ) ) :\n\t\t\t\tforeach( $df_box->post_types as $post_type ) {\n\t\t\t\t\tadd_meta_box( $df_box->id . \"_box\", $df_box->title, 'df_meta_fields', $post_type, 'side', 'low', $df_box );\n\t\t\t\t}\n\t\t\tendif;\n\t\t}\n\t}",
"public function add_meta_boxes()\n {\n /* Author Name */\n add_meta_box(\n 'testimonial_options',\n 'Testimonial Options',\n array ( $this , 'render_features_box'),\n 'testimonial',\n 'side',\n 'default'\n );\n /* Author email */\n /* approved [checkbox] */\n /* featured [checkbox] */\n }",
"function master_sidebar_post_type_meta_boxes() {\n\t\n\t$post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' );\n\t$admin_page_name = 'appearance_page_custom_theme_sidebars';\n\n\tif ( ! $post_types ) {\n\t\treturn;\n\t}\n\n\t// Add metabox for each posttype\n\tforeach ( $post_types as $post_type ) {\n\t\t$post_type = apply_filters( 'master_sidebar_meta_box_object', $post_type );\n\t\tif ( $post_type ) {\n\t\t\t$id = $post_type->name;\n\t\t\tadd_meta_box( \n\t\t\t\t\"master-add-{$id}\", \n\t\t\t\t$post_type->labels->name, \n\t\t\t\t'master_sidebar_item_post_type_meta_box', \n\t\t\t\t$admin_page_name, \n\t\t\t\t'side', \n\t\t\t\t'default', \n\t\t\t\t$post_type \n\t\t\t);\n\t\t}\n\t}\n}",
"function add_meta_box() {\t\t\n\t\t\t/* Gets available public post types. */\n\t\t\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\t\t\t\n\t\t\t$post_types = apply_filters( 'remove_youtube_white_label_meta_box', $post_types );\n\t\t\t\n\t\t\t/* For each available post type, create a meta box on its edit page if it supports '$prefix-post-settings'. */\n\t\t\tforeach ( $post_types as $type ) {\n\t\t\t\t/* Add the meta box. */\n\t\t\t\tadd_meta_box( self::DOMAIN . \"-{$type->name}-meta-box\", __( 'YouTube Embed Shortcode Creator (does not save meta)', self::DOMAIN ), array( $this, 'meta_box' ), $type->name, 'side', 'default' );\n\t\t\t}\n\t\t}",
"function add_meta_boxes($post_type, $post)\n {\n }",
"function _sp_custom_meta_boxes() {\n\t$post_id = ( isset( $_GET['post'] ) ) ? $_GET['post'] : ( isset( $_POST['post_ID'] ) ? $_POST['post_ID'] : '');\n\n\t$template_file = get_post_meta( $post_id, '_wp_page_template', TRUE );\n\n\t/////////////////////////////////////////////////////\n\t// portfolio sort position\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'portfolio-sort-position',\n\t\t__( 'Sort Position', 'sp-theme' ),\n\t\t'_sp_custom_box_portfolio_sort_position',\n\t\t'sp-portfolio',\n\t\t'side',\n\t\t'low' \n\t);\n\n\t/////////////////////////////////////////////////////\n\t// slider carousel shortcode\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'carousel-shortcode',\n\t\t__( 'Carousel Shortcode', 'sp-theme' ),\n\t\t'_sp_custom_box_carousel_shortcode',\n\t\t'sp-slider',\n\t\t'side',\n\t\t'low' \n\t);\n\n\t/////////////////////////////////////////////////////\n\t// wpautop post\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_auto_formatting_post',\n\t\t__( 'Auto Content Formating', 'sp-theme' ),\n\t\t'_sp_custom_box_wpautop',\n\t\t'post',\n\t\t'side',\n\t\t'low' \n\t);\n\n\t/////////////////////////////////////////////////////\n\t// wpautop page\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_auto_formatting_page',\n\t\t__( 'Auto Content Formating', 'sp-theme' ), \n\t\t'_sp_custom_box_wpautop',\n\t\t'page',\n\t\t'side',\n\t\t'low'\n\t);\t\n\n\t/////////////////////////////////////////////////////\n\t// wpatup portfolio\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_auto_formatting_portfolio',\n\t\t__( 'Auto Content Formating', 'sp-theme' ), \n\t\t'_sp_custom_box_wpautop',\n\t\t'sp-portfolio',\n\t\t'side',\n\t\t'low'\n\t);\t\n\n\t/////////////////////////////////////////////////////\n\t// custom page layout page\n\t/////////////////////////////////////////////////////\n\t// don't show on maintenance page\n\tif ( $template_file !== 'maintenance-page.php' ) {\n\t\tadd_meta_box(\n\t\t\t'sp_page_layout',\n\t\t\t__( 'Custom Sidebar Layout', 'sp-theme' ), \n\t\t\t'_sp_custom_box_layout',\n\t\t\t'page',\n\t\t\t'side',\n\t\t\t'low'\n\t\t);\t\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// custom page layout post\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_post_layout',\n\t\t__( 'Custom Sidebar Layout', 'sp-theme' ), \n\t\t'_sp_custom_box_layout',\n\t\t'post',\n\t\t'side',\n\t\t'low'\n\t);\t\n\n\t/////////////////////////////////////////////////////\n\t// custom page layout portfolio\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_portfolio_layout',\n\t\t__( 'Custom Sidebar Layout', 'sp-theme' ), \n\t\t'_sp_custom_box_layout',\n\t\t'sp-portfolio',\n\t\t'side',\n\t\t'low'\n\t);\n\n\t/////////////////////////////////////////////////////\n\t// custom page layout product\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_product_layout',\n\t\t__( 'Custom Sidebar Layout', 'sp-theme' ), \n\t\t'_sp_custom_box_layout',\n\t\t'product',\n\t\t'side',\n\t\t'low'\n\t);\n\n\t// check if SEO enabled\n\tif ( sp_get_option( 'seo_enable', 'is', 'on' ) || ! sp_get_option( 'seo_enable', 'isset' ) ) {\n\n\t\t/////////////////////////////////////////////////////\n\t\t// seo post\n\t\t/////////////////////////////////////////////////////\n\t\tadd_meta_box(\n\t\t\t'sp_seo_settings',\n\t\t\t__( 'Seo Settings', 'sp-theme' ),\n\t\t\t'_sp_custom_box_seo_settings',\n\t\t\t'post'\n\t\t);\n\n\t\t/////////////////////////////////////////////////////\n\t\t// seo page\n\t\t/////////////////////////////////////////////////////\n\t\t// don't show on maintenance page\n\t\tif ( $template_file !== 'maintenance-page.php' ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'sp_seo_settings',\n\t\t\t\t__( 'Seo Settings', 'sp-theme' ),\n\t\t\t\t'_sp_custom_box_seo_settings',\n\t\t\t\t'page'\n\t\t\t);\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// seo woo product\n\t\t/////////////////////////////////////////////////////\n\t\tadd_meta_box(\n\t\t\t'sp_seo_settings',\n\t\t\t__( 'Seo Settings', 'sp-theme' ),\n\t\t\t'_sp_custom_box_seo_settings',\n\t\t\t'product'\n\t\t);\n\n\t\t/////////////////////////////////////////////////////\n\t\t// seo portfolio\n\t\t/////////////////////////////////////////////////////\n\t\tadd_meta_box(\n\t\t\t'sp_seo_settings',\n\t\t\t__( 'Seo Settings', 'sp-theme' ),\n\t\t\t'_sp_custom_box_seo_settings',\n\t\t\t'sp-portfolio'\n\t\t);\n\t}\n\t\n\t/////////////////////////////////////////////////////\n\t// testimonial submitter\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_testimonial_submitter',\n\t\t__( 'Testimonial Submitter', 'sp-theme' ),\n\t\t'_sp_custom_box_testimonial_settings',\n\t\t'sp-testimonial',\n\t\t'side',\n\t\t'core'\n\t); \n\n\t/////////////////////////////////////////////////////\n\t// advanced page options\n\t/////////////////////////////////////////////////////\n\t// don't show on maintenance page\n\tif ( $template_file !== 'maintenance-page.php' ) {\t\n\t\tadd_meta_box(\n\t\t\t'sp_advanced_page_options',\n\t\t\t__( 'Advanced Options', 'sp-theme' ),\n\t\t\t'_sp_custom_box_advanced_page_options',\n\t\t\t'page'\n\t\t);\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// advanced post options\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_advanced_post_options',\n\t\t__( 'Advanced Options', 'sp-theme' ),\n\t\t'_sp_custom_box_advanced_page_options',\n\t\t'post'\n\t);\n\n\t/////////////////////////////////////////////////////\n\t// advanced portfolio options\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_advanced_portfolio_options',\n\t\t__( 'Advanced Options', 'sp-theme' ),\n\t\t'_sp_custom_box_advanced_page_options',\n\t\t'sp-portfolio'\n\t);\n\n\t/////////////////////////////////////////////////////\n\t// advanced woo product options\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_advanced_woo_product_options',\n\t\t__( 'Advanced Options', 'sp-theme' ),\n\t\t'_sp_custom_box_advanced_page_options',\n\t\t'product'\n\t);\n\n\t/////////////////////////////////////////////////////\n\t// contact form shortcode\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'contact-form-shortcode',\n\t\t__( 'Contact Form Shortcode', 'sp-theme' ),\n\t\t'_sp_custom_box_contact_form_shortcode',\n\t\t'sp-contact-form',\n\t\t'side',\n\t\t'low' \n\t);\n\n\t/////////////////////////////////////////////////////\n\t// contact form general settings\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'contact-form-settings',\n\t\t__( 'Contact Form Settings', 'sp-theme' ),\n\t\t'_sp_custom_box_contact_form_settings',\n\t\t'sp-contact-form',\n\t\t'normal',\n\t\t'high'\n\t);\n\t\n\t/////////////////////////////////////////////////////\n\t// contact form content\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'contact-form-content',\n\t\t__( 'Contact Form Content', 'sp-theme' ),\n\t\t'_sp_custom_box_contact_form_content',\n\t\t'sp-contact-form',\n\t\t'normal',\n\t\t'high'\n\t); \n\n\t/////////////////////////////////////////////////////\n\t// contact form messages\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'contact-form-messages',\n\t\t__( 'Contact Form Messages', 'sp-theme' ),\n\t\t'_sp_custom_box_contact_form_messages',\n\t\t'sp-contact-form',\n\t\t'normal',\n\t\t'high'\n\t);\n\n\t/////////////////////////////////////////////////////\n\t// page builder page\n\t/////////////////////////////////////////////////////\n\t// don't show on maintenance page\n\tif ( $template_file !== 'maintenance-page.php' ) {\t\n\t\tadd_meta_box(\n\t\t\t'page-builder',\n\t\t\t__( 'Page Builder', 'sp-theme' ),\n\t\t\t'_sp_custom_box_page_builder',\n\t\t\t'page',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// alternate product image on hover\n\t/////////////////////////////////////////////////////\n\t/*\n\tadd_meta_box(\n\t\t'sp_alternate_product_image',\n\t\t__( 'Alternate Product Image', 'sp-theme' ),\n\t\t'_sp_custom_box_alternate_product_image',\n\t\t'product',\n\t\t'side',\n\t\t'low' \n\t);\n\t*/\n\n\t/////////////////////////////////////////////////////\n\t// custom product tabs\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_custom_product_tabs',\n\t\t__( 'Product Tabs Option', 'sp-theme' ),\n\t\t'_sp_custom_product_tabs',\n\t\t'product',\n\t\t'normal',\n\t\t'low' \n\t);\n\n\t/////////////////////////////////////////////////////\n\t// featured video post\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_featured_video',\n\t\t__( 'Featured Video', 'sp-theme' ), \n\t\t'_sp_custom_box_featured_video',\n\t\t'post',\n\t\t'side',\n\t\t'low'\n\t);\t\n\n\t/////////////////////////////////////////////////////\n\t// faq sort order\n\t/////////////////////////////////////////////////////\n\tadd_meta_box(\n\t\t'sp_faq_order',\n\t\t__( 'Sort Order', 'sp-theme' ), \n\t\t'_sp_custom_box_faq_order',\n\t\t'sp-faq',\n\t\t'side',\n\t\t'low'\n\t);\t\n\n\treturn true;\n}",
"public function setup_meta_box($post) {\n\t\t\t\n\t\t\t$build = new Build($post->ID, $this->slug, $this->options);\n\t\t\t$build->build_meta_box();\n\t\t}",
"function buildCustomPostWidgets()\n {\n // add_meta_box( $id, $title, $callback, $screen, $context, $priority, $callback_args );\n add_meta_box( 'cover_image_meta_box', 'Add an Image', array($this,'selectImageMetaBox'), 'playscripts', 'normal', 'high' );\n add_meta_box( 'cover_sound_meta_box', 'Add a Sound', array($this,'selectSoundMetaBox'), 'playscripts', 'normal', 'high' );\n }",
"function wtfdivi099_add_meta_boxes() {\r\n\tforeach(get_post_types() as $pt) {\r\n\t\tif (post_type_supports($pt, 'editor') and function_exists('et_single_settings_meta_box')) {\r\n\t\t\tadd_meta_box('et_settings_meta_box', __('Divi Custom Post Settings', 'Divi'), 'et_single_settings_meta_box', $pt, 'side', 'high');\r\n\t\t}\r\n\t} \r\n}",
"function meta_boxes() {\n\t\tadd_meta_box( 'event-details', 'Event Details', array( $this , 'details_box' ), 'event', 'normal', 'high' );\n\t}",
"function testimonials_meta_boxes() {\n\tadd_meta_box( 'testimonials_form', 'testimonials', 'normal', 'high' );\n}",
"function add_your_fields_meta_box(){\r\nadd_meta_box(\r\n'your_fields_meta_box',// $id\r\n'Auteur',// $title\r\n'show_your_fields_meta_box',// $callback\r\n'Livre',// $screen\r\n'normal',// $context\r\n'high'// $priority\r\n);\r\n}",
"function add_press_metaboxes() {\n\tadd_meta_box('wpt_press_link', 'Relevant link', 'wpt_press_link', 'press', 'normal', 'default');\n\tadd_meta_box('wpt_press_date', 'Publication date', 'wpt_press_date', 'press', 'normal', 'default');\n\tadd_meta_box('wpt_press_type', 'Publication type', 'wpt_press_type', 'press', 'side', 'default');\n \n}",
"function sr_add_meta_pagebuilder() { \n add_meta_box( \n 'meta_pagebuilder', // $id \n __('Pagebuilder', 'sr_avoc_theme'), // $title \n 'sr_show_meta_pagebuilder', // $callback \n 'page', // $page \n 'normal', // $context \n 'high'); // $priority\n\t\t\n\tadd_meta_box( \n 'meta_pagebuilder', // $id \n __('Pagebuilder', 'sr_avoc_theme'), // $title \n 'sr_show_meta_pagebuilder', // $callback \n 'portfolio', // $page \n 'normal', // $context \n 'high'); // $priority\t\t\n}",
"final public function add_meta_boxes()\n {\n foreach ((array)$this->GetHooks() as $hook) :\n if (!$hook['edit']) {\n continue;\n }\n foreach ((array)$hook['permalink'] as $post_type) :\n remove_meta_box('tagsdiv-' . $this->Archive, $post_type, 'side');\n remove_meta_box($this->Archive . 'div', $post_type, 'side');\n endforeach;\n endforeach;\n }",
"public function add_meta_box() {\n\t\tadd_meta_box(\n\t\t\t 'related_posts_meta_box'\n\t\t\t,__( 'Related Posts', self::LANG )\n\t\t\t,array( &$this, 'render_meta_box_content' )\n\t\t\t,'post'\n\t\t\t,'advanced'\n\t\t\t,'high'\n\t\t);\n\t}",
"public static function register_meta_boxes() {\n // Get meta boxes to register.\n $meta_boxes = apply_filters( 'rwmb_meta_boxes', array() );\n\n\n if ( is_array( $meta_boxes ) ) {\n // Load all custom fields.\n static $loaded;\n\n if ( ! isset( $loaded ) ) {\n foreach ( glob( implode( '/', array_slice( explode( '/', str_replace( '\\\\', '/', __FILE__ ) ), 0, -1 ) ) . '/fields/*.php' ) as $file ) {\n include_once $file;\n }\n\n $loaded = true;\n }\n\n // Instantiate all meta boxes.\n foreach ( $meta_boxes as $meta_box ) {\n $meta_box = new self( $meta_box );\n }\n }\n }",
"function bnk_create_slide_metabox() {\r\n\tglobal $slide_meta;\r\n \r\n\tadd_meta_box($slide_meta['id'], $slide_meta['title'], 'bnk_build_slide_metabox', $slide_meta['page'], $slide_meta['context'], $slide_meta['priority']);\r\n}",
"public function add_meta_boxes() {\n\t\t// init tooltips here since at this time the meta-box pre-registration is done,\n\t\t// we already know the current screen and the 'condition()' has been checked\n\t\t$this->init_tooltips();\n\n\t\t// Avoid appearance own meta fields on the standard Custom Fields metabox.\n\t\tadd_filter( 'is_protected_meta', array( $this, 'is_protected_meta' ), 10, 2 );\n\t}",
"public static function add_simple_social_meta_meta_box() {\n\n\t\t/* Get all available public post types. */\n\t\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\n\t\t/* Loop through each post type, adding the meta box for each type's post editor screen. */\n\t\tforeach ( $post_types as $type )\n\t\t\tadd_meta_box( 'simple-social-meta-data', sprintf( __( 'Social Meta', SIMPLE_SOCIAL_META::$text_domain ), $type->labels->singular_name ), __CLASS__ . '::simple_social_meta_meta_box_display', $type->name, 'normal', 'high' );\n\t}",
"function sp_add_custom_box() {\n\tif( function_exists( 'add_meta_box' )) {\n\t\tadd_meta_box( 'sp_custom_box_1', __( 'General Property Info', 'sp' ), 'sp_inner_custom_box_1', 'post', 'normal', 'high' );\n\t\tadd_meta_box( 'sp_custom_box_2', __( 'Property Details', 'sp' ), 'sp_inner_custom_box_2', 'post', 'normal', 'high' );\n\t\tadd_meta_box( 'sp_custom_box_3', __( 'Property Photos', 'sp' ), 'sp_inner_custom_box_3', 'post', 'normal', 'high' );\n\t}\n}",
"public function add_meta_boxes() {\n\t\t\t// Address\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_address', \n\t\t\t\t'Adresse',\n\t\t\t\tarray( $this, 'meta_box_address' ),\n\t\t\t\t'wpmeetups', 'side', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Location\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_location', \n\t\t\t\t'Location',\n\t\t\t\tarray( $this, 'meta_box_location' ),\n\t\t\t\t'wpmeetups', 'side', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Geodata\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_geodata', \n\t\t\t\t'Geodaten',\n\t\t\t\tarray( $this, 'meta_box_geodata' ),\n\t\t\t\t'wpmeetups', 'side', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Date\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_dates', \n\t\t\t\t'Datum und Zeit der Meetups',\n\t\t\t\tarray( $this, 'meta_box_date' ),\n\t\t\t\t'wpmeetups', 'advanced', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Gallery\n\t\t\tadd_meta_box(\n\t\t\t\t'meetup_gallery',\n\t\t\t\t'Gallerie',\n\t\t\t\tarray( $this, 'meta_box_gallery' ),\n\t\t\t\t'wpmeetups', 'advanced', 'default'\n\t\t\t);\n\t\t}",
"function quiz_add_meta_boxes( $post ){\n\tadd_meta_box( 'quiz_meta_box', __( 'Quiz settings', 'random-timed-quiz' ), 'build_meta_box', 'random-timed-quiz', 'normal', 'high' );\t\n}",
"function greater_jackson_habitat_add_page_metaboxes() {\n\t\n\tglobal $post;\n\t\n\t// Each page except the Home Page\n\tif ( greater_jackson_habitat_is_editing_home() ) return;\n\t\n\tif ( get_post_meta( $post->ID, '_wp_page_template', true ) !== 'page-templates/about.php' ) {\n\t\n\t\tadd_meta_box(\n\t\t\t'gjh-subtitle',\n\t\t\t__( 'Subtitle', 'greater-jackson-habitat-theme' ),\n\t\t\t'greater_jackson_habitat_subtitle_metabox_content',\n\t\t\t'page',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\t\t\n\t}\n\t\n\t/*\n\t\n\tadd_meta_box(\n\t\t'gjh-extra-meta',\n\t\t__( 'Extra Section', 'greater-jackson-habitat-theme' ),\n\t\t'greater_jackson_habitat_extra_metabox_content',\n\t\t'page',\n\t\t'normal',\n\t\t'low'\n\t);\n\t\n\t*/\n \n}",
"function add_custom_meta_box() { \nglobal $post, $post_type;\n\n\t// specific template\n\t//if('page-templatename.php' == get_post_meta($post->ID, '_wp_page_template', true)) {\n \tadd_meta_box( \n \t'custom_meta_box', // $id \n\t\t\t'More Stuff!', // $title \n\t\t\t'show_custom_meta_box', // $callback \n\t\t\t'post', // $page \n\t\t\t'normal', // $context \n\t\t\t'high'\n\t\t); // $priority \n\t//}\n\t\n\t//specific post-type\n\t/*if('custom post type' == $post_type) {\n \tadd_meta_box( \n \t'custom_meta_box', // $id \n\t\t\t'Options', // $title \n\t\t\t'show_custom_meta_box', // $callback \n\t\t\t'custom post type', // $page \n\t\t\t'normal', // $context \n\t\t\t'high'\n\t\t); // $priority \n\t}*/\n}",
"function post_meta_boxes_setup() {\n\t\t\t/* Add meta boxes on the 'add_meta_boxes' hook. */\n\t\t\tadd_action( 'add_meta_boxes', array( 'VWvideoShare', 'add_post_meta_boxes' ) );\n\n\t\t\t/* Save post meta on the 'save_post' hook. */\n\t\t\tadd_action( 'save_post', array( 'VWvideoShare', 'save_post_meta'), 10, 2 );\n\t\t}",
"public function add_meta_box(){\n\t\t\n\t\t/**\n\t\t * Includes our array of post types\n\t\t */\n\t\tinclude( 'q-and-a-post-types.php' );\n\t\t\n\t\tforeach ( $q_and_a_post_types as $post_type ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'q-and-a',\n\t\t\t\t'Questions and Answers',\n\t\t\t\tarray( $this, 'display_meta_box' ),\n\t\t\t\t$post_type, \n\t\t\t\t'normal',\n\t\t\t\t'default'\n\t\t\t);\n\t\t}\n\t}",
"function idem_pop_up_add_meta_box()\n{\n add_meta_box(\n 'idem-pop-up-meta-box', // id, used as the html id att\n __( 'Idem Pop Up' ), // meta box title, like \"Page Attributes\"\n 'idem_pop_up_meta_box_cb', // callback function, spits out the content\n 'page', // post type or page. We'll add this to pages only\n 'side', // context (where on the screen)\n 'high' // priority, where should this go in the context?\n );\n}",
"function bluewhale_meta_box_setup() {\n add_action('add_meta_boxes', 'bluewhale_meta_box');\n\n /* Adds Save meta box function to 'save post meta' hook */\n add_action('save_post', 'bluewhale_save_meta', 10, 2);\n}",
"public function add_meta_boxes() {\n\t\tforeach ( $this->screens as $screen ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'scheduled-course-settings',\n\t\t\t\t__( 'Scheduled Course Settings', 'Scheduled Course' ),\n\t\t\t\tarray( $this, 'add_meta_box_callback' ),\n\t\t\t\t$screen,\n\t\t\t\t'advanced',\n\t\t\t\t'default'\n\t\t\t);\n\t\t}\n\t}",
"function post_meta_boxes_setup() {\n\n\t\tadd_action( 'add_meta_boxes', array($this, 'add_post_meta_boxes') );\n\t}",
"public function add_meta_boxes() {\n\t\tforeach ( $this->screens as $screen ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'event-settings',\n\t\t\t\t__( 'Event Settings', 'lps_wp' ),\n\t\t\t\tarray( $this, 'add_meta_box_callback' ),\n\t\t\t\t$screen,\n\t\t\t\t'advanced',\n\t\t\t\t'default'\n\t\t\t);\n\t\t}\n\t}",
"public function setup_meta_box() {\n\t\t\tadd_meta_box( 'add-shortcode-section', __( 'Shortcode', IFLANG ), array( $this, 'meta_box' ), 'nav-menus', 'side', 'high' );\n\t\t}",
"function ncl_add_post_meta_boxes() {\n\t$post_types = get_post_types();\n\tforeach ( $post_types as $post_type ) {\n\t\tadd_meta_box( 'ncl-current-location', 'Current Location', 'ncl_current_location_meta_box', $post_type, 'side', 'default' );\n\t}\n}",
"function moutheme_register_meta_boxes()\n{\n\tglobal $meta_boxes;\n\n\t// Make sure there's no errors when the plugin is deactivated or during upgrade\n\tif ( class_exists( 'RW_Meta_Box' ) ) {\n\t\tforeach ( $meta_boxes as $meta_box ) {\n\t\t\tnew RW_Meta_Box( $meta_box );\n\t\t}\n\t}\n}",
"function myplugin_add_custom_box() {\n\t\t add_meta_box( \n\t\t 'myplugin_sectionid',\n\t\t __( 'My Post Section Title', 'myplugin_textdomain' ),\n\t\t 'myplugin_inner_custom_box',\n\t\t 'wpflexslider' \n\t\t );\n\t\t add_meta_box(\n\t\t 'myplugin_sectionid',\n\t\t __( 'My Post Section Title', 'myplugin_textdomain' ), \n\t\t 'myplugin_inner_custom_box',\n\t\t 'page'\n\t\t );\n\t\t add_meta_box('wpt_events_location', 'Event Location', 'wpt_events_location', 'events', 'side', 'default');\n\t\t}",
"public function addCustomBox() {\n add_meta_box( \n $this->post_type . '_meta',\n __( self::getLabel($this->post_type) . ' Meta', $this->post_type . '_meta' ),\n array($this, 'innerCustomBox'),\n $this->post_type,\n $this->fields_location, \n $this->fields_priority\n ); \n }",
"function embedpage_add_meta_box() {\n $screens = ['post', 'page'];\n foreach ($screens as $screen) {\n add_meta_box(\n 'embedpage_code', // Unique ID\n __('Code to embed this content', 'embedpage'), // Box title\n 'embedpage_meta_box_content', // Content callback, must be of type callable\n $screen // Post type\n );\n }\n}",
"public function register_meta_box( $post ) {\n\t\tadd_meta_box(\n\t\t\t$this->meta_box['id'],\n\t\t\t$this->meta_box['title'],\n\t\t\t[$this, 'render_meta_box'],\n\t\t\t$this->post_type,\n\t\t\t$this->meta_box['context'],\n\t\t\t$this->meta_box['priority']\n\t\t);\n\t}",
"function pexeto_load_meta_boxes(){\n\t$portf_taxonomies=get_terms('portfolio_category', array('hierarchical'=>true, 'hide_empty'=>0));\n\t$portf_categories=array(array('id'=>'-1', 'name'=>'All Portfolio Categories'));\n\n\tforeach($portf_taxonomies as $taxonomy){\n\t\t$portf_categories[]=array(\"name\"=>$taxonomy->name, \"id\"=>$taxonomy->term_id);\n\t}\n\t$loader_portf_categories=array_merge(array(array('id'=>'hide','name'=>'Hide'), (array('id'=>'disabled','name'=>'Show:'))), $portf_categories);\n\n\t//load the post categeories\n\t$categories=get_categories('hide_empty=0');\n\t$pexeto_categories=array(array('id'=>'-1', 'name'=>'All Categories'));\n\tfor($i=0; $i<sizeof($categories); $i++){\n\t\t$pexeto_categories[]=array('id'=>$categories[$i]->cat_ID, 'name'=>$categories[$i]->cat_name);\n\t}\n\t\n\tglobal $pexeto_data, $new_meta_boxes, $new_meta_portfolio_boxes, $new_meta_post_boxes;\n\t\n\t$sliders=pexeto_get_created_sliders();\n\n\t/* ------------------------------------------------------------------------*\n\t * META BOXES FOR THE PAGES\n\t * ------------------------------------------------------------------------*/\n\n\t//the meta data for pages\n\t$new_meta_boxes =\n\tarray(\n\n\tarray(\n\t\t\"title\" => '<div class=\"ui-icon ui-icon-wrench\"></div>General Page Settings',\n\t\t\"type\" => \"heading\"),\n\n\tarray(\n\t\t\"title\" => \"Header\",\n\t\t\"name\" => \"slider\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => $sliders,\n\t\t\"std\" => 'none'\n\t\t),\n\n\t\tarray(\n\t\t\"title\" => \"Page Layout\",\n\t\t\"name\" => \"layout\",\n\t\t\"type\" => \"imageradio\",\n\t\t\"options\" => array(array(\"img\"=>PEXETO_IMAGES_URL.'layout-right-sidebar.png', \"id\"=>\"right\", \"title\"=>\"Right Sidebar Layout\"),\n\t\tarray(\"img\"=>PEXETO_IMAGES_URL.'layout-left-sidebar.png', \"id\"=>\"left\", \"title\"=>\"Left Sidebar Layout\"),\n\t\tarray(\"img\"=>PEXETO_IMAGES_URL.'layout-full-width.png', \"id\"=>\"full\", \"title\"=>\"Full Width Layout\")),\n\t\t\"std\" => 'right',\n\t\t\"description\" => 'Available for Default, Featured Posts and Contact page templates'\n\t\t),\n\n\t\tarray(\n\t\t\"name\" => \"sidebar\",\n\t\t\"title\" => \"Sidebar\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => $pexeto_data->pexeto_sidebars,\n\t\t\"description\" => 'You can select a sidebar for this page between the default one and another one that\n\t\tyou have created. If you would like to use another sidebar, rather than the default one, you can\n\t\tcreate a new sidebar in \"'.PEXETO_THEMENAME.' Options->Sidebars\" section and after that you will be able to select the\n\t\tsidebar here.'),\n\t\t\n\t\tarray(\n\t\t\"name\" => \"show_title\",\n\t\t\"title\" => \"Display Page Title\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array(array(\"name\"=>\"Use Global Settings\", \"id\"=>\"global\"),\n\t\tarray(\"name\"=>\"Display\", \"id\"=>\"on\"),\n\t\tarray(\"name\"=>\"Hide\", \"id\"=>\"off\")),\n\t\t\"std\" => 'global',\n\t\t\"description\" => 'Whether to display the page title or not - if \"Use Global Settings\" selected, the global setting selected in the\n\t\t'.PEXETO_THEMENAME.' Options » General » \"Display page title on pages\" field will be used.'),\n\t\t\n\t\tarray(\n\t\t\"title\" => \"Custom full width background image\",\n\t\t\"name\" => \"full_bg\",\n\t\t\"std\" => \"\",\n\t\t\"type\" => \"upload\",\n\t\t\"description\" => 'You can globally set a full width background image in the '.PEXETO_THEMENAME.' Options » Style Settings » \n\t\tGeneral section. In this field you can set a custom background image that will be displayed for this page only.'\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"title\" => '<div class=\"ui-icon ui-icon-wrench\"></div>Featured Page Template Settings',\n\t\t\"type\" => \"heading\"),\n\t\t\n\t\t\tarray(\n\t\t\"name\" => \"featured_category\",\n\t\t\"title\" => \"Display blog posts from category\",\n\t\t\"type\" => \"select\",\n\t\t\"none\" => true,\n\t\t\"options\" => $pexeto_categories,\n\t\t\"std\" => '-1'\n\t\t\t),\n\t\t\t\n\t\t\tarray(\n\t\t\"title\" => \"Number of posts to display\",\n\t\t\"name\" => \"featured_post_number\",\n\t\t\"std\" => \"5\",\n\t\t\"type\" => \"text\"\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"title\" => '<div class=\"ui-icon ui-icon-image\"></div>Portfolio Settings - available only for Portfolio/Gallery page templates',\n\t\t\"type\" => \"heading\"),\n\n\t\tarray(\n\t\t\"name\" => \"post_category\",\n\t\t\"title\" => \"Display portfolio items from categories\",\n\t\t\"type\" => \"select\",\n\t\t\"none\" => true,\n\t\t\"options\" => $portf_categories,\n\t\t\"std\" => '-1',\n\t\t\"description\" => 'If \"All Categories\" selected, all the Portfolio items will be displayed. If another category is selected, only the Portfolio items that belong\n\t\tto this category or this category\\'s subcategories will be displayed. By selecting different categories, you can create multiple portfolio/gallery\n\t\tpages with different items displayed.'),\n\n\t\tarray(\n\t\t\"name\" => \"order\",\n\t\t\"title\" => \"Portfolio item order\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array(array(\"name\"=>\"By Date\", \"id\"=>\"date\"),\n\t\tarray(\"name\"=>\"By Custom Order\", \"id\"=>\"custom\")),\n\t\t\"std\" => 'date',\n\t\t\"description\" => 'If you select \"By Date\" the last created item will be displayed first. If you select by \"By Custom Order\"\n\t\tyou will have to set the order field of each of the items - the items with the smaller order number will be displayed first.'),\n\n\n\t\tarray(\n\t\t\"name\" => \"show_filter\",\n\t\t\"title\" => \"Show portfolio category filter\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array(array(\"name\"=>\"Show\", \"id\"=>\"true\"),\n\t\tarray(\"name\"=>\"Hide\", \"id\"=>\"false\")),\n\t\t\"std\" => 'true',\n\t\t\"description\" => 'If \"Show\" selected, a category filter will be displayed above the portfolio items'),\n\n\t\tarray(\n\t\t\"name\" => \"show_info\",\n\t\t\"title\" => \"Show item info\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array( array(\"name\"=>\"Hide\", \"id\"=>\"false\"),\n\t\tarray(\"name\"=>\"Show\", \"id\"=>\"true\")),\n\t\t\"std\" => 'true',\n\t\t\"description\" => 'If \"Show\" selected, the portfolio item title and category will be displayed below the image (only for the Grid Gallery template)'\n\t\t),\n\n\n\t\tarray(\n\t\t\"title\" => \"Number of portfolio items to show per load/page\",\n\t\t\"name\" => \"post_number\",\n\t\t\"std\" => \"10\",\n\t\t\"type\" => \"text\"\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"name\" => \"image_width\",\n\t\t\"title\" => \"Image width\",\n\t\t\"type\" => \"text\",\n\t\t\"std\" => '290',\n\t\t\"description\" => 'The image width in the grid gallery. The image width is always static and the height is determined by the image ratio (only for the Grid Gallery template)'\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"name\" => \"desaturate\",\n\t\t\"title\" => \"Black/white image effect\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array( array(\"name\"=>\"OFF\", \"id\"=>\"false\"),array(\"name\"=>\"ON\", \"id\"=>\"true\")),\n\t\t\"std\" => 'false',\n\t\t\"description\" => 'If this option is enabled, the images will be automatically converted to black/white (desaturated) and they will be colored on hover (only for the Grid Gallery template).'\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"name\" => \"show_back_btn_end\",\n\t\t\"title\" => 'Show a \"Back to gallery\" button in the end of the image slider',\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array( array(\"name\"=>\"Hide\", \"id\"=>\"false\"),\n\t\tarray(\"name\"=>\"Show\", \"id\"=>\"true\")),\n\t\t\"std\" => 'false',\n\t\t\"description\" => 'If \"Show\" selected, a \"Back to gallery\" button will be appended to the last image of the image slider (only for the Grid Gallery template)'\n\t\t),\n\n\t\tarray(\n\t\t\"name\" => \"partial_loading\",\n\t\t\"title\" => 'Partial image loading in horizontal slider',\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array( array(\"name\"=>\"Disabled\", \"id\"=>\"false\"),\n\t\tarray(\"name\"=>\"Enabled\", \"id\"=>\"true\")),\n\t\t\"std\" => 'false',\n\t\t\"description\" => 'If \"Enabled\" selected, the slider will not wait for all the images to be loaded in order to get displayed. Before the slider is displayed it will load the amount of images you set in the \"Number of images to load before displaying the slider\" field below and after that the rest of the images will be displayed dynamically - as soon as the image gets loaded it will be displayed on the slider (only for the Grid Gallery template)'\n\t\t),\n\n\t\tarray(\n\t\t\"name\" => \"img_num_before_load\",\n\t\t\"title\" => \"Number of images to load before displaying the slider\",\n\t\t\"type\" => \"text\",\n\t\t\"std\" => '3',\n\t\t\"description\" => 'If partial image loaing is enabled above, this would be the number of images to load before displaying the horizontal slider. (only for the Grid Gallery template)'\n\t\t)\n\t\t\n\t\t);\n\n\n\n\t\t/* ------------------------------------------------------------------------*\n\t\t * META BOXES FOR THE PORTFOLIO POSTS\n\t\t * ------------------------------------------------------------------------*/\n\n\t\t$new_meta_portfolio_boxes =\n\t\tarray(\n\n\t\tarray(\n\t\t\"title\" => \"Preview Image URL\",\n\t\t\"name\" => \"preview\",\n\t\t\"std\" => \"\",\n\t\t\"type\" => \"upload\",\n\t\t\"description\" => 'Main preview image. If the \"Custom Thumbnail URL\" field below is empty, the thumbnail image\n\t\twill be automatically generated by the image set in this field.'\n\t\t),\n\n\t\tarray(\n\t\t\"title\" => \"Custom Thumbnail URL (optional)\",\n\t\t\"name\" => \"thumbnail\",\n\t\t\"std\" => \"\",\n\t\t\"type\" => \"upload\",\n\t\t\"description\" => 'By default the theme will generate automatically the thumbnail image for the item from\n\t\tthe bigger perview image, set in the \"Preview Image URL\" field below. However, if you prefer to manually set\n\t\tthis thumbnail image, you have to set its URL in this field.'\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"title\" => '<div class=\"ui-icon ui-icon-image\"></div>Grid Gallery items settings only',\n\t\t\"type\" => \"heading\"),\n\t\t\n\t\tarray(\n\t\t\"title\" => \"When clicked on the image open:\",\n\t\t\"name\" => \"action\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array(array(\"name\"=>\"Preview image in lightbox\", \"id\"=>\"lightbox\"),\n\t\tarray(\"name\"=>\"The content of the item as slider\", \"id\"=>\"permalink\"),\n\t\tarray(\"name\"=>\"The content of the item on new page\", \"id\"=>\"permalink_new\"),\n\t\tarray(\"name\"=>\"Play Video\", \"id\"=>\"video\"),\n\t\tarray(\"name\"=>\"Custom link\", \"id\"=>\"custom\"),\n\t\tarray(\"name\"=>\"Do Nothing\", \"id\"=>\"nothing\")),\n\t\t\"std\" => \"lightbox\",\n\t\t\"description\" => \"Select the action to be performed after clicking on the portfolio item.\"\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"title\" => \"Custom Link/Video URL\",\n\t\t\"name\" => \"custom\",\n\t\t\"std\" => \"\",\n\t\t\"type\" => \"text\",\n\t\t\"description\" => 'If \"Play Video\" selected above, you can insert a video URL here. If \"Custom link\" selected above, \n\t\tyou can insert the custom URL'\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"title\" => \"Item Description\",\n\t\t\"name\" => \"description\",\n\t\t\"std\" => \"\",\n\t\t\"type\" => \"textarea\",\n\t\t\"description\" => 'If \"Preview image in lightbox\" or \"Play Video\" has been selected in the clicking\n\t\taction field above, you can insert a description in this field that will be displayed below the image/video in lightbox.'\n\t\t),\n\t\t\n\t\tarray(\n\t\t\"name\" => \"show_content\",\n\t\t\"title\" => \"Show portfolio content on slider preview section\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array(array(\"name\"=>\"Show\", \"id\"=>\"show\"),\n\t\tarray(\"name\"=>\"Hide\", \"id\"=>\"hide\")),\n\t\t\"std\" => 'show',\n\t\t\"description\" => 'If \"Show\" selected, a section containing the portfolio title, category, content and a \"Back to gallery\" button will be\n\t\tprepended to the image slider when the preview is opened in the Grid Gallery template.'),\n\t\t\n\t\t\tarray(\n\t\t\"title\" => '<div class=\"ui-icon ui-icon-image\"></div>Showcase and single page items settings',\n\t\t\"type\" => \"heading\"),\n\t\t\n\t\tarray(\n\t\t\"title\" => \"Crop image from\",\n\t\t\"name\" => \"crop\",\n\t\t\"type\" => \"imageradio\",\n\t\t\"options\" => array(array(\"img\"=>PEXETO_IMAGES_URL.'crop-c.png', \"id\"=>\"c\", \"title\"=>\"Center\"),\n\t\tarray(\"img\"=>PEXETO_IMAGES_URL.'crop-t.png', \"id\"=>\"t\", \"title\"=>\"Top\"),\n\t\tarray(\"img\"=>PEXETO_IMAGES_URL.'crop-b.png', \"id\"=>\"b\", \"title\"=>\"Bottom\"),\n\t\tarray(\"img\"=>PEXETO_IMAGES_URL.'crop-l.png', \"id\"=>\"l\", \"title\"=>\"Left\"),\n\t\tarray(\"img\"=>PEXETO_IMAGES_URL.'crop-r.png', \"id\"=>\"r\", \"title\"=>\"Right\")\n\t\t),\n\t\t\"std\" => \"c\",\n\t\t\"description\" => 'This option is available when the thumbnail will be automatically generated from the preview image (when the \"Thumbnail URL\" field above is empty)- you can see above how the cropping settings will affect both portrait and landscape oriented images.\n\t\t(available for Showcase page template only)'\n\t\t),\n\n\t\t\tarray(\n\t\t\"name\" => \"show_title\",\n\t\t\"title\" => \"Show portfolio title on preview page\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array(array(\"name\"=>\"Show\", \"id\"=>\"show\"),\n\t\tarray(\"name\"=>\"Hide\", \"id\"=>\"hide\")),\n\t\t\"std\" => 'show',\n\t\t\"description\" => 'If \"Show\" selected, the portfolio title will be displayed on the single portfolio page and on the\n\t\tPortfolio Showcase template.'),\n\t\t\n\t\tarray(\n\t\t\"name\" => \"show_preview\",\n\t\t\"title\" => \"Show preview image on preview page\",\n\t\t\"type\" => \"select\",\n\t\t\"options\" => array(array(\"name\"=>\"Show\", \"id\"=>\"show\"),\n\t\tarray(\"name\"=>\"Hide\", \"id\"=>\"hide\")),\n\t\t\"std\" => 'show',\n\t\t\"description\" => 'If \"Show\" selected, the preview image will be displayed on the single portfolio page and on the\n\t\tPortfolio Showcase template.')\n\t\t\n);\n\t\t\n\t\t\n}"
] | [
"0.82191217",
"0.80654615",
"0.80446464",
"0.8042274",
"0.7982741",
"0.79629076",
"0.7961311",
"0.79566205",
"0.7953053",
"0.7913438",
"0.7857327",
"0.78455746",
"0.78196794",
"0.78156394",
"0.77983737",
"0.7756919",
"0.7756676",
"0.7732704",
"0.7706554",
"0.77033186",
"0.7688018",
"0.7688018",
"0.7678953",
"0.76689565",
"0.7666591",
"0.7665053",
"0.7664339",
"0.7659951",
"0.765823",
"0.76198477",
"0.7619067",
"0.76129496",
"0.76128364",
"0.7603149",
"0.75979",
"0.75685817",
"0.75659186",
"0.7564452",
"0.75628906",
"0.755571",
"0.75446826",
"0.75372744",
"0.7533577",
"0.7533177",
"0.7528735",
"0.7506981",
"0.7492766",
"0.7491659",
"0.74869645",
"0.74797535",
"0.7461879",
"0.7454305",
"0.7447826",
"0.74474615",
"0.7447208",
"0.7446727",
"0.7434512",
"0.7429441",
"0.7422268",
"0.7408213",
"0.7397628",
"0.73837876",
"0.7379952",
"0.737423",
"0.7371729",
"0.73655176",
"0.73584455",
"0.7357207",
"0.73566294",
"0.7348897",
"0.7345826",
"0.7338664",
"0.7333696",
"0.7330242",
"0.73243785",
"0.7289746",
"0.7283719",
"0.7277055",
"0.72659224",
"0.72653776",
"0.72615695",
"0.7258026",
"0.725751",
"0.7256859",
"0.7255824",
"0.7254771",
"0.7254025",
"0.72522324",
"0.7249733",
"0.72496015",
"0.7243606",
"0.7237535",
"0.72318417",
"0.72285193",
"0.72281677",
"0.7223807",
"0.7223194",
"0.72165334",
"0.7215927",
"0.7197197",
"0.7195849"
] | 0.0 | -1 |
Determine if the user is authorized to make this action. | public function authorize()
{
return $this->user()->can('manage-routes');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 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()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n {\n return !is_null($this->user());\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 // this was my best guess\n return $this->user()->id === $this->route('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 $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(): bool\n {\n return $this->isUserAuthorised();\n }",
"public function authorize(): bool\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return request()->user() != null;\n }",
"public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }",
"public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\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 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 isAuthorized() {}",
"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 authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }",
"public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\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\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(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function authorize()\n {\n return request()->loggedin_role === 1;\n }",
"function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }",
"public function isAuthorized() {\n\t\treturn true;\n\t}",
"public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\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 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 if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }",
"public function authorize()\n {\n return auth()->user()->is_author($this->route('board'));\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 isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }",
"public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}",
"function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\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 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()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }",
"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 $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 authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }",
"public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\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 $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }",
"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 return is_client_or_staff();\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 isAuthorized() {\n\t\t\n\t}",
"public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }",
"public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }",
"public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}",
"public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }",
"public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }",
"public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\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 $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 return !empty(Auth::user());\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 $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }",
"public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\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 {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function authorize()\n {\n // User system not implemented\n return true;\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()\n\t{\n $subjectId = $this->route('subject');\n\n return Subject::find($subjectId)->user->id == Auth::id();\n\t}",
"public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\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 (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize() {\n\t\tif (Auth::user()->user_type == \"S\" || Auth::user()->user_type == \"O\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tabort(404);\n\t\t}\n\t}",
"public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }",
"public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }",
"public function hasAuthorized() {\n return $this->_has(1);\n }",
"public function authorize()\n {\n return $this->user()->hasRole('admin');\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 $this->user()->can('update', $this->route('user'));\n }",
"public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }",
"public function authorize()\n {\n $id = $this->route('id');\n if ($id) {\n $giftList = GiftList::find($id);\n if (!$giftList || $giftList->user->id != Auth::user()->id) {\n return false;\n }\n }\n return true;\n }",
"public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\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 if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"public function authorize()\n {\n return \\Auth::check() ? true : false;\n }",
"public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\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\t{\n\t\treturn Auth::user()->hasRole('admin');\n\t}",
"public function authorize()\n\t{\n\t\treturn Auth::user()->hasRole('admin');\n\t}",
"public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }",
"public function authorize()\n {\n return Auth::guest() || isMember();\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 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 $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 return TRUE;\n }"
] | [
"0.8265296",
"0.82451475",
"0.82061696",
"0.82047397",
"0.82047397",
"0.8201702",
"0.81293136",
"0.80944514",
"0.8085804",
"0.8074648",
"0.80542374",
"0.80337673",
"0.80173796",
"0.7980766",
"0.7959179",
"0.7949416",
"0.7935022",
"0.79347277",
"0.78957665",
"0.78944355",
"0.7834053",
"0.78301674",
"0.7814108",
"0.7802764",
"0.7788369",
"0.77826524",
"0.77826524",
"0.7777109",
"0.7765792",
"0.7760043",
"0.77437794",
"0.7741301",
"0.77346617",
"0.7724647",
"0.7724647",
"0.7722088",
"0.7721751",
"0.77047133",
"0.7696556",
"0.76859576",
"0.7682739",
"0.76821774",
"0.7674924",
"0.767431",
"0.7664362",
"0.7660154",
"0.7654947",
"0.76544505",
"0.7648249",
"0.7641717",
"0.7638698",
"0.7635294",
"0.76241815",
"0.7614503",
"0.7614503",
"0.76077974",
"0.7604549",
"0.7600539",
"0.7599361",
"0.7598912",
"0.75933605",
"0.75807667",
"0.7575622",
"0.75750315",
"0.7568686",
"0.7568595",
"0.75627387",
"0.75537896",
"0.7552166",
"0.7542878",
"0.7542198",
"0.75420934",
"0.7540669",
"0.7538721",
"0.7524337",
"0.7523756",
"0.75153273",
"0.751483",
"0.7514578",
"0.7511449",
"0.75099105",
"0.75031835",
"0.7500733",
"0.74987763",
"0.7480655",
"0.7480583",
"0.7477724",
"0.7474089",
"0.74727625",
"0.74714774",
"0.7466506",
"0.7465431",
"0.7452239",
"0.7449111",
"0.7449111",
"0.74462414",
"0.7443765",
"0.743825",
"0.743825",
"0.74377775",
"0.7435443"
] | 0.0 | -1 |
Get the validation rules that apply to the action. | public function rules()
{
return [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRules()\n {\n return $this->validation_rules;\n }",
"public function getRules()\n {\n return $this->validator->getRules();\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 return $this->validationRules;\n }",
"protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }",
"public static function getRules()\n {\n return (new static)->getValidationRules();\n }",
"public static function validationRules($action = null)\n {\n $rules = collect([\n 'title' => ['bail', 'required', 'max:100'],\n 'body' => ['bail', new RichTextRequired, 'max:10000']\n ]);\n\n switch ($action) {\n case \"create\":\n $rules = $rules->only(['title', 'body']);\n break;\n case \"update\":\n $rules = $rules->only(['title', 'body']);\n break;\n }\n\n return $rules->toArray();\n }",
"public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }",
"protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\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 $rules = [];\n if(!empty($this->rules)){\n foreach ($this->rules as $action => $rule) {\n $regex = \"*\" . $action;\n if($this->is($regex)){\n $rules = $rule;\n break;\n }\n }\n }\n return $rules;\n }",
"public function rules() {\n return $this->get_from_model(__FUNCTION__);\n }",
"public function rules()\n { \n return $this->rules;\n }",
"public function rules() {\n\t\t$action_method = $this->route()->getActionMethod();\n\t\t$rules = [\n\t\t\t'name' => 'required',\n\t\t\t'description' => 'required',\n\t\t\t'file_category_id' => 'required',\n\t\t];\n\n\t\tif ( $action_method === 'store' ) {\n\t\t\t$rules['file_upload'] = 'required';\n\t\t}\n\n\t\treturn $rules;\n\t}",
"public static function validationRules($action = null)\n {\n $rules = collect([\n 'name' => ['bail', 'required', 'string', 'max:100'],\n 'description' => ['bail', new RichTextRequired, 'max:1000'],\n 'moderators' => ['bail', 'array', 'exists:users,username'],\n 'order' => ['bail', 'required', 'array', 'exists:channels,slug'],\n 'locked' => ['bail', 'sometimes', 'boolean'],\n 'channel_category' => ['bail', 'required', 'exists:channel_categories,slug'],\n 'file' => [\n 'bail', 'nullable', 'sometimes', 'image', 'max:3072',\n Rule::dimensions()->minWidth(1200)->minHeight(400)\n ]\n ]);\n\n switch ($action) {\n case \"create\":\n $rules = $rules->only([\n 'name', 'description', 'moderators', 'locked'\n ]);\n break;\n case \"update\":\n $rules = $rules->only([\n 'name', 'description', 'channel_category', 'moderators', 'locked'\n ]);\n break;\n case \"reorder\":\n $rules = $rules->only('order');\n break;\n case \"image\":\n $rules = $rules->only('file');\n break;\n }\n\n return $rules->toArray();\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 getValidationRules()\n {\n return [];\n }",
"public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }",
"public function rules()\n {\n // get action name\n $routeAction = app('router')->currentRouteAction();\n $method = trim( strrchr($routeAction, '@'), '@');\n $rules = [];\n\n // 是否有对应方法的验证规则\n if ( isset($this->ruleConfig[$method]) ) {\n $rules = $this->ruleConfig[$method];\n\n // 可以设置一个默认规则列表,没有对应规则时则用默认的\n } elseif ( ! empty($this->ruleConfig['__default'])) {\n $rules = $this->ruleConfig['__default'];\n }\n\n return $rules;\n }",
"public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }",
"public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }",
"public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}",
"abstract protected function getValidationRules();",
"public function getValidationRules() : array;",
"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}",
"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 $this->buildRules();\n return $this->rules;\n }",
"public static function validationRules($action = null)\n {\n $rules = collect([\n 'file' => ['bail', 'required', 'image', 'max:1024']\n ]);\n\n switch ($action) {\n case \"create\":\n $rules = $rules->only(['file']);\n break;\n }\n\n return $rules->toArray();\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 rules()\n {\n $called_function = Route::getCurrentRoute()->getActionMethod();\n\n $rules = array();\n\n if($called_function == 'store')\n {\n $rules = [\n 'username' => 'required|unique:users,username',\n 'password' => 'required',\n 'role' => 'required',\n ];\n }\n\n if($called_function == 'update')\n {\n $rules = [\n 'username' => 'required',\n 'role' => 'required',\n ];\n }\n\n return $rules;\n }",
"protected function getValidRules()\n {\n return $this->validRules;\n }",
"public function validation_rules() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn $class::_object()->validates;\r\n }",
"public function rules()\n {\n $actionMethod = $this->route()->getActionMethod();\n\n if ( $actionMethod == 'store') return [\n 'item.email' => 'required|email|max:50',\n 'item.roles' => 'array|required',\n 'item.name' => 'required|alpha_num|max:50',\n 'item.last_name' => 'required|alpha_num|max:50',\n 'item.password' => 'required|between:3,50',\n 'password_confirm' => 'same:item.password'\n ];\n\n if( $actionMethod == 'update' ) return [\n 'item.email' => 'required|email',\n 'item.roles' => 'array|required',\n 'item.name' => 'required|alpha_num',\n 'item.last_name' => 'required|alpha_num',\n 'password_confirm' => 'same:item.password'\n ];\n\n return [];\n }",
"public function getRules()\r\n\t{\r\n\t\treturn $this->rules;\r\n\t}",
"public function rules()\n {\n return static::$rules;\n }",
"public function rules()\n {\n $rules = array();\n return $rules;\n }",
"public function validationRules()\n {\n return [];\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 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 getRules()\r\n\t{\r\n\t\treturn $this->_rules;\r\n\t}",
"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 function rules()\n {\n if ($this->request->get('action') == 'edit') {\n $valid = array(\n\n 'expensive_for' => 'required|',\n 'budget_category_id' => 'required|',\n 'budget_subcategory_id' => 'required|',\n 'expensive_quantity' => 'required|',\n 'expensive_rate' => 'required|',\n 'specifications' => 'required|',\n );\n } else {\n $valid = array(\n 'expensive_for' => 'required|',\n 'budget_category_id' => 'required|',\n 'budget_subcategory_id' => 'required|',\n 'expensive_quantity' => 'required|',\n 'expensive_rate' => 'required|',\n 'specifications' => 'required|',\n );\n }\n return $valid;\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 function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'addNameUnit':\n return [\n 'building_guid' => 'max:32',\n 'name' => 'required|max:128',\n 'name_unit' => 'required|max:128',\n 'unit' => 'max:128',\n 'unit_unit' => 'max:128'\n ];\n case 'changeNameUnit':\n return [\n 'name' => 'required|max:128',\n 'name_unit' => 'required|max:128',\n 'unit' => 'max:128',\n 'unit_unit' => 'max:128'\n ];\n default;\n return [\n\n ];\n }\n }",
"public function getRules()\n {\n return $this->rules;\n }",
"public function getRules()\n {\n return $this->rules;\n }",
"public function getRules()\n {\n return $this->rules;\n }",
"public function getRules()\n {\n return $this->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 if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\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 getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }",
"protected function get_validation_rules()\n {\n }",
"public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\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 = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\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 $this->formObject();\n\n return $this->formObject()->rulesForStoring();\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 $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\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 $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 ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }",
"public function getRules()\n {\n return $this->get(self::_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()\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 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 getRules()\n {\n if (!isset($this->_rules)){\n $this->_getRules();\n }\n return $this->_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(): 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()\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 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 $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 $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 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 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\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 //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 getRules()\n\t{\n\t\t\n\t\t$rules = array();\n\t\t\n\t\tforeach ( $this->getFields() as $field )\n\t\t{\n\t\t\t$rules = array_merge( $rules, $field->getRules() );\n\t\t}\n\t\t\n\t\treturn $rules;\n\t}",
"public function getRules() {\n\t\treturn self::$rules;\n\t}",
"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 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 validationRules()\n {\n return [];\n }",
"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 }",
"abstract public function getValidationRules(): array;",
"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 $method_name = substr(strstr(($this->route()->action)['as'], '.'), 1);\n\n switch ($method_name) {\n case 'show':\n return [\n \"period_id\" => \"required|integer|exists:periods,id\"\n ];\n case 'store':\n case 'update':\n return [\n 'teacher_id' => 'required|string|exists:users,id',\n 'name' => 'required|string'\n ];\n case 'destroy':\n return [\n 'period_id' => 'required|exists:periods,id'\n ];\n case 'store-teacher-period':\n case 'update-teacher-period':\n return [\n 'name' => 'required|string'\n ];\n case 'getStudents':\n return [\n 'period_id' => \"required|integer|exists:periods,id\"\n ];\n case 'attachStudent':\n case 'detachStudent':\n return [\n 'period_id' => 'required|integer|exists:periods,id',\n 'user_id' => 'required|integer|exists:users,id'\n ];\n }\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 defineValidationRules()\n {\n return [];\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->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 $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 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['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }",
"public function getRules(): array\n {\n return $this->rules;\n }",
"protected function validationRules() : array\n {\n return [];\n }"
] | [
"0.80618066",
"0.8002028",
"0.790071",
"0.789029",
"0.7878679",
"0.78218657",
"0.7807406",
"0.7793681",
"0.77879256",
"0.77742267",
"0.77742267",
"0.77742267",
"0.77742267",
"0.77742267",
"0.77742267",
"0.77710783",
"0.7744431",
"0.77189857",
"0.77187806",
"0.7702196",
"0.7694718",
"0.769327",
"0.7653316",
"0.7637429",
"0.76308274",
"0.7629411",
"0.7615811",
"0.76046145",
"0.7545726",
"0.75329953",
"0.7523721",
"0.7522557",
"0.75159234",
"0.75047123",
"0.7504516",
"0.74935305",
"0.74882305",
"0.7487863",
"0.7487248",
"0.74840474",
"0.74769133",
"0.74748904",
"0.7473129",
"0.74603647",
"0.74474245",
"0.7441207",
"0.74400127",
"0.74350494",
"0.7434877",
"0.7428451",
"0.7428451",
"0.7428451",
"0.7428451",
"0.7409484",
"0.7409302",
"0.73955476",
"0.7393808",
"0.7389373",
"0.738599",
"0.736723",
"0.73654073",
"0.7347354",
"0.73454887",
"0.7342921",
"0.7342795",
"0.7339857",
"0.73334044",
"0.73318917",
"0.7328516",
"0.7317536",
"0.73065335",
"0.73055786",
"0.72886527",
"0.7276549",
"0.7276056",
"0.72670335",
"0.72652113",
"0.7264574",
"0.72612774",
"0.725036",
"0.72492623",
"0.7248477",
"0.7243452",
"0.7240908",
"0.7234502",
"0.72220045",
"0.7221843",
"0.7208559",
"0.72061956",
"0.71987176",
"0.7197453",
"0.7187766",
"0.7186924",
"0.7186129",
"0.718573",
"0.71846825",
"0.7181387",
"0.71799517",
"0.7177624",
"0.71756345",
"0.7167444"
] | 0.0 | -1 |
Execute the action and return a result. | public function handle()
{
$route = (new FetchRoute)->actingAs(
$this->user()
)->run([
'encoded_id' => $this->encoded_id,
'draft' => true,
]);
return $route->forceDelete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function executeAction() {\n return $this->{$this->action}();\n }",
"public function execute()\n {\n $action = $this->action ?: '__index';\n $params = (array) $this->params;\n\n $response = $this->__preAction($action, $params);\n if ($response !== false) {\n $response = call_user_func_array(array($this, $action), $params);\n }\n\n $response = $this->__postAction($action, $params, $response) ?: $response;\n\n return $response ?: new \\Gini\\CGI\\Response\\Nothing();\n }",
"protected function executeAction() {}",
"protected function executeAction() {}",
"protected function executeAction() {}",
"protected function executeAction() {}",
"public function process() {\n\t\t$action = $this->get_action();\n\n\t\t$result = $this->$action();\n\n\t\t$this->set_processed_item( $result );\n\n\t\treturn $result;\n\t}",
"protected function executeAction() {\r\n\t\t$this->objectAction->validateAction();\r\n\t\t$this->objectAction->executeAction();\r\n\t\t\r\n\t\t$this->handleResult();\r\n\t}",
"public function execute() {\n if ( $this->mInternalMode ) {\n $this->executeAction();\n } else {\n $this->executeActionWithErrorHandling();\n }\n }",
"public function executeAction()\n\t{\n\t\t$action = request()->input('action');\n\n\t\tif (in_array($action, $this->actions))\n\t\t{\n\t\t\tforeach (request()->input('rows', []) as $row)\n\t\t\t{\n\t\t\t\t$this->transactions->{$action}($row);\n\t\t\t}\n\n\t\t\treturn response('Success');\n\t\t}\n\n\t\treturn response('Failed', 500);\n\t}",
"public function execute()\n {\n $resultForward = $this->resultForwardFactory->create();\n\n return $resultForward->forward('edit');\n }",
"protected function executeAction() {\n \n }",
"protected function executeAction()\n {\n $this->triggerEvent( __FUNCTION__ . '.pre');\n if ($this->flowEvaluator->executeActionInFlow()) {\n $this->triggerEvent(__FUNCTION__ . '.success');\n $this->manageExecutedAction();\n } else {\n $this->triggerEvent(__FUNCTION__ . '.fail');\n }\n $this->triggerEvent( __FUNCTION__ . '.post');\n }",
"public function executeAction() {\r\n\t\t\r\n\t}",
"public function executeAction()\n {\n $action = request()->input('action');\n\n if (in_array($action, $this->actions)) {\n foreach (request()->input('rows', []) as $row) {\n $this->locales->{$action}($row);\n }\n\n return response('Success');\n }\n\n return response('Failed', 500);\n }",
"final public function perform() {\n try {\n $this->checkSecurity();\n }\n catch (Exception $e) {\n $ppal = WebSession::getInstance()->getPrincipal();\n $username = $ppal->getName();\n\n $message = \"User is not authorized - Authentication Error\";\n $info = $ppal->isAnonymous() ? \"Anonymous user\" : '';\n\n $logger = Logger::getLogger(\"auth\");\n $logger->info(\"{$_SERVER['SERVER_ADDR']}|{$_SERVER['REMOTE_ADDR']}|\".LOG_APP_NAME.\"|LOGIN|114|{$message}|{$username}||||{$info}\");\n\n //Throw exception to continue with predefined workflow\n throw $e;\n }\n\n try {\n \t $retVal = $this->performImpl(); \n \n $this->logActionOK($this->getAction4Logger());\n\n return $retVal; \n } catch (Exception $e) {\n $this->logActionERROR($this->getAction4Logger(), $e);\n\n throw $e;\n }\n }",
"public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Forward $resultForward */\n $resultForward = $this->resultForwardFactory->create();\n return $resultForward->forward('edit');\n }",
"public function execute()\n {\n return curl_exec($this->_handle);\n }",
"public function run(): Response\n {\n return $this->triggerAction($this->pendingAction);\n }",
"function performAction($action)\n{\n\trequire_once(SITE_DIR.'_classes/_factory/_ActionFactory.php');\n\t$action = ActionFactory::createAction($action);\n\t$result = $action->execute();\n}",
"public function invoke($action);",
"function execute($action, $fields){\r\n return $this->perform_request($this->build_fields($action,$fields));\r\n }",
"public function invoke()\n\t{\n\t\treturn $this->dispatch([ $this ]);\n\t}",
"private function execute()\n {\n // executes a cURL session for the request, and sets the result variable\n $result = Request::get($this->getRequestURL())->send();\n // return the json result\n return $result->raw_body;\n }",
"public function execute() \n\t{\n\t\t// execute general act without input & without entity - e.g : publishAll()\n\t\tif(!$this->entity && !$this->input) \n\t\t{\n\t\t\t$this->{$this->act}(); \n\t\t}\t\n\n\t\t// execute general act with input & without entity - e.g : storeBatch($categories)\n\t\tif(!$this->entity && $this->input) \n\t\t{\n\t\t\t$this->{$this->act}($this->input); \n\t\t}\t\t\t\t\n\n\t\t// execute custom act on entity, without input - e.g: activate($entity), publish($entity)\n\t\tif($this->entity && !$this->input) \n\t\t{\n\t\t\t$this->{$this->act}($this->entity);\n\t\t}\n\n\t\t// execute update act on entity, with input - e.g: update($entity, $updates) \n\t\tif($this->entity && $this->input) \n\t\t{\n\t\t\t$this->{$this->act}($this->entity, $this->input); \n\t\t}\t\n\n\t\treturn static::$self;\t\t\n\t}",
"public function execute() {\n\t\t$controller = $this->manager->get($this->getController());\n\t\t$reflection = new \\ReflectionClass($controller);\n\t\t$controller->run( $this->getAction($reflection) );\n\t}",
"public function execute()\n {\n /** @var \\Magento\\Backend\\Model\\View\\Result\\Forward $resultForward */\n $resultForward = $this->_resultForwardFactory->create();\n return $resultForward->forward('edit');\n }",
"public function launch() {\r\n\t\t// Check if the requested class exists\r\n\t\tif(class_exists($this->class)) {\r\n\t\t\t// It is, create a new instance\r\n\t\t\t$this->action_instance = new $this->class($this);\r\n\t\t\t\r\n\t\t\t// Check for action authentication\r\n\t\t\tif( !$this->action_instance->checkAuth() ) {\r\n\t\t\t // Authentication failed! Terminate the script\r\n\t\t\t error('no_auth');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if the requested method exists\r\n\t\t\tif( is_callable(array($this->action_instance, $this->method))) {\r\n\t\t\t\t// It is, launch it\r\n\t\t\t\t$this->action_instance->{$this->method}();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// The requested method does not exist, display an error\r\n\t\t\t\treturn error('The requested method does not exist!', false);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// The requested class does not exist, display an error\r\n\t\t\treturn error('The requested controller does not exist!', false);\r\n\t\t}\r\n\t}",
"public function execute() {\n \n return (new Result(shell_exec($this->fullCommand())));\n }",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function execute()\r\n\t{\r\n\t\t$service_name = $this->getRequestParameter( \"myaction\" );\r\n\r\n\t\t// remove all '_' and set to lowercase\r\n\t\t$myaction_name = trim( strtolower( str_replace ( \"_\" , \"\" , $service_name ) ) );\r\n\t\t$clazz_name = $myaction_name . \"Action\";\r\n//\t\techo \"[$myaction_name] [$clazz_name]<br>\";\r\n\r\n//\t\t$clazz = get_class ( $clazz_name );\r\n\r\n\t\t//$multi_request = $this->getRequestParameter( \"multirequest\" , null );\r\n\t\t$multi_request = $myaction_name == \"multirequest\" ;\r\n\t\tif ( $multi_request )\r\n\t\t{\r\n\t\t\t$multi_request = new myMultiRequest ( $_REQUEST, $this );\r\n\t\t\t$response = $multi_request->execute();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$include_result = @include_once ( \"{$clazz_name}.class.php\");\r\n\t\t\tif ( $include_result )\r\n\t\t\t{\r\n\t\t\t\t$myaction = new $clazz_name( $this );\r\n\t\t\t\t$myaction->setInputParams ( $_REQUEST );\r\n\t\t\t\t$response = $myaction->execute( );\r\n\t\t\t\tkEventsManager::flushEvents();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$format = $this->getP ( \"format\" );\r\n\t\t\t\t$response = \"Error: Invalid service [$service_name]\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$format = $this->getP ( \"format\" );\r\n\t\tif ( $format == kalturaWebserviceRenderer::RESPONSE_TYPE_PHP_ARRAY || $format == kalturaWebserviceRenderer::RESPONSE_TYPE_PHP_OBJECT )\r\n\t\t{\r\n\t\t\t//$this->setHttpHeader ( \"Content-Type\" , \"text/html; charset=utf-8\" );\r\n\t\t\t$response = \"<pre>\" . print_r ( $response , true ) . \"</pre>\" ;\r\n\t\t}\r\n\r\n\t\t// uncomment in order to cache api responses\r\n\t\tif(kConf::get('enable_cache'))\r\n\t\t{\r\n\t\t\t$this->cacheResponse($response);\r\n\t\t}\r\n\r\n\t\t\r\n $ret = $this->renderText( $response );\r\n KExternalErrors::terminateDispatch();\r\n return $ret;\r\n\t}",
"public function execute()\n {\n $path=$this->getPath();\n try\n {\n Log::info('Trying module '.$this->module);\n \t$this->page = $this->moduleInstance($this->module,$path,$this->params);\n\n \ttry\n \t{\n Log::info('Trying action '.$this->action);\n \t\t $this->page->executeAction($this->action);\n \t}\n catch (SecurityException $e) {\n $this->handleSecurity();\n }\n catch (Error404Exception $e) {\n $this->returnActionNotFound();\n }\n catch (Exception $e)\n {\n Log::info('Action '.$this->action.' rejected for module '.$this->module.', trying index instead ');\n Log::info('Reason : '.$e->getMessage());\n $this->page->handleException($e);\n }\n\n }\n catch (Error404Exception $e) {\n\n $this->returnModuleNotFound();\n }\n catch (SecurityException $e) {\n $this->handleSecurity();\n }\n catch (Exception $e)\n {\n\n Log::info('Error module '.$this->module.'. Revealing as 404');\n \t $this->page = $this->moduleInstance('error',$path);\n $this->page->executeAction('404');\n }\n Log::info($this->module.'/'.$this->action.' executed successfully');\n }",
"public function run() {\n\n if(method_exists($this, $this->action)) {\n $output = call_user_func_array(array($this, $this->action), (array)$this->arguments);\n } else {\n raise('invalid controller action: ' . $this->action);\n }\n\n // if the controller has a valid layout\n // render that instead of the output generated by the action\n if(!$output and $layout = $this->layout) {\n $output = $layout->render($this->format); \n } \n\n if(is_a($output, 'Kirby\\\\Toolkit\\\\Response')) {\n return $output;\n } else {\n return new Response($output, $this->format);\n }\n\n }",
"protected function doExecute()\n\t{\n\t\t$controller = $this->getController();\n\n\t\t$controller = new $controller($this->input, $this);\n\n\t\t$this->setBody($controller->execute());\n\t}",
"public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute();",
"public function execute()\n {\n $controllerClassName = $this->requestUrl->getControllerClassName();\n $controllerFileName = $this->requestUrl->getControllerFileName();\n $actionMethodName = $this->requestUrl->getActionMethodName();\n $params = $this->requestUrl->getParams();\n \n if ( ! file_exists($controllerFileName))\n {\n exit('controlador no existe');\n }\n\n require $controllerFileName;\n\n $controller = new $controllerClassName();\n\n $response = call_user_func_array([$controller, $actionMethodName], $params);\n \n $this->executeResponse($response);\n }",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function executeAction( $action, $getParams = array() );",
"public function execute()\n\t{\n\t $jobcode = $this->getRequest()->getParam('jobcode');\n\t $this->schedule->executeImmediate($jobcode);\n\t return $this->resultRedirectFactory->create()->setUrl($this->getUrl(\"*/*/index\"));\n\t}",
"public function execute() {\n\t\t$result = [\n\t\t\t'success' => false,\n\t\t\t'errorMessage' => '',\n\t\t];\n\t\t$options = $this->getRequest()->getParams();\n\t\ttry {\n\t\t\t$response = $this->clientResolver->create(\"elasticsearch7\", $options)->testConnection();\n\t\t\tif ($response) {\n\t\t\t\t$result['success'] = true;\n\t\t\t\t$url = \"{$options['hostname']}:{$options['port']}\";\n\t\t\t\t$this->curl->get($url);\n\t\t\t\t$result['html'] = $this->curl->getBody();\n\t\t\t}\n\t\t} catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n\t\t\t$result['errorMessage'] = $e->getMessage();\n\t\t} catch (\\Exception $e) {\n\t\t\t$message = __($e->getMessage());\n\t\t\t$result['errorMessage'] = $this->tagFilter->filter($message);\n\t\t}\n\n\t\t/** @var \\Magento\\Framework\\Controller\\Result\\Json $resultJson */\n\t\t$resultJson = $this->resultJsonFactory->create();\n\t\treturn $resultJson->setData($result);\n\t}",
"public function execute() {\n\t\t\t$response = Response::factory($this);\n\t\t\t\n\t\t\t$controller = $this->route->controller();\n\t\t\tif($controller !== null) {\n\t\t\t\t$this->controller = Controller::factory($controller, $response);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t$response->data($this->controller->execute());\n\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t$response->data('<div class=\"Frawst-Debug\">'.\n\t\t\t\t\t\t'<h1>A Controller Problem Occurred!</h1>'.\n\t\t\t\t\t\t'<pre>'.$e.'</pre></div>');\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$this->controller = null;\n\t\t\t} else {\n\t\t\t\tif($this->route->template() === null) {\n\t\t\t\t\t$response->notFound();\n\t\t\t\t}\n\t\t\t\t$response->data(null);\n\t\t\t}\n\t\t\t\n\t\t\treturn $response;\n\t\t}",
"public function execute()\n\t{\n\t\t$this->prepare();\n\t\t$result = $this->processor->execute( $this->method, $this->url, $this->headers, $this->body, $this->config );\n\t\t$this->body = ''; // We need to do this as we reuse the same object for performance. Once we've executed, the body is useless anyway due to the changing params\n\t\tif ( $result ) {\n\t\t\t$this->response_headers = $this->processor->getHeaders();\n\t\t\t$this->response_body = $this->processor->getBody();\n\t\t\t$this->executed = true;\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\t$this->executed = false;\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function Execute ()\n {\n $client = $this->GetServiceWrapper()->GetServiceObject();\n $client_options = $this->GetClientOptions();\n $client->setOptions($client_options);\n\n $this->setRouter($this->GetServiceWrapper()->GetRouteStack() );\n\n $request = $client->getRequest();\n $request->setMethod(static::REQUEST_METHOD);\n $request->getUri()->setPath($this->GetRoute());\n\n $this->mServiceResponse = $client->dispatch($request)->GetBody();\n\n $this->mResult = $this->GetResultPrototype();\n\n if (empty($this->mServiceResponse))\n {\n if (true === $this->mThrowEmptyModelExceptions)\n {\n throw new Interrupt\\ModelNotFoundFailure(get_class($this), get_class($this->GetServiceWrapper()->GetPrototype()), $stmt->queryString);\n }\n }\n else\n {\n $this->ProcessResponse();\n }\n\n return $this->mResult;\n }",
"function execute() {\r\n\t\t\r\n\t\tswitch( $this->mAction ) {\r\n\t\t\tcase 'help':\r\n\t\t\t\t$this->Help();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'compute':\r\n\t\t\t\t$this->Compute();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'liste':\r\n\t\t\t\t$this->Liste();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'open':\r\n\t\t\t\t$this->Open();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'save':\r\n\t\t\t\t$this->Save();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'delete':\r\n\t\t\t\t$this->Delete();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'install':\r\n\t\t\t\t$this->Install();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\t$this->mOutput->start( $this->mDB->isOK(), $this->mLang, $this->mText, array(), '', $this->mCountRegexes, $this->mRegexes );\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public function invoke() {\r\n $this->action = Util::getAction($this->action);\r\n \r\n switch ($this->action) {\r\n case 'customer_login':\r\n $this->processCustomerLogin();\r\n break;\r\n case 'get_customer':\r\n $this->processGetCustomer();\r\n break;\r\n case 'show_registration':\r\n $this->processShowRegistration();\r\n break;\r\n case 'register_product':\r\n $this->processRegisterProduct();\r\n break;\r\n case 'logout':\r\n $this->processLogout();\r\n break;\r\n default:\r\n $this->processCustomerLogin();\r\n break;\r\n }\r\n }",
"function execute()\n\t{\n\t\t// Call controller method\n\t\t// echo \"METHOD: \" . $this->method;\n\t\t// return;\n\t\teval(\"\\$this->\" . $this->method . \"();\");\n\t}",
"public function execute()\n {\n $response = [\n 'status' => 'failure',\n 'message' => ''\n ];\n\n $params = $this->getRequest()->getParams();\n\n $result = $this->_resultJsonFactory->create();\n\n if (!key_exists('vat_id', $params)) {\n $response['message'] = \"vat id invalid\";\n return $result->setData($response);\n }\n\n if (!$this->_isValidVatId($params['vat_id'])) {\n $response['message'] = \"vat id invalid\";\n return $result->setData($response);\n }\n\n $this->_checkoutSession->setRatepayVatId($params['vat_id']);\n\n $response['status'] = \"success\";\n $response['message'] = \"vat id saved\";\n return $result->setData($response);\n }",
"public function execute() : string\n {\n $actionId = $this->getRequest()->get('header.X-Osynapsy-Action');\n $actionParameters = $this->getRequest()->get('post.actionParameters');\n list($controllerHandle, $defaultAction) = $this->controllerFactory($this->route->controller, $this);\n return (string) $this->runAction($controllerHandle, $defaultAction, $actionId, $actionParameters ?? []);\n }",
"public abstract function execute();",
"public abstract function execute();",
"public abstract function execute();",
"public function execute(){\n return $this->general(); \n }",
"function execute() {\n return 1;\n }",
"protected function callActionMethod() {}",
"public function execute()\r\n {\r\n $params = $this->getRequest()->getParams();\r\n\r\n $result = $this->resultFactory->create(ResultFactory::TYPE_JSON);\r\n\r\n try {\r\n $this->isAjaxAndPost();\r\n\r\n if($params['destination'] === 'create'){\r\n $resultData = $this->moduleGeneratorHelper->createModule();\r\n }else if($params['destination'] === 'select'){\r\n $resultData = $this->moduleGeneratorHelper->selectModule();\r\n }else{\r\n throw new \\Exception('Undefined destination action.');\r\n }\r\n }catch (\\Exception $e){\r\n $result->setData(['success' => false, 'message' => $e->getMessage()]);\r\n return $result;\r\n }\r\n\r\n $this->logTime('CreateOrSelect action ended.');\r\n\r\n $result->setData($resultData);\r\n return $result;\r\n }",
"public function perform(&$data)\n\t{\n\t\t$action = $this->action;\n\t\treturn $action($data);\n\t}",
"public function _doAction();",
"public function execute()\n\t{\n\t\t$this->prepare();\n\t\t$result = $this->processor->execute( $this->method, $this->url, $this->headers, $this->body, $this->config );\n\n\t\tif ( $result ) { // XXX exceptions?\n\t\t\t$this->response_headers = $this->processor->get_response_headers();\n\t\t\t$this->response_body = $this->processor->get_response_body();\n\t\t\t$this->executed = true;\n\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\t// processor->execute should throw an Exception which would bubble up\n\t\t\t$this->executed = false;\n\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function run() {\r\n\t\tif (isset($_GET['action'])) {\r\n\t\t\t$action = strtolower($_GET['action']);\r\n\t\t} else {\r\n\t\t\t$action = 'index';\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->checkAccess($action)) {\r\n\t\t\t$action = \"action\" . ucwords($action);\r\n\t\t} else {\r\n\t\t\t$action = \"actionNotAllowed\";\r\n\t\t}\r\n\t\t\r\n\t\tif (method_exists($this, $action)) {\r\n\t\t\t$this->$action();\r\n\t\t} else {\r\n\t\t\t$this->invalidAction($action);\r\n\t\t}\r\n\t}",
"public function exec()\n {\n try {\n $http_response = $this->front_controller->exec();\n return $this->http_transport->sendResponse($http_response);\n } catch (Exception $e) {\n $this->echoException($e);\n exit(1);\n }\n }",
"public function run()\n {\n $this->container = $this->container ?: new \\Phanda\\Container\\Container();\n\n try {\n if ($this->isActionOnController()) {\n return $this->runControllerMethod();\n }\n\n return $this->runCallableMethod();\n } catch (HttpResponseException $e) {\n return $e->getMessage();\n }\n }",
"public function execute()\n {\n $resultJson = $this->jsonFactory->create();\n $answer = null;\n $success = true;\n $question = $this->getQuestion();\n if ($question) {\n try {\n $answer = $this->helperData->getAnswer($question);\n } catch (\\Exception $e) {\n $answer = $e->getMessage();\n $success = false;\n }\n if (!empty($answer)) {\n $answer = trim($answer);\n }\n } else {\n $success = false;\n $answer = __('Please add some context so the AI can come up with the right content.');\n }\n\n return $resultJson->setData([\n 'answer' => $answer,\n 'success' => $success\n ]);\n }",
"protected function execute($action)\n\t{\n\t\t// Action is a function\n\t\tif (is_callable($action)) {\n\t\t\tif (method_exists($action, 'bindTo')) {\n\t\t\t\t$action->bindTo($this);\n\t\t\t}\n\n\t\t\treturn call_user_func_array($action, $this->args);\n\t\t}\n\n\t\t// Action can be in shape of 'directory/class'\n\t\t$action = preg_replace('/', '\\\\', $action);\n\t\t$class = \"\\\\{$controllerDir}\\\\{$action}\";\n\n\t\t// Action is a defined controller\n\t\tif (class_exists($class, true)) {\n\t\t\t$controller = new $class($this->template, $this->args, $this->baseUri);\n\n\t\t\t$crudMethod = $this->getCrudMethod($this->request['method']);\n\t\t\t$httpMethod = \"_{$this->request['method']}\";\n\n\t\t\t// Check which method is available in order of \n\t\t\t// given argument, rails crud method and httpmethod.\n\n\t\t\t// Action can be in form of 'class:method'\n\t\t\tif (!is_null(explode(':', $action)[1])) {\n\t\t\t\t$controllerMethod = explode(':', $action)[1];\n\n\t\t\t\tif(method_exists($controller, $controllerMethod)) {\n\t\t\t\t\t$response = $controller->$controllerMethod();\n\t\t\t\t} else {\n\t\t\t\t\tthrow new \\BadMethodCallException(\n\t\t\t\t\t\t\"Class '{$class}' does not support \".\n\t\t\t\t\t\t\"method {$controllerMethod}.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t} elseif (method_exists($controller, $crudMethod)) {\n\t\t\t\t$response = $controller->$crudMethod();\n\n\t\t\t} elseif (method_exists($controller, $httpMethod)) {\n\t\t\t\t$response = $controller->$httpMethod();\n\n\t\t\t} else {\n\t\t\t\tthrow new \\BadMethodCallException(\n\t\t\t\t\t\"Class '{$class}' does not support \".\n\t\t\t\t\t\"methods {$crudMethod} or {$httpMethod}.\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}\n\t\tthrow new InvalidActionException(\"Executed action '{$action}' \".\n\t\t\t\"is not a defined closure or controller.\");\n\t}",
"final public function perform()\n {\n $this->execute($this->args, $this->app);\n }",
"protected function manageExecutedAction()\n {\n $action = $this->flowEvaluator->getActionInFlow();\n $this->triggerEvent(__FUNCTION__ . '.executed');\n if ($action->hasFinalResults()) {\n $params = array('results' => $action->spit());\n $this->triggerEvent(__FUNCTION__ . '.hasFinalResults', $params);\n }\n }",
"public function execute()\n {\n if (!$this->user->authorize('admin.login')) {\n // TODO: improve\n return false;\n }\n\n $params = [];\n\n $event = new Event(\n [\n 'type' => &$this->target,\n 'key' => &$this->id,\n 'directory' => &$this->directory,\n 'collection' => &$this->collection,\n 'object' => &$this->object\n ]\n );\n $this->grav->fireEvent(\"flex.{$this->target}.admin.route\", $event);\n\n if ($this->isFormSubmit()) {\n $form = $this->getForm();\n $this->nonce_name = $form->getNonceName();\n $this->nonce_action = $form->getNonceAction();\n }\n\n // Handle Task & Action\n if ($this->task) {\n // validate nonce\n if (!$this->validateNonce()) {\n $e = new RequestException($this->getRequest(), 'Page Expired', 400);\n\n $this->close($this->createErrorResponse($e));\n }\n $method = $this->task_prefix . ucfirst(str_replace('.', '', $this->task));\n\n if (!method_exists($this, $method)) {\n $method = $this->task_prefix . 'Default';\n }\n\n } elseif ($this->target) {\n if (!$this->action) {\n if ($this->id) {\n $this->action = 'edit';\n $params[] = $this->id;\n } else {\n $this->action = 'list';\n }\n }\n $method = 'action' . ucfirst(strtolower(str_replace('.', '', $this->action)));\n\n if (!method_exists($this, $method)) {\n $method = $this->action_prefix . 'Default';\n }\n } else {\n return null;\n }\n\n if (!method_exists($this, $method)) {\n return null;\n }\n\n try {\n $response = $this->{$method}(...$params);\n } catch (RequestException $e) {\n $response = $this->createErrorResponse($e);\n } catch (RuntimeException $e) {\n // If task fails to run, redirect back to the previous page and display the error message.\n if ($this->task && !$this->redirect) {\n $this->setRedirect($this->referrerRoute->toString(true));\n }\n $response = null;\n $this->setMessage($e->getMessage(), 'error');\n }\n\n if ($response instanceof ResponseInterface) {\n $this->close($response);\n }\n\n // Grab redirect parameter.\n $redirect = $this->post['_redirect'] ?? null;\n unset($this->post['_redirect']);\n\n // Redirect if requested.\n if ($redirect) {\n $this->setRedirect($redirect);\n }\n\n return $response;\n }"
] | [
"0.8158507",
"0.7919956",
"0.7323433",
"0.73228854",
"0.73228854",
"0.73228854",
"0.7311486",
"0.7286468",
"0.7210248",
"0.7123298",
"0.6949441",
"0.6805409",
"0.67945397",
"0.67396957",
"0.673067",
"0.6708025",
"0.66695654",
"0.6665719",
"0.6649038",
"0.66345155",
"0.6608906",
"0.65929395",
"0.6569839",
"0.65621096",
"0.655098",
"0.6547429",
"0.6541751",
"0.64814794",
"0.6480959",
"0.6424924",
"0.641619",
"0.64076334",
"0.6372397",
"0.6368937",
"0.633619",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.6319258",
"0.63162076",
"0.6311375",
"0.6311375",
"0.6310382",
"0.6310382",
"0.6310382",
"0.6310382",
"0.6310382",
"0.6310382",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.6310039",
"0.63080686",
"0.6294578",
"0.6280751",
"0.6277849",
"0.62671256",
"0.62631726",
"0.62598944",
"0.6254638",
"0.6252708",
"0.6252651",
"0.6238311",
"0.6233465",
"0.6233465",
"0.6233465",
"0.62261087",
"0.6218031",
"0.62111294",
"0.620861",
"0.62055653",
"0.62033266",
"0.6201773",
"0.6201239",
"0.6199924",
"0.6198225",
"0.6183052",
"0.6182051",
"0.61625195",
"0.61382174",
"0.6133538"
] | 0.0 | -1 |
Returns the response from the action. | public function response($result, $request)
{
return $this->respondWithNoContent();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getResponseAction () {\n return $this->responseAction();\n }",
"public function getActionResponse($action=null){\n\t\t if($action){\n\t\t\t if(isset($this->action_response[$action])){\n\t\t\t \treturn $this->action_response[$action];\n\t\t\t }\n\t\t\t return;\n\t\t }\n\t\t return $this->action_response;\n\t}",
"public function getResponse()\r\n {\r\n return $this->_controller->getResponse();\r\n }",
"public function getResponse()\n {\n return $this->result->getResponse();\n }",
"public function getResponse() {}",
"public function getResponse() {}",
"function get_response() {\n return $this->response;\n }",
"public function get_response()\n {\n return $this->response; \n }",
"public function mainAction()\n {\n return $this->setResponse();\n }",
"public function get_response()\n\t{\n\t\treturn $this->response;\n\t}",
"public function get_response()\n\t{\n\t\treturn $this->response;\n\t}",
"public function getResponse()\n {\n return $this->get('response');\n }",
"public function getResponse()\n {\n return $this->get('response');\n }",
"public function indexAction()\n {\n\n return $this->response;\n }",
"public function response()\r\n {\r\n return $this->response;\r\n }",
"public function response()\r\n {\r\n return $this->response;\r\n }",
"public function getResponse()\n {\n return $this->response;\n }",
"public function response()\n\t\t{\n\t\t\treturn $this->response;\n\t\t}",
"public function getResponse() {\n return $this->response;\n }",
"public function getResponse() {\n return $this->response;\n }",
"public function getResponse() {\n return $this->response;\n }",
"public function getResponse ()\n {\n return $this->response;\n }",
"protected function getResponse()\n {\n return $this->response;\n }",
"public function getResponse()\r\n\t{\r\n\t\treturn $this -> response;\r\n\t}",
"public function response()\n {\n return $this->response;\n }",
"public function response()\n {\n return $this->response;\n }",
"public function getResponse() {\n\t\treturn $this->data->getResponse();\n\t}",
"public function getResponse()\r\n {\r\n return $this->response;\r\n }",
"public function response()\n {\n return $this->context->getResponse();\n }",
"public function getResponse() {\n\t\treturn $this->response;\n\t}",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }",
"public function getResponse()\n {\n return $this->get('Response');\n }"
] | [
"0.83888674",
"0.7174754",
"0.7150855",
"0.6974776",
"0.6931902",
"0.6931902",
"0.68952215",
"0.6871222",
"0.68644094",
"0.6861356",
"0.6861356",
"0.68586594",
"0.68586594",
"0.685057",
"0.6847018",
"0.6847018",
"0.68370646",
"0.68359673",
"0.6792551",
"0.6792551",
"0.6792551",
"0.6790326",
"0.6787622",
"0.67666715",
"0.6758834",
"0.6758834",
"0.67546016",
"0.6753827",
"0.671777",
"0.6699511",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767",
"0.6696767"
] | 0.0 | -1 |
Creates a new us | public function createAction()
{
if (!$this->request->isPost()) {
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "index"
));
}
// We're testing there no US with the same number for this project.
$uss = Userstory::find(array("id_project = :id_project: AND number = :number:",
"bind" => array(
"id_project" => $this->session->get("id_proj"),
"number" => $this->request->getPost("number")
)
));
if($uss->count() > 0) {
$this->flash->error("Ce numéro d'US est déjà utilisé, veuillez en choisir un autre.");
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "new"
));
}
// And we create the new Userstory.
$us = new Userstory();
$us->id_project = $this->session->get('id_proj');
$us->id_sprint = null;
$us->number = $this->request->getPost("number");
$us->content = $this->request->getPost("content");
$us->cost = $this->request->getPost("cost");
$us->status = "todo";
if (!$us->save()) {
foreach ($us->getMessages() as $message) {
$this->flash->error($message);
}
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "new"
));
}
$this->flash->success("Userstory créée avec succès");
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "index",
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n $ostObj = $this->instantiateOSTSDKForV2Api();\n $usersService = $ostObj->services->users;\n $params = array();\n $response = $usersService->create($params)->wait();\n $this->isSuccessResponse($response);\n }",
"public function create(){}",
"public function create()\n {\n $this->resetFields();\n //DAN MEMBUKA AREA\n $this->openUser();\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 \n }",
"private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }",
"public function create()\n\t{\n\t\t\n\t\t//\n\t}",
"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}",
"public function create(){\n\t\t//\n\t}",
"public function create(){\n\t\t//\n\t}",
"public function create(){\n\t\t//\n\t}",
"public function create(){\n\t\t//\n\t}",
"public function create() {\n\t\t\t//\n\t\t}",
"public function create() {\n\n\t\t\n\t}",
"public function create()\n\t{\n\n\n\t\t//\n\t}",
"public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}",
"public function create()\n {}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create()\n\t {\n\t //\n\t }",
"public function create()\r\n\t{\r\n\t\t//\r\n\t}",
"public function create()\n\t{\n\t\t//\n\n\t\t\n\n\t}",
"public function create() {}",
"public function create()\n {\n $simpan = new membership;\n }",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}",
"public function create()\n\t{\n\t\t//\n\t}"
] | [
"0.6713635",
"0.6525694",
"0.6421425",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.6408233",
"0.63636935",
"0.6349641",
"0.6314924",
"0.6299753",
"0.6299753",
"0.6285826",
"0.6285826",
"0.6285826",
"0.6285826",
"0.6277548",
"0.625932",
"0.62583876",
"0.6257837",
"0.6231994",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.6230735",
"0.622864",
"0.62224585",
"0.6216549",
"0.6214035",
"0.61984813",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454",
"0.61961454"
] | 0.0 | -1 |
Saves a us edited | public function saveAction()
{
if (!$this->request->isPost()) {
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "index"
));
}
$id_us = $this->request->getPost("id");
$us = Userstory::findFirst(array(
'id_us = :id_us:',
'bind' => array('id_us' => $id_us)
));
if (!$us) {
$this->flash->error("Cette userstory n'existe pas.");
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "index"
));
}
$us->id_us = $id_us;
$us->title = $this->request->getPost("title");
$us->content = $this->request->getPost("content");
$us->cost = $this->request->getPost("cost");
if (!$us->save()) {
foreach ($us->getMessages() as $message) {
$this->flash->error($message);
}
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "edit",
"params" => array($us->id_us)
));
}
$this->flash->success("Userstory correctement modifiée.");
return $this->dispatcher->forward(array(
"controller" => "userstory",
"action" => "index"
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\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()\n {\n parent::save();\n\n $soxId = $this->getEditObjectId();\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n // shopid\n $sShopID = oxRegistry::getSession()->getVariable(\"actshop\");\n $aParams['oxarticles__oxshopid'] = $sShopID;\n\n $oArticle = oxNew(\"oxarticle\");\n $oArticle->loadInLang($this->_iEditLang, $soxId);\n\n $oArticle->setLanguage(0);\n\n // checkbox handling\n if (!$oArticle->oxarticles__oxparentid->value && !isset($aParams['oxarticles__oxremindactive'])) {\n $aParams['oxarticles__oxremindactive'] = 0;\n }\n\n $oArticle->assign($aParams);\n\n //tells to article to save in different language\n $oArticle->setLanguage($this->_iEditLang);\n $oArticle = oxRegistry::get(\"oxUtilsFile\")->processFiles($oArticle);\n\n $oArticle->resetRemindStatus();\n\n $oArticle->updateVariantsRemind();\n\n $oArticle->save();\n }",
"public function save()\n {\n if (empty($this->id))\n {\n $sql =\n \"INSERT INTO rozvrhova_akcia (zaciatok, koniec, id_semester)\n\t\t\t\t VALUES (\".\n DateConvert::SKDateTime2DBTimestamp(\"$1\").\", \".\n DateConvert::SKDateTime2DBTimestamp(\"$2\").\",\n\t\t\t\t$3)\";\n $params = array($this->zaciatok, $this->koniec, $this->id_semester);\n }else\n {\n // save after edit\n $sql =\n \"UPDATE rozvrhova_akcia SET\n\t\t\t\t zaciatok=\".DateConvert::SKDateTime2DBTimestamp(\"$1\").\",\n\t\t\t\t koniec=\".DateConvert::SKDateTime2DBTimestamp(\"$2\").\",\n\t\t\t\t id_semester=$3\n\t\t\t\t WHERE id=$4\";\n $params = array($this->zaciatok, $this->koniec, $this->id_semester, $this->id);\n }\n $this->dbh->query($sql, $params);\n }",
"public function save()\r\n {\r\n \r\n }",
"function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `tours` values('\".addslashes($this->id).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->duration).\"' , '\".addslashes($this->description).\"' , '\".addslashes($this->tcid).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}",
"public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}",
"public function save() {\n\t\t\t\n\t\t}",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"public function save()\n\t{\n\n\t}",
"public function save()\r\n {\r\n //\r\n }",
"function save()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$post\t= JRequest::get('post');\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\t$post['id'] = (int) $cid[0];\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_( 'Weblink Saved' );\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Weblink' );\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\t\t$link = 'index.php?option=com_weblinks';\n\t\t$this->setRedirect($link, $msg);\n\t}",
"function save()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$user = JFactory::getUser();\n\t\t$post\t= JRequest::get('post');\n\t\tif (!($user->authorise('core.create', 'com_gmapfp') and empty($post['id'])) and !($user->authorise('core.edit', 'com_gmapfp') and !empty($post['id'])))\n\t\t{\n\t\t\t$this->setMessage(JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'), 'error');\n\t\t} else {\n\t\t\t$model = $this->getModel('gmapfp');\n\t\t\t$returnid=$model->store($post);\n\t\t\tif ($returnid>0) {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED' );\n\t\t\t} else {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED_ERROR' );\n\t\t\t}\n\t\t}\n\n\t\t$link = 'index.php?option=com_gmapfp&controller=gmapfp&task=view';\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$this->setRedirect($link, $msg);\n\t}",
"protected function saveUpdate()\n {\n }",
"public function save()\n {\n }",
"function save()\n {\n if( $this->input->post('modifiedwiki') !== null )\n {\n $params = array(\n 'body' => $this->input->post('savewiki'),\n );\n \n $this->wiki_model->update_wiki($this->input->post('modifiedwiki'), $params);\n\n $data['wikis'] = $this->wiki_model->get_all_wikis();\n $data['title'] = \"Documentation\";\n $this->load->view('templates/header', $data);\n $this->load->view('pages/wikihome.php');\n $this->load->view('templates/footer'); \n }\n else\n {\n show_error('The wiki you are trying to edit does not exist.');\n }\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 }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"function save() {\n //save the added fields\n }",
"public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public final function save() {\n }",
"function save();",
"function save();",
"protected function _save_add_edit() {\n\t\t\t$this->Dossierpcg66->begin();\n\n\t\t\tif ( !Hash::get($this->request->data, 'Dossierpcg66.etatdossierpcg') ) {\n\t\t\t\t$this->request->data['Dossierpcg66']['etatdossierpcg'] = 'attaffect';\n\t\t\t}\n\n\t\t\t$saved = $this->Dossierpcg66->saveAll( $this->request->data, array( 'validate' => 'first', 'atomic' => false ) );\n\t\t\t$etatdossierpcg = Hash::get($this->viewVars, 'dossierpcg66.Dossierpcg66.etatdossierpcg');\n\t\t\t$etatFinal = in_array( $etatdossierpcg, array( 'annule', 'traite', 'decisionvalid', 'transmisop' ) );\n\t\t\t$id = $saved ? $this->Dossierpcg66->id : Hash::get($this->viewVars, 'dossierpcg66.Dossierpcg66.id');\n\t\t\t$decisiondefautinsertionep66_id = Hash::get(\n\t\t\t\t$this->viewVars, 'dossierpcg66.Dossierpcg66.decisiondefautinsertionep66_id'\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * INFO : Passe l'etat d'une EP Audition transformé en EP Parcours\n\t\t\t * en \"traité\" si EP Parcours n'est pas traité alors que le Dossierpcg est validé.\n\t\t\t * En pratique ça n'arrive jamais et je ne comprend pas l'utilité de ce processus...\n\t\t\t * Ne semble pas avoir de conséquences.\n\t\t\t */\n\t\t\tif ( $saved && $etatFinal && $decisiondefautinsertionep66_id ) {\n\t\t\t\t$saved = $this->Dossierpcg66->WebrsaDossierpcg66->updateEtatPassagecommissionep( $decisiondefautinsertionep66_id );\n\t\t\t}\n\n\t\t\tif( $saved && $this->_saveFichiers($id) ) {\n\t\t\t\t$this->Dossierpcg66->commit();\n\t\t\t\t$this->Jetons2->release( $this->viewVars['dossier_id'] );\n\t\t\t\t$this->Session->setFlash( 'Enregistrement effectué', 'flash/success' );\n\t\t\t\t$this->redirect( array( 'controller' => 'dossierspcgs66','action' => 'index', $this->viewVars['foyer_id'] ) );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$id && $this->set('fichiers', $this->Fileuploader->fichiers( $id ));\n\t\t\t\t$this->Dossierpcg66->rollback();\n\t\t\t\t$this->Session->setFlash( 'Erreur lors de l\\'enregistrement', 'flash/error' );\n\t\t\t}\n\t\t}",
"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->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }",
"public function save(){\n }",
"public function editSave($id)\n {\n $data = array();\n $data['id'] = $id;\n $data['title'] = $_POST['title'];\n $data['content'] = $_POST['content'];\n $data['time'] = $_POST['time'];\n \n $this->model->editSave($data);\n header('location:'. URL .'index');\n }",
"public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"public function save()\n {\n }",
"public function save()\n {\n }",
"function SaveMemberEditor () {\n\n global $gSITEDOMAIN;\n\n global $gGROUPMEMBERACTION, $gGROUPMEMBERUSERNAME, $gGROUPMEMBERDOMAIN;\n\n // Loop through the action list.\n foreach ($gGROUPMEMBERACTION as $count => $action) {\n $username = $gGROUPMEMBERUSERNAME[$count];\n $domain = $gGROUPMEMBERDOMAIN[$count];\n switch ($action) {\n case GROUP_ACTION_APPROVE:\n $this->Approve ($username, $domain);\n break;\n case GROUP_ACTION_REMOVE:\n $USER = new cOLDUSER ();\n $USER->Select (\"Username\", $username);\n $USER->FetchArray ();\n if ($USER->uID != $this->userAuth_uID) {\n //$this->Leave ($username, $domain);\n } // if\n unset ($USER);\n break;\n } // switch\n } // foreach\n\n $this->Message = __(\"Member List Saved\");\n return (TRUE);\n }",
"public function save()\n {\n // For V2.0\n }",
"public function save() {\n }",
"public function save() {\n }",
"public function save() {\n }",
"public final function save()\n {\n }",
"function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }",
"public abstract function save();",
"public function save()\n {\n //\n }",
"public function save()\n\t{\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile->{Yii::$app->request->post()['flag']} = Yii::$app->request->post()['val'];\n\n\t\t$updatedProfile->save();\n\t}",
"function save()\n {\n }",
"function save()\n {\n }",
"function save() {\n $modified_fields = $this->modified_fields;\n $is_new = $this->isNew();\n\n if($is_new && ($this->getToken() == '')) {\n $this->resetToken();\n } // if\n\n $save = parent::save();\n if($save && !is_error($save)) {\n if($is_new || in_array('email', $modified_fields) || in_array('first_name', $modified_fields) || in_array('last_name', $modified_fields)) {\n $content = $this->getEmail();\n if($this->getFirstName() || $this->getLastName()) {\n $content .= \"\\n\\n\" . trim($this->getFirstName() . ' ' . $this->getLastName());\n } // if\n\n search_index_set($this->getId(), 'User', $content);\n cache_remove_by_pattern('object_assignments_*_rendered');\n } // if\n\n // Role changed?\n if(in_array('role_id', $modified_fields)) {\n clean_user_permissions_cache($this);\n } // if\n } // if\n\n return $save;\n }",
"public function save():void;",
"public function save_additional_editors() {\n\n\t\tglobal $post;\n\t\t$post_id = $post->ID;\n\n\t\tif ( ! empty( $_POST['contents'] ) ) {\n\t\t\t$data = htmlspecialchars( $_POST['contents'] );\n\t\t\tupdate_post_meta( $post_id, 'contents', $data );\n\t\t}\n\t\tif ( ! empty( $_POST['authordesc'] ) ) {\n\t\t\t$data = htmlspecialchars( $_POST['authordesc'] );\n\t\t\tupdate_post_meta( $post_id, 'authordesc', $data );\n\t\t}\n\t\tif ( ! empty( $_POST['heweb17reviews'] ) ) {\n\t\t\t$data = htmlspecialchars( $_POST['heweb17reviews'] );\n\t\t\tupdate_post_meta( $post_id, 'heweb17reviews', $data );\n\t\t}\n\t\tif ( ! empty( $_POST['featureblurb'] ) ) {\n\t\t\t$data = htmlspecialchars( $_POST['featureblurb'] );\n\t\t\tupdate_post_meta( $post_id, 'featureblurb', $data );\n\t\t}\n\n\n\t}",
"function saveEditArticulo(){\n\t\t$r = $this->ar->updateArticulo($this->id,$this->nombre,$this->descripcion);\n\t\tif($r=='true'){\n\t\t\t$msg = ARTICULO_EDITADO;\n\t\t}else{\n\t\t\t$msg = ERROR_EDIT_ARTICULO;\n\t\t}\n\t\treturn $msg;\t\n\t}",
"public function save()\n {\n return $this->edit($this->id, $this->data);\n }",
"function save()\n {\n $this->form_validation->set_rules($this->_get_rules());\n\n if($this->form_validation->run()){\n $entity = $this->_from_form();\n $this->data['save'] = $this->model->insert_entry($entity);\n $this->data['action_performed'] = 'save';\n $this->success($entity);\n }\n else {\n $this->create();\n }\n }",
"public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}",
"function save()\n {\n parent::save();\n }",
"function save()\n {\n parent::save();\n }",
"function save()\n {\n parent::save();\n }",
"function save() {\r\n $swr_id = $this->input->post(\"swr_id\");\r\n $process_id = $this->input->post(\"process_id\");\r\n $form_id = $this->input->post(\"form_id\");\r\n $this->load->model(\"staffs/process_model\");\r\n $data = array(\r\n \"process_id\" => $process_id,\r\n \"form_id\" => $form_id,\r\n \"swr_id\" => $swr_id\r\n );\r\n $this->process_model->edit_row($form_id, $data);\r\n }",
"function save()\n\t{\n\t\t$this->store() ;\n\t\t$link = 'index.php?option=com_arts_curriculum';\n\t\t$this->setRedirect( $link, $this->msg);\n\t}",
"public function editar()\n\t{\n\t\t$estado = new Estado();\n\t\t$estado->idestado = $_POST['idestado'];\n\t\t$estado->nombre = $_POST['nombreeditar'];\n\t\t$estado->poblacion_hombres = $_POST['poblacionHeditar'];\n\t\t$estado->poblacion_mujeres = $_POST['poblacionMeditar'];\n\t\t$estado->poblacion_total = $_POST['poblacionTeditar'];\n\t\t$estado->edad_promedio = $_POST['edadPeditar'];\n\t\t$estado->update();\n\t\t//redireccionamos a la vista agregarEstado\n\t\theader(\"location: index.php?controller=Direccion&action=agregarEstado\");\n\t}",
"function savePartie() {\n $data = array(\n 'winner' => $this->session->userdata('winner'),\n 'pierreJ1' => $this->session->userdata('pierreJ1'),\n 'pierreJ2' => $this->session->userdata('pierreJ2'),\n 'scoreJ1' => $this->session->userdata('scoreJ1'),\n 'scoreJ2' => $this->session->userdata('scoreJ2')\n );\n \n $this->db->where('id', $this->session->userdata('idPartie'))\n ->update('partie', $data);\n }",
"public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }",
"public function Save()\n {\n $required = array(\n \"title\" => \"Título\",\n \"src\" => \"Imagem\"\n );\n $this->validateData($required);\n parent::Save();\n }",
"public function save()\r\n {\r\n $this->checkIfDemo();\r\n $this->form_validation->set_rules('title', 'Title', 'trim|alpha_numeric_spaces|required|min_length[2]|max_length[50]');\r\n $this->form_validation->set_rules('description', 'Description', 'required|min_length[50]|max_length[10000]');\r\n $this->form_validation->set_rules('labels[]', 'Labels', 'max_length[50]');\r\n $this->form_validation->set_rules('values[]', 'Values', 'max_length[200]');\r\n\r\n $edit = $this->xssCleanInput('job_id') ? $this->xssCleanInput('job_id') : false;\r\n\r\n if ($this->form_validation->run() === FALSE) {\r\n echo json_encode(array(\r\n 'success' => 'false',\r\n 'messages' => $this->ajaxErrorMessage(array('error' => validation_errors()))\r\n ));\r\n } else {\r\n $this->AdminJobModel->storeJob($edit);\r\n echo json_encode(array(\r\n 'success' => 'true',\r\n 'messages' => $this->ajaxErrorMessage(array('success' => lang('job') . ($edit ? lang('updated') : lang('created'))))\r\n ));\r\n }\r\n }",
"function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `layer_points` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `layer_points` values('\".addslashes($this->id).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->lat).\"' , '\".addslashes($this->lon).\"' , '\".addslashes($this->alt).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->lp_image).\"' , '\".addslashes($this->notes).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}",
"public function save() {\n JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t// Initialise variables.\n $app = JFactory::getApplication();\n $model = $this->getModel('DwOpportunityForm', 'Dw_opportunitiesModel');\t\n\n // Get the user data.\n $data = JFactory::getApplication()->input->get('jform', array(), 'array');\n\t\t\n\t\t// Check if user can edit or create the item ---------------------------------------------------------------------------------------------\n\t\t$id = ( ( $data['id'] == 0 ) || !isset ( $data['id'] ) ) ? null : (int)$data['id'];\n $user = JFactory::getUser();\n\n if( $id ) \n\t\t{\n \t//Check the user can edit this item\n $authorised = $user->authorise('core.edit', 'com_dw_opportunities');\n\t\t\t\n\t\t\tif(!$authorised && $user->authorise('core.edit.own', 'com_dw_opportunities'))\n\t\t\t{\n\t\t\t\t//Check the owner from the model\n\t\t\t\t$itemData = $model -> getData($id);\n\t\t\t\t$itemOwner = ( isset ( $itemData -> created_by ) ) ? $itemData -> created_by : null ;\n\t\t\t\t$authorised = $user -> id == $itemOwner ; \n\t\t\t}\n\t\t\n } \n\t\telse \n\t\t{\n //Check the user can create new item\n $authorised = $user->authorise('core.create', 'com_dw_opportunities');\n }\t\t\n\n\t\tif (!$authorised)\n\t\t{\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , JText::_('COM_DW_OPPORTUNITIES_OPPORTUNITY_WIZARD_PERMISSION_DENIED') , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t}\n\t\t// ------------------------------------------------------------------------------------------------------------------------------\n\t\t\n // Validate the posted data.\n $form = $model->getForm();\n \n\t\tif (!$form)\n\t\t{\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $model->getError() , true ); //JForm::getInstance could not load file\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t}\n\t\t\n // Validate the posted data.\n $data = $model->validate($form, $data);\n\n // Check for errors.\n if ($data === false) \n\t\t{\n \ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $model->getErrors() , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t\t\n }\n\n // Attempt to save the data.\n $return = $model->save($data);\n\n // Check for errors.\n if ($return === false) \n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\techo new JResponseJson( '' , $model->getError() , true );\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\techo new JResponseJson($e);\n\t\t\t}\n\t\t\n\t\t\tjexit();\n\t\t\t\n }\n\n\t\ttry\n\t\t{\n\t\t\techo new JResponseJson( $return );\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\techo new JResponseJson($e);\n\t\t}\n\t\n\t\tjexit();\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward(array(\n 'controller' => \"tokuisaki_bunrui4_kbns\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $tokuisaki_bunrui4_kbn = TokuisakiBunrui4Kbns::findFirstByid($id);\n\n if (!$tokuisaki_bunrui4_kbn) {\n $this->flash->error(\"得意先分類4が見つからなくなりました。\" . $id);\n\n $this->dispatcher->forward(array(\n 'controller' => \"tokuisaki_bunrui4_kbns\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n if ($tokuisaki_bunrui4_kbn->updated !== $this->request->getPost(\"updated\")) {\n $this->flash->error(\"他のプロセスから得意先分類4が変更されたため更新を中止しました。\"\n . $id . \",uid=\" . $tokuisaki_bunrui4_kbn->kousin_user_id . \" tb=\" . $tokuisaki_bunrui4_kbn->updated .\" pt=\" . $this->request->getPost(\"updated\"));\n\n $this->dispatcher->forward(array(\n 'controller' => \"tokuisaki_bunrui4_kbns\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $post_flds = [];\n $post_flds = [\"cd\",\n \"name\",\n \"updated\",\n ];\n \n\n $thisPost=[]; // カンマ編集を消すとか日付編集0000-00-00を入れるとか$thisPost[]で行う\n $chg_flg = 0;\n foreach ($post_flds as $post_fld) {\n if ((array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld)) !== $tokuisaki_bunrui4_kbn->$post_fld) {\n $chg_flg = 1;\n break;\n }\n }\n if ($chg_flg === 0) {\n $this->flash->error(\"変更がありません。\" . $id);\n\n $this->dispatcher->forward(array(\n \"controller\" => \"tokuisaki_bunrui4_kbns\",\n \"action\" => \"edit\",\n \"params\" => array($tokuisaki_bunrui4_kbn->id)\n ));\n\n return;\n }\n\n $this->_bakOut($tokuisaki_bunrui4_kbn);\n\n foreach ($post_flds as $post_fld) {\n $tokuisaki_bunrui4_kbn->$post_fld = array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld);\n }\n\n if (!$tokuisaki_bunrui4_kbn->save()) {\n\n foreach ($tokuisaki_bunrui4_kbn->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward(array(\n 'controller' => \"tokuisaki_bunrui4_kbns\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $this->flash->success(\"得意先分類4の情報を更新しました。\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"tokuisaki_bunrui4_kbns\",\n 'action' => 'edit',\n 'params' => array($tokuisaki_bunrui4_kbn->id)\n ));\n }",
"public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }",
"function edit_save() {\n $user = $this->ion_auth->user()->row();\n $data['profil'] = $this->input->post('profil', true);\n $data['pengajaran'] = $this->input->post('pengajaran', true);\n $data['riset'] = $this->input->post('riset', true);\n $data['publikasi'] = $this->input->post('publikasi', true);\n $data['pengalaman'] = $this->input->post('pengalaman', true);\n $data['pendidikan'] = $this->input->post('pendidikan', true);\n $data['fname'] = $this->input->post('fname', true);\n $data['lname'] = $this->input->post('lname', true);\n //print_r($data['profil']);\n\n $this->model_portofolio->update_data_portofolio($user->id, 1, $data['profil']);\n $this->model_portofolio->update_data_portofolio($user->id, 2, $data['pengajaran']);\n $this->model_portofolio->update_data_portofolio($user->id, 3, $data['riset']);\n $this->model_portofolio->update_data_portofolio($user->id, 4, $data['publikasi']);\n $this->model_portofolio->update_data_portofolio($user->id, 5, $data['pengalaman']);\n $this->model_portofolio->update_data_portofolio($user->id, 6, $data['pendidikan']);\n $this->model_portofolio->update_name($user->id,$data['fname'],$data['lname']);\n //redirect('portofolio/user');\n }",
"public function saveAction()\n\t{\n\t\t$message = 'Une erreur est survenue. Votre école n\\'a pas été enregistré.';\n\n\t\t$school = new School();\n\t\t$school->id = (int) $this->getRequest()->post('id');\n\t\t$school->name = Input::safe( $this->getRequest()->post('name') );\n\t\t$saved = $school->save();\n\n\t\tif ( $saved ) {\n\t\t\t$message = 'Votre école a correctement été enregistré.';\n\t\t}\n\t\t$this->render( View::make( 'schools/show' , array(\n\t\t\t'status' => $saved,\n\t\t\t'message' => $message,\n\t\t\t'title' => $school->name,\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}",
"public function saved($model)\n\t{\n\t}",
"public function edit( )\r\n {\r\n //\r\n }",
"public function save()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\r\n\t\t$post\t= JRequest::get('post');\r\n\t\t$cid \t= JRequest::getVar( 'cid', array(), 'post', 'array' );\r\n\t\tJArrayHelper::toInteger($cid);\r\n\t\t\r\n\t\t$model = $this->getModel('languages');\r\n\t\t\r\n\t\tif ($model->store($cid, $post)) {\r\n\t\t\t$msg = JText::_( 'LANGUAGES_SAVED' );\r\n\t\t} else {\r\n\t\t\t$msg = JText::_( 'Error Saving Languages:' .$model->getErrors());\r\n\t\t}\r\n\r\n\t\t// Check the table in so it can be edited.... we are done with it anyway\r\n\t\t$link = 'index.php?option=com_joomfish';\r\n\t\t$this->setRedirect($link, $msg);\r\n\t}",
"public function save($data)\n\t{\n\t\t$id = (!empty($data['id'])) ? $data['id'] : (int)$this->getState('einsatzbericht.id');\n $state = (!empty($data['state'])) ? 1 : 0;\n $user = JFactory::getUser();\n if($id) {\n\t\t\t\n\t\t\t\n //Check the user can edit this item\n $authorised = $user->authorise('core.edit', 'com_einsatzkomponente') || $authorised = $user->authorise('core.edit.own', 'com_einsatzkomponente.einsatzbericht');\n if($user->authorise('core.edit.state', 'com_einsatzkomponente') !== true && $state == 1){ //The user cannot edit the state of the item.\n $data['state'] = 0;\n }\n } else {\n //Check the user can create new items in this section\n $authorised = $user->authorise('core.create', 'com_einsatzkomponente');\n if($user->authorise('core.edit.state', 'com_einsatzkomponente') !== true && $state == 1){ //The user cannot edit the state of the item.\n $data['state'] = 0;\n }\n }\n if ($authorised !== true) {\n JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));\n return false;\n }\n\t\t\t\n\t\t\t\n\t\t\t// Einsatz kopieren\n\t\t\tif($user->authorise('core.create', 'com_einsatzkomponente') == true){\n\t\t $copy = JFactory::getApplication()->getUserState('com_einsatzkomponente.edit.einsatzbericht.copy');\n \tif (!$copy == 0) :\n JFactory::getApplication()->setUserState('com_einsatzkomponente.edit.einsatzbericht.id', 0);\n JFactory::getApplication()->setUserState('com_einsatzkomponente.edit.einsatzbericht.copy', 0);\n $data['id'] = 0;\n\t\t\tendif; \n\t\t\t}\n\n\t\t$app\t= JFactory::getApplication();\n\t\t$params = $app->getParams('com_einsatzkomponente');\n $table = $this->getTable();\n if ($table->save($data) === true) {\n\t\tif ($params->get('eiko')) :\n\t\tif(!$_FILES['data']['name']['0'] =='') :\n\t\t$this->upload ($table->id,'data');\n\t\tendif;\t\n\t\tendif;\t\n\n return $id;\n } else {\n return false;\n }\n \n\t}",
"public function save(){\r\n $db = new Database();\r\n $sql = \"\";\r\n $stm = null;\r\n if (empty($this->id)){\r\n $sql = \"insert into interests (name) values (:name)\";\r\n $stm = $db->pdo->prepare($sql);\r\n }\r\n else{\r\n $sql = \"update interests set name=:name where id=:id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':id', $this->id);\r\n }\r\n $stm->bindParam(':name', $this->name);\r\n $stm->execute();\r\n }",
"public function saveAction() {\n parent::saveAction();\n }",
"public function edit() {\n\t\t\t\n\t\t}",
"public function save($params);",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }"
] | [
"0.69948494",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.6839321",
"0.68110865",
"0.6793522",
"0.6746136",
"0.6736995",
"0.6695141",
"0.6688173",
"0.66735363",
"0.66735363",
"0.6671161",
"0.65914816",
"0.65866715",
"0.65861213",
"0.6580722",
"0.6573933",
"0.65662515",
"0.6527228",
"0.65255404",
"0.650906",
"0.65066195",
"0.6503602",
"0.6481536",
"0.6480372",
"0.6480372",
"0.64676577",
"0.64615977",
"0.6456214",
"0.64343655",
"0.6421212",
"0.64190346",
"0.6382742",
"0.6382742",
"0.6382742",
"0.6382742",
"0.6382742",
"0.6381944",
"0.6381944",
"0.6380996",
"0.6380669",
"0.637992",
"0.63781834",
"0.63781834",
"0.63730794",
"0.6351367",
"0.6330097",
"0.6328598",
"0.63051754",
"0.63040656",
"0.63040656",
"0.6300549",
"0.6297082",
"0.62897635",
"0.62861794",
"0.62815386",
"0.6278047",
"0.62748295",
"0.6271854",
"0.6271854",
"0.6271854",
"0.6258218",
"0.6250265",
"0.62417",
"0.6241124",
"0.62350196",
"0.62256366",
"0.62183",
"0.6211473",
"0.62105006",
"0.6207959",
"0.62012285",
"0.6200093",
"0.61886173",
"0.61873853",
"0.6179189",
"0.61668986",
"0.616535",
"0.6156682",
"0.6149716",
"0.6142049",
"0.61391306",
"0.61369705",
"0.6136057"
] | 0.65175366 | 36 |
init the required globals | public function __construct()
{
global $viewController, $database, $settings, $message, $tableName, $tableColumns;
// get the database table names
$name = array_key_exists('dbName', $_GET) ? $_GET['dbName'] : null;
$tableName = $database->secureInput($name);
// check if database name is empty
if ($tableName == null || empty($tableName)) {
$message->setError("Missing table name to edit", \ALS\Message::Error);
} else {
// load the required table columns
$tableColumns = $database->getTableColumns($tableName);
}
// load the required scripts
global $customScripts;
$customScripts = '<script src="' . $settings->getTemplatesURL() . 'assets/js/popper.min.js"></script>' . "\n";
$customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/jquery.dataTables.min.js"></script>' . "\n";
$customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/dataTables.bootstrap4.min.js"></script>' . "\n";
$customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/dataTables.responsive.min.js"></script>' . "\n";
$customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/responsive.bootstrap4.min.js"></script>' . "\n";
// load the view
$viewController->loadView("ad_db_editTables.html");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function initializeGlobalVariables() {}",
"public static function fromGlobals() {}",
"private function setup_globals() {\r\n\t\t/** Versions **********************************************************/\r\n\r\n\t\t$this->version = '0.3-alpha';\r\n\t\t$this->db_version = '1';\r\n\r\n\t\t/** Paths *************************************************************/\r\n\r\n\t\t$this->file = __FILE__;\r\n\t\t$this->basename = apply_filters( 'atcf_plugin_basenname', plugin_basename( $this->file ) );\r\n\t\t$this->plugin_dir = apply_filters( 'atcf_plugin_dir_path', plugin_dir_path( $this->file ) );\r\n\t\t$this->plugin_url = apply_filters( 'atcf_plugin_dir_url', plugin_dir_url ( $this->file ) );\r\n\r\n\t\t$this->template_url = apply_filters( 'atcf_plugin_template_url', 'crowdfunding/' );\r\n\r\n\t\t// Includes\r\n\t\t$this->includes_dir = apply_filters( 'atcf_includes_dir', trailingslashit( $this->plugin_dir . 'includes' ) );\r\n\t\t$this->includes_url = apply_filters( 'atcf_includes_url', trailingslashit( $this->plugin_url . 'includes' ) );\r\n\r\n\t\t// Languages\r\n\t\t$this->lang_dir = apply_filters( 'atcf_lang_dir', trailingslashit( $this->plugin_dir . 'languages' ) );\r\n\r\n\t\t/** Misc **************************************************************/\r\n\r\n\t\t$this->domain = 'atcf'; \r\n\t}",
"function init_from_globals () {\n\t\t$this->init($_SERVER, $_GET, $_POST, $_FILES, 'php://input', $_COOKIE, MICROTIME);\n\t}",
"public static function init()\n {\n self::$browsers = new Browser_Manager();\n self::$users = new User_Manager();\n self::$routes = new Routing_Manager();\n self::$pages = new Page_Manager();\n self::$themes = new Theme_Manager();\n self::$debug = new Debug_Manager();\n\n // disable debugging if we are unit testing\n if (defined('UNIT_TEST') && UNIT_TEST)\n {\n self::$debug->setEnabled(false);\n }\n\n\t\t// with the general environment loaded, we can now load\n\t\t// the modules that are app-specific\n self::$request = new App_Request();\n self::$response = new App_Response();\n self::$conditions = new App_Conditions();\n }",
"protected function initVars() {\n\n\t\t}",
"function init() {}",
"public function getGlobals()\n {\n }",
"public function getGlobals();",
"public function getGlobals();",
"function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"private function init() {\n // Set environment variables MUST BE DONE IN THIS ORDER!\n self::initDefaultFormValues(); // Assign default values to forms\n self::initTablePriorityHash();\n self::initTableTypePriorityHash();\n self::initTableHash(); // assign tables.\n self::initTableColumnsHash(); // assign hash with column details.\n #self::initSurveyHash(); // Assign Surveys TODO Place this back in when surveys are merged.\n self::initAstroFilterHash(); // Assign Filters\n self::initQualityFlags(); // assign hash with column details for all quality flag tables.\n }",
"public function register_globals()\n {\n }",
"public function register_globals()\n {\n }",
"function __construct() {\n\t\t$this->init();\n\t\t$this->register_globals();\n\t}",
"public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"private function initialization() {\n //global $_POST,$_GET,$_SERVER,$_FILES,$_COOKIE,$_ENV;\n \n $this->ServerVar = &$_SERVER;\n $this->EnvVar = &$_ENV;\n $this->CookieVar = &$_COOKIE;\n $this->VARS = daddslashes(array_merge($_POST, $_GET, $_FILES));\n //$this->VARS = array_merge($_POST, $_GET, $_FILES);\n }",
"public function setGlobalsData()\n\t{\n\t\t$GLOBALS['controller'] = $this->class_Name;\n\t\t$GLOBALS['action'] = $this->action_Name;\n\t}",
"public function init_globals() {\n\t\t\t$current_theme = wp_get_theme();\n\t\t\t$this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) );\n\t\t\t$this->envato_username = apply_filters( $this->theme_name . '_theme_setup_wizard_username', 'dfdevelopment' );\n\t\t\t$this->oauth_script = apply_filters( $this->theme_name . '_theme_setup_wizard_oauth_script', $this->custom_url.'/files/envato/wptoken/server-script.php' );\n\t\t\t$this->page_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_page_slug', $this->theme_name . '-setup' );\n\t\t\t$this->parent_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_parent_slug', '' );\n\n\t\t\t//If we have parent slug - set correct url\n\t\t\tif ( $this->parent_slug !== '' ) {\n\t\t\t\t$this->page_url = 'admin.php?page=' . $this->page_slug;\n\t\t\t} else {\n\t\t\t\t$this->page_url = 'themes.php?page=' . $this->page_slug;\n\t\t\t}\n\t\t\t$this->page_url = apply_filters( $this->theme_name . '_theme_setup_wizard_page_url', $this->page_url );\n\n\t\t\t//set relative plugin path url\n\t\t\t$this->plugin_url = trailingslashit( get_template_directory_uri() . '/inc/envato_setup' );\n\t\t}",
"public function __construct() {\n\t\t$this->init();\n\t\t$this->register_globals();\n\t}",
"public function init()\n {\n // RETURN : global vars are set before\n if ( $this->initVar() )\n {\n return;\n }\n // RETURN : global vars are set before\n // Init the devider for the categories\n $this->initCatDevider();\n\n return;\n }",
"public function init()\n {\n $this->setEnv();\n }",
"public function _init(){}",
"public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }",
"function initializer() {\n init_env();\n }",
"function init(){\r\n\t}",
"protected static function initializeGlobalTimeTrackingVariables() {}",
"function init() {\r\n }",
"public function _init() {}",
"protected function _init()\r\n\t{\r\n\t}",
"function init();",
"function init() {\n\t\t\n\t}",
"public static function init()\n\t{\n\t\tself::initSettings();\n\t\tself::setupSettings();\n\t\tself::validateSettings();\n\t}",
"function init()\n\t{\n\t}",
"function init()\n\t{\n\t}",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public function init();",
"public static function init()\n {\n }",
"function init()\r\n \t{\r\n \t}",
"public static function init() {\n }",
"public static function init() {\n }",
"public static function init() {\n }",
"public static function init(){\n \n }",
"public static function init ()\n {\n }",
"public function init(){}",
"public function init(){}",
"function init()\n {\n }",
"function init()\n {\n }",
"function init()\n {\n }",
"function init()\n\t{\n\t\t\n\t}",
"public static function createFromGlobals();",
"protected static function init()\n {\n }",
"private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }",
"protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }",
"public static function init(): void {}",
"private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}",
"abstract protected function _init();",
"abstract protected function _init();",
"static public function init() {\n }",
"protected function _init()\n {\n }",
"function init()\r\n{\r\n\tglobal $SETTINGS;\t\r\n\t\r\n\trequire('funcs/logging.php');\r\n\trequire('funcs/http_funcs.php');\r\n\trequire('funcs/api_funcs.php');\r\n\t\r\n\t$SETTINGS = get_settings();\r\n\t\r\n\t\r\n\tdo_log(\"System initiated, debug level is: \".DEBUG,0);\r\n}",
"abstract function init();",
"public static function init()\n {\n }",
"protected function init()\n\t{\n\t\t\n\t}",
"function qa_initialize_modularity()\n{\n\tglobal $qa_modules, $qa_layers, $qa_override_files, $qa_override_files_temp, $qa_overrides, $qa_direct;\n\n\t$qa_modules = array();\n\t$qa_layers = array();\n\t$qa_override_files = array();\n\t$qa_override_files_temp = array();\n\t$qa_overrides = array();\n\t$qa_direct = array();\n}",
"public function init()\n {\n // Create a registry object\n\t\tself::$registry = new Registry();\n\t\t\n // set the current url and path root\n self::$url = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].( str_replace( $_SERVER['DOCUMENT_ROOT'], '', self::$path['root'] ) );\n \n // begin output buffering\n ob_start();\n\n }",
"protected function _init()\n {\n }",
"public function InitAll ();",
"protected function init()\n {\n $this->autoRefresh = $this->createAutoRefreshSetting();\n\n // User setting --> textbox converted to int defining a validator and filter\n $this->refreshInterval = $this->createRefreshIntervalSetting();\n\n // User setting --> radio\n $this->color = $this->createColorSetting();\n }",
"public static function initInitial()\n {\n\t\t// load the general environment first\n // the order matters!\n self::$languages = new Language_Manager();\n }",
"private function init()\n\t{\n\t\treturn;\n\t}",
"abstract protected function init();",
"abstract protected function init();",
"abstract protected function init();",
"abstract protected function init();",
"abstract protected function init();",
"abstract protected function init();",
"abstract public function init();",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}"
] | [
"0.8363796",
"0.78047043",
"0.76319814",
"0.75502867",
"0.7480796",
"0.72958493",
"0.7280463",
"0.72623104",
"0.72304994",
"0.72304994",
"0.72031283",
"0.7196483",
"0.71795076",
"0.71795076",
"0.7133442",
"0.71278137",
"0.7122769",
"0.7058183",
"0.70355314",
"0.7014274",
"0.6971612",
"0.6964613",
"0.69641894",
"0.69572246",
"0.6946214",
"0.69461346",
"0.69175893",
"0.6899712",
"0.6898176",
"0.689355",
"0.68860793",
"0.68537575",
"0.68402624",
"0.6834564",
"0.6834564",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.682389",
"0.6816125",
"0.6802746",
"0.67991865",
"0.67991865",
"0.67991865",
"0.67863476",
"0.6781438",
"0.6773389",
"0.6773389",
"0.6763108",
"0.6763108",
"0.6763108",
"0.6750831",
"0.6748725",
"0.6746021",
"0.6741269",
"0.6728307",
"0.67263013",
"0.67156297",
"0.6714422",
"0.6714422",
"0.67133045",
"0.6696198",
"0.6676844",
"0.6674359",
"0.6664762",
"0.66616184",
"0.6634742",
"0.6634535",
"0.6628039",
"0.6627603",
"0.66261184",
"0.66119",
"0.66034955",
"0.65980333",
"0.65980333",
"0.65980333",
"0.65980333",
"0.65980333",
"0.65980333",
"0.65922046",
"0.6584157",
"0.6584157",
"0.6584157",
"0.6584157",
"0.6584157",
"0.6584157",
"0.6583451",
"0.6583451",
"0.6583451",
"0.6583451",
"0.6583368",
"0.6583368"
] | 0.0 | -1 |
Admin Edit an existing record or display form for adding a new record. | public function admin_edit($id = null)
{
if (!empty($id) && is_numeric($id))
{
$record = $this->Coupon->find('first', array(
'conditions' => array('Coupon.id' => $id)
));
if (empty($this->data))
{
$this->data = $record;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit_record()\n {\n \t$id = $this->uri->segment(4);\n $table = CMS_TABLE.' as u';\n\t\t$fields = array('u.*');\n\t\t$match = array('u.cms_id' => $id);\n\t\t$result \t = $this->general_model->get_records($table,$fields,'','',$match);\n\t\t$data['editRecord'] = $result;\n\t\t$data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit(Record $record)\n {\n //\n }",
"public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function showEdit()\n {\n\n }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view(\"web_admin.books.edit\");\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit() {\n\t\t\t\n\t\t}",
"public function edit()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/product/edit');\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/update';\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/edit', $this->data);\r\n\r\n\r\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function editAction() {}",
"public function addEditAction()\n {\n $form = $this->_getForm();\n\n $id = $this->_getPrimaryId();\n\n if ($this->getRequest()->isPost()) {\n $this->_handlePostAction();\n\n if ($form->isValid($this->getRequest()->getPost())) {\n $this->_processValidForm();\n }\n } else {\n if ($id) {\n $row = $this->_getRow($id);\n\n $form->setDefaults($row->toArray());\n }\n }\n\n if (!$id) {\n $url = $this->_getNewSubmitLocation();\n } else {\n $url = $this->_getEditSubmitLocation();\n }\n\n $form->setAction($this->view->url($url, null, true));\n\n $this->view->form = $form;\n }",
"public function edit( )\r\n {\r\n //\r\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public static function BackDisplayEdit()\n\t{\n\t\t$Object = Object::getById(\n\t\t\t$options = array(\n\t\t\t\t'object_id'\t => Util::getvalue('id'),\n\t\t\t\t'model' => 'ArticleModel',\n\t\t\t\t'table' => ArticleModel::$table,\n\t\t\t\t'state'\t\t => false, \n\t\t\t\t'relations'\t => true,\n\t\t\t\t'multimedas' => true,\n\t\t\t\t'categories' => true\n\t\t\t)\n\t\t);\n\n\t\tif(!$Object) Application::Route(array('modulename'=>'article'));\n\t\t\n\t\t$Locations = Location::getList($parent=0);\n\n\t\tparent::loadAdminInterface();\n\t\tself::$template->setcontent($Object, null, 'object');\n\t\tself::$template->setcontext($Locations, null, 'locations');\n\t\tself::$template->add(\"article.templates.xsl\");\n\t\tself::$template->add(\"article.edit.xsl\");\n\t\tself::$template->display();\n\t}",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function edit($model, $form);",
"public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }",
"public function editAction()\n {\n $ctrlRow = new Admin_Model_DbRow_Controller($this->dbCtrl->find($this->checkControllerIdParam()));\n $form = new Admin_Form_Controller_Edit($ctrlRow);\n\n IF($this->getRequest()->isPost()) {\n IF($form->isValid($this->getRequest()->getParams())) {\n $ctrlRow->fromArray(array(\n 'description' => $this->getRequest()->getParam('description')\n ));\n $this->dbCtrl->update($ctrlRow->toDbArray(array('description')), $ctrlRow->get('id'));\n \n $this->_redirect('admin/controller/index');\n }\n }\n\n $this->view->form = $form;\n }",
"public function edit()\n\t{\n\t\t//\n\t}",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function getEdit(){\n return view(\"admin.product.edit\" );\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function edit()\n {\n \n \n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit()\n\t{\n\t\t\n\t}",
"public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"function edit()\n\t{\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Make sure you are logged in\n\t\tif (!$user->authorise('com_weblink.weblink.edit')) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\tJRequest::setVar('view', 'weblink');\n\t\tJRequest::setVar('layout', 'form');\n\n\t\t$model = &$this->getModel('weblink');\n\t\t$model->checkout();\n\n\t\tparent::display();\n\t}",
"function show_edit()\n\t{\n\t\treturn '';\n\t}",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"public function edit() {\n }",
"public function edit_admin_show($edit)\n\t{\n\t\t$sql=\"SELECT * FROM `create_admin` WHERE id = '$edit'\";\n\t\t$result=$this->db->query($sql);\n\t\t$data= $result->fetch_array();\n\t\techo \"<input class='id' type='text' name='id' value='$data[serial_id]'>\n <br><br>\n <input class='name' type='text' name='name' value='$data[name]'>\n <br><br>\n <input class='email' type='email' name='email' value='$data[email]'>\n <br><br>\n <input class='pass' type='password' name='pass' value='$data[password]'>\n <br><br>\n <select class='categore' name='categore'>\n <option value='$data[categore]' selected='selected'>$data[categore]</option>\n <option value='super-admin'>Super-Admin</option>\n <option value='admin'>Admin</option>\n <option value='sub-admin'>Sub-Admin</option>\n </select>\n \n <select class='stat' name='stat'>\n \t<option value='$data[stat]'>$data[stat]</option>\n <option value='1'>Active</option>\n <option value='0'>Inactive</option>\n </select>\n <br><br>\n <button type='submit' class='submit' name='update' >Update Admin</button>\";\n\t}",
"function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'transactions');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function edit(BookRecord $bookRecord)\n {\n //\n }",
"abstract protected function renderEdit();",
"public function editRecord() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-edit') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = $this->uri->segment(3);\n $user = $this->UserModel->getRecord($id);\n $permission_group = $this->UserModel->getUserType($user->id);\n $user->user_role = $permission_group->user_type;\n $this->data['result'] = $user;\n $this->set_view('user/edit_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }",
"public function actionEdit($id) { }",
"public function editAction()\r\n {\r\n }",
"public function actionEdit(){\n\t\t$form = $_POST;\n\t\t$id = $form['id'];\n\t\tunset($form['id']);\n\t\tunset($form['submit_']);\n\t\tif($form['active'] == 'on'){\n\t\t\t$form['active'] = 1;\n\t\t}\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('UPDATE core_pages SET ? WHERE id = ?', $form, $id);\n\t\t$this->redirect('pages:');\n\t}",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\n {\n \n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gc_Service_OrderShow::getOrderShow(intval($id));\n\t\n\t\t//状态\n\t\t$this->assign('ordershow_status', $this->ordershow_status);\n\t\t\n\t\t//渠道\n\t\tlist(,$ordershow_channel) = Gc_Service_OrderChannel::getAllOrderChannel();\n\t\t$ordershow_channel = Common::resetKey($ordershow_channel, 'id');\n\t\t$this->assign('ordershow_channel', $ordershow_channel);\n\t\t\t\t\n\t\t$this->assign('info', $info);\n\t}",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }",
"function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}",
"public function postEdit(){\n return view(\"admin.product.edit\" );\n }",
"public function actionEdit()\n\t{\n\t\t$field = $this->_getFieldOrError($this->_input->filterSingle('field_id', XenForo_Input::STRING));\n\t\treturn $this->_getFieldAddEditResponse($field);\n\t}",
"public function Edit()\n\t{\n\t\t\n\t}",
"public function edit()\r\n\t{\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\r\n\t}",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit()\n\t{\n\t\tJRequest::setVar( 'view', 'player' );\n\t\tJRequest::setVar( 'layout', 'form' );\n\t\tJRequest::setVar('hidemainmenu', 1);\n\t \t \n\t\tparent::display();\n\t}",
"public function edit()\n\t{\n\t\treturn view('account.edit');\n\t}",
"public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}",
"public function getEditForm();",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit($id = null)\n\t{\n\t\t// Set title\n\t\t$this->setTitle($id ? 'K2_EDIT_EXTRA_FIELD' : 'K2_ADD_EXTRA_FIELD');\n\n\t\t// Set row\n\t\t$this->setRow($id);\n\n\t\t// Set form\n\t\t$this->setForm();\n\n\t\t// Set menu\n\t\t$this->setMenu('edit');\n\n\t\t// Set Actions\n\t\t$this->setFormActions();\n\n\t\t// Render\n\t\tparent::render();\n\t}",
"public function edit(PatientRecord $patientRecord)\n {\n //\n }",
"public function edit()\n {\n return view('admin.post.createOrUpdate');\n }",
"public function index_onUpdateForm()\n\t{\n\t\t$record_id = post('record_id');\n\t\tparent::update($record_id);\n\t\t$this->controller->vars['record_id'] = $record_id;\n\t\treturn $this->makePartial('update');\n\t}",
"public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function editForm($id)\n {\n $record = HistoryDb::findOrFail($id);\n $this->edit_id = $id;\n $this->title = $record->title;\n $this->description = $record->description;\n $this->event_date = $record->event_date;\n $this->mode = 'edit';\n $this->submit_text = \"Update\";\n\n // Util::showAlert($this,'Test content...!');\n\n }",
"public function edit()\n\t {\n\t return view('lecturer.edit');\n\t }",
"public function editAction()\n {\n $primaryKey = $this->params($this->primaryKeyName);\n $form = $this->getForm();\n $model = $this->getModel(); \n if (!is_null($primaryKey)) {\n $data = $this->sm->get($this->mainTableFactory)->getOne($primaryKey);\n $model->exchangeObject($data);\n }\n $form->setData($model->toArray());\n $tokens = explode('\\\\',$this->modelName);\n $keyViewModel = end($tokens);\n $keyViewModel = lcfirst($keyViewModel);\n return new ViewModel([\n 'form' => $form,\n $keyViewModel => $model,\n ]);\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}",
"public function edit()\n {\n return view('website::edit');\n }",
"public function _editAction() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$action_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$action_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->getAllWhere ( 'form_id = \"' . ( int ) $this->_getFormId () . '\"' );\n\t\t\n\t\t$action = $this->getModel ( 'action' );\n\t\t$action->get ( ( int ) $action_id );\n\t\t\n\t\t$this->loadPluginModel ( 'actions' );\n\t\t\n\t\t$this->setView ( 'edit_action' );\n\t\n\t}",
"protected function actionEdit() {\r\n\r\n //try 1: get the object type and names based on the current object\r\n $objInstance = class_objectfactory::getInstance()->getObject($this->getSystemid());\r\n if($objInstance != null) {\r\n $strObjectTypeName = uniSubstr($this->getActionNameForClass(\"edit\", $objInstance), 4);\r\n if($strObjectTypeName != \"\") {\r\n $strType = get_class($objInstance);\r\n $this->setCurObjectClassName($strType);\r\n $this->setStrCurObjectTypeName($strObjectTypeName);\r\n }\r\n }\r\n\r\n //try 2: regular, oldschool resolving based on the current action-params\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n\r\n $objEdit = new $strType($this->getSystemid());\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"edit\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\".$this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error editing current object type not known \", class_exception::$level_ERROR);\r\n }"
] | [
"0.77151984",
"0.74062943",
"0.740129",
"0.7256166",
"0.72399557",
"0.7213179",
"0.72093755",
"0.7188606",
"0.71717924",
"0.7162131",
"0.7162131",
"0.7125118",
"0.71148413",
"0.70985675",
"0.7091996",
"0.7063838",
"0.7060254",
"0.7058638",
"0.7058638",
"0.7053377",
"0.7051325",
"0.70447886",
"0.7025788",
"0.6995646",
"0.6979755",
"0.6976559",
"0.69711167",
"0.6962522",
"0.6950119",
"0.6946076",
"0.6939441",
"0.6933321",
"0.6906701",
"0.690222",
"0.68762696",
"0.68686134",
"0.6850911",
"0.68485546",
"0.68426424",
"0.6837772",
"0.68305635",
"0.6822432",
"0.6822243",
"0.6820306",
"0.68112385",
"0.6810655",
"0.6806435",
"0.6806376",
"0.67896545",
"0.67852235",
"0.6777604",
"0.6771851",
"0.67704624",
"0.676807",
"0.676807",
"0.67675644",
"0.67663664",
"0.67580557",
"0.67580557",
"0.67580557",
"0.67560726",
"0.6754134",
"0.67496777",
"0.6749203",
"0.67459863",
"0.6741098",
"0.673288",
"0.67305136",
"0.67208856",
"0.6709684",
"0.6703287",
"0.6698248",
"0.6697093",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.66903114",
"0.6684881",
"0.66834855",
"0.66794246",
"0.6674525",
"0.66696364",
"0.6665208",
"0.6665208",
"0.6665208",
"0.66650754",
"0.6663854",
"0.6659394",
"0.6651489",
"0.66507715",
"0.66450816",
"0.6644819",
"0.6639433"
] | 0.0 | -1 |
Admin Save record (existing or new). | public function admin_save()
{
if ($this->Coupon->saveAll($this->data))
{
$id = (empty($this->data['Coupon']['id'])) ? $this->Coupon->getInsertID() : $this->data['Coupon']['id'];
$this->Session->setFlash('Record saved.', 'default', array('class' => 'success'));
$this->redirect('/admin/coupons/edit/' . $id);
}
$this->Session->setFlash('Record could not be saved. Please check the form for errors.', 'default', array('class' => 'failure'));
return $this->setAction('admin_edit');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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();",
"function save() {\n\n\t\t// calls generic ORM save (insert or update)\n\t\tparent::save();\n\n\t}",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"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 save() {\n\t\t\t\n\t\t}",
"public function save()\r\n {\r\n //\r\n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"function save()\n {\n $this->form_validation->set_rules($this->_get_rules());\n\n if($this->form_validation->run()){\n $entity = $this->_from_form();\n $this->data['save'] = $this->model->insert_entry($entity);\n $this->data['action_performed'] = 'save';\n $this->success($entity);\n }\n else {\n $this->create();\n }\n }",
"public function save()\r\n {\r\n \r\n }",
"public function save(){\n }",
"public function save()\n\t{\n\n\t}",
"public static function save()\n\t{\n//\t\t{\n//\t\t\techo static::$error;\n//\t\t\treturn false;\n//\t\t}\n\n\t\t$instance = static::$_instance[static::_getTable()];\n\t\t$columns = DB::getColumnListing(static::$_table);\n\n\t\tif (@$instance->id)\n\t\t{\n\t\t\tDB::where($instance->id);\n\n\t\t\tif (in_array('updated', $columns))\n\t\t\t\t$instance->updated = date('Y-m-d H:i:s');\n\n\t\t\tif (in_array('updater', $columns))\n\t\t\t\t$instance->updater = (int)Auth::identity()->id;\n\n\t\t\tDB::table(static::$_table)->update($instance);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (in_array('ordering', $columns))\n\t\t\t\t$instance->ordering = DB::table(static::$_table)->getNewOrdering();\n\n\t\t\tif (in_array('created', $columns))\n\t\t\t\t$instance->created = date('Y-m-d H:i:s');\n\n\t\t\tif (in_array('creator', $columns))\n\t\t\t\t$instance->creator = (int)Auth::identity()->id;\n\n\t\t\tDB::table(static::$_table)->insert($instance);\n\t\t\t$instance->id = DB::getLastInsertId();\n\t\t}\n\n\t\treturn true;\n\t}",
"public function save()\n {\n }",
"public function save() {\n }",
"public function save()\n {\n //\n }",
"public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }",
"public function save() {\n }",
"public function save() {\n }",
"public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}",
"function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }",
"public function save(){\r\n return isset($this->id) ? $this->update() : $this->create();\r\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 return isset($this->id) ? $this->update() : $this->create();\n \n }",
"public function save()\n {\n }",
"public function save()\n {\n }",
"public function save()\n {\n // For V2.0\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 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 function postSave() {}",
"public function save(){\n\t\treturn isset($this->id)?$this->update():$this->create();\t\n\t}",
"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(): bool\n {\n return $this->id > 0\n ? $this->actionHandler->update()\n : $this->actionHandler->insert();\n }",
"public function save() {\n\n }",
"public abstract function save();",
"public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }",
"public function save() {\r\n $dateNow = date('Y-m-d H:i:s', time());\r\n $this->id = (int) $this->id;\r\n \r\n if (!empty($this->id)) {\r\n //update case\r\n if ($this->_update()) {\r\n return true;\r\n }\r\n }\r\n else {\r\n //Insert case\r\n if ($this->_insert()) {\r\n return true;\r\n }\r\n }\r\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 }",
"protected function saveUpdate()\n {\n }",
"public function save() : bool {\n\t\t// Check if record is new\n\t\t$isNew = isset($this->{$this->primaryKey}) && $this->{$this->primaryKey} ? false : true;\n\n\t\tif ($isNew) {\n\t\t\t// Insert\n\t\t\t$this->database->query('INSERT INTO ' . $this->tableNamePrefixed, $this->getValuesForDatabase());\n\t\t\tif ($this->database->getInsertId()) {\n\t\t\t\t$this->{$this->primaryKey} = $this->database->getInsertId();\n\t\t\t}\n\t\t} else {\n\t\t\t// Update\n\t\t\t$this->database->query(\n\t\t\t\t'UPDATE ' . $this->tableNamePrefixed . ' SET',\n\t\t\t\t$this->getValuesForDatabase(),\n\t\t\t\t'WHERE ' . $this->primaryKey . ' = ?', $this->{$this->primaryKey}\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}",
"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(){\n // if(isset($this->id)){$this->update();} else {$this->create();}\n return isset($this->id)? $this->update(): $this->create() ;\n\n }",
"protected function actionSave() {\r\n $strType = $this->getCurObjectClassName();\r\n $strSystemId = \"\";\r\n\r\n if(!is_null($strType)) {\r\n\r\n /** @var $objRecord interface_model|class_model */\r\n $objRecord = null;\r\n\r\n if($this->getParam(\"mode\") == \"new\") {\r\n $objRecord = new $strType();\r\n $strSystemId = $this->getSystemid();\r\n }\r\n else if($this->getParam(\"mode\") == \"edit\")\r\n $objRecord = new $strType($this->getSystemid());\r\n\r\n if($objRecord != null) {\r\n $objForm = $this->getAdminForm($objRecord);\r\n if(!$objForm->validateForm()) {\r\n if($this->getParam(\"mode\") === \"new\")\r\n return $this->actionNew();\r\n if($this->getParam(\"mode\") === \"edit\")\r\n return $this->actionEdit();\r\n }\r\n\r\n $objForm->updateSourceObject();\r\n $objRecord->updateObjectToDb($strSystemId);\r\n\r\n $this->adminReload(getLinkAdminHref($this->getArrModule(\"modul\"), $this->getActionNameForClass(\"list\", $objRecord), \"&systemid=\".$objRecord->getStrPrevId().($this->getParam(\"pe\") != \"\" ? \"&peClose=1\" : \"\")));\r\n return \"\";\r\n }\r\n }\r\n else\r\n throw new class_exception(\"error on saving current object type not known \", class_exception::$level_ERROR);\r\n\r\n\r\n return $this->getLang(\"commons_error_permissions\");\r\n }",
"public function save($model);",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"public function saveAction(): void\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $id = $this->request->getPost('id', 'int');\n \n $record = Ana::findFirstById($id);\n \n \n if (!$record) {\n $this->flash->error('ana does not exist');\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $data = $this->request->getPost();\n \n \n $form = new AnaForm();\n \n \n if (!$form->isValid($data, $record)) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error((string)$message);\n }\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'new',\n ]);\n\n return;\n }\n\n \n \n \n if (!$record->save()) {\n foreach ($record->getMessages() as $message) {\n $this->flash->error((string)$message);\n }\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'new',\n ]);\n\n return;\n }\n\n $form->clear();\n $this->flash->success('Ana se guardo con èxito');\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n }",
"public function saveAction() {\n parent::saveAction();\n }",
"public function save($update = true) {}",
"function save() {\n //save the added fields\n }",
"public function save($data);",
"public function save($data);",
"public function save($data);",
"public function save($params);",
"public function save() {\n\n $data = array(\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'metatitle' => $this->getMetatitle(),\n 'metakeywords' => $this->getMetakeywords(),\n 'metadescription' => $this->getMetadescription()\n );\n $data['parent_id'] = 0; // by default it is 0, becouse right now there is no use of parent id in this application\n if (null === ($id = $this->getId())) {\n unset($data['id']);\n $data['status'] = 1;\n return $this->getMapper()->getDbTable()->insert($data);\n } else {\n $data['status'] = $this->getStatus();\n return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n }\n\n }",
"public function save() \n\t{\n\t\tif (isset($this->id)) {\t\n\t\t\n\t\t\t// Return update when id exists\n\t\t\treturn $this->update();\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t// Return insert when id does not exists\n\t\t\treturn $this->insert();\n\t\t}\n\t}",
"function save()\n\t{\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$user = JFactory::getUser();\n\t\t$post\t= JRequest::get('post');\n\t\tif (!($user->authorise('core.create', 'com_gmapfp') and empty($post['id'])) and !($user->authorise('core.edit', 'com_gmapfp') and !empty($post['id'])))\n\t\t{\n\t\t\t$this->setMessage(JText::_('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED'), 'error');\n\t\t} else {\n\t\t\t$model = $this->getModel('gmapfp');\n\t\t\t$returnid=$model->store($post);\n\t\t\tif ($returnid>0) {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED' );\n\t\t\t} else {\n\t\t\t\t$msg = JText::_( 'GMAPFP_SAVED_ERROR' );\n\t\t\t}\n\t\t}\n\n\t\t$link = 'index.php?option=com_gmapfp&controller=gmapfp&task=view';\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$this->setRedirect($link, $msg);\n\t}",
"public function save()\n\t{\n\n\t\treturn parent::save();\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() {\r\n if ($this->model->getId()) {\r\n return $this->model->update();\r\n }\r\n return $this->create();\r\n }",
"public function Save(){\r\n\t\t$this->db->save();\r\n\t}",
"function saveRecord()\n\t{\n\t\t$data['roleID'] = $this->roleID;\n\t\t$data['module'] = $this->module;\n\t\t$data['roleName'] = $this->roleName;\n\t\t$data['roleDesc'] = $this->roleDesc;\n\t\t\n\t\t$this->db->insert('roles', $data); \n\t\t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse \n\t\t\treturn true;\n\t}",
"public function save()\n\t{\n\t\tparent::save();\n\t\t\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\t\t\n\t\t$this->db->query('UPDATE `'.$table_prefix.'indicator_lang` SET indicator_title = ?, indicator_description = ? WHERE indicator_id = ? AND locale = ?',\n\t\t\t$this->indicator_title, $this->indicator_description, $this->id, $this->locale\n\t\t);\n\t}",
"public function save() {\n return isset($this->id) ? $this->update() : $this->create();\n }",
"public function save()\n {\n \treturn FactoryAbastract::dao(get_class($this))->save($this);\n }",
"public function save() {\n return $this->{static::$primaryKey} === null? $this->create() : $this->update();\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 {\n return;\n }",
"public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\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 }",
"public function save(Authenticatable $model);",
"public function SaveRecord()\n {\n // call ValidateForm()\n if ($this->ValidateForm() == false)\n return;\n\n $recArr = array();\n if ($this->ReadInputRecord($recArr) == false)\n return;\n\n if ($this->m_Mode == MODE_N)\n $dataRec = new DataRecord(null, $this->GetDataObj());\n else if ($this->m_Mode == MODE_E)\n $dataRec = new DataRecord($this->GetActiveRecord(), $this->GetDataObj());\n foreach ($recArr as $k=>$v)\n $dataRec[$k] = $v; // or $dataRec->$k = $v;\n $ok = $dataRec->save();\n\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n\n $this->UpdateActiveRecord($this->GetDataObj()->GetActiveRecord());\n $this->SetDisplayMode (MODE_R);\n // TODO: popup message of new record successful saved\n return $this->ReRender();\n }",
"public function save()\n {\n return $this->edit($this->id, $this->data);\n }",
"public function save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}",
"public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function Save()\n {\n }",
"public function save()\n {\n if($this->id != -1)\n {\n $this->update_subject();\n }\n else\n {\n $this->insert_subject();\n }\n }",
"public function save()\n {\n $this->hasTableName();\n $pk = $this->pk;\n $condition = \"\";\n if ($this->isNew) {\n $sql = \"INSERT INTO \" . $this->table_name . \" SET \";\n $update = '';\n } else {\n if (!isset($this->$pk))\n throw new Exception('Update em objeto sem chave definida', 403);\n\n $sql = \"UPDATE \" . $this->table_name . \" SET \";\n $update = \" WHERE `\" . $this->pk . \"` = '\" . $this->$pk . \"'\";\n }\n foreach ($this->rules() as $key => $validation) {\n if ($this->validateField($key, $validation) && isset($this->$key) && $this->$key != \"\") {\n $sql .= \" `\" . $key . \"` = '\" . $this->$key . \"',\";\n $condition .= \" `\" . $key . \"` = '\" . $this->$key . \"' AND\";\n }\n }\n if (!$this->getErrors()) {\n $sql = substr($sql, 0, -1) . $update;\n if (Database::dbactionf($sql)) {\n if ($this->isNew) {\n $this->$pk = Database::lastID();\n $this->persisted();\n }\n return true;\n }\n }\n return false;\n }"
] | [
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.7501105",
"0.73498344",
"0.732811",
"0.732811",
"0.7325933",
"0.72666633",
"0.72653395",
"0.72102326",
"0.71809006",
"0.7180385",
"0.7171492",
"0.7104266",
"0.7087023",
"0.7070196",
"0.70564145",
"0.70549715",
"0.70409495",
"0.7040869",
"0.70276487",
"0.70276487",
"0.70099056",
"0.6981533",
"0.6980788",
"0.697502",
"0.69737864",
"0.6960146",
"0.6960146",
"0.69496703",
"0.6949189",
"0.69485897",
"0.6946087",
"0.69428706",
"0.69343394",
"0.6903163",
"0.68876356",
"0.6876043",
"0.6871946",
"0.6865687",
"0.68454766",
"0.68453914",
"0.6841701",
"0.68416226",
"0.68402743",
"0.67794687",
"0.67780864",
"0.67663175",
"0.67663175",
"0.67663175",
"0.67663175",
"0.67663175",
"0.67527443",
"0.6741971",
"0.6740175",
"0.6737432",
"0.67284137",
"0.67284137",
"0.67284137",
"0.6717162",
"0.6710828",
"0.6699768",
"0.66925275",
"0.66877717",
"0.668385",
"0.6679998",
"0.6675237",
"0.666289",
"0.6656771",
"0.6656525",
"0.6651605",
"0.66477907",
"0.66428494",
"0.66428494",
"0.66415364",
"0.6622675",
"0.6617762",
"0.6602113",
"0.6590987",
"0.65785795",
"0.657776",
"0.6575304",
"0.65727895",
"0.6568898",
"0.65685934"
] | 0.6740683 | 69 |
Admin Delete a record. | public function admin_delete($id)
{
if ($this->Coupon->delete($id))
{
$this->Session->setFlash('Record deleted.', 'default', array('class' => 'success'));
$this->redirect('/admin/coupons');
}
$this->Session->setFlash('Record not deleted.', 'default', array('class' => 'failure'));
$this->redirect('/admin/coupons/edit/' . $id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getDeleteRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// delete\n\t\t\t\t$this->getHandler()->delete($record);\n\n\n\t\t\t\t$msg = new Message('You have successful delete 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 delete()\r\n {\r\n $recordId = $this->getRecId();\r\n $command = static::getDb()->newDeleteCommand(static::$defaultLayout, $recordId);\r\n try {\r\n $command->execute();\r\n return 1;\r\n } catch (FileMakerException $e) {\r\n $this->addError('delete', $e->getMessage());\r\n return 0;\r\n }\r\n }",
"function deleteRecord()\t{\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif (is_array($origArr))\t{\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\tif (!$GLOBALS['TCA'][$this->theTable]['ctrl']['delete'])\t{\t// If the record is fully deleted... then remove the image (or any file) attached.\n\t\t\t\t\t\t\t$this->deleteFilesFromRecord($this->recUid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->cObj->DBgetDelete($this->theTable, $this->recUid, TRUE);\n\t\t\t\t\t\t$this->currentArr = $origArr;\n\t\t\t\t\t\t$this->saved = 1;\n\t\t\t\t\t\t$this->userProcess_alt($conf['edit.']['userFunc_afterDelete'],$conf['edit.']['userFunc_afterDelete.'],array('rec'=>$this->currentArr, 'origRec'=>$origArr));\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t }\n\t\t}\n\t}",
"public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }",
"public function delete() {\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 deleteRecord() {\n\n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-delete') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n \n $id = $this->uri->segment(3);\n\n if ($id != $this->user()->id) {\n $result = $this->UserModel->deleteRecordData($id);\n $this->UserModel->deleteUserType($id);\n if ($result == 1) {\n $this->session->set_flashdata('message', '2');\n redirect('UserCon/showAllRecordsPage');\n } else {\n echo \"Database error!\";\n }\n } else {\n $this->session->set_flashdata('message', '3');\n redirect('UserCon/showAllRecordsPage');\n }\n } else {\n echo \"access denied\";\n }\n }",
"public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }",
"public function deleteRecord ($id);",
"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 deleteRecord($id){\n\t}",
"public function actionDelete() {}",
"public function actionDelete() {}",
"function delete_record () { //deletes a record\n\t\t\n\t\t//deletes record\n\t\t$pdo = Database::connect();\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$sql = \"DELETE FROM customers WHERE id = ?\";\n\t\t$q = $pdo->prepare($sql);\n\t\t$q->execute(array($_GET['id']));\n\t\tDatabase::disconnect();\n\t\theader(\"Location: customer.php\");\n\t\t\t\n\t}",
"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() {\n #\n }",
"public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }",
"public function DeleteRecord()\n {\n // TODO: support delete multiple records\n // read the id array from the check box list _REQUEST['row_selections']\n global $g_BizSystem;\n $values = $g_BizSystem->GetClientProxy()->GetFormInputs('row_selections',false);\n if ($values)\n {\n foreach ($values as $id)\n {\n $recArray = $this->GetDataObj()->FetchById($id);\n $dataRec = new DataRecord($recArray, $this->GetDataObj());\n // take care of exception\n try {\n $dataRec->Delete();\n }\n catch (BDOException $e)\n {\n // call $this->ProcessBDOException($e);\n $this->ProcessBDOException($e);\n return;\n }\n }\n }\n else // delete current focused record\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n global $g_BizSystem;\n //$recId = $this->m_ActiveRecord[\"Id\"];\n $ok = $this->GetDataObj()->DeleteRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n }\n $this->m_RecordId = null; // clean the current record id\n // TODO: adjust current page. if current page return no record, goto prev page\n \n return $this->ReRender();\n }",
"public function do_delete_record()\n {\n $v_list_delete = get_post_var('hdn_item_id_list','');\n $this->model->do_delete_record($v_list_delete);\n }",
"public function delete()\n {\n \n }",
"public function deleting()\n {\n # code...\n }",
"public function delete() {\r\n }",
"function delete() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// check type\n\t\t$responseType = (KRequest::getString('show_list') == '1') ? 'list' : 'json';\n\n\t\t// set ids or just one id\n\t\t$id = KRequest::getInt('id');\n\t\t$ids = KRequest::getString('ids');\n\n\t\t// The system takes in 'id' or 'ids'. In either case, we make an array $ids for looping later\n\t\tif(!empty($ids)) {\n\t\t\t$ids = explode(',', $ids);\n\t\t}\n\t\telseif($id){\n\t\t\t$ids = [$id];\n\t\t}\n\t\telse $ids = [];\n\n\t\t// Cast all IDs to int for sanitation\n\t\tforeach ($ids as &$id) {\n\t\t\t$id = intval($id);\n\t\t}\n\t\tunset($id);\n\n\t\t// Bounce if no record ID came in\n\t\tif(empty($ids)) {\n\n\t\t\tif($responseType == 'json') {\n\n\t\t\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\n\t\t\t\techo ConfigboxJsonResponse::makeOne()\n\t\t\t\t\t->setSuccess(false)\n\t\t\t\t\t->setErrors(array(KText::_('Please select a record to delete')))\n\t\t\t\t\t->toJson();\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$error = KText::_('Please select a record to delete');\n\t\t\t\tKenedoPlatform::p()->sendSystemMessage($error, 'error');\n\t\t\t\tKenedoViewHelper::addMessage($error, 'error');\n\t\t\t\t$this->display();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$model = $this->getDefaultModel();\n\t\t$success = $model->delete($ids);\n\n\t\t$this->purgeCache();\n\t\t$model->forgetRecords();\n\n\t\tif (KRequest::getInt('quickedit', 0) == 1) {\n\t\t\tif ($success) {\n\t\t\t\t$msg = KText::_('Records deleted.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$msg = implode(',', $model->getErrors());\n\t\t\t}\n\n\t\t\tKenedoPlatform::p()->sendSystemMessage($msg, 'notice');\n\t\t\t$this->setRedirect($_SERVER['HTTP_REFERER']);\n\t\t\treturn;\n\t\t}\n\n\t\t// Deliver the good news\n\t\tif ($responseType == 'json') {\n\n\t\t\t$messages = array();\n\t\t\tif ($success == true) {\n\t\t\t\t$messages[] = KText::_('Records deleted.');\n\t\t\t}\n\n\t\t\tKenedoPlatform::p()->setDocumentMimeType('application/json');\n\n\t\t\techo ConfigboxJsonResponse::makeOne()\n\t\t\t\t->setSuccess($success)\n\t\t\t\t->setErrors($model->getErrors())\n\t\t\t\t->setCustomData('messages', $messages)\n\t\t\t\t->toJson();\n\n\t\t}\n\t\telseif ($responseType == 'list'){\n\t\t\t$msg = KText::_('Records deleted.');\n\t\t\tKenedoPlatform::p()->sendSystemMessage($msg, 'notice');\n\t\t\tKenedoViewHelper::addMessage($msg, 'notice');\n\t\t\t$this->display();\n\t\t}\n\n\t\treturn;\n\n\t}",
"private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}",
"public function delete()\n {\n \n }",
"public function delete()\n {\n // TODO: Implement delete() method.\n }",
"public function delete($entity){ \n //TODO: Implement remove record.\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"public function delete()\n {\n //\n }",
"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();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete()\r\n\t{\r\n\t}",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"public function delete( $args ) {\n\t\t$db = new \\WordPress\\CMS\\DB\\Database( $this->wpdb );\n\t\t$table = $db->get_table( $args['table'] );\n\t\t$record_ident = isset( $args['ident'] ) ? $args['ident'] : false;\n\t\tif ( ! $record_ident ) {\n\t\t\twp_safe_redirect( $table->get_url() );\n\t\t\texit;\n\t\t}\n\n\t\t// Ask for confirmation.\n\t\tif ( ! isset( $_POST['confirm_deletion'] ) ) {\n\t\t\t$template = new \\WordPress\\CMS\\Template( 'record/delete.html' );\n\t\t\t$template->table = $table;\n\t\t\t$template->record = $table->get_record( $record_ident );\n\t\t\treturn $template->render();\n\t\t}\n\n\t\t// Delete the record.\n\t\tcheck_admin_referer( 'cms-record-delete-' . $record_ident );\n\t\ttry {\n\t\t\t$this->wpdb->query( 'BEGIN' );\n\t\t\t$table->delete_record( $record_ident );\n\t\t\t$this->wpdb->query( 'COMMIT' );\n\t\t} catch ( \\Exception $e ) {\n\t\t\t$template = $this->get_template( $table );\n\t\t\t$template->record = $table->get_record( $record_ident );\n\t\t\t$template->add_notice( 'error', $e->getMessage() );\n\t\t\treturn $template->render();\n\t\t}\n\n\t\twp_safe_redirect( $table->get_url() );\n\t\texit;\n\t}",
"function delete()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\t\tglobal $mainframe;\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$ids = JRequest::getVar('ids', array(), 'request', 'array');\r\n\t\t$model->deleteRows( $ids );\r\n\t\tif ( JRequest::getVar('format') == 'raw') {\r\n\t\t\tJRequest::setVar( 'view', 'table' );\r\n\t\t\t$this->display();\r\n\t\t} else {\r\n\t\t\t//@TODO: test this\r\n\t\t\t$ref = JRequest::getVar( 'fabrik_referrer', \"index.php\", 'post' );\r\n\t\t\t$mainframe->redirect( $ref, count($ids) . \" \" . JText::_( 'RECORDS DELETED' ) );\r\n\t\t}\r\n\t}",
"public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }",
"function deleteRecord($id)\n\t{\n\t\t$this->form->deleteRecord($this->tablename, $id);\n\t}",
"public function delete() {\r\n $page = $this->api->getParam('page', '1');\r\n $this->model->id = $_REQUEST['id'];\r\n $this->checkOwner();\r\n $message = 'Cannot Be Deleted';\r\n if ($this->model->delete()) {\r\n $message = 'Deleted Successfully';\r\n }\r\n $this->api->redirect('contact/home?message=' . $message . '&page=' . $page);\r\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete()\n {\n }",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"public function delete()\n\t{\n\t}",
"public function delete(){\n }",
"public function delete()\n {\n $this->_validateModifiable();\n\n $this->_getDataSource()->delete($this);\n }",
"function delete($recordID) \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\n \n\t if(UserModel::Create()->UpdateIsActive($recordID)==1)\n\t\t{$this->renderWithTemplate('users/delete', 'AdminPageBaseTemplate');}\n\t\telse\n\t\t{$this->renderWithTemplate('users/error', 'AdminPageBaseTemplate');}\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 function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query->execute();\n\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t}\n\t}",
"public function deleteAction(Request $request, Record $record)\n {\n $form = $this->createDeleteForm($record);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($record);\n $em->flush();\n }\n\n return $this->redirectToRoute('eval_record_index');\n }",
"public function delete() {\n\n }",
"protected function delete() {\n\t}",
"public function deleteAction() {\n \n }",
"public function deleteAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (true === $this->employee->setAction('delete'))\n\t\t{\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t}",
"public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }",
"public function delete()\n {\n if (empty($this->recordId)) {\n return $this->fm->returnOrThrowException('You cannot delete a record that does not exist on the server.');\n }\n if ($this->parent) {\n $editCommand = $this->fm->newEditCommand($this->parent->layout->getName(), $this->parent->recordId, []);\n $editCommand->setDeleteRelated($this->layout->getName() . \".\" . $this->recordId);\n\n return $editCommand->execute();\n } else {\n $layoutName = $this->layout->getName();\n\n $editCommand = $this->fm->newDeleteCommand($layoutName, $this->recordId);\n return $editCommand->execute();\n }\n }",
"public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }",
"public function delete()\n {\n\n }",
"public function delete_mnt_record()\r\n {\r\n $mnt_id = $this->input->get('mnt_id');\r\n echo $this->maintenance_model->delete_record($mnt_id);\r\n\r\n }",
"public function destroy($id)\n {\n //delete specific record\n }",
"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 deleted(Edit $edit)\n {\n //\n }",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }",
"public function destroy(Record $record)\n {\n //\n }",
"public function delete_record()\n {\n $id = $this->input->get('tpid');\n\n $result = $this->PumpModel->delete_data(array('tpid'=>$id));\n // print_r($result);die;\n redirect(base_url(). 'Pump');\n }",
"function delete()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete();\n\t$this->view_logs();\n}",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\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() {\n\n $input_data = $this->request->getJsonRawBody();\n $id = isset($input_data->id) ? $input_data->id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => false, 'message' => 'Id is null']);\n else:\n $kidphysical_delete = NidaraKidPhysicalInfo::findFirstByid($id);\n if ($kidphysical_delete):\n if ($kidphysical_delete->delete()):\n return $this->response->setJsonContent(['status' => true, 'Message' => 'Record has been deleted succefully ']);\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'Data could not be deleted']);\n endif;\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'ID doesn\\'t']);\n endif;\n endif;\n }",
"public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }",
"public function delete()\n\n {\n Customers::find($this->deleteId)->delete();\n session()->flash('message', 'Post Deleted Successfully.');\n\n }",
"public function deleteAction()\n {\n \n }",
"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 Do_delete_Example1(){\n\n\t}",
"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 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 deleteAction()\n {\n }",
"public static function delete() {\n\n\n\t\t}"
] | [
"0.810655",
"0.75969255",
"0.7552575",
"0.7540839",
"0.7503049",
"0.7494371",
"0.749177",
"0.7469019",
"0.744173",
"0.7432779",
"0.7379121",
"0.7379121",
"0.73488516",
"0.728218",
"0.7281215",
"0.72579277",
"0.7232865",
"0.7214349",
"0.72120464",
"0.7138606",
"0.71347713",
"0.71298003",
"0.7127961",
"0.7127441",
"0.71188897",
"0.71094155",
"0.71049464",
"0.708558",
"0.70753133",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.70683384",
"0.7061762",
"0.70593166",
"0.7053551",
"0.7051172",
"0.70511067",
"0.70460206",
"0.7045997",
"0.70426416",
"0.70426416",
"0.70426416",
"0.70426416",
"0.70426416",
"0.70426416",
"0.70426416",
"0.70426416",
"0.70426416",
"0.70426416",
"0.7022485",
"0.7022485",
"0.7022219",
"0.70221454",
"0.70054066",
"0.70022625",
"0.70000345",
"0.6991061",
"0.6990023",
"0.69834226",
"0.6982615",
"0.69822526",
"0.6982062",
"0.6972547",
"0.69675314",
"0.69647133",
"0.69574726",
"0.6955511",
"0.6949606",
"0.6940312",
"0.6932204",
"0.68963057",
"0.68953395",
"0.6892672",
"0.6889132",
"0.6883672",
"0.68830633",
"0.68735266",
"0.68726236",
"0.6851106",
"0.6849256",
"0.68490964",
"0.68381494",
"0.68305594",
"0.68283147",
"0.681788",
"0.6799704",
"0.67881894",
"0.67826265",
"0.6774803"
] | 0.0 | -1 |
Inject config to uploader core. | public function inject($inject = array())
{
$this->inject = $inject;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }",
"private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n $this->_config = $configLoader;\n\t}",
"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 uploadConfig($store)\n {\n parent::uploadConfig($store);\n\n $this->extend('updateConfig', $store);\n }",
"public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }",
"public function __construct()\n {\n $this->params['config'] = config('app');\n }",
"public function __construct($config = array())\n {\n $this->_upload = new MyLib_Upload_Image();\n if (!empty($config)) {\n foreach ($config as $key => $value) {\n if (array_key_exists($key, $this->_config)) {\n $this->_config[$key] = $value;\n }\n }\n }\n\n if ($this->_config['basefolder'] == '') {\n $this->_config['basefolder'] = Zend_Registry::get('photoBasePath');\n }\n }",
"private function mergeConfig() {\n\t\t$this->mergeConfigFrom(\n\t\t\t__DIR__ . '/../config/config.php', 'sl-upload'\n\t\t);\n\t}",
"protected function configure($config = '') {\n parent::configure($config);\n }",
"protected function addConfiguration()\n {\n $this['config'] = $this->share(\n function () {\n $user_config_file = (file_exists('phpdoc.xml'))\n ? 'phpdoc.xml'\n : 'phpdoc.dist.xml';\n\n return \\Zend\\Config\\Factory::fromFiles(\n array(\n __DIR__.'/../../data/phpdoc.tpl.xml',\n $user_config_file\n ), true\n );\n }\n );\n }",
"public function _initConfig() {\r\n $this->config = Yaf\\Application::app()->getConfig();\r\n Yaf\\Registry::set(\"config\", $this->config);\r\n\r\n //申明, 凡是以Foo和Local开头的类, 都是本地类\r\n $this->loader = Yaf\\Loader::getInstance();\r\n $this->loader->registerLocalNamespace([\"fly\"]);\r\n }",
"protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', $this->getOptions());\n\t}",
"private function _setupConfig($config) {\n\t\t$this->config = $config;\n\t}",
"protected static function configure($config)\n {\n }",
"protected function setup_config() {\n\t\t\t// TODO: Implement setup_config() method.\n\t\t}",
"public function init() {\n //TODO override and put config intialization code here\n }",
"private function initialiseConfig()\n {\n $this->mergeConfigFrom(__DIR__ . '/..' . Settings::LARAVEL_REAL_CONFIG, Settings::LARAVEL_CONFIG_NAME);\n }",
"public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }",
"public function configure()\n\t{\n\t\t$this->fileDir = 'form';\n\t\t$this->fileName = 'resourcebooking.js';\n\n\t\t$this->addExtension('crm.site.form.resourcebooking');\n\t\t//$this->addExtension('ui.vue.components.datepick');\n\t\t//$this->addExtension('calendar.resourcebooking');\n\n\t\t$this->embeddedModuleName = 'crm.form.resourcebooking';\n\t}",
"public function __construct()\n {\n parent::__construct();\n $this->config = config($this->configName);\n }",
"private function configure(): void\n {\n if (!$this->app->configurationIsCached()) {\n $this->mergeConfigFrom(__DIR__ . '/../config/paket.php', 'paket');\n }\n }",
"private function registerConfiguration()\n {\n $configPath = __DIR__ . '/../config/themify.php';\n $this->mergeConfigFrom($configPath, 'themify');\n $this->publishes([$configPath => config_path('themify.php')]);\n }",
"public static function configure($config)\n {\n static::$config = $config;\n }",
"public function __construct($config)\n {\n $this->pathImg = $config->paths->imagesWebRoot;\n $this->folderImageOriginal = $config->paths->imagesOriginal;\n $this->exiftool = $config->paths->exifTool;\n $this->dbPath = $config->paths->database;\n }",
"public function onConfigLoaded(array &$config)\n {\n $this->hash = @$config['editor']['hash'];\n $this->template = @$config['editor']['template'];\n $this->deleteDir = @$config['editor']['content_dir_delete'];\n }",
"protected function registerConfigs()\n {\n // Append or overwrite configs\n #config(['test' => 'hi']);\n\n // Merge configs\n #$this->mergeConfigFrom(__DIR__.'/../Config/parser.php', 'mrcore.parser');\n }",
"public static function config() {\n require_once( 'includes/widget-config.php' );\n }",
"protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', new Zend_Config($this->getOptions()));\n\t}",
"protected function _initConfig()\n {\n Zend_Registry::set('config', $this->getOptions());\n Zend_Registry::set('acl', new Application_Model_Acl());\n }",
"public function __construct($config)\n {\n // Parent\n parent::__construct();\n\n // Save config\n $this->config = $config;\n }",
"private function initializeSettings() {\r\n global $config;\r\n $this->settings = $config;\r\n $this->fileUploadPath = $this->settings[\"uploadFolder\"];\r\n $this->fileSavePath = $this->settings[\"downloadFolder\"];\r\n $this->currentLang = $this->settings[\"lang\"];\r\n $this->currentpage = 1;\r\n }",
"public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }",
"public function configure(array $config);",
"public function init($config);",
"public function __construct() {\n $this->shopTypeOriginalImageUploadPath = Config::get('constant.SHOP_TYPE_ORIGINAL_IMAGE_UPLOAD_PATH');\n $this->shopTypeThumbImageUploadPath = Config::get('constant.SHOP_TYPE_THUMB_IMAGE_UPLOAD_PATH');\n $this->shopTypeThumbImageHeight = Config::get('constant.SHOP_TYPE_THUMB_IMAGE_HEIGHT');\n $this->shopTypeThumbImageWidth = Config::get('constant.SHOP_TYPE_THUMB_IMAGE_WIDTH');\n }",
"protected function setConfigurations()\n {\n if ($files = $this->getFiles('config'))\n {\n foreach ($files as $key => $filename)\n {\n $this->config->set(basename($filename, '.php'), require path('config').DIRECTORY_SEPARATOR.($filename));\n }\n }\n }",
"private function setupConfig()\n {\n $this->publishes([\n __DIR__ . '/config' => config_path(),\n ], 'config');\n\n $this->mergeConfigFrom(__DIR__ . '/../config/package-blueprint.php', 'package-blueprint');\n }",
"protected function configure(): void\n {\n $this->mergeConfigFrom(\n __DIR__ . '/config/permissions_makr.php', 'permissions_makr'\n );\n }",
"public function __construct($config)\n {\n $this->config = $config;\n $this->resizer = ResizerFactory::getResizer($config->get('mode'));\n }",
"function __construct() {\n parent::__construct();\n array_push($this->_config_paths, APPPATH.'custom/');\n }",
"protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/dashkit.php', 'dashkit'\n );\n }",
"public function additional_settings() {\n\n\t\t\tif ( $this->_media_uploader ) {\n\n\t\t\t\t$this->enqueue_thickbox();\n\t\t\t}\n\t\t}",
"function __construct() {\n\tparent::__construct();\n\t$this->config = json_decode(file_get_contents(CONFIG_DIR . \"controllers/playlist.config.json\"), false);\n }",
"public function cfg_setup()\n\t{\n\t\t$this->cfg = AppConfig::get()[\"app\"];\n\t\t$this->cfg[\"app_name\"] = $this->cfg[\"name\"];\n\n\t}",
"public function _on_configuring($config)\n {\n }",
"protected function load_config() {\n $this->config = Kohana::$config->load('imagecache');\n $this->config_patterns = Kohana::$config->load('imagecache_patterns');\n }",
"abstract public function configure();",
"public function setup()\n {\n $this->_config = array(\n 'adapters' => array(\n array(\n 'adapter' => 'Solar_Log_Adapter_File',\n 'events' => 'debug',\n 'file' => Solar_File::tmp('test_solar_log_adapter_multi.debug.log'),\n 'format' => '%e %m',\n ),\n array(\n 'adapter' => 'Solar_Log_Adapter_File',\n 'events' => 'info, notice',\n 'file' => Solar_File::tmp('test_solar_log_adapter_multi.other.log'),\n 'format' => '%e %m',\n ),\n ),\n );\n \n parent::setup();\n @unlink($this->_config['adapters'][0]['file']);\n @unlink($this->_config['adapters'][1]['file']);\n }",
"public function setupConfig()\n {\n\n $settings = settings_m::get()->groupBy(\"setting_key\")->all();\n\n $settings_arr = [];\n foreach($settings as $key => $item)\n {\n $value = $item[0]->setting_value;\n if(in_array($item[0]->setting_type,[\"image\", \"file\"]))\n {\n\n if($item[0]->setting_value > 0)\n {\n $get_path = attachments_m::find($item[0]->setting_value);\n if(is_object($get_path))\n {\n $value = $get_path->path;\n }\n }\n\n }\n\n $settings_arr[\"$key\"] = $value;\n\n }\n\n config()->set('settings_arr', $settings_arr);\n\n #endregion\n\n #region set timezone config\n\n date_default_timezone_set($settings_arr['timezone']);\n\n #endregion\n\n #region set mail config\n\n config([\n \"mail.driver\" => $settings_arr['mail_type'],\n \"mail.host\" => $settings_arr['smtp_host'],\n \"mail.port\" => $settings_arr['smtp_port'],\n \"mail.from.address\" => $settings_arr['email'],\n \"mail.from.name\" => $settings_arr['name'],\n \"mail.encryption\" => $settings_arr['smtp_ssl'],\n \"mail.username\" => $settings_arr['smtp_user'],\n \"mail.password\" => $settings_arr['smtp_pass'],\n ]);\n\n #endregion\n\n }",
"public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }",
"protected function configure()\n {\n parent::configure();\n\n $this->composer = new Composer($this->preset->filesystem(), $this->preset->basePath());\n }",
"protected function setParamConfig()\n {\n $this->paramConfig = ArrayManipulation::deepMerge($this->paramConfig, array(\n 'placeholder' => array(\n 'name' => 'Platzhalter Text',\n 'type' => 'textfield'\n ),\n 'rows' => array(\n 'name' => 'Anzahl Zeilen',\n 'type' => 'textfield'\n ),\n 'maxlength' => array(\n 'name' => 'Maximale Anzahl Zeichen (optional)',\n 'type' => 'textfield'\n )\n ));\n }",
"protected function configure()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../../config/knet.php', 'knet'\n );\n }",
"static function set_config() {\n\t\tif ( file_exists( self::childpath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'config/wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'config/wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::childpath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::childpath() . 'wpgrade-config' . EXT;\n\t\t} elseif ( file_exists( self::themepath() . 'wpgrade-config' . EXT ) ) {\n\t\t\tself::$configuration = include self::themepath() . 'wpgrade-config' . EXT;\n\t\t}\n\t}",
"public function configure()\n\t{\n\t\tif (!$this->form)\n\t\t{\n\t\t\t$this->form = new WebForm\\Form($this->getId());\n\t\t}\n\n\t\t$data = $this->form->get();\n\t\t$isCloud = Loader::includeModule('bitrix24');\n\n\t\t$this->fileDir = 'form';\n\t\t$this->fileName = str_replace(\n\t\t\t['#id#', '#sec#'],\n\t\t\t[$this->getId(), $data['SECURITY_CODE']],\n\t\t\t$isCloud ? 'loader_#id#.js' : 'loader_#id#_#sec#.js'\n\t\t);\n\n\t\t$name = 'crm.site.form.embed.unit';\n\t\t$this->addExtension($name);\n\t\t$module = $this->getModule($name);\n\t\t$module->getProfile()->setCallParameter($this->getCallParameter());\n\n\t\t$this->embeddedModuleName = 'crm.site.form.unit.loader';\n\t}",
"public function __construct($config=null)\n {\n switch (true) {\n\n case is_array($config):\n // add from user provided array\n break;\n\n case is_string($config):\n // add from a user file\n $config = $this->getConfigFromFile($config);\n break;\n\n default:\n\n // add from the HOME dir\n // $file = getenv('HOME') . '/.apix/config.php';\n // if (file_exists($file)) {\n // $config = $this->getConfigFromFile($file);\n // }\n\n // default to the distribution file\n $config = null;\n }\n\n $this->setConfig($config);\n }",
"public function configure();",
"public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)\n {\n $this->configurationManager = $configurationManager;\n\n $frameworkSettings = $this->configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,\n 'fsmediagallery',\n 'fsmediagallery_mediagallery'\n );\n $flexformSettings = $this->configurationManager->getConfiguration(\n ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS\n );\n\n // merge Framework (TypoScript) and Flexform settings\n if (isset($frameworkSettings['settings']['overrideFlexformSettingsIfEmpty'])) {\n /** @var $typoScriptUtility \\MiniFranske\\FsMediaGallery\\Utility\\TypoScriptUtility */\n $typoScriptUtility = GeneralUtility::makeInstance('MiniFranske\\\\FsMediaGallery\\\\Utility\\\\TypoScriptUtility');\n $mergedSettings = $typoScriptUtility->override($flexformSettings, $frameworkSettings);\n $this->settings = $mergedSettings;\n } else {\n $this->settings = $flexformSettings;\n }\n\n /**\n * sync persistence.storagePid=settings.startingpoint and persistence.recursive=settings.recursive\n */\n // overwrite persistence.storagePid if settings.startingpoint is defined in flexform\n if (!empty($this->settings['startingpoint'])) {\n $frameworkSettings['persistence']['storagePid'] = $this->settings['startingpoint'];\n // if settings.startingpoint is not set in flexform, use persistence.storagePid from TS\n } elseif (!empty($frameworkSettings['persistence']['storagePid'])) {\n $this->settings['startingpoint'] = $frameworkSettings['persistence']['storagePid'];\n // startingpoint/storagePid is not set via TS nor flexforms > fallback to current pid\n } else {\n $this->settings['startingpoint'] = $frameworkSettings['persistence']['storagePid'] = $GLOBALS['TSFE']->id;\n }\n\n // set persistence.recursive if settings.recursive is defined in flexform\n if (!empty($this->settings['recursive'])) {\n $frameworkSettings['persistence']['recursive'] = $this->settings['recursive'];\n // if settings.recursive is not set in flexform, use persistence.recursive from TS\n } elseif (!empty($frameworkSettings['persistence']['recursive'])) {\n $this->settings['recursive'] = $frameworkSettings['persistence']['recursive'];\n // recursive is not set via TS nor flexforms\n } else {\n $this->settings['recursive'] = $frameworkSettings['persistence']['recursive'] = 0;\n }\n\n // write back altered configuration\n $this->configurationManager->setConfiguration($frameworkSettings);\n\n // check some settings\n if (!isset($this->settings['list']['pagination']['itemsPerPage']) || $this->settings['list']['pagination']['itemsPerPage'] < 1) {\n $this->settings['list']['pagination']['itemsPerPage'] = 12;\n }\n if (!isset($this->settings['album']['pagination']['itemsPerPage']) || $this->settings['album']['pagination']['itemsPerPage'] < 1) {\n $this->settings['album']['pagination']['itemsPerPage'] = 12;\n }\n // correct resizeMode 's' set in flexforms (flexforms value '' is used for inherit/definition by TS)\n if (isset($this->settings['list']['thumb']['resizeMode']) && $this->settings['list']['thumb']['resizeMode'] == 's') {\n $this->settings['list']['thumb']['resizeMode'] = '';\n }\n if (isset($this->settings['album']['thumb']['resizeMode']) && $this->settings['album']['thumb']['resizeMode'] == 's') {\n $this->settings['album']['thumb']['resizeMode'] = '';\n }\n if (isset($this->settings['detail']['asset']['resizeMode']) && $this->settings['detail']['asset']['resizeMode'] == 's') {\n $this->settings['detail']['asset']['resizeMode'] = '';\n }\n if (isset($this->settings['random']['thumb']['resizeMode']) && $this->settings['random']['thumb']['resizeMode'] == 's') {\n $this->settings['random']['thumb']['resizeMode'] = '';\n }\n }",
"public function setupConfig() {\n\t\t// By default we will not show the new featured image metabox for any post type.\n\t\t// It is up to other components (like the portfolio component) or the theme to \"declare\" (via the filters bellow)\n\t\t// what post types should use it.\n\t\t$this->config = array(\n\t\t\t// 'post_types' => array( 'post', 'jetpack-portfolio', ),\n\t\t);\n\n\t\t// Allow others to make changes to the config\n\t\t// Make the hooks dynamic and standard\n\t\t$hook_slug = self::prepareStringForHooks( self::COMPONENT_SLUG );\n\t\t$modified_config = apply_filters( \"pixelgrade_{$hook_slug}_initial_config\", $this->config, self::COMPONENT_SLUG );\n\n\t\t// Check/validate the modified config\n\t\tif ( method_exists( $this, 'validate_config' ) && ! $this->validate_config( $modified_config ) ) {\n\t\t\t/* translators: 1: the component slug */\n\t\t\t_doing_it_wrong( __METHOD__, sprintf( 'The component config modified through the \"pixelgrade_%1$s_initial_config\" dynamic filter is invalid! Please check the modifications you are trying to do!', esc_html( $hook_slug ) ), null );\n\t\t\treturn;\n\t\t}\n\n\t\t// Change the component's config with the modified one\n\t\t$this->config = $modified_config;\n\n\t\t// Filter only the post types for legacy reasons\n\t\t// @todo Evaluate if these legacy reasons still stand\n\t\tif ( isset( $this->config['post_types'] ) ) {\n\t\t\t$this->config['post_types'] = apply_filters( \"pixelgrade_{$hook_slug}_post_types\", $this->config['post_types'] );\n\t\t}\n\t}",
"protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }",
"public function configure(array $config): void;",
"public static function config();",
"private function init($config)\r\n {\r\n $this->setConfig($config);\r\n }",
"public function __construct($config) {\n $this->config = $config;\n }",
"public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }",
"abstract protected function configure();",
"abstract protected function configure();",
"protected function defineConfig()\n {\n // Get config paths\n $configs = $this->config->getDirectly(__DIR__ . '/../Config/path.php')['default_config'] ?? [];\n\n // Add all of them to config collector if $configs is an array\n if (is_array($configs)) {\n foreach ($configs as $alias => $path) {\n $this->config->set($alias, $path);\n }\n }\n }",
"public function __construct()\n {\n $this->_config = request('_config');\n }",
"protected function initConfig()\n {\n $this->config = [];\n }",
"function setConfig() {\n\n\t\t\t// Mapping array for PI flexform\n\t\t\t$flex2conf = array(\n\t\t\t\t'news' => 'sDEF:news',\n\t\t\t\t'days' => 'sDEF:days',\n\t\t\t\t'darkdesign' => 'sDEF:dark',\n\t\t\t\t'show_last' => 'sDEF:show_last',\n\t\t\t\t'order_by' => 'sDEF:listOrderBy',\n\t\t\t\t'asc_desc' => 'sDEF:ascDesc',\n\t\t\t\t'category_mode' => 'sDEF:categoryMode',\n\t\t\t\t'category' => 'sDEF:categorySelection',\n\t\t\t\t'sideTop' => 'sSIDE:blog',\n\t\t\t\t'sideTopTitle' => 'sSIDE:blogTitle',\n\t\t\t\t'sideTopText' => 'sSIDE:blogText',\n\t\t\t\t'sideTopImage' => 'sSIDE:blogImage',\n\t\t\t\t'sideMiddle' => 'sSIDE:reader',\n\t\t\t\t'sideMiddleTitle' => 'sSIDE:readerTitle',\n\t\t\t\t'sideMiddleText' => 'sSIDE:readerText',\n\t\t\t\t'sideMiddleImage' => 'sSIDE:readerImage',\n\t\t\t\t'sideBottom' => 'sSIDE:bottom',\n\t\t\t\t'sideBottomTitle' => 'sSIDE:bottomTitle',\n\t\t\t\t'swfParams.' => array(\n\t\t\t\t\t'loop' => 'sFLASH:loop',\n\t\t\t\t\t'menu' => 'sFLASH:menu',\n\t\t\t\t\t'quality' => 'sFLASH:quality',\n\t\t\t\t\t'scale' => 'sFLASH:scale',\n\t\t\t\t\t'bgcolor' => 'sFLASH:bgcolor',\n\t\t\t\t\t'swliveconnect' => 'sFLASH:swliveconnect',\n\t\t\t\t),\n\t\t\t\t'playerParams.' => array(\n\t\t\t\t\t'timer' => 'sPLAYER:timer',\n\t\t\t\t\t'transition' => 'sPLAYER:transition',\n\t\t\t\t\t'random' => 'sPLAYER:random',\n\t\t\t\t\t'navigation' => 'sPLAYER:navigation',\n\t\t\t\t),\n\t\t\t\t'width' => 'sFLASH:width',\n\t\t\t\t'height' => 'sFLASH:height',\n\t\t\t\t'version' => 'sFLASH:version',\n\t\t\t);\n\n\t\t\t// Ovverride TS setup with flexform\n\t\t\t$this->conf = $this->api->fe_mergeTSconfFlex($flex2conf,$this->conf,$this->piFlexForm);\n\n\t\t\t$this->conf['swfParams.']['width'] = $this->conf['width'];\n\t\t\t$this->conf['swfParams.']['height'] = $this->conf['height'];\n\t\t\t$this->conf['swfParams.']['wmode'] = $this->conf['wmode'];\n \t\t//$this->conf['width'] = 512;\n\t\t\t//$this->conf['height'] = 265;\n\t\t\t//$this->conf['wmode'] = 'opaque';\n\t\t\t// DEBUG ONLY - Output configuration array\n\t\t\t#$this->api->debug($this->conf,'MP3 Player: configuration array');\n\t\t}",
"protected function __construct($config) {\n\t\t$this->config = $config;\n\t}",
"public function __construct($config){\n $this->_config = $config;\n }",
"protected function setUpFromConfig()\n\t{\n\t\t$timeLimit = 4 * 60 * 60;\n\n\t\t$parameters = $this->container->getParameters();\n\t\tif (is_array($parameters) and array_key_exists(\"taskManager\", $parameters)) {\n\t\t\t/// ***** TIMELIMIT ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"timeLimit\"])) {\n\t\t\t\t$timeLimit = $parameters[\"taskManager\"][\"timeLimit\"];\n\t\t\t}\n\t\t\t/// ***** MAX HISTORY DAYS ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"history\"][\"maxDays\"])) {\n\t\t\t\t$this->maxHistoryDays = (int)$parameters[\"taskManager\"][\"history\"][\"maxDays\"];\n\t\t\t}\n\t\t\t/// ***** MAX HISTORY RECORDS ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"history\"][\"maxRecords\"])) {\n\t\t\t\t$this->maxHistoryRecords = (int)$parameters[\"taskManager\"][\"history\"][\"maxRecords\"];\n\t\t\t}\n\t\t}\n\n\t\tset_time_limit($timeLimit);\n\t}",
"protected function registerConfigPublisher()\n {\n $this->app->singleton('config.publisher', function ($app) {\n $path = $app->make('path.config');\n\n $publisher = new ConfigPublisher($app->make('files'), $path);\n\n $publisher->setPackagePath($app->make('path.base') . '/src');\n\n return $publisher;\n });\n }",
"public function init($config)\n\t{\n\t}",
"protected function _initConfig()\n {\n parent::_initConfig();\n $this->_mergeConfig(array(\n 'get_descriptions' => false, // true to get descriptions for text sections\n ));\n }",
"function __construct()\r\n\t{\r\n\t\trequire './configs/configs.php';\r\n\t}",
"public function __construct()\n {\n $this->config = include(dirname(__FILE__). '/../config/config.php');\n }",
"function initConfig($config) {\r\n $configApp = new ZendExt_App_Config();\r\n $config = $configApp->configApp($config);\r\n Zend_Registry::getInstance()->config = $config;\r\n }",
"protected function initializeConfiguration() {}",
"protected function configure()\n {\n // load config\n $config = new \\Phalcon\\Config(array(\n 'base_url' => '/',\n 'static_base_url' => '/',\n ));\n\n if (file_exists(APPPATH.'config/static.php')) {\n $static = include APPPATH.'config/static.php';\n $config->merge($static);\n }\n\n if (file_exists(APPPATH.'config/setup.php')) {\n $setup = include APPPATH.'config/setup.php';\n $config->merge($setup);\n }\n\n return $config;\n }",
"protected function setupConfig()\n\t{\n\t\tparent::setupConfig();\n\t\t\n\t\tunset($this->config->event_log);\n\t\t$this->config->event_log = new EventLogTemp(\n\t\t\t$this->config->olp_db,\n\t\t\t$this->config->olp_db->db_info['db'],\n\t\t\t$this->config_data->application_id,\n\t\t\t'event_log_new_bbx'\n\t\t);\n\t}",
"private function load_config() {\n $this->config = new Config();\n }",
"public function init($config)\n {\n $this->config = $config;\n }",
"private function __construct()\n {\n // Overwrite _config from config.ini\n if ($_config = \\Phalcon\\DI::getDefault()->getShared('config')->auth) {\n foreach ($_config as $key => $value) {\n $this->_config[$key] = $value;\n }\n }\n\n $this->_cookies = \\Phalcon\\DI::getDefault()->getShared('cookies');\n $this->_session = \\Phalcon\\DI::getDefault()->getShared('session');\n $this->_security = \\Phalcon\\DI::getDefault()->getShared('security');\n }",
"public function setConfig($config)\r\n {\r\n $this->config = $config;\r\n }",
"static function configure()\n\t{\n\t\tPie_Config::load('config/pie.json');\n\t\t\n\t\t// Get the app config, but don't load it yet\n\t\t$app_p = new Pie_Parameters();\n\t\t$app_p->load('config/app.json');\n\t\t$app_p->load('local/app.json');\n\t\t\n\t\t// Load all the plugin config files first\n\t\t$paths = explode(PS, get_include_path());\n\t\t$plugins = $app_p->get('pie', 'plugins', array());\n\t\tforeach ($plugins as $plugin) {\n\t\t\t$plugin_path = Pie::realPath('plugins'.DS.$plugin);\n\t\t\tif (!$plugin_path) {\n\t\t\t\tthrow new Pie_Exception_MissingPlugin(compact('plugin'));\n\t\t\t}\n\t\t\tPie_Config::load($plugin_path.DS.'config'.DS.'plugin.json');\n\t\t\tarray_splice($paths, 1, 0, array($plugin_path));\n\t\t\t$PLUGIN = strtoupper($plugin);\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_DIR', $plugin_path);\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_CONFIG_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_CONFIG_DIR', $plugin_path.DS.'config');\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_CLASSES_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_CLASSES_DIR', $plugin_path.DS.'classes');\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_FILES_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_FILES_DIR', $plugin_path.DS.'files');\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_HANDLERS_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_HANDLERS_DIR', $plugin_path.DS.'handlers');\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_PLUGINS_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_PLUGINS_DIR', $plugin_path.DS.'plugins');\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_SCRIPTS_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_SCRIPTS_DIR', $plugin_path.DS.'scripts');\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_TESTS_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_TESTS_DIR', $plugin_path.DS.'tests');\n\t\t\tif (!defined($PLUGIN.'_PLUGIN_WEB_DIR'))\n\t\t\t\tdefine($PLUGIN.'_PLUGIN_WEB_DIR', $plugin_path.DS.'web');\n\t\t}\n\t\tset_include_path(implode(PS, $paths));\n\t\t\n\t\t// Now, we can merge in our app's config\n\t\tPie_Config::merge($app_p);\n\n\t\t// Now, load any other files we were supposed to load\n\t\t$config_files = Pie_Config::get('pie', 'configFiles', array());\n\t\tforeach ($config_files as $cf) {\n\t\t\tPie_Config::load($cf);\n\t\t}\n\t\t$script_files = Pie_Config::get('pie', 'scriptFiles', array());\n\t\tforeach ($script_files as $cf) {\n\t\t\tPie::includeFile($cf);\n\t\t}\n\t}",
"protected function setFilesParameters(ContainerBuilder $container, array $config, YamlFileLoader $loader)\n {\n $container->setParameter(\n 'open_orchestra_media_admin.files.thumbnail_format',\n $config['thumbnail']\n );\n\n $container->setParameter(\n 'open_orchestra_media_admin.files.alternatives.default.thumbnail',\n $config['files']['alternatives']['default']['thumbnail']\n );\n\n $container->setParameter(\n 'open_orchestra_media_admin.files.alternatives.audio.thumbnail',\n $config['files']['alternatives']['audio']['thumbnail']\n );\n\n if (count($config['files']['alternatives']['image']['formats']) > 0) {\n $container->setParameter(\n 'open_orchestra_media_admin.files.alternatives.image.formats',\n $config['files']['alternatives']['image']['formats']\n );\n } else {\n $loader->load('alternatives_formats.yml');\n }\n }",
"protected function loadConfigsForRegister(): void\n {\n $shipConfigs = $this->getConfigsFromShip();\n $containersConfigs = $this->getConfigsFromContainers();\n\n $configs = array_merge($shipConfigs, $containersConfigs);\n\n foreach ($configs as $file){\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $this->mergeConfigFrom($file, $filename);\n }\n }",
"private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }",
"private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }",
"public function __construct($config)\n {\n $this->config = $config;\n }",
"public function __construct($config)\n {\n $this->config = $config;\n }",
"public function __construct($config)\n {\n $this->config = $config;\n }",
"private function _configure($config)\n\t{\t\n\t\t$this->_ci->load->config('bucket/bucket');\n\t\t\n\t\t$defaults = array(\n\t\t\n\t\t\t'bucket_layouts_path' => 'layouts/',\n\t\t\t'bucket_content_path' => 'content/',\n\t\t\t'bucket_partials_path' => 'partials/',\n\t\t\t'bucket_assets_path' => 'assets/',\n\t\t\t\n\t\t\t'bucket_assets_cache_path' => 'assets/',\n\n\t\t\t'bucket_assets_css_path' => 'css/',\n\t\t\t'bucket_assets_js_path' => 'js/',\n\t\t\t'bucket_assets_img_path' => 'img/',\n\n\t\t\t'bucket_assets_css_extension' => '.css',\n\t\t\t'bucket_assets_js_extension' => '.js',\n\n\t\t\t'bucket_assets_url_path' => 'assets/',\n\t\t\t'bucket_asset_name_separator' => '--',\n\t\t\t'bucket_obfuscate_assets_timestamp' => FALSE,\n\t\t\t\n\t\t\t'bucket_default_behaviour' => 'development',\n\t\t\t'bucket_behaviours' => array(\n\t\t\t\t\n\t\t\t\t'development' => array(\n\t\t\t\t\n\t\t\t\t\t'minify_layout' => FALSE,\n\t\t\t\t\t'minify_css' => FALSE,\n\t\t\t\t\t'minify_js' => FALSE,\n\t\t\t\t\t'combine_css' => FALSE,\n\t\t\t\t\t'combine_js' => FALSE,\n\t\t\t\t\t'browser_cache_css' => FALSE,\n\t\t\t\t\t'browser_cache_js' => FALSE,\n\t\t\t\t\t'browser_cache_img' => FALSE,\n\t\t\t\t\t'application_cache_css' => FALSE,\n\t\t\t\t\t'application_cache_js' => FALSE,\n\t\t\t\t\t'application_cache_img' => FALSE,\n\t\t\t\t\t'gzip_layout' => FALSE,\n\t\t\t\t\t'gzip_css' => FALSE,\n\t\t\t\t\t'gzip_js' => FALSE,\n\t\t\t\t\t'gzip_img' => FALSE\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t\n\t\t\t\t'production' => array(\n\n\t\t\t\t\t'minify_layout' => TRUE,\n\t\t\t\t\t'minify_css' => TRUE,\n\t\t\t\t\t'minify_js' => TRUE,\n\t\t\t\t\t'combine_css' => TRUE,\n\t\t\t\t\t'combine_js' => TRUE,\n\t\t\t\t\t'browser_cache_css' => TRUE,\n\t\t\t\t\t'browser_cache_js' => TRUE,\n\t\t\t\t\t'browser_cache_img' => TRUE,\n\t\t\t\t\t'application_cache_css' => TRUE,\n\t\t\t\t\t'application_cache_js' => TRUE,\n\t\t\t\t\t'application_cache_img' => TRUE,\n\t\t\t\t\t'gzip_layout' => TRUE,\n\t\t\t\t\t'gzip_css' => TRUE,\n\t\t\t\t\t'gzip_js' => TRUE,\n\t\t\t\t\t'gzip_img' => TRUE\n\t\t\t\t\n\t\t\t\t)\n\t\t\t\t\n\t\t\t)\n\t\t\t\n\t\t);\n\t\t\n\t\tforeach($defaults as $key => $value)\n\t\t{\n\t\t\tif ($this->_ci->config->item($key) == '')\n\t\t\t{\n\t\t\t\t$this->_ci->config->set_item($key, $value);\n\t\t\t}\n\t\t}\n\t\t\n \t\tforeach(array('bucket_layouts_path', 'bucket_content_path', 'bucket_partials_path', 'bucket_assets_path', 'bucket_assets_css_path', 'bucket_assets_js_path', 'bucket_assets_img_path', 'bucket_assets_cache_path', 'bucket_assets_url_path') as $item)\n\t\t{\n\t\t\t$this->_ci->config->set_item($item, $this->_reduce_double_slashes($this->_ci->config->item($item) . '/'));\n\t\t}\n\t\t\n\t\tif (!preg_match(\"|^[\".str_replace(array('\\\\-', '\\-'), '-', preg_quote($this->_ci->config->item('permitted_uri_chars'), '-')).\"]+$|i\", $this->_ci->config->item('bucket_asset_name_separator')))\n\t\t{\n\t\t\tshow_error(\"The asset name separator is not in the pattern of valid URL characters\");\n\t\t}\n\t\t\n\t\tif(count($config) === 1 && isset($config['behaviour_id']))\n\t\t{\n\t\t\t$this->set_behaviour_id($config['behaviour_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->set_behaviour_id($this->_ci->config->item('bucket_default_behaviour'));\n\t\t}\n\t}",
"protected function configure()\n {\n $this->addArgument(\n 'environment', InputArgument::REQUIRED | InputArgument::OPTIONAL, 'What environment to run the script in',\n 'production'\n );\n $this->_httpClient = new Client();\n }",
"public function onConfig(array $config = []);",
"public function setConfig($config)\n {\n $this->config = $config;\n }",
"public function setConfig($config)\n {\n $this->config = $config;\n }",
"public function set_config( $config ) {\n\t\tif ( is_string( $config ) && file_exists( $config ) ) {\n\t\t\t$config = require_once $config;\n\t\t}\n\n\t\tif ( is_array( $config ) ) {\n\t\t\t$this->config = array_replace_recursive( $this->config, $config );\n\t\t}\n\t}"
] | [
"0.6556836",
"0.6374358",
"0.6316786",
"0.6282473",
"0.6279587",
"0.626696",
"0.62310433",
"0.62266403",
"0.6225025",
"0.6200689",
"0.6198997",
"0.61819494",
"0.61465794",
"0.6139633",
"0.61144334",
"0.61055017",
"0.6039768",
"0.6020426",
"0.5970549",
"0.59625906",
"0.59530824",
"0.5950725",
"0.5950228",
"0.5945092",
"0.59436667",
"0.59322697",
"0.59144455",
"0.5904465",
"0.588925",
"0.58741206",
"0.5847215",
"0.5841307",
"0.58358264",
"0.5834334",
"0.5832411",
"0.58315986",
"0.58249557",
"0.5819903",
"0.5815418",
"0.5783379",
"0.5775725",
"0.57682496",
"0.57677794",
"0.57666427",
"0.57651293",
"0.57433265",
"0.57411814",
"0.5739607",
"0.57330614",
"0.57281446",
"0.5720572",
"0.57150483",
"0.5710628",
"0.57051164",
"0.57013524",
"0.5679873",
"0.5676477",
"0.5673631",
"0.56677455",
"0.56656224",
"0.56648713",
"0.56634814",
"0.5658392",
"0.5655801",
"0.5652083",
"0.5642719",
"0.5642719",
"0.563737",
"0.56368405",
"0.56330043",
"0.56297415",
"0.5617965",
"0.5617534",
"0.5616783",
"0.5615044",
"0.5615014",
"0.5608645",
"0.5607306",
"0.5606101",
"0.56056964",
"0.5605285",
"0.55976284",
"0.5597258",
"0.55967826",
"0.55943245",
"0.55927426",
"0.5592039",
"0.5578594",
"0.5572925",
"0.55679953",
"0.5563933",
"0.5562615",
"0.55527735",
"0.55527735",
"0.55527735",
"0.5548285",
"0.5544548",
"0.55430555",
"0.5540672",
"0.5540672",
"0.5540352"
] | 0.0 | -1 |
Chaining uploader to resizing. | public function resize($sizes = [])
{
$this->uploadInit->resize($sizes);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}",
"function imgResize_gallery($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$allowedFormat=array('image/*'),$Maxfilesize=2097152,$filename_body='')\t{\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t$handle->allowed = $allowedFormat;\n\t\t$handle->file_max_size = $Maxfilesize;\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif($filename_body!='')\n\t\t\t$handle->file_name_body_add = $filename_body;\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif((($img_proper[0]>$imgx && $img_proper[1]>$imgy) || ($img_proper[0]>$imgx && $img_proper[1]<$imgy)) && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}",
"protected function widenResizeMagic(): void\n {\n $this->image->widen($this->widenResize, function ($constraint) {\n $constraint->upsize();\n });\n }",
"public function resizeEmbed($dir) {\n switch ($this->filetype) {\n case 'svg':\n $svgImage = $dir . 'image.png';\n if ($this->isTransparent($svgImage)) {\n $ext = 'png';\n } else {\n $ext = 'jpg';\n }\n break;\n case 'png':\n if ($this->isApng()) {\n $ext = 'gif';\n } else if ($this->isTransparent()) {\n $ext = 'png';\n } else {\n $ext = 'jpg';\n }\n break;\n case 'mp4':\n case 'webm':\n $ext = 'gif';\n break;\n default:\n $ext = $this->filetype;\n break;\n }\n $imageName = $dir . \"original.\" . $this->filetype;\n if ($this->filetype == 'svg') {\n $imageName = $svgImage;\n }\n $thumbnail = $dir . \"thumbnail.\" . $ext;\n if ($this->isVideo) {\n exec('ffmpeg -i ' . $this->image . ' -filter_complex \"[0:v] fps=30,scale=64:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse\" ' . $thumbnail . ' 2>&1', $output);\n FishyUtils::getInstance()->logExecError($output);\n $imageName = $thumbnail;\n }\n switch ($this->filetype) {\n case \"png\":\n exec(\"magick convert -background none $imageName -resize 64x64^ \\ -gravity center -extent 64x64 $thumbnail 2>&1\", $output);\n FishyUtils::getInstance()->logExecError($output);\n break;\n case \"jpg\":\n exec(\"magick convert $imageName -resize 64x64^ \\ -gravity center -extent 64x64 $thumbnail 2>&1\", $output);\n FishyUtils::getInstance()->logExecError($output);\n break;\n case 'mp4':\n case 'webm':\n case \"gif\":\n exec(\"magick convert $imageName -layers Coalesce -resize 64x64 -layers Optimize $thumbnail 2>&1\", $output);\n FishyUtils::getInstance()->logExecError($output);\n break;\n }\n }",
"function imgResize($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$postFix=\"\") {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\tif ($handle->uploaded) {\n\t\t\tif($img_proper[0]>$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]>$imgx && $img_proper[1]<$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->file_name_body_add = $postFix;\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}",
"function _resize(&$model, $name) {\n $setting = $this->settings[$model->name][$name];\n \n if (!empty($setting['resize']['original'])) unset($setting['resize']['original']);\n \n # loop through the resize options\n foreach (!empty($setting['resize']) && is_array($setting['resize']) ? $setting['resize'] : array() as $k => $v) {\n \n # create resized data to save into the database\n $versioned = array(\n 'parent_id' => $model->{$name}->id,\n 'model' => $model->name,\n 'foreign_key' => $model->id,\n 'field' => $name,\n 'version' => strtolower($k),\n 'filename' => assetFileName($model->data[$name]['filename'], $k),\n 'mime' => $model->data[$name]['type'],\n 'size' => null,\n );\n \n # move the versioned file\n if (!assetSaveFile($model, $this->directory.$model->data[$name]['filename'], $versioned['filename'], false)) {\n $this->_setError($model, 'Critical Error found while saving file in Resize: '. $name, 'error');\n return false;\n }\n \n # initialize and perform the resize task\n $resize = new Resize($this->directory.$versioned['filename'], $v);\n \n if (!$resize) {\n $this->_setError($model, 'Could not perform resizing tasks on: type: '. $k .' file: '. $model->data[$name]['filename'] .'.', 'error');\n return false;\n } else {\n \n # save remaining values\n $versioned['size'] = filesize($this->directory.$versioned['filename']);\n list($versioned['width'], $versioned['height']) = getimagesize($this->directory.$versioned['filename']);\n \n # save the new entry\n $versionModel = new $model->{$name};\n $versionModel->create();\n \n # save the versioned file data\n if (!$versionModel->save($versioned, false)) {\n $this->_setError($model, 'Critical Error found while saving record in Resize: '. $name, 'error');\n return false;\n }\n }\n }\n }",
"public function reprocess()\n {\n $fileLocation = $this->storage == 'filesystem' ? $this->path('original') : $this->url('original');\n\n if (!$this->originalFilename() || !file_exists($fileLocation)) {\n return;\n }\n\n foreach ($this->styles as $style) {\n $file = FileFactory::create($fileLocation);\n\n $ext = pathinfo($file->getFilename(), PATHINFO_EXTENSION);\n if (\n $style->dimensions\n && (\n $file->isImage()\n || in_array($ext, ['psd', 'ai', 'eps', 'ar3'])\n )\n ) {\n if ($ext == 'psd') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/psd.png'), 'psd.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'ai') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/ai.png'), 'ai.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'eps') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/eps.png'), 'eps.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'ar3') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/ar3.png'), 'ar3.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($file->isImage()) {\n $file = $this->resizer->resize($file, $style);\n }\n }\n else {\n $file = $file->getRealPath();\n }\n\n $filePath = $this->path($style->name);\n $this->move($file, $filePath);\n }\n }",
"function saveFile(UploadedFile $file, $width)\n{\n $filename = md5(mt_rand().$file->getBasename()).'.'.$file->guessClientExtension();\n\n $file->move(__DIR__.'/../../img', $filename);\n\n $imagine = new Imagine\\Gd\\Imagine();\n $image = $imagine->open(__DIR__.'/../../img/'.$filename);\n\n $box = $image->getSize();\n $box = $box->widen((int) $width);\n\n $image = $image->thumbnail($box, Imagine\\Image\\ImageInterface::THUMBNAIL_OUTBOUND);\n $image->save(__DIR__.'/../../img/mini_'.$filename);\n\n return $filename;\n}",
"function uploadAndResizeImage(array $fileToUpload, $uploadFolder, array $sizes) {\n\n $result = [];\n\n /*\n Vi smider værdierne fra $_FILES super global\n variablen i vores egne variabler og giver dem\n et mere beskrivende variabel navn\n */\n\n $originalFile = $fileToUpload['name'];\n\n /*\n pathinfo er en function til at få information omkring en fil, samt stien til den fil.\n i dette tilfælde benytter vi den til at få endelsen på filen altså: jpg, gif, png osv\n\n Vi kører pathinfo igennem en strtolower (string to lower) function, således at fil\n endelsen altid kommer ud i små bogstaver.\n\n Vi ved ikke hvad brugerne kommer med, så dette er en måde at sikre os, at vi altid\n arbejder på den samme måde, nemlig med små bogstaver\n */\n\n $fileType = strtolower(pathinfo($originalFile, PATHINFO_EXTENSION));\n\n // var_dump($fileType);\n // die;\n\n /*\n Vi benytter samme metode til at få filnavnet ud, uden endelsen: .jpg, .png osv\n */\n\n $originalFilename = pathinfo($originalFile, PATHINFO_FILENAME);\n\n // var_dump($originalFilename);\n // die;\n\n $uploadedFile = $fileToUpload['tmp_name'];\n $errors = $fileToUpload['error'];\n $fileSize = $fileToUpload['size'];\n\n /*\n Det er nu tid til at kigge på hvilken fil og filtype vi har fået ind\n og teste på om dette er den rette.\n\n Vi begynder samtidig med at se på selve resize delen af scriptet\n\n Til denne del, benytter vi en række functions som går ind og opfører\n sig lidt som et billedredigerings program, som eksempelvis Photoshop.\n\n Det betyder at vi begynder at kigge på hvad der er i selve filen vi uploader,\n vi ser på billedet i pixels, som man ville gøre det i et billedredigeringsprogram\n\n Da måden PHP ser på hvad der er i et billede rent pixelmæssigt er udgjort på baggrund\n af filtypen: png, jpg osv, kan vi slå \"valideringen\" af filtypen sammen med denne del\n */\n\n switch ($fileType) {\n case 'png':\n\n /*\n png formatet er i orden, her beder vi php om at\n skabe et kilde billede i pixels, i hukommelsen, vi kan arbejde med\n som var det et billedredigerings program.\n */\n\n $sourceImage = imagecreatefrompng($uploadedFile);\n\n break;\n\n case 'gif':\n\n /* samme som ovenstående bare i forhold til gif billeder */\n\n $sourceImage = imagecreatefromgif($uploadedFile);\n\n break;\n\n case 'jpeg':\n case 'jpg':\n\n /* samme som ovenstående bare i forhold til jpg billeder */\n\n $sourceImage = imagecreatefromjpeg($uploadedFile);\n\n break;\n\n default:\n\n /* skulle vi få et format ind vi ikke kender, stopper vi scriptet */\n\n throw new Exception('Unknown image filetype given');\n\n break;\n }\n\n /*\n Nu hvor vi skal til at arbejde med vores kilde billede, er vi nødt til at kende\n størrelsen.\n getimagesize functionen returnerer et array med størrelses informationerne.\n Her skal vi benytte de 2 første værdier, som angiver størrelsen i integers\n */\n\n $sourceImageWidth = getimagesize($uploadedFile)[0];\n\n // var_dump($sourceImageWidth);\n // var_dump($sourceImageHeight);\n // die;\n\n /*\n Alternativt kan man bruge list functionen, som giver os mulighed for at\n overføre værdier fra et array, direkte til variabler.\n\n Her er det dog vigtigt at kende placeringerne i det array der returneres.\n\n Vi ved at de 2 første er vores vidde og bredde og kunne derfor skrive\n list($variabeltilvidde, $variabeltilhøjdre) = getimagesize($uploadedFile);\n */\n\n list($sourceImageWidth, $sourceImageHeight) = getimagesize($uploadedFile);\n\n /*\n Vi skal nu til selve resizing af billeder.\n\n Da vi angiver disse i et array, vil vi løbe over dem\n igennem en foreach\n */\n\n foreach ($sizes as $prefix => $size) {\n /*\n Vi angiver først vores ønskede billedstørrelse\n Vidden kan vi tage fra vores sizes array.\n\n Højden bruger vi i en udregning for at holde vores aspect ratio.\n Formlen for denne lyder:\n Original højde / original vidde * ny vidde = ny højde\n */\n\n $width = $size;\n $height = ($sourceImageHeight / $sourceImageWidth) * $size;\n\n // echo $width;\n // echo $height;\n // die;\n\n /*\n Vi skaber et tomt canvas, som vi kan fylde ud med pixels fra\n det originale billede. Dette canvas sætter vi størrelsen på.\n imagecreatetruecolor functionen benyttes til at skabe dette tomme canvas\n */\n\n $newImage = imagecreatetruecolor($width, $height);\n /*\n Vi benytter imagecopyresample functionen til at kopiere pixels fra vores originale billede\n over til vores nye billede.\n\n Måden dette gøres på, er ved at skabe et rektangel på det originale billede, hvor de pixels\n som ligger inden for denne rektangel bliver kopieret.\n\n Dernæst benytter vi endnu et rektangel på det nye billede, hvorved de kopierede pixels\n pastes ind.\n\n Hvis det nye billede er mindre, vel der her skabes en resizing, som derved får de kopierede\n pixels til at passe ind i det rektangel de skal passe i.\n\n Vi angiver vores nye billede, vores originale billede og dernes koordinaterne for:\n Hvor på x aksen rektanglet på det nye billede skal placeres\n Hvor på y aksen rektanglet på det nye billede skal placeres\n\n Hvor på x aksen rektanglet på det originale billede skal placeres\n Hvor på y aksen rektanglet på det originale billede skal placeres.\n\n Dernæst angiver vi størrelsen på vores rekstangler, altså:\n Vidden på rektanglet på vores nye billede\n Højden på rektanglet på vores nye billede\n\n Vidden på rektanglet på vores originale billede\n Højde på rektanglet på vores originale billede\n */\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, 0, 0, $width, $height, $sourceImageWidth, $sourceImageHeight);\n\n /*\n Når det nye billede har modtagede de kopierede pixels\n fra det originale er vi klar til at gemme det.\n\n Vi opbygger derefter filnavnet samt stien hvor dette skal gemmes.\n $uploadFolder stien bliver givet igennem denne functions parameter\n\n time() functionen giver os et timestamp for det øjeblik filens skal gemmes.\n vi benytter dette, for at få et unikt filnavn, således at vi ikke overskriver\n eksisterende filer med samme navn\n\n $prefix bliver givet igennem vores sizes array\n\n $originalFilename blev fundet igennem overførslen fra Super global variablen\n øverst i denne function.\n\n Dernæst vælger vi at gemme denne fil som jpg.\n\n */\n if ($fileType == \"jpeg\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.jpg';\n imagejpeg($newImage, $filename, 100);\n }\n if ($fileType == \"jpg\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.jpg';\n imagejpeg($newImage, $filename, 100);\n }\n if ($fileType == \"gif\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.gif';\n imagegif($newImage, $filename, 100);\n }\n if ($fileType == \"png\") {\n $filename = $uploadFolder . $prefix . '_' . time() . '_' . $originalFilename . '.png';\n imagepng($newImage, $filename, 100);\n }\n\n /*\n Vores nye billede ligger stadigvæk i serverens hukommelse\n For at være gode og ansvarlige programmører, sletter vi dette, således\n at hukommelsen frigives til de andre brugere af serveren :-)\n */\n\n imagedestroy($newImage);\n\n /*\n Til sidst smider vi vores filsti i vores result array, således\n at det efterfølgende kan benyttes i en database.\n\n Vi genbruger her vores prefix fra vores sizes array, således\n at fil stierne kan adskilles\n */\n\n $result[$prefix] = $filename;\n }\n\n /*\n Da vores originale billede også ligger i serverens hukommelse,\n vil vi igen være gode og ansvarlige programmører der fjerner dette\n */\n\n imagedestroy($sourceImage);\n\n return $result;\n}",
"public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}",
"public function lifecycleFileUpload() {\n $this->upload();\n}",
"public function resizing(Resizable $model)\n {\n if ($this->queueIt()) {\n $this->app[Dispatcher::class]->dispatch(new ResizeImage($model));\n } else {\n $this->doIt($model);\n }\n }",
"public static function resize(){\n\n}",
"public function lifecycleFileUpload()\n {\n $this->upload();\n }",
"public function lifecycleFileUpload()\n {\n $this->upload();\n }",
"public function lifecycleFileUpload() {\n $this->upload();\n }",
"public function upload() {\n $this->file->move($this->baseDir(), $this->fileName());\n $this->makeThumbnail();\n\n return $this;\n }",
"function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}",
"public function enqueue_uploader()\n {\n }",
"public function __construct(){\n if(!isset($_FILES) or empty($_FILES)) return false;\n \n \n //check if destination folder is writable\n if(!is_writable($this->destination)):\n \n Notify::developer('You cannot upload the file, '.$this->destination.' does not exist or does not have writing permissions');\n return false;\n \n endif;\n \n \n //load list of authorized files\n $this->AuthorizedFileTypes=explode(' ',ALLOWED_FILE_TYPES);\n \n //load list of authorized images that have to be resized after upload\n $this->AuthorizedImages=explode(' ',ALLOWED_IMAGE_TYPES);\n \n \n //load list of authorized images that have to be resized after upload\n $this->ImageSizes=explode(' ',IMAGES_MAX_DIMENSIONS);\n \n \n \n //set the memory limit\n ini_set('memory_limit', $this->memory_limit);\n \n foreach($_FILES as $FileGroup):\n /*I treat the files always as if it was from multiple files form\n so if the array it's actually only of a file I still create the $Files array\n with just one file so that I can process the same way in both occasions*/\n \n \n //in caso di files multipli riarrangio tutto in Array numerico contenente i file separati in subarray\n if (is_array($FileGroup['tmp_name'])) //file multipli\n $Files=Arrays::reGroupSubArrays($FileGroup);\n //altrimenti se il file è uno riorganizzo solo quello in un subarray per renderlo uniforme per operazione successiva\n else\n $Files[0]=$FileGroup;\n \n if($Files[0]['error']!=4): //this is the only prove that at least one file is being uploaded so I can proceed\n\n $this->n_of_files_to_upload+=count($Files);\n \n $FilesToUpload[]=$Files;\n \n \n foreach($Files as $File):\n $ext=EasyFile::mimeToExtension($File['type']);\n if(self::fileIsAllowed($ext)):\n if(move_uploaded_file($File['tmp_name'],$this->destination.$File['name'])):\n $this->n_of_uploaded_files++;\n endif;\n \n else:\n Notify::userError('Attenzione! Il file '.$File['name'].' non è stato caricato in quanto l\\'estensione '.$ext.' non è autorizzata');\n endif;\n endforeach;\n \n unset($Files);\n \n endif;\n \n \n endforeach;\n \n \n print_r($FilesToUpload);\n \n print_r(Arrays::ditchFirstNumericLevel($FilesToUpload));\n \n echo $mess=$this->n_of_uploaded_files.' files of '.$this->n_of_files_to_upload.' have been successfully uploaded';\n \n //Notify::success($mess);\n \n \n}",
"public function resizeImages()\n {\n $conn = $this->getConnection();\n if ($images = $this->getImages($conn)) {\n $imagePath = $this->getNameImages($conn, $images[0]['image_id']);\n\n if ($images[0]['image_id'] == $images[1]['image_id']) {\n //blocks records while they are in resizing, status in progress\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n $this->changeStatus($conn, 'in progress', 'new', $id);\n }\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n // $image_id = $images[$i]['image_id'];\n if ($this->setNewSize($imagePath, $this->size[$i], $this->size[$i])) {\n $this->updateImages($conn, 'complete', 'done', $imagePath, $id, $this->size[$i]);\n } else\n $this->updateImages($conn, 'error', 'something wrong', $imagePath, $id, $this->size[$i]);\n }\n }\n $conn = null;\n } else echo \"everything is done \\n\";\n }",
"function media_upload_max_image_resize()\n {\n }",
"public function uploadAndResize($request, $width=null, $height=null)\n {\n if( is_null($width) && is_null($height) )\n {\n $width = 1600; \n $height = 1000;\n }\n\n if($request->file('file'))\n {\n $this->validate($request, ['file' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048']);\n $image = $request->file('file');\n $input['imagename'] = time().'.'.$image->getClientOriginalExtension();\n $destinationPath = public_path('/images');\n\n //redimensionner Image\n $image_resize = Resize::make($image->getRealPath()); \n $resultat = $image_resize->resize($width, $height);\n $path = $destinationPath . '/' . $input['imagename'];\n $image_resize->save($path);\n return $input['imagename'];\n }\n }",
"protected function flushWrites()\n {\n foreach ($this->queuedForWrite as $style) {\n $ext = pathinfo($this->uploadedFile->getFilename(), PATHINFO_EXTENSION);\n if (\n $style->dimensions\n && (\n $this->uploadedFile->isImage()\n || in_array($ext, ['psd', 'ai', 'eps', 'ar3'])\n )\n ) {\n if ($ext == 'psd') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/psd.png'), 'psd.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'ai') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/ai.png'), 'ai.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'eps') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/eps.png'), 'eps.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($ext == 'ar3') {\n $uploadedFile = new UploadedFile(\n new SymfonyUploadedFile(public_path('img/files/ar3.png'), 'ar3.png')\n );\n $file = $this->resizer->resize($uploadedFile, $style);\n }\n else if ($this->uploadedFile->isImage()) {\n $file = $this->resizer->resize($this->uploadedFile, $style);\n }\n }\n else {\n $file = $this->uploadedFile->getRealPath();\n }\n\n $filePath = $this->path($style->name);\n $this->move($file, $filePath);\n }\n\n $this->queuedForWrite = [];\n }",
"public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }",
"function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}",
"public function uploadLogo() {\n if($this->employer_logo instanceof UploadedFile){\n $filename = Yii::$app->security->generateRandomString() . \".\" . $this->employer_logo->extension;\n\n //Resize file using imagine\n $newTmpName = $this->employer_logo->tempName . \".\" . $this->employer_logo->extension;\n\n $imagine = new \\Imagine\\Gd\\Imagine();\n $image = $imagine->open($this->employer_logo->tempName);\n $image->resize($image->getSize()->widen(500));\n $image->save($newTmpName);\n\n //Overwrite old filename for S3 uploading\n $this->employer_logo->tempName = $newTmpName;\n\n //Save to S3 Temporary folder\n $awsResult = Yii::$app->resourceManager->save($this->employer_logo, \"employer-logo/\" . $filename);\n if($awsResult){\n $this->employer_logo = $filename;\n }\n }\n }",
"public function resizeOnUpload(Varien_Event_Observer $observer)\n {\n return $this;\n }",
"public function uploadImage($event)\n {\n if (!array_key_exists($this->attribute, $event->sender->attributes)) {\n throw new InvalidConfigException(Yii::t('wavecms/main', 'Attribute {attribute} not found in model {model}', ['attribute' => $this->attribute, 'model' => $event->sender->className()]));\n }\n\n $oldFile = $event->sender->getOldAttribute($this->attribute);\n\n $uploadedFile = UploadedFile::getInstance($event->sender, $this->attribute);\n\n if (null !== $uploadedFile && $uploadedFile->size !== 0) {\n\n $folder = $this->getWebrootFolder();\n\n if ($oldFile) {\n $this->unlinkFiles($oldFile);\n }\n\n $baseName = $uploadedFile->baseName;\n $fileName = $baseName . '.' . $uploadedFile->extension;\n\n while (@file_exists($folder . '/' . $fileName)) {\n $baseName .= '_';\n $fileName = $baseName . '.' . $uploadedFile->extension;\n }\n\n FileHelper::createDirectory($folder, 0777);\n $uploadedFile->saveAs($folder . '/' . $fileName);\n\n FileHelper::createDirectory($folder . '/' . $this->thumbFolder, 0777);\n Image::thumbnail($folder . '/' . $fileName, $this->thumbWidth, $this->thumbHeight)\n ->save($folder . '/' . $this->thumbFolder . '/' . $fileName, ['quality' => $this->quality]);\n\n if (is_array($this->sizes)) {\n $i = 0;\n foreach ($this->sizes as $size) {\n $manipulatorInterface = ManipulatorInterface::THUMBNAIL_OUTBOUND;\n\n if (isset($size[2]) && in_array($size[2], [ManipulatorInterface::THUMBNAIL_OUTBOUND, ManipulatorInterface::THUMBNAIL_INSET], true)) {\n $manipulatorInterface = $size[2];\n }\n\n FileHelper::createDirectory($folder . '/' . $i, 0777);\n Image::thumbnail($folder . '/' . $fileName, $size[0], $size[1], $manipulatorInterface)\n ->save($folder . '/' . $i . '/' . $fileName, ['quality' => $this->quality]);\n $i++;\n }\n }\n\n $event->sender->{$this->attribute} = $fileName;\n } else {\n if (Yii::$app->request->post($this->attribute . '_image_delete')) {\n $this->unlinkFiles($oldFile);\n $event->sender->{$this->attribute} = null;\n } else {\n $event->sender->{$this->attribute} = $oldFile;\n }\n }\n }",
"function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}",
"function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}",
"public function resize( $size, $to = null, $prefix = '', $file_index = null ) {\r\n\t\t\t$this->thumb( $size, '', $prefix, true, $to, false, $file_index );\r\n\t\t}",
"public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }",
"public function lifecycleFileUpload(): void\n {\n $this->upload();\n }",
"public function ImageResize($file_resize_width, $file_resize_height){\r\n $this->proc_filewidth=$file_resize_width;\r\n $this->proc_fileheight=$file_resize_height;\r\n }",
"public function copyResized() {\n\t\t\n\t\t$output = array();\n\t\t\n\t\t$options = array_merge(\n\t\t\tarray(\n\t\t\t\t'url' => '',\n\t\t\t\t'filename' => '',\n\t\t\t\t'width' => false,\n\t\t\t\t'height' => false,\n\t\t\t\t'crop' => false\n\t\t\t),\n\t\t\t$_POST\n\t\t);\n\t\t\n\t\t$width = $options['width'];\n\t\t$height = $options['height'];\n\t\t\n\t\tif (!((is_numeric($width) || is_bool($width)) && (is_numeric($height) || is_bool($height)))) {\n\t\t\t$output['error'] = Text::get('error_file_size');\n\t\t\treturn $output;\n\t\t}\n\t\t\n\t\tif ($options['filename']) {\n\t\t\n\t\t\t// Get parent directory.\n\t\t\tif ($options['url']) {\n\t\t\t\t$Page = $this->Automad->getPage($options['url']);\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_PAGES . $Page->path;\n\t\t\t} else {\n\t\t\t\t$directory = AM_BASE_DIR . AM_DIR_SHARED . '/';\n\t\t\t}\n\t\t\n\t\t\t$file = $directory . $options['filename'];\n\t\t\n\t\t\tCore\\Debug::log($file, 'file');\n\t\t\tCore\\Debug::log($options, 'options');\n\t\t\t\t\n\t\t\tif (file_exists($file)) {\n\t\t\t\t\n\t\t\t\tif (is_writable($directory)) {\n\t\t\t\t\t\n\t\t\t\t\t$img = new Core\\Image(\n\t\t\t\t\t\t$file, \n\t\t\t\t\t\t$width, \n\t\t\t\t\t\t$height,\n\t\t\t\t\t\tboolval($options['crop'])\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$cachedFile = AM_BASE_DIR . $img->file;\n\t\t\t\t\t$resizedFile = preg_replace('/(\\.\\w{3,4})$/', '-' . floor($img->width) . 'x' . floor($img->height) . '$1', $file);\n\t\t\t\t\t\n\t\t\t\t\tif (!$output['error'] = FileSystem::renameMedia($cachedFile, $resizedFile)) {\n\t\t\t\t\t\t$output['success'] = Text::get('success_created') . ' \"' . basename($resizedFile) . '\"';\n\t\t\t\t\t\t$this->clearCache();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . ' \"' . $directory . '\"';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$output['error'] = Text::get('error_file_not_found');\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\n\t}",
"public function uploadImage()\n {\n if (null === $this->fileimage) {\n return;\n }\n\n $upload = new Upload();\n $this->image = $upload->createName(\n $this->fileimage->getClientOriginalName(),\n $this->getUploadRootDir().'/',\n array('tmp/','miniature/')\n );\n\n $imagine = new Imagine();\n\n /* Tmp */\n $size = new Box(1920,1080);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'inset')\n ->save($this->getUploadRootDir().'tmp/'.$this->image);\n\n /* Miniature */\n $size = new Box(300,300);\n $imagine->open($this->fileimage)\n ->thumbnail($size, 'outbound')\n ->save($this->getUploadRootDir().'miniature/'.$this->image);\n\n }",
"function upload_passport($path, $ext, $sn) {\n $img_url = 'passport' . $sn . '-' . date('mdYHis.') . $ext;\n move_uploaded_file($path, \"temp_img/\" . $img_url);\n $resizeObj = new resize(\"temp_img/\" . $img_url);\n $resizeObj->resizeImage(280, 350, 'crop');\n $resizeObj->saveImage(\"pics/\" . $img_url, 100);\n unlink(\"temp_img/\" . $img_url);\n return $img_url;\n}",
"public function upload($field = false, $file = false, $resize_type = false, $resolution = false, $parent = false, $watermark = true)\n {\n global $config, $l_deny_files_regexp, $rlHook;\n\n /* get tmp file if exists */\n $tmp = $_SESSION['tmp_files'];\n\n $rlHook->load('phpUpload');\n\n if ((is_readable(RL_UPLOAD . $tmp[$parent][$field]) && $tmp[$parent][$field]) || (is_readable(RL_UPLOAD . $tmp[$field]) && $tmp[$field])) {\n $file_tmp_name = $_SESSION['tmp_files'][$parent][$field] ? $_SESSION['tmp_files'][$parent][$field] : $_SESSION['tmp_files'][$field];\n\n /* prevent denied files upload */\n if (preg_match($l_deny_files_regexp, $file_tmp_name)) {\n return false;\n }\n\n $file_ext = pathinfo($file_tmp_name, PATHINFO_EXTENSION);\n $file_name = $file . '.' . $file_ext;\n $file_dir = RL_UPLOAD . $file_tmp_name;\n }\n /* get file from FILES */\n else {\n $file_tmp_name = $parent && $_FILES[$parent] ? $_FILES[$parent]['name'][$field] : $_FILES[$field]['name'];\n\n /* prevent denied files upload */\n if (preg_match($l_deny_files_regexp, $file_tmp_name)) {\n return false;\n }\n\n $file_type = $parent && $_FILES[$parent] ? $_FILES[$parent]['type'][$field] : $_FILES[$field]['type'];\n $file_tmp_dir = $parent && $_FILES[$parent] ? $_FILES[$parent]['tmp_name'][$field] : $_FILES[$field]['tmp_name'];\n $file_ext = pathinfo($file_tmp_name, PATHINFO_EXTENSION);\n $file_name = $file . '.' . $file_ext;\n\n if ($this->photoSaveOriginal) {\n $file_name_original = $file . '_original.' . $file_ext;\n $this->photoOriginal = $file_name_original;\n }\n $file_dir = RL_UPLOAD . $file_name;\n\n /* upload file */\n if (move_uploaded_file($file_tmp_dir, $file_dir)) {\n chmod($file_dir, 0777);\n } else {\n trigger_error(\"Unable to move_uploaded_file\", E_WARNING);\n $GLOBALS['rlDebug']->logger(\"Unable to move_uploaded_file\");\n }\n }\n\n if (is_readable($file_dir)) {\n $final_distanation = RL_FILES . $file_name;\n\n if ($this->photoSaveOriginal && $this->photoOriginal) {\n copy($file_dir, RL_FILES . $this->photoOriginal);\n }\n\n if (!empty($resize_type) && !empty($resolution)) {\n $this->loadClass('Resize');\n $this->loadClass('Crop');\n\n /* crop image */\n if (is_array($resolution)) {\n $GLOBALS['rlCrop']->loadImage($file_dir);\n $GLOBALS['rlCrop']->cropBySize($resolution[0], $resolution[1], ccCENTER);\n $GLOBALS['rlCrop']->saveImage($file_dir, $config['img_quality']);\n $GLOBALS['rlCrop']->flushImages();\n }\n\n /* resize image */\n $resize_type = strtoupper($resize_type);\n $GLOBALS['rlResize']->resize($file_dir, $final_distanation, $resize_type, $resolution, true, $watermark);\n } else {\n copy($file_dir, $final_distanation);\n }\n\n if (is_readable($final_distanation)) {\n chmod($final_distanation, 0644);\n\n unlink($file_dir);\n\n if ($parent) {\n unset($_SESSION['tmp_files'][$parent][$field]);\n } else if ($field) {\n unset($_SESSION['tmp_files'][$field]);\n }\n\n return $file_name;\n }\n }\n\n return false;\n }",
"public static function uploadImage($file, $type = null)\n {\n #image types\n #thumbnail\n #small\n #medium\n #large\n #x-large\n $resize = array();\n\n if (!is_null($type)){\n switch($type){\n case 'logo':\n $resize[] = array(\n 'prefix' => PREFIX_LOGO,\n 'width' => IMG_WIDTH_THUMB,\n 'resize' => true,\n 'cropping' => false,\n 'ratio_y' => true,\n );\n break;\n case 'content':\n case 'gallery':\n $resize['thumb'] = array(\n 'prefix' => PREFIX_THUMB,\n 'width' => IMG_WIDTH_THUMB,\n 'height'=> IMG_HEIGHT_THUMB,\n 'resize' => true,\n 'cropping' => true,\n );\n $resize['small'] = array(\n 'prefix' => PREFIX_SMALL,\n 'width' => IMG_WIDTH_SMALL,\n 'height'=> IMG_HEIGHT_SMALL,\n 'resize' => true,\n 'cropping' => true,\n );\n }\n }\n\n $dest = UPLOAD_DST_DIR; // The place the files will be uploaded to (currently a 'files' directory). Should have write permission\n\n #create new names of the uploaded image file\n $imageName = $file['name']; // Get the name of the file (including file extension).\n $imgFname = substr($imageName, 0, strpos($imageName, '.'));\n $imageExt = substr($imageName, strpos($imageName, '.'), strlen($imageName) - 1); // Get the extension from the filename.\n\n $baseImgName = str_replace(\" \",\"_\",trim($imgFname,\"-\"));\n if (file_exists($dest . $baseImgName . $imageExt)) {\n $baseImgName = str_replace(\" \",\"_\",trim($imgFname,\"-\")) . rand(0, 999);\n }\n\n /*\n if ($resize){\n //create image names\n $resize['thumbnail']['name'] = IMG_THUMB.$baseImgName;\n $resize['medium']['name'] = IMG_MEDIUM.$baseImgName;\n }*/\n\n #now upload the image and resize\n $handle = new Upload($file);\n\n if ($handle->uploaded) {\n\n //upload the main file to the server first\n $handle->file_new_name_body = $baseImgName;\n $handle->Process($dest);\n\n #main file created\n if (!$handle->processed) {\n echo $handle->log;\n echo ' Error creating main file: ' . $handle->error . '';\n throw new Exception( ' Error creating main file: ' . $handle->error );\n }\n\n // yes, the file is on the server\n // below are some example settings which can be used if the uploaded file is an image.\n if ($resize){\n foreach($resize as $type => $value){\n\n //file name for the resize\n $handle->file_new_name_body = $value['prefix'].$baseImgName;\n\n //make the basic settings\n if ($value['resize']){\n $handle->image_resize = true;\n }\n\n if ($value['cropping']) {\n $handle->image_x = $value['width'];\n $handle->image_y = $value['height'];\n $handle->image_ratio_crop = true;\n } else if ($value['ratio_y'] == true){\n $handle->image_x = $value['width'];\n $handle->image_ratio_y = true;\n } else if ($value['ratio_x'] == true){\n $handle->image_y = $value['height'];\n $handle->image_ratio_x = true;\n }\n\n //create image now\n $handle->Process($dest);\n\n if ( !$handle->processed ){\n\n echo $handle->log;\n echo \"Error creating \".$type.\" for image file \".$baseImgName .'<br />';\n echo $handle->error;\n throw new Exception( \"Error creating \".$type.\" for image file \".$baseImgName . var_export($handle->error, true));\n }\n }\n }\n\n // we delete the temporary files\n $handle->Clean();\n return $baseImgName . strtolower($imageExt);\n } else {\n throw new Exception( \"Cannot upload image\" . var_export($_FILES, true));\n }\n }",
"function process_user_default_avatar_uploader($array) \r\n\t{\r\n\t\tglobal $wpdb, $xoouserultra;\r\n\t\t\r\n\t\t/* File upload conditions */\r\n\t\t$this->allowed_extensions = array(\"jpg\", \"jpeg\", \"png\");\t\r\n\t\t\r\n\t\t$original_max_width = $xoouserultra->get_option('media_avatar_width');\r\n\t\t$original_max_height = $xoouserultra->get_option('media_avatar_height');\r\n\t\t\t\r\n\t\tif($original_max_width==\"\" || $original_max_height==\"\")\r\n\t\t{\t\t\t\r\n\t\t\t$original_max_width = 120;\t\t\t\r\n\t\t\t$original_max_height = 120;\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\tif (isset($_FILES))\r\n\t\t{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tforeach ($_FILES as $key => $array) {\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\textract($array);\r\n\t\t\t\t\r\n\t\t\t\t$file = $_FILES[$key];\t\t\t\t\r\n\t\t\t\t$info = pathinfo($file['name']);\r\n\t\t\t\t$real_name = $file['name'];\r\n\t\t\t\t$ext = $info['extension'];\r\n\t\t\t\t$ext=strtolower($ext);\r\n\t\t\r\n\t\t\t\t\r\n\t\t\t\tif ($name) {\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( !in_array($ext, $this->allowed_extensions) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->messages_process .= __('The file format is not allowed!','xoousers');\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t/*Upload file*/\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$path_f = ABSPATH.$xoouserultra->get_option('media_uploading_folder');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$target_path = $path_f.'/custom_avatar_image/';\r\n\t\t\t\t\t\t// Checking for upload directory, if not exists then new created. \r\n\t\t\t\t\t\tif(!is_dir($target_path))\r\n\t\t\t\t\t\t mkdir($target_path, 0755);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$target_path = $target_path.\"uultra_default_avatar_image_.\" .$ext;\t\t\t\t\t\t\r\n\t\t\t\t\t\tmove_uploaded_file( $tmp_name, $target_path);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//check resize\r\n\t\t\t\t\t\t//check max width\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tlist( $source_width, $source_height, $source_type ) = getimagesize($target_path);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(($source_width > $original_max_width)) \r\n\t\t\t\t\t\t{\r\n\r\n\r\n\t\t\t\t\t\t if ($this->resizeImageWithMaxWidth($target_path, $target_path, $original_max_width, $original_max_height,$ext)) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$old = umask(0);\r\n\t\t\t\t\t\t\t\tchmod($target_path, 0755);\r\n\t\t\t\t\t\t\t\tumask($old);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//update\t\t\t\t\t\t\r\n\t\t\t\t\t\tupdate_option('uultra_default_user_avatar', \"uultra_default_avatar_image_.\" .$ext );\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->messages_process .= __('--- Finished --- ', 'xoousers');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\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}\r\n\t\t\r\n\t}",
"public function uploader(){\n\n // Recuperando imagem em base64\n // Exemplo: data:image/png;base64,AAAFBfj42Pj4\n $imagen = $_POST['imagen'];\n\n // Separando tipo dos datos da imagen\n // $tipo: data:image/png\n // $datos: base64,AAAFBfj42Pj4\n list($tipo, $datos) = explode(';', $imagen);\n\n // Isolando apenas o tipo da imagen\n // $tipo: image/png\n list(, $tipo) = explode(':', $tipo);\n\n\n // Isolando apenas os datos da imagen\n // $datos: AAAFBfj42Pj4\n list(, $datos) = explode(',', $datos);\n\n //Convertendo base64 para imagen\n $datos = base64_decode($datos);\n\n //Gerando nombre aleatório para a imagen\n $nombre = 'upl_' . $_POST['nombre'];\n\n //Controlador\n $controlador = $_POST['controlador'];\n $modelo = $this->getModel($controlador);\n\n //Ruta\n $ruta = ROOT . 'public' . DS . 'img' . DS . $controlador . DS;\n\n\n // Salvando imagen em disco\n if (file_put_contents($ruta.\"{$nombre}.jpg\", $datos)){\n\n //$parametro = json_decode(stripslashes($_POST['datos']),true);\n $parametro = $_POST['datos'];\n\n if($modelo->modificarImagen($nombre.\".jpg\",$parametro)){\n //$modelo->modificarImagen($parametro[0],array(1));\n // El modelo debe contener este metodo en el cual recibe el nombre de la imagen y un Array de datos auxiliares\n\n $thumb = new upload($ruta.\"{$nombre}.jpg\");\n $thumb->image_resize = true;\n $thumb->image_y = $thumb->image_dst_y / 2;\n $thumb->image_x = $thumb->image_dst_x / 2;\n $thumb->file_name_body_pre = 'thumb_';\n $thumb->process($ruta . 'thumb' . DS);\n }\n\n }\n }",
"private function moveAndCreatePhoto(\n UploadedFile $file,\n $size = ['l' => [1000, 1000], 's' => [300, 300]]\n ) {\n $extension = '.' . $file->extension();\n\n $name = token();\n $filename = $name . $extension;\n\n $path = upload_path_images();\n $imageTmp = Image::make($file->getRealPath());\n\n if (!$imageTmp) {\n return false;\n }\n\n $largeSize = $size['l'];\n $thumbSize = $size['s'];\n\n // save original\n $imageTmp->save($path . $name . ImageThumb::$originalAppend . $extension);\n\n // if width is the biggest - resize on max width\n if ($imageTmp->width() > $imageTmp->height()) {\n // resize the image to the large height and constrain aspect ratio (auto width)\n $imageTmp->resize(null, $largeSize[1], function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $filename);\n\n // resize the image to the thumb height and constrain aspect ratio (auto width)\n $imageTmp->resize(null, $thumbSize[1], function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $name . ImageThumb::$thumbAppend . $extension);\n }\n else {\n // resize the image to the large width and constrain aspect ratio (auto height)\n $imageTmp->resize($largeSize[0], null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $filename);\n\n // resize the image to the thumb width and constrain aspect ratio (auto width)\n $imageTmp->resize($thumbSize[0], null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $name . ImageThumb::$thumbAppend . $extension);\n }\n\n return $filename;\n }",
"public function resizeImage()\n {\n \treturn view('resizeImage');\n }",
"public function upload()\n {\n\n if (null == $this->fichier)\n {\n return;\n }\n\n if ($this->oldFichier)\n {\n // suppression de l'ancienne image\n if (file_exists($this->getUploadRootDir() . '/' . $this->oldFichier))\n {\n unlink($this->getUploadRootDir() . '/' . $this->oldFichier);\n }\n\n\n // suppression des anciens thumbnails\n foreach ($this->thumbnails as $key => $thumbnail)\n {\n if (file_exists($this->getUploadRootDir() . '/' . $key . '-' . $this->oldFichier))\n {\n unlink($this->getUploadRootDir() . '/' . $key . '-' . $this->oldFichier);\n }\n\n }\n }\n\n //$date = new \\DateTime('now');\n\n //$nameImage = $date->format('YmdHis') . '-' . $this->fichier->getClientOriginalName();\n //$extension = $this->fichier->guessExtension();\n //$nameImage = str_replace(' ', '-', $this->alt) . uniqid();\n\n // move (param 1 chemin vers dossier, param 2 nom image)\n\n //$this->name = $nameImage . \".\" . $extension;\n\n $this->fichier->move(\n $this->getUploadRootDir(),\n $this->name\n //$nameImage . \".\" . $extension\n );\n\n //$imagine = new \\Imagine\\Gd\\Imagine();\n\n /*$imagine\n ->open($this->getAbsolutePath())\n ->thumbnail(new \\Imagine\\Image\\Box(350, 160))\n ->save(\n $this->getUploadRootDir().'/' .\n $nameImage . '-thumb-small.' . $extension);*/\n\n $imagine = new \\Imagine\\Gd\\Imagine();\n $imagineOpen = $imagine->open($this->getAbsolutePath());\n\n foreach ($this->thumbnails as $key => $thumbnail)\n {\n $size = new \\Imagine\\Image\\Box($thumbnail[0], $thumbnail[1]);\n $mode = \\Imagine\\Image\\ImageInterface::THUMBNAIL_INSET;\n \n $imagineOpen->thumbnail($size, $mode)\n ->save($this->getUploadRootDir() . '/' . $key . '-' . $this->name);\n }\n }",
"function do_upload()\r\n\t{\r\n\t\tif (isset($_FILES[$this->post_name]))\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$tmp_file\t= ( !$this->isArrayPostName ) ? $post['tmp_name'] : $post['tmp_name'][$this->arrayPostName];\r\n\r\n\t\t\tif ( is_uploaded_file( $tmp_file ) )\r\n\t\t\t{\r\n\t\t\t\tif ($this->filteringExtension($post))\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->checkFileSize())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file_name = $this->getFileNameUploaded();\r\n\t\t\t\t\t\t$dest = $this->folder.$file_name;\r\n\t\t\t\t\t\t$upload = move_uploaded_file($tmp_file, $dest);\r\n\t\t\t\t\t\tif ($upload)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t@chmod($dest, $this->chmod);\r\n\t\t\t\t\t\t\t$this->file_name_sukses_uploaded = $file_name;\r\n\t\t\t\t\t\t\t$cfg_resize = array('source_image'=> $dest);\r\n\t\t\t\t\t\t\tif($this->is_resize)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$cfg_resize = array(\r\n\t\t\t\t\t\t\t\t\t'source_image'=> $dest,\r\n\t\t\t\t\t\t\t\t\t'width'\t\t\t\t=> $this->rez_width,\r\n\t\t\t\t\t\t\t\t\t'height'\t\t\t=> $this->rez_height\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t// pr(json_encode($cfg_resize, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $cfg_resize)->resize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_watermark)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this->watermark_param['source_image'] = $dest;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($this->watermark_param, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $this->watermark_param)->watermark();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_thumbnail)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(substr($this->thumb_prefix, -1) == '/' && !is_dir($this->folder.$this->thumb_prefix))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t@mkdir($this->folder.$this->thumb_prefix, 0777);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$config = array_merge($cfg_resize, $this->thumb_param);\r\n\t\t\t\t\t\t\t\t$config['create_thumb'] = FALSE ;\r\n\t\t\t\t\t\t\t\t$config['new_image'] = $this->folder.$this->thumb_prefix.$file_name;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($config, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $config)->resize();\r\n\t\t\t\t\t\t\t\t_class('images')->move_upload($this->folder.$this->thumb_prefix.$file_name);\r\n\t\t\t\t\t\t\t\t@chmod($this->folder.$this->thumb_prefix.$file_name, $this->chmod);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t_class('images')->move_upload($dest);\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse $this->error_code .= 'move_upload_file_failed';\r\n\t\t\t\t\t} else $this->error_code .= 'file_size_max_exceeded';\r\n\t\t\t\t} else $this->error_code .= 'file_type_unallowed';\r\n\t\t\t}// end if is_uploaded_file\r\n#\t\t\telse $this->error_code .= 'file_upload_from_post_failed';\r\n\t\t}// end if isset\r\n\t\telse {\r\n#\t\t\t$this->error_code .= 'file_post_un_uploaded';\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function __resize(&$tmp, $width, $height) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}",
"function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}",
"public function save(array $options = []) {\n/* if (preg_match('/image/', $this->mime_type)) {\n $this->isImage = true;\n $manager = new ImageManager(array('driver' => 'gd'));\n $image = Storage::disk('public')->get($this->myFile);\n $imageOrig = $manager->make($image); \n //Get width and height of the image\n $this->img_width = $imageOrig->width();\n $this->img_height = $imageOrig->height();\n }*/\n parent::save($options);\n $this->createThumbs();\n }",
"public function run() {\n\n // make enough memory available to scale bigger images\n ini_set('memory_limit', $this->thumb->options['memory']);\n \n // create the gd lib image object\n switch($this->thumb->image->mime()) {\n case 'image/jpeg':\n $image = @imagecreatefromjpeg($this->thumb->image->root()); \n break;\n case 'image/png':\n $image = @imagecreatefrompng($this->thumb->image->root()); \n break;\n case 'image/gif':\n $image = @imagecreatefromgif($this->thumb->image->root()); \n break;\n default:\n raise('The image mime type is invalid');\n break;\n } \n\n // check for a valid created image object\n if(!$image) raise('The image could not be created');\n\n // cropping stuff needs a couple more steps \n if($this->thumb->options['crop'] == true) {\n\n // Starting point of crop\n $startX = floor($this->thumb->tmp->width() / 2) - floor($this->thumb->result->width() / 2);\n $startY = floor($this->thumb->tmp->height() / 2) - floor($this->thumb->result->height() / 2);\n \n // Adjust crop size if the image is too small\n if($startX < 0) $startX = 0;\n if($startY < 0) $startY = 0;\n \n // create a temporary resized version of the image first\n $thumb = imagecreatetruecolor($this->thumb->tmp->width(), $this->thumb->tmp->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n \n // crop that image afterwards \n $cropped = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $cropped = $this->keepColor($cropped);\n imagecopyresampled($cropped, $thumb, 0, 0, $startX, $startY, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->tmp->width(), $this->thumb->tmp->height()); \n imagedestroy($thumb);\n \n // reasign the variable\n $thumb = $cropped;\n\n } else {\n $thumb = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->result->width(), $this->thumb->result->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n } \n \n // convert the thumbnail to grayscale \n if($this->thumb->options['grayscale']) {\n imagefilter($thumb, IMG_FILTER_GRAYSCALE);\n }\n\n // convert the image to a different format\n if($this->thumb->options['to']) {\n\n switch($this->thumb->options['to']) {\n case 'jpg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'gif': \n imagegif($thumb, $this->thumb->root()); \n break; \n }\n\n // keep the original file's format\n } else {\n\n switch($this->thumb->image->mime()) {\n case 'image/jpeg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'image/png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'image/gif': \n imagegif($thumb, $this->thumb->root()); \n break;\n }\n\n }\n\n imagedestroy($thumb);\n \n }",
"public function compressSized($type)\n {\n $ext = array('jpg', 'jpeg');\n $fileExtension = strtolower(pathinfo($this->filename, PATHINFO_EXTENSION));\n\n if (is_file($this->dirs['original'] . DIRECTORY_SEPARATOR . $this->filename) &&\n in_array($fileExtension, $ext))\n {\n\n $this->resizeImage($type);\n\n $file = $this->dirs[$type]\n . DIRECTORY_SEPARATOR\n . pathinfo($this->filename, PATHINFO_FILENAME) . '.jpg';\n\n $recompress = $this->getRecompressCommand($file, $file, $type);\n $output = array();\n $retval = false;\n exec($recompress, $output, $retval);\n\n $this->log[$type] = array(\n 'time' => date('Y.m.d. H:i:s'),\n 'error' => $retval,\n 'compress' => $output\n );\n }\n\n // PNG to WEBP\n if (is_file($this->dirs['original'] . DIRECTORY_SEPARATOR . $this->filename) &&\n $fileExtension === 'png')\n {\n $options = array(\n 'resize_width' => $this->options[$type]['resize_width'],\n 'resize_height' => $this->options[$type]['resize_height'],\n 'resize_square' => $this->options[$type]['resize_square'],\n 'webp_quality' => $this->options[$type]['webp_quality'],\n 'type' => $type\n );\n $sourcePath = $this->dirs['original'] . DIRECTORY_SEPARATOR . $this->filename;\n $destPath = $this->dirs[$type] . DIRECTORY_SEPARATOR . $type . '_' . $this->filename;\n $this->webp->run($sourcePath, $destPath, $options);\n\n }\n }",
"protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }",
"function aurum_woocommerce_3_3_transfer_image_sizes() {\n\t\t$do_resize = false;\n\t\t\n\t\t// WooCommerce Thumbnail\n\t\tif ( ( $shop_catalog_image_size = get_theme_mod( 'shop_catalog_image_size' ) ) ) {\n\t\t\t\n\t\t\t// {width}x{height} format\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)x(?<height>[0-9]+)(x(?<cropped>0|1))?$#', $shop_catalog_image_size, $shop_catalog_image_size_matches ) ) {\n\t\t\t\t$width = $shop_catalog_image_size_matches['width'];\n\t\t\t\t$height = $shop_catalog_image_size_matches['height'];\n\t\t\t\t$cropping = ! isset( $shop_catalog_image_size_matches['cropped'] ) || $shop_catalog_image_size_matches['cropped'];\n\t\t\t\t\n\t\t\t\t$ratio = _get_aspect_ratio( $width, $height );\n\t\t\t\t\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', $cropping ? 'custom' : 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $ratio[0] );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_height', $ratio[1] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t\t// Crop width only\n\t\t\telse if( is_numeric( $shop_catalog_image_size ) ) {\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $shop_catalog_image_size );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Single image\n\t\tif ( ( $shop_single_image_size = get_theme_mod( 'shop_single_image_size' ) ) ) {\n\t\t\t\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)(x(?<height>[0-9]+))?(x(?<cropped>0|1))?$#', $shop_single_image_size, $shop_single_image_size_matches ) ) {\n\t\t\t\tupdate_option( 'woocommerce_single_image_width', $shop_single_image_size_matches['width'] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Request image regeneration\n\t\tif ( $do_resize && class_exists( 'WC_Regenerate_Images' ) ) {\n\t\t\tWC_Regenerate_Images::queue_image_regeneration();\n\t\t}\n\t\t\n\t\t// Lightbox has moved\n\t\tset_theme_mod( 'shop_single_lightbox', ! get_theme_mod( 'shop_single_lightbox_disable', false ) );\n\t\t\n\t\t\n\t\t// WooCommerce columns\n\t\t$shop_product_columns = get_data( 'shop_product_columns' );\n\t\t\n\t\tupdate_option( 'woocommerce_catalog_columns', aurum_get_number_from_word( 'decide' == $shop_product_columns ? 4 : $shop_product_columns ) );\n\t\t\n\t\tif ( preg_match( '#[0-9]+#', get_data( 'shop_products_per_page' ), $matches ) ) {\n\t\t\tupdate_option( 'woocommerce_catalog_rows', $matches[0] );\n\t\t}\n\t\t\n\t\t// Run this once\n\t\tupdate_option( 'aurum_woocommerce_3_3_transfer_image_sizes', true );\n\t}",
"protected function scaleImages() {}",
"public function saveImage($name = null) : Uploader {\n\n $dir = Path::public() . '/' . Config::get('project.uploads.publicDir');\n $dir .= '/' . Config::get('project.uploads.images.dir');\n if (!file_exists($dir)) {\n Folder::instance($dir)->create();\n }\n\n $ext = $this->file->extension;\n $ext = $ext == 'png' ? 'png' : 'jpg';\n\n $img = Image::instance($this->file->tmp, $ext);\n $name = $name ?? GUID();\n\n $this->name = \"$name.$ext\";\n\n $sizes = Config::get('project.uploads.images.sizes');\n if (empty($sizes)) return $this;\n\n $sizeFiles = [ ];\n\n foreach($sizes as $size => $max) {\n\n $sizeDir = $dir . \"/$size\";\n if (!file_exists($sizeDir)) {\n mkdir($sizeDir);\n }\n\n $fileRoute = $img->cap($max, $max, true)->save($sizeDir . \"/$name.$ext\", $ext, 100);\n $sizeFiles[$size] = Path::toRelative($fileRoute, true);\n }\n\n $this->sizeFiles = $sizeFiles;\n\n return $this;\n\n }",
"function imgResizeHorW($file_ori,$UploadPath,$imgx=130,$imgy=150,$type='H',$clean=0) {\n\t\t$dest_filename='';\n\t\t\n\t\t$handle = new upload($file_ori);\n\t\t\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\tif($type=='W')\t{\n\t\t\t\t//$handle->image_x = $imgx;\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t} else if($type=='H')\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t}\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}",
"public function optimizeOnResize($event) {\n\t\t$thumb = $event->return;\n\n\t\t$this->optimize($thumb, false, 'auto');\n\n\t\t$event->return = $thumb;\n\t}",
"function upload_image($image,$path,$modwidths,$unlink){\n\t\t\t $imagename = $image['name'];\n\t\t\t $ext = pathinfo($imagename,PATHINFO_EXTENSION);\n $source = $image['tmp_name'];\n $target = $path.$imagename;\n\t\t\t $this->filename = $this->name.\".jpg\";\n move_uploaded_file($source, $target);\n \t\t\t $imagepath = $imagename;\n \t\t\t $file = $path.\"/\".$imagepath; //This is the original file\n \t\t\t\t\n list($width, $height) = getimagesize($file) ; \n\t\t\t //create images for each modwidth specified\n\t\t\t foreach($modwidths as $modwidth)\n\t\t\t {\n\t\t\t\t $newid = uniqid();\n\t\t\t\t $save = $path.\"/\".$newid.\".jpg\"; //This is the new file you saving\n\t\t\t\t $this->images[] = $newid.\".jpg\"; //This saves the image name in the images array of the class\n\t\t\t\t $diff = $width / $modwidth;\t//Calculate image scale based on the modwidth\n\t \n\t\t\t\t $modheight = $height / $diff; //calculate modheight based on the scale\n\t\t\t\t \n\t\t\t\t $tn = imagecreatetruecolor($modwidth, $modheight) ; \n\t\t\t\t //Generate the image from the source\n\t\t\t\t if ($ext == \"jpg\" or $ext == \"jpeg\")\n\t\t\t\t $image = imagecreatefromjpeg($file);\n\t\t\t\t elseif ($ext == \"gif\")\n\t\t\t\t $image = imagecreatefromgif($file);\n\t\t\t\t elseif ($ext == \"png\")\n\t\t\t\t $image = imagecreatefrompng($file);\n\t\t\t\t else\n\t\t\t\t $image = false; \n\t\t\t\t \n\t\t\t\t if ($image)\n\t\t\t\t {\n\t\t\t\t\t imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; \n\t\t\t\t\t imagejpeg($tn, $save, 100) ; \n\t\t\t\t\t $this->success = true; //set the success variable of the class as true\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $this->success = false; //set the success variable of the class as false\n\t\t\t\t }\n\t\t\t }\n \t\t\t//Delete source file if the unlink variable is set to 1\n \t\t\t if ($unlink == 1)\n\t\t\t unlink($target);\n\t\t}",
"function resizeUpload($field,$pic_dir,$name_dir,$cropratio=NULL,$watermark=NULL,$max_width,$max_height,$add_to_filename=NULL, $quality=90){\r\n\t\tglobal $font_path, $font_size, $water_mark_text_1, $water_mark_text;\r\n\t\t$maxwidth = $max_width; // Max new width or height, can not exceed this value.\r\n\t\t$maxheight = $max_height;\r\n\t\t$dir = $pic_dir; // Directory to save resized image. (Include a trailing slash - /)\r\n\t\t// Collect the post variables.\r\n\t\t$postvars = array(\r\n\t\t\t\"image\" => trim($_FILES[\"$field\"][\"name\"]),\r\n\t\t\t\"image_tmp\" => $_FILES[\"$field\"][\"tmp_name\"],\r\n\t\t\t\"image_size\" => (int)$_FILES[\"$field\"][\"size\"],\r\n\t\t\t);\r\n\t\t\t// Array of valid extensions.\r\n\t\t\t$valid_exts = array(\"jpg\",\"jpeg\",\"gif\",\"png\");\r\n\t\t\t$mod_exts = array(\"gif\",\"png\");\r\n\t\t\t// Select the extension from the file.\r\n\t\t\t$ext = end(explode(\".\",strtolower(trim($_FILES[\"$field\"][\"name\"]))));\r\n\t\t\t//echo (\"Image size: \" . $postvars[\"image_size\"] . \"<br> Ext: \" . $ext . \"<br>\");\r\n\t\t\t// Check is valid extension.\r\n\t\t\tif(in_array($ext,$valid_exts)){\r\n\t\t\t\tif($ext == \"jpg\" || $ext == \"jpeg\"){\r\n\t\t\t\t\t$image = imagecreatefromjpeg($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"gif\"){\r\n\t\t\t\t\t$image = imagecreatefromgif($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"png\"){\r\n\t\t\t\t\t$image = imagecreatefrompng($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\t// Grab the width and height of the image.\r\n\t\t\t\tlist($width,$height) = getimagesize($postvars[\"image_tmp\"]);\r\n\t\t\t\t// Ratio cropping\r\n\t\t\t\t$offsetX\t= 0;\r\n\t\t\t\t$offsetY\t= 0;\r\n\t\t\t\tif ($cropratio) {\r\n\t\t\t\t\t\t$cropRatio = explode(':', (string) $cropratio);\r\n\t\t\t\t\t\t$ratioComputed\t\t= $width / $height;\r\n\t\t\t\t\t\t$cropRatioComputed\t= (float) $cropRatio[0] / (float) $cropRatio[1];\r\n\t\t\t\t\t\tif ($ratioComputed < $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too tall so we will crop the top and bottom\r\n\t\t\t\t\t\t\t$origHeight\t= $height;\r\n\t\t\t\t\t\t\t$height\t\t= $width / $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetY\t= ($origHeight - $height) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $width;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if ($ratioComputed > $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too wide so we will crop off the left and right sides\r\n\t\t\t\t\t\t\t$origWidth\t= $width;\r\n\t\t\t\t\t\t\t$width\t\t= $height * $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetX\t= ($origWidth - $width) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// We get the other dimension by multiplying the quotient of the new width or height divided by\r\n\t\t\t\t// the old width or height.\r\n\t\t\t $w_adjust = ($maxwidth / $width);\r\n\t\t\t $h_adjust = ($maxheight / $height);\r\n\t\t\t if (($width >= $maxwidth)||($height >= $maxheight)) {\r\n\t\t\t\t if($w_adjust <= $h_adjust)\r\n\t\t\t\t {\r\n\t\t\t\t\t $newwidth=floor($width*$w_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$w_adjust);\r\n\t\t\t\t } else {\r\n\t\t\t\t\t $newwidth=floor($width*$h_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$h_adjust);\r\n\t\t\t\t }\r\n\t\t\t } else {\r\n\t\t\t\t \t$newwidth=$width;\r\n\t\t\t\t\t$newheight=$height;\r\n\t\t\t }\r\n\t\t\t\t// Create temporary image file.\r\n\t\t\t\t$tmp = imagecreatetruecolor($newwidth,$newheight);\r\n\t\t\t\t\r\n\t\t\t\t// Copy the image to one with the new width and height.\r\n\t\t\t\t\timagecopyresampled($tmp,$image,0,0,$offsetX,$offsetY,$newwidth,$newheight,$width,$height);\r\n\t\t\t\t\t// Create random 5 digit number for filename. Add to current timestamp.\r\n\t\t\t\t\t$rand = rand(10000,99999);\r\n\t\t\t\t\t$rand .= time();\r\n\t\t\t\t\t$origfilename = $name_dir.$rand ;\r\n if ($add_to_filename){ $origfilename .= \"_\".$add_to_filename; }\r\n $origfilename .= \".jpg\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$filename = $dir.$rand;\r\n if ($add_to_filename){ $filename .= \"_\".$add_to_filename; }\r\n $filename .= \".jpg\";\r\n\r\n\t\t\t\tif ($watermark) {\r\n\t\t\t\t\t//Apply watermark here\t\t\t\t\t\r\n\t\t\t\t\t$maroon = imagecolorallocate($tmp, 134, 22, 0);\r\n\t\t\t\t\t$white = imagecolorallocate($tmp, 255, 255, 255);\r\n\t\t\t\t\t/*$base_height = $newheight-20;\r\n\t\t\t\t\t$base_width = $newwidth/5;*/\r\n\t\t\t\t\t//$borderOffset = 4;\r\n\t\t\t\t\t$dimensions = imagettfbbox($font_size, 0, $font_path, $water_mark_text);\r\n\t\t\t\t\t$lineWidth = ($dimensions[2] - $dimensions[0]);\r\n\t\t\t\t\t$textX = (ImageSx($tmp) - $lineWidth) / 2;\r\n\t\t\t\t\t$textY = ($newheight/10)*9;\t\t\t\t\t\r\n\t\t\t\t // Add some shadow to the text\t\t\t\t\t\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX+1,$textY+1, $white, $font_path, $water_mark_text);\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX, $textY, $maroon, $font_path, $water_mark_text);\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t// Create image file with specified quality in % (low quality image in less image sharpness)\r\n\t\t\t\timagejpeg($tmp,$filename,$quality);\r\n\t\t\t\treturn $origfilename;\r\n\r\n\t\t\t\timagedestroy($image);\r\n\t\t\t\timagedestroy($tmp);\t\r\n\r\n\t\t\t}\r\n\r\n\t\r\n\r\n\t}",
"function ImageUpload($imagefieldname, $savename, $maxheight, $maxwidth, $minheight, $minwidth) {\r\n global $imageuploaddir, $imageuploadmaxsize, $debuglog;\r\n // first 2 globals are only retrieved for use here, debuglog is to append error messages\r\n $imagedir = $imageuploaddir;\r\n $thiserror = \"\";\r\n $uploadedfile_name = $_FILES[$imagefieldname]['name'];\r\n $uploadedfile_tmp = $_FILES[$imagefieldname]['tmp_name'];\r\n $uploadedfile_size = $_FILES[$imagefieldname]['size'];\r\n $uploadedfile_type = $_FILES[$imagefieldname]['type'];\r\n if ($uploadedfile_size > $imageuploadmaxsize) {\r\n $thiserror .= \"Error: Uploaded image size must be less than \" . $imageuploadmaxsize/1000000 . \" MB!<br />\";\r\n } else {\r\n if (isset($_FILES[$imagefieldname]['name'])) {\r\n $temp_img = $imagedir.'tmp_'.$savename;\r\n $prod_img = $imagedir.$savename;\r\n move_uploaded_file($uploadedfile_tmp, $temp_img);\r\n chmod ($temp_img, octdec('0666'));\r\n $sizes = getimagesize($temp_img);\r\n if ($sizes[0] == 0 || $sizes[1] == 0) { $imageszerror = \"Y\"; $imageulerror = \"Y\"; }\r\n else {\r\n $aspect_ratio = $sizes[1]/$sizes[0];\r\n if ($sizes[1] <= $maxheight) { $new_width = $sizes[0]; $new_height = $sizes[1]; }\r\n else { $new_height = $maxheight; $new_width = abs($new_height/$aspect_ratio); }\r\n if ($new_width <= $maxwidth) { $new_width = $new_width; $new_height = $new_height; }\r\n else { $new_width = $maxwidth; $new_height = abs($new_width*$aspect_ratio); }\r\n $destimg=ImageCreateTrueColor($new_width,$new_height);\r\n }\r\n $debuglog .= \"W: $new_width H: $new_height (After Max Adjustment)<br />\\n\";\r\n if ($uploadedfile_type == \"image/jpeg\" || $uploadedfile_type == \"image/pjpeg\") { $srcimg=ImageCreateFromJPEG($temp_img); }\r\n else if ($uploadedfile_type == \"image/gif\") { $srcimg=ImageCreateFromGIF($temp_img); }\r\n else if ($uploadedfile_type == \"image/png\" || $uploadedfile_type == \"image/x-png\") { $srcimg=ImageCreateFromPNG($temp_img); }\r\n else if ($uploadedfile_type == \"image/bmp\") { $srcimg=ImageCreateFromBMP($temp_img); }\r\n else {\r\n $imageulerror = \"Y\";\r\n if ($imageszerror == \"Y\") { $thiserror .= \"Error: Uploaded file has 0 for either height or length!<br />\"; }\r\n $thiserror .= \"Error: $uploadedfile_type used.<br>Only GIF, JPEG, PNG, and Windows BMP files allowed!<br />\";\r\n }\r\n if ($imageulerror != \"Y\") {\r\n if(function_exists('imagecopyresampled')) {\r\n imagecopyresampled($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n } else {\r\n Imagecopyresized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));\r\n }\r\n }\r\n if ($srcimg) {\r\n // Fix for minimum width and height\r\n if ($new_width < $minwidth || $new_height < $minheight) {\r\n if ($new_height < $minheight) {\r\n $newy = intval(($minheight-$new_height)/2);\r\n $thisheight = $minheight;\r\n } else {\r\n $newy = 0;\r\n $thisheight = $new_height;\r\n }\r\n if ($new_width < $minwidth) {\r\n $newx = intval(($minwidth-$new_width)/2);\r\n $thiswidth = $minwidth;\r\n } else {\r\n $newx = 0;\r\n $thiswidth = $new_width;\r\n }\r\n $debuglog .= \"W: $thiswidth H: $thisheight (After Min Adjustment)<br />\\n\";\r\n $destimg=imagecreatetruecolor($thiswidth, $thisheight);\r\n $bk=imagecolorallocate($destimg, 255, 255, 255);\r\n imagefill($destimg,0,0,$bk);\r\n imagecopy($destimg, $srcimg, $newx, $newy, 0, 0, $new_width, $new_height);\r\n }\r\n // Sharpen image\r\n $sharpenmatrix = array(\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n array(-1.0, 28, -1.0), // array(-1, 16, -1),\r\n array(-1.2, -1, -1.2), // array(-1, -1, -1),\r\n );\r\n $sharpendivisor = array_sum(array_map('array_sum', $sharpenmatrix));\r\n imageconvolution($destimg, $sharpenmatrix, $sharpendivisor, 0);\r\n // Finally output production image\r\n ImageJPEG($destimg,$prod_img,95);\r\n }\r\n if ($imageulerror != \"Y\") { imagedestroy($destimg); }\r\n if (file_exists($temp_img)) { unlink($temp_img); }\r\n }\r\n }\r\n if ($imageulerror != \"Y\") { $success = \"Y\"; } else { $success = \"N|$thiserror\"; }\r\n return $success;\r\n}",
"function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}",
"function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}",
"public function processPhoto()\n\t{\n $filename = $this->createFilename();\n\n // resize image\tand save them\n $this->uploadImage(\\Input::file('photo'), 100, 50, 'uploads/photos/medium/' . $filename);\n $this->uploadImage(\\Input::file('photo'), 50, 25, 'uploads/photos/small/' . $filename);\n\n\t\t\\Input::file('photo')->move('uploads/photos/original/', $filename);\n\n\t\t// Save photo in the database\n\t\treturn $this->applicant->update(['photo' => $filename]);\n\t}",
"public function getResize()\n {\n $ratio = 1.0;\n $image = Input::get('img');\n $dir = Input::get('dir');\n\n $original_width = Image::make(base_path() . \"/\" . Config::get('lfm.images_dir') . $dir . \"/\" . $image)->width();\n $original_height = Image::make(base_path() . \"/\" . Config::get('lfm.images_dir') . $dir . \"/\" . $image)->height();\n\n $scaled = false;\n\n if ($original_width > 600)\n {\n $ratio = 600 / $original_width;\n $width = $original_width * $ratio;\n $height = $original_height * $ratio;\n $scaled = true;\n } else\n {\n $height = $original_height;\n $width = $original_width;\n }\n\n if ($height > 400)\n {\n $ratio = 400 / $original_height;\n $width = $original_width * $ratio;\n $height = $original_height * $ratio;\n $scaled = true;\n }\n\n return View::make('laravel-filemanager::resize')\n ->with('img', Config::get('lfm.images_url') . $dir . \"/\" . $image)\n ->with('dir', $dir)\n ->with('image', $image)\n ->with('height', number_format($height, 0))\n ->with('width', $width)\n ->with('original_height', $original_height)\n ->with('original_width', $original_width)\n ->with('scaled', $scaled)\n ->with('ratio', $ratio);\n }",
"public function doUploadBySize($width = 170, $height = 170, $isDelSrcImg = true, $isCopyImg = false)\n {\n $result = false;\n try {\n $field = $this->_config['field'];\n $imagefile = $_FILES[$field]['tmp_name'];\n $truename = $_FILES[$field]['name'];\n\n require_once 'MyLib/Image/Validate.php';\n $validate = new MyLib_Image_Validate();\n\n if (!$validate->isValid($imagefile, $truename)) {\n return false;\n }\n\n //$path = $this->_getPath();\n //if (!empty($this->_path)) {\n // return $this->_path;\n //}\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n\n $path = 'apps/';\n switch ($this->_config['section']) {\n\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n case 2 :\n\t $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n\t break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n\n $result = $this->_upload->upfileBySize($this->_config['field'],\n array('baseFolder' => $this->_config['basefolder'], 'path' => $path, 'id' => $this->_config['id'],\n 'width' => $width, 'height' => $height, 'imageName' => $imageName, 'isDelSrcImg' => $isDelSrcImg,\n 'isCopyImg' => $isCopyImg));\n }\n catch (Exception $e) {\n\n }\n return $result;\n }",
"public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }",
"public function uploadImage($image){\n\t\t\n\t\t$ruta = \"../public/uploads/\";\n\t\tini_set(\"max_execution_time\",0);\n\t\t$handle->forbidden \t= array('application/*');\n\t\t$handle \t\t\t= new Upload($image);\n\t\t\n\t\tif( $handle->uploaded ){\n\t\t\t\n\t\t\t$path1 = $ruta;\t\n\t\t\tif (!file_exists(\"$path1\")){\n\t\t\t\tmkdir($path1,0777);\n\t\t\t}\n\t\t\t//original <<<<<---------------------------- VER SI PUEDO BORRAR\n\t\t\t$path_ori1 = $ruta.'original/';\n\t\t\tif (!file_exists(\"$path_ori1\")){\n\t\t\t\tmkdir($path_ori1,0777);\n\t\t\t}\n\t\t\t$imagename =\t$handle->Process($path_ori1);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// big-muro (height: 184px; width: 256px;)\n\t\t\t$path_big = $ruta.'big-post/';\n\t\t\t$handle->image_resize \t= true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n \t\t \tlist($org_width, $org_height) = getimagesize($image['tmp_name']);\n \t\t \t$handle->image_ratio_crop\t = true;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n\t\t\t$handle->image_x = 256;\n\t\t\t$handle->image_y = 184;\n\t\t\tif (!file_exists(\"$path_tapa\")){\n\t\t\t\tmkdir($path_tapa,0777);\n\t\t\t}\n\t\t\t$imagename = $handle->Process($path_big);\n\t\t\t\n\t\t\t// ampliada (width =\"758\" height =\"544\") \n\t\t\t$path_ampliada = $ruta.'ampliada/';\n\t\t\t$handle->image_resize \t= true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n \t\t \tlist($org_width, $org_height) = getimagesize($image['tmp_name']);\n \t\t \t$handle->image_ratio_crop\t = true;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio = true;\n \t\t \t$handle->jpeg_quality \t\t\t= 100;\n\t\t\t$handle->image_x = 658;\n\t\t\t$handle->image_y = 444;\n\t\t\tif (!file_exists(\"$path_tapa\")){\n\t\t\t\tmkdir($path_tapa,0777);\n\t\t\t}\n\t\t\t$imagename = $handle->Process($path_ampliada);\t\t\t\t\t\n\t\t\t\n\t\t\t$handle->Clean();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $imagename; \n\t\t\n\t}",
"function update_image_size_options() {\n\tupdate_option( 'thumbnail_size_w', 160 );\n\tupdate_option( 'thumbnail_size_h', 160 );\n\tupdate_option( 'thumbnail_crop', 1 );\n\tupdate_option( 'medium_size_w', 320 );\n\tupdate_option( 'medium_size_h', 9999 );\n\tupdate_option( 'medium_large_size_w', 512 ); // Assign this but usually not used.\n\tupdate_option( 'medium_large_size_h', 9999 );\n\tupdate_option( 'large_size_w', 768 );\n\tupdate_option( 'large_size_h', 9999 );\n}",
"private function moveAndCreatePhoto(\n UploadedFile $file, $size = ['l' => [1024, 768], 's' => [320, 240]]\n ) {\n $extension = '.' . $file->extension();\n\n $name = token();\n $filename = $name . $extension;\n\n $path = upload_path_images();\n $imageTmp = Image::make($file->getRealPath());\n\n if (!$imageTmp) {\n return false;\n }\n\n $largeSize = $size['l'];\n $thumbSize = $size['s'];\n\n // save original\n $imageTmp->save($path . $name . ImageThumb::$originalAppend . $extension);\n\n // if height is the biggest - resize on max height\n if ($imageTmp->width() < $imageTmp->height()) {\n // resize the image to the large height and constrain aspect ratio (auto width)\n $imageTmp->resize(null, $largeSize[1], function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $filename);\n\n // resize the image to the thumb height and constrain aspect ratio (auto width)\n $imageTmp->resize(null, $thumbSize[1], function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $name . ImageThumb::$thumbAppend . $extension);\n }\n else {\n // resize the image to the large width and constrain aspect ratio (auto height)\n $imageTmp->resize($largeSize[0], null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $filename);\n\n // resize the image to the thumb width and constrain aspect ratio (auto width)\n $imageTmp->resize($thumbSize[0], null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($path . $name . ImageThumb::$thumbAppend . $extension);\n }\n\n return $filename;\n }",
"public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }",
"public function saveAsset()\n {\n if(!empty($this->uploadedFile))\n {\n // If file is exist -> remove him\n if(file_exists($this->getFilePath()))\n {\n unlink($this->getFilePath());\n }\n $this->genFilename();\n $imagine = Image::getImagine()->open($this->uploadedFile->tempName);\n }\n else\n {\n if(file_exists($this->getFilePath())) {\n $imagine = Image::getImagine()->open($this->getFilePath());\n } else return false;\n }\n\n $size = $imagine->getSize();\n $box = $this->getImageBox($size);\n\n if (($size->getWidth() <= $box->getWidth() && $size->getHeight() <= $box->getHeight()) || (!$box->getWidth() && !$box->getHeight())) {\n $widthDiff = abs($size->getWidth() - $box->getWidth()) / $size->getWidth();\n $heightDiff = abs($size->getHeight() - $box->getHeight()) / $size->getHeight();\n if($widthDiff > $heightDiff) {\n $resizeBox = new Box($box->getWidth(), $size->getHeight() * $box->getWidth()/$size->getWidth());\n } else {\n $resizeBox = new Box($size->getWidth() * $box->getHeight()/$size->getHeight(), $box->getHeight());\n }\n $imagine->resize($resizeBox);\n\n // var_dump($width);\n // var_dump($height);\n // die;\n // // $imagine->crop($point, $box);\n // $imagine->save($this->getFilePath());\n // return $this->save(false);\n }\n\n $imagine = $imagine->thumbnail($box, ManipulatorInterface::THUMBNAIL_OUTBOUND);\n $imagine->save($this->getFilePath());\n\n // create empty image to preserve aspect ratio of thumbnail\n // $thumb = Image::getImagine()->create($box, new Color('FFF', 100));\n\n // // calculate points\n // $startX = 0;\n // $startY = 0;\n // if ($size->getWidth() < $box->getWidth()) {\n // $startX = ceil($box->getWidth() - $size->getWidth()) / 2;\n // }\n // if ($size->getHeight() < $box->getHeight()) {\n // $startY = ceil($box->getHeight() - $size->getHeight()) / 2;\n // }\n\n // $thumb->paste($img, new Point($startX, $startY));\n // $thumb->save($this->getFilePath());\n\n return $this->save(false);\n }",
"protected function resizeImage($path)\n\t{\n\t\t$iP = &$this->uploader->imageProcessor;\n\t\t$iP->load($this->uploader->mediaService->getItem($path));\n\t\t$iP->resize_square(500);\n\t\t$iP->saveImage();\n }",
"public function autoRegisterThumb200()\n {\n $this->getMediaCollections()->filter->isImage()->each(function ($mediaCollection) {\n $this->addMediaConversion('thumb_200')\n ->width(200)\n ->height(200)\n ->fit('crop', 200, 200)\n ->optimize()\n ->performOnCollections($mediaCollection->getName())\n ->nonQueued();\n });\n }",
"public function resizeImagePost(Request $request)\n {\n\t $this->validate($request, [\n 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n $sizenames = ['MDPI', 'HDPI', 'XHDPI', 'XXHDPI','XXXHDPI','PlayStore'];\n $sizeW = ['48','72','96','144','192','512'];\n\n for ($i = 0; $i < 6; $i++){\n $image = $request->file('image');\n $input['imagename'] = $sizenames[$i].'.'.\"png\";\n \n \n $destinationPath = public_path('/thumbnail');\n $img = Image::make($image->getRealPath());\n $img->resize($sizeW[$i], $sizeW[$i], function ($constraint) {\n //$constraint->aspectRatio();\n })->save($destinationPath.'/'.$input['imagename']);\n\n\n $destinationPath = public_path('/images');\n $image->move($destinationPath, $input['imagename']);\n }\n \n //$this->postImage->add($input);\n\n\n return back()\n \t->with('success','Image Upload successful')\n \t->with('imageName',$input['imagename']);\n }",
"function upload_file($field,$directory,$filename='') {\n\t\t global $resizer;\n\t\t \n $_FILES[$field]['name']=$filename;\n if(move_uploaded_file($_FILES[$field]['tmp_name'],''.$directory.$_FILES[$field]['name'])) {\n\t\t \n\t\t \t\n\t\t //$this->createThumb(''.$directory.$_FILES[$field]['name'],''.$directory.$_FILES[$field]['name'],$width,$height);\n\t\t\t\treturn $_FILES[$field]['name'];\n\t\t\t \n\t\t\t \n\t }\n\t\t return false;\n }",
"function reduce_image_size($dest_folder,$image_name,$files)\n{\n //REDUCE IMAGE RESOLUTION\n if($files)\n {\n //echo 123;exit;\n $dest = $dest_folder.$image_name;\n $width = 300;\n $height = 300;\n list($width_orig, $height_orig) = getimagesize($files);\n $ratio_orig = $width_orig/$height_orig;\n if ($width/$height > $ratio_orig)\n {\n $width = $height*$ratio_orig;\n }\n else\n {\n $height = $width/$ratio_orig;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($files);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p,$dest, 100);\n ImageDestroy ($image_p);\n }\n //END OF REDUCING IMAGE RESOLUTION\n}",
"function acf_enqueue_uploader()\n {\n }",
"function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }",
"public function getResize($size, $dir, $filename) {\t\n\t\t$parts = explode(\".\", $filename);\n\t\tif(count($parts > 1)) {\n\t\t\t$filename = $parts[0];\n\t\t\t$extension = $parts[1]; \n\t\t}\t\n\n\t\tif($size === \"original\") {\n\t\t\t$size = $dir . $filename .\".\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minOriginal);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxOriginal);\n\t\t\t}\n\t\t} elseif($size === \"large\") {\n\t\t\t$size = $dir . $filename .\"_l.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minLarge);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxLarge);\n\t\t\t}\n\t\t} elseif($size === \"medium\") {\t\t\t\n\t\t\t$size = $dir . $filename .\"_m.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\t$this->resize(_maxMedium, _minMedium);\n\t\t\t\n\t\t\t/*\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minMedium);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxMedium);\n\t\t\t}\n\t\t\t*/\n\t\t} elseif($size === \"small\") {\n\t\t\t$size = $dir . $filename .\"_s.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\t$this->resize(_maxSmall, _minSmall);\n\t\t\t\n\t\t\t/*\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minSmall);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxSmall);\n\t\t\t}\n\t\t\t*/\n\t\t} elseif($size === \"miniature\") {\n\t\t\t$size = $dir . $filename . \"_min.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minMini);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxMini);\n\t\t\t}\n\t\t}\n\n\t\t$this->save($size);\n\t\t\n\t\treturn $size;\n \t}",
"public static function uploadImage($file)\n {\n\n $dir_dest = ROOT . \"../images/portfolio/\";\n $dir_thumb = ROOT . \"../images/portfolio/thumb/\";\n\n #create new names of the uploaded image file\n $imageName = strtolower($file['name']); // Get the name of the file (including file extension).\n $imgFname = substr($imageName, 0, strpos($imageName, '.'));\n $imageExt = substr($imageName, strpos($imageName, '.'), strlen($imageName) - 1); // Get the extension from the filename.\n\n $baseImgName = str_replace(\" \",\"_\",$imgFname);\n\n if (file_exists($dir_dest . $baseImgName . $imageExt)) {\n $baseImgName = str_replace(\" \",\"_\",$imgFname) . rand(0, 999);\n }\n\n $thumb = \"tn_\".$baseImgName;\n\n //$name300px = \"300px\" . $baseImgName;\n //$name125px = \"125px\" . $baseImgName;\n\n #now upload the image and resize\n $handle = new upload($file);\n\n if ($handle->uploaded) {\n\n //upload the main file to the server first\n $handle->file_new_name_body = $baseImgName;\n $handle->Process($dir_dest);\n\n #main file created\n if (!$handle->processed) {\n\n //this should throw exception\n echo $handle->log;\n echo ' Error creating main file: ' . $handle->error . '';\n return false;\n }\n\n // yes, the file is on the server\n // below are some example settings which can be used if the uploaded file is an image.\n $handle->file_new_name_body = $thumb;\n $handle->image_resize = true;\n $handle->image_ratio_crop = 'T';\n $handle->image_y = 271;\n $handle->image_x = 281;\n\n $handle->Process($dir_thumb);\n\n #file created for 300px\n if (!$handle->processed) {\n\n //this should throw exception\n echo $handle->log;\n echo ' Error creating thumb image file: ' . $handle->error . '';\n return false;\n }\n // we delete the temporary files\n $handle->Clean();\n return $baseImgName . strtolower($imageExt);\n }\n //this should throw exception\n echo \"Cannot upload\" . var_export($_FILES, true);\n return false;\n }",
"function do_upload_gallery(){\r\n\t\t\t$data = '';\r\n\t\t\t$error = '';\r\n\t\t\t$this->load->library('image_lib');\r\n\r\n\t\t\t$config = array(\r\n\t\t\t\t'upload_path' => \"./../static/uploadimgs/original/\",\r\n\t\t\t\t'allowed_types' => \"gif|jpg|png|jpeg\",\r\n\t\t\t\t'overwrite' => TRUE,\r\n\t\t\t\t'max_size' => \"2048000\", // Can be set to particular file size , here it is 2 MB(2048 Kb)\r\n\t\t\t\t'max_height' => \"\",\r\n\t\t\t\t'max_width' => \"\",\r\n\t\t\t\t'file_name' => $_POST['newfilename']\r\n\t\t\t);\r\n\r\n\t\t\t$this->load->library('upload', $config);\r\n\t\t\tif($this->upload->do_upload('file')){\r\n\t\t\t\t//for thumbs image\r\n\t\t\t\t//your desired config for the resize() function\r\n\t\t\t $config = array(\r\n\t\t\t 'source_image' => \"./../static/uploadimgs/original/\".$_POST['newfilename'], //path to the uploaded image\r\n\t\t\t 'new_image' => \"./../static/uploadimgs/thumbs/\", //path to\r\n\t\t\t 'maintain_ratio' => true,\r\n\t\t\t 'width' => 300,\r\n\t\t\t 'height' => 300\r\n\t\t\t );\r\n\t\t\t $this->image_lib->initialize($config);\r\n \t\t\t$this->image_lib->resize();\r\n\r\n\t\t\t\t$data = array('upload_data' => $this->model->upload_gallery_img($_POST['eventid'],$_POST['newfilename'],$_POST['userid']));\r\n\t\t\t\t// $data = array('imageid'=>$_POST['imageid'],'imagename'=>$_POST['newfilename']);\r\n\t\t\t\t$success = \"success\";\r\n\t\t\t}else{\r\n\t\t\t\t$error = array('error' => $this->upload->display_errors());\r\n\t\t\t\t$success = \"fail\";\r\n\t\t\t}\r\n\t\t\techo json_encode(array(\"data\" => $data ,\"error\" => $error,'success'=>$success));\t\r\n\r\n\t\t}",
"public function register_image_sizes() {\n\n }",
"function vt_resize( $attach_id = null, $img_url = null, $width, $height, $crop = false ) {\n\t\n\t//initialise variable to prevent wp_debug mode error.\n\t$file_path = '';\n\t$image_src[0] = '';\n\t$image_src[1] = '';\n\t$image_src[2] = '';\n\t\t\n\t// we use the attachment id if it is given.\n\tif ( $attach_id ) {\n\t\n\t\t$image_src = wp_get_attachment_image_src( $attach_id, 'full' );\n\t\t//file path will return abnormally if given attachment id is wrong.\n\t\t$file_path = get_attached_file( $attach_id );\n\t\t\n\t\t//echo \"This is from attachment id \".$file_path.\"<br/>\";\n\t\n\t// if not use the image url to find the attachment ID!\n\t} else if ( $img_url ) {\n\t\t\n\t\t\n\t\t$attachment_id = truethemes_get_attachment_id_from_src($img_url);\n\t\t$image_src_ed = wp_get_attachment_image_src( $attachment_id, 'full' );\n\t\t$get_file_path = get_attached_file( $attachment_id );\n\t\t//file path will return abnormally if given image url is wrong. \n\t\t$file_path = $get_file_path;\n\t\t\n\t\t//echo \"This is from image src \".$file_path.\"<br/>\";\n\t\t\n\t $orig_size = $image_src_ed;\n\t\t\n\t\t$image_src[0] = $orig_size[0];\n\t\t$image_src[1] = $orig_size[1];\n\t\t$image_src[2] = $orig_size[2];\n\t\t\t\t\t\t\t\t\t\n\t}\n\t\n\t$file_info = pathinfo( $file_path );\n\t//initialise variable to prevent WP_debug mode error.\n\t$file_info['extension'] = '';\n\t$file_info['dirname'] = '';\n\t$extension = '.'. $file_info['extension'];\n\n\t// the image path without the extension\n\t$no_ext_path = $file_info['dirname'].'/'.$file_info['filename'];\n\n\t$cropped_img_path = $no_ext_path.'-'.$width.'x'.$height.$extension;\n\n\t// checking if the file size is larger than the target size\n\t// if it is smaller or the same size, stop right here and return\n\tif ( $image_src[1] > $width || $image_src[2] > $height ) {\n\n\t\t// the file is larger, check if the resized version already exists (for $crop = true but will also work for $crop = false if the sizes match)\n\t\tif ( file_exists( $cropped_img_path ) ) {\n\n\t\t\t$cropped_img_url = str_replace( basename( $image_src[0] ), basename( $cropped_img_path ), $image_src[0] );\n\t\t\t\n\t\t\t$vt_image = array (\n\t\t\t\t'url' => $cropped_img_url,\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height\n\t\t\t);\n\t\t\t\n\t\t\treturn $vt_image;\n\t\t}\n\n\t\t// $crop = false\n\t\tif ( $crop == false ) {\n\t\t\n\t\t\t// calculate the size proportionaly\n\t\t\t$proportional_size = wp_constrain_dimensions( $image_src[1], $image_src[2], $width, $height );\n\t\t\t$resized_img_path = $no_ext_path.'-'.$proportional_size[0].'x'.$proportional_size[1].$extension;\t\t\t\n\n\t\t\t// checking if the file already exists\n\t\t\tif ( file_exists( $resized_img_path ) ) {\n\t\t\t\n\t\t\t\t$resized_img_url = str_replace( basename( $image_src[0] ), basename( $resized_img_path ), $image_src[0] );\n\n\t\t\t\t$vt_image = array (\n\t\t\t\t\t'url' => $resized_img_url,\n\t\t\t\t\t'width' => $proportional_size[0],\n\t\t\t\t\t'height' => $proportional_size[1]\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\treturn $vt_image;\n\t\t\t}\n\t\t}\n\n\t\t// no cache files - let's finally resize it\n\t\t\n\t\t//function check for WordPress 3.5 wp_get_image_editor\n\t\tif(function_exists('wp_get_image_editor')){\n\t\t$new_img_path = tt_resize_image( $file_path, $width, $height, $crop );\n\t\t}else{\n\t\t$new_img_path = image_resize( $file_path, $width, $height, $crop );\t\t\n\t\t}\n\n\t\t$new_img_size = getimagesize( $new_img_path );\n\t\t$new_img = str_replace( basename( $image_src[0] ), basename( $new_img_path ), $image_src[0] );\n\n\t\t// resized output\n\t\t$vt_image = array (\n\t\t\t'url' => $new_img,\n\t\t\t'width' => $new_img_size[0],\n\t\t\t'height' => $new_img_size[1]\n\t\t);\n\t\t\n\t\treturn $vt_image;\n\t}\n\n\t// default output - without resizing\n\t$vt_image = array (\n\t\t'url' => $image_src[0],\n\t\t'width' => $image_src[1],\n\t\t'height' => $image_src[2]\n\t);\n\n\treturn $vt_image;\n}",
"public function thumbAction() // {{{\n {\n $file_id = $this->getScalarParam('file_id', 0);\n $file = $this->_driveHelper->getRepository()->getFileOrThrow($file_id);\n\n if (!$this->_driveHelper->isFileReadable($file)) {\n throw new Maniple_Controller_NotAllowedException('You are not allowed to access this file');\n }\n\n if (!in_array($file->mimetype, array('image/jpeg', 'image/gif', 'image/png'))) {\n throw new Exception('Plik nie jest obrazem');\n }\n\n $options = array(\n 'width' => 0,\n 'height' => 0,\n 'scale' => true,\n 'crop' => true,\n );\n\n if (null !== ($dims = $this->getScalarParam('dims'))) {\n $dims = explode('x', $dims);\n $width = (int) array_shift($dims);\n $height = (int) array_shift($dims);\n $options['width'] = min($width, 1024);\n $options['height'] = min($height, 1024);\n } elseif (null !== ($max = $this->getScalarParam('max'))) {\n $options['max'] = max(0, $max);\n }\n\n $image_path = $this->getResource('core.image_helper')->getImagePath(\n $file->getPath(),\n $options\n );\n\n $options = array(\n 'type' => $file->mimetype,\n 'cache' => true,\n );\n if ($this->getScalarParam('download')) {\n $options['name'] = $file->name;\n }\n\n $this->getResource('core.file_helper')->sendFile(\n $this->_request,\n $this->_response,\n $image_path,\n $options\n );\n }",
"public function p_upload(){\n \n if(!isset($_FILES)){\n //send the user back to the profile but this time have error set.\n Router::redirect(\"/users/profile/\".$this->user->user_id.\"/error\");\n }\n //fixed filename upper case possibility.\n $_FILES['avatar_pic']['name'] = strtolower($_FILES['avatar_pic']['name']);\n //get file extension \n $parts = pathinfo( ($_FILES['avatar_pic']['name']) );\n //boolean set to FALSE for incorrect file extension uploading\n $upload_ok = FALSE;\n \n \n \n \n if($parts['extension'] == \"jpg\")\n $upload_ok = TRUE;\n if($parts['extension'] == \"jpeg\")\n $upload_ok = TRUE; \n if($parts['extension'] == \"png\")\n $upload_ok = TRUE;\n if($parts['extension'] == \"gif\")\n $upload_ok = TRUE; \n \n if($upload_ok) { \n //upload the chosen file and rename it temp-user_id.original extension\n Upload::upload($_FILES, \"/uploads/avatars/\", array(\"jpg\", \"jpeg\", \"gif\", \"png\"), \"temp-\".$this->user->user_id); \n //resize the image to 258x181 -- usually it's 258 wide then optimal height.\n $imgObj = new Image(APP_PATH.'uploads/avatars/'.'temp-'.$this->user->user_id.'.'.$parts['extension']);\n \n $imgObj->resize(100, 100);\n $imgObj->save_image(APP_PATH.'uploads/avatars/'.$this->user->user_id.'.'.'png'); //save the file as user_id.png\n unlink('uploads/avatars/'.'temp-'.$this->user->user_id.'.'.$parts['extension']); //delete the temp file\n Router::redirect(\"/users/profile/\".$this->user->user_id);\n }\n else {\n //send the user back to the profile but this time have error set.\n Router::redirect(\"/users/profile/\".$this->user->user_id.\"/error\");\n } //else\n }",
"function upload($file, $name, $type = 'file', $sub_folder = '', $resize = array(), $addWatermark=false, $metadata_conf=array()) {\r\n\t\t$ext = $this->getExtension(@$file['name']);\r\n $fileSize = @$file['size'];\r\n\t\tswitch (true) {\r\n\t\t\tcase (@$file['error'] > 0) :\r\n\t\t\t\treturn \"Error : \" . $this->_error_code[$file['error']];\r\n\t\t\tcase ($type == 'foto' && !in_array($ext, $this->_imageType)) :\r\n\t\t\t\treturn 'tipe file tidak cocok. File harus berupa gambar.';\r\n\t\t\tcase ($type == 'file' && !in_array($ext, $this->_fileType)) :\r\n\t\t\t\treturn 'tipe file tidak cocok.';\r\n\t\t}\r\n\t\t\r\n\t\t#$location = ASSET_IMG_UPLOAD_DIR;\r\n\t\tif ($sub_folder)\r\n\t\t $location = $sub_folder . '/';\r\n\r\n\t\t$this->createDir($location);\r\n\t\tif (file_exists($location . $name . \".\" . $ext))\r\n\t\t unlink($location . $name . \".\" . $ext);\r\n\t\t\r\n\t\t\r\n\t\tif (!move_uploaded_file($file['tmp_name'], $location . $name . \".\" . $ext)){\r\n\t\t\treturn 'upload gagal';\r\n\t\t}else {\r\n //set realimage metadata\r\n if(is_array($metadata_conf) && count($metadata_conf)>0)\r\n {\r\n $metadata_conf['filename'] = $location . $name . \".\" . $ext;\r\n $ret_metadata = $this->metadata_image($metadata_conf);\r\n //echo '<pre>'; print_r($ret_metadata); echo '<pre>';\r\n }\r\n //end \r\n\t\t\t$ret_resize = false;\r\n $ret_dirresize = $ret_urlresize = array();\r\n\t\t\tif (is_array($resize) && count($resize) && $type != 'file'){\r\n\t\t $ret_resize = array();\r\n\t\t foreach($resize as $key=>$size)\r\n\t\t\t\t{\r\n\t\t\t\t\t$file = $location . $name . \".\" . $ext;\r\n\t\t\t\t\t$crop = strpos($key, \":\") ? $key : '';\r\n\t\t\t\t\t$ret_dirresize[$size] = $this->resize_image($file, $crop, $size, $addWatermark);\r\n $ret_urlresize[$size] = str_replace(ASSETS_UPLOAD_DIR, ASSETS_UPLOAD_URL, $ret_dirresize[$size]);\r\n //set resized iamge metadata\r\n if(is_array($metadata_conf) && count($metadata_conf)>0)\r\n {\r\n $metadata_conf['filename'] = $ret_dirresize[$size];\r\n $ret_metadata = $this->metadata_image($metadata_conf);\r\n //echo '<pre>'; print_r($ret_metadata); echo '<pre>';\r\n }\r\n //end \r\n\t\t\t\t}\r\n\t\t \r\n\t\t\t}\r\n \r\n\t\t $return = array(\r\n 'nama' => $name . \".\" . $ext, \r\n 'type' => $ext, \r\n 'size' => $fileSize,\r\n 'path' => $location, \r\n 'url_resize'=> $ret_urlresize,\r\n 'dir_resize'=> $ret_dirresize,\r\n 'sourcefile'=> \"\"\r\n );\r\n \r\n return $return;\r\n\t\t}\r\n }",
"private function makeImageFit($key, $uri, $file_name, $w = 242) {\n\t\t$saveAs = $this->tmp . '/' . $file_name;\n\t\t$img = \\Image::make($uri)->orientate();\n\t\t$img->resize($w, null, function ($constraint) {\n\t\t\t$constraint->aspectRatio();\n\t\t});\n\t\t$img->save($saveAs, 80);\n\t\t$img->destroy();\n\t\t//Send File back up to S3.\n\t\t$this->s3->put(array(\n\t\t\t'Bucket' => $this->s3->request['bucket'],\n\t\t\t'Key' => $key,\n\t\t\t'CacheControl' => 'max-age=172800',\n\t\t\t'SourceFile' => $saveAs,\n\t\t));\n\t\t//Delete temp File.\n\t\tFile::delete($saveAs);\n\t\tunset($img);\n\t}",
"function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }",
"public function actualizaThumbnail()\r\n {\r\n if($thumbnail=$this->getAbosluteThumbnailPath()){\r\n if(file_exists($thumbnail)){\r\n unlink($thumbnail);\r\n }\r\n }\r\n $this->crearThumbnail();\r\n }",
"public function rebuildThumb()\r\n {\r\n switch ($this->storage)\r\n {\r\n \tcase \"s3\":\r\n \r\n \t $request = \\Web::instance()->request( $this->url );\r\n \t if (empty($request['body'])) {\r\n \t throw new \\Exception('Invalid Item URL');\r\n \t }\r\n \r\n \t $buffer = $request['body'];\r\n \r\n \t break;\r\n \r\n \tcase \"gridfs\":\r\n \r\n \t $db = $this->getDb();\r\n \t $gridfs = $db->getGridFS( $this->collectionNameGridFS() );\r\n \t $length = $this->{\"length\"};\r\n \t $chunkSize = $this->{\"chunkSize\"};\r\n \t $chunks = ceil( $length / $chunkSize );\r\n \t $collChunkName = $this->collectionNameGridFS() . \".chunks\";\r\n \t $collChunks = $this->getDb()->{$collChunkName};\r\n \t \t\r\n \t $buffer = null;\r\n \t for( $i=0; $i<$chunks; $i++ )\r\n \t {\r\n \t $chunk = $collChunks->findOne( array( \"files_id\" => $this->id, \"n\" => $i ) );\r\n \t $buffer .= (string) $chunk[\"data\"]->bin;\r\n \t }\r\n \r\n \t break;\r\n \r\n \tdefault:\r\n\r\n \t throw new \\Exception('Invalid Item Storage');\r\n \t \r\n \t break;\r\n }\r\n\r\n if ( $thumb_binary_data = $this->getThumb( $buffer )) {\r\n $thumb = new \\MongoBinData( $thumb_binary_data, 2 );\r\n }\r\n \r\n $app = \\Base::instance();\r\n $files_path = $app->get('TEMP') . \"assets_thumbs\";\r\n if (!file_exists($files_path)) {\r\n mkdir( $files_path, \\Base::MODE, true );\r\n }\r\n $file_path = $files_path . '/' . $this->slug;\r\n file_put_contents( $file_path, $thumb_binary_data );\r\n \r\n return $this->set( 'thumb', $thumb )->save();\r\n }",
"function wp_media_upload_handler()\n {\n }",
"public function do_profile_resize_image($data){\n\t\t//Your Image\n\t\t$imgSrc = 'public/upload/img/profile/' . $data['file'];\n\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($imgSrc);\n\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\")\n\t\t\t$myImage = imagecreatefromjpeg($imgSrc);\n\t\telse if ($data['type'] == \"png\")\n\t\t\t$myImage = imagecreatefrompng($imgSrc);\n\t\telse if ($data['type'] == \"gij\")\n\t\t\t$myImage = imagecreatefromgif($imgSrc);\n\n\t\t// calculating the part of the image to use for thumbnail\n\t\tif ($width > $height) {\n\t\t $y = 0;\n\t\t $x = ($width - $height) / 2;\n\t\t $smallestSide = $height;\n\t\t} else {\n\t\t $x = 0;\n\t\t $y = ($height - $width) / 2;\n\t\t $smallestSide = $width;\n\t\t}\n\n\t\t// copying the part into thumbnail\n\t\t$thumbSize = 300;\n\t\t$thumb = imagecreatetruecolor($thumbSize, $thumbSize);\n\t\timagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);\n\n\t\t//final output\n\t\t$thumbnail_path = 'public/upload/img/profile/thumbnail_' . $data['file'];\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\") {\n\t\t\timagejpeg($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"png\") {\n\t\t\timagepng($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"gif\") {\n\t\t\timagegif($thumb, $thumbnail_path);\n\t\t}\n\n\t}",
"function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}",
"public function thumb( $size, $type = '', $prefix = '_thumb', $allowGrowth = false, $to = null, $allow_dir_create = false, $file_index = null ) {\r\n\t\t\tif ( $to ) {\r\n\t\t\t\t$to = self::prepare_path_string( $to, true );\r\n\t\t\t\tself::try_create_folder( $to, $allow_dir_create );\r\n\t\t\t}\r\n\t\t\tfor( $i = 0; $i < $this->Files_ready_count; $i++ ) {\r\n\t\t\t\tif ( $file_index !== null && $file_index != $i ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif ( in_array( $this->Files_ready[$i]['ext'], self::FTY_IMAGES_GD ) ) {\r\n\t\t\t\t\t// get the processed image ressource\r\n\t\t\t\t\t$image = $this->create_image( $i, $size, $type, $allowGrowth );\r\n\t\t\t\t\t$this->save_image( $image, $i, $to, $prefix );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public function image_resize($width = 0, $height = 0, $image_url, $filename, $upload_url)\n {\n $source_path = realpath($image_url);\n list($source_width, $source_height, $source_type) = getimagesize($source_path);\n switch ($source_type)\n {\n case IMAGETYPE_GIF:\n $source_gdim = imagecreatefromgif($source_path);\n break;\n case IMAGETYPE_JPEG:\n $source_gdim = imagecreatefromjpeg($source_path);\n break;\n case IMAGETYPE_PNG:\n $source_gdim = imagecreatefrompng($source_path);\n break;\n }\n\n $source_aspect_ratio = $source_width / $source_height;\n $desired_aspect_ratio = $width / $height;\n\n if ($source_aspect_ratio > $desired_aspect_ratio)\n {\n /*\n * Triggered when source image is wider\n */\n $temp_height = $height;\n $temp_width = (int)($height * $source_aspect_ratio);\n }\n else\n {\n /*\n * Triggered otherwise (i.e. source image is similar or taller)\n */\n $temp_width = $width;\n $temp_height = (int)($width / $source_aspect_ratio);\n }\n\n /*\n * Resize the image into a temporary GD image\n */\n\n $temp_gdim = imagecreatetruecolor($temp_width, $temp_height);\n imagecopyresampled($temp_gdim, $source_gdim, 0, 0, 0, 0, $temp_width, $temp_height, $source_width, $source_height);\n\n /*\n * Copy cropped region from temporary image into the desired GD image\n */\n\n $x0 = ($temp_width - $width) / 2;\n $y0 = ($temp_height - $height) / 2;\n $desired_gdim = imagecreatetruecolor($width, $height);\n imagecopy($desired_gdim, $temp_gdim, 0, 0, $x0, $y0, $width, $height);\n\n /*\n * Render the image\n * Alternatively, you can save the image in file-system or database\n */\n\n $image_url = $upload_url . $filename;\n\n imagepng($desired_gdim, $image_url);\n\n return $image_url;\n\n /*\n * Add clean-up code here\n */\n }",
"protected function _do_resize($width, $height)\n {\n $pre_width = $this->width;\n $pre_height = $this->height;\n\n // Loads image if not yet loaded\n $this->_load_image();\n\n // Test if we can do a resize without resampling to speed up the final resize\n if ($width > ($this->width / 2) AND $height > ($this->height / 2))\n {\n // The maximum reduction is 10% greater than the final size\n $reduction_width = round($width * 1.1);\n $reduction_height = round($height * 1.1);\n\n while ($pre_width / 2 > $reduction_width AND $pre_height / 2 > $reduction_height)\n {\n // Reduce the size using an O(2n) algorithm, until it reaches the maximum reduction\n $pre_width /= 2;\n $pre_height /= 2;\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($pre_width, $pre_height);\n\n if (imagecopyresized($image, $this->_image, 0, 0, 0, 0, $pre_width, $pre_height, $this->width, $this->height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n }\n }\n\n // Create the temporary image to copy to\n $image = $this->_create($width, $height);\n\n // Execute the resize\n if (imagecopyresampled($image, $this->_image, 0, 0, 0, 0, $width, $height, $pre_width, $pre_height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $image;\n\n // Reset the width and height\n $this->width = imagesx($image);\n $this->height = imagesy($image);\n }\n }",
"public function save() {\n// is there an image resource and file location to work with?\n if (isset($this->_resource, $this->_file_location)) {\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $this->_file_location);\n break;\n case \"image/png\":\n imagepng($this->_resource, $this->_file_location);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $this->_file_location);\n break;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::save() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }",
"public function upload(){\n if( NULL === $this->getFile()){\n return;\n }\n $filename= $this->getFile()->getClientOriginalName();\n\n // Move to the target directory\n \n $this->getFile()->move(\n $this->getAbsolutePath(), \n $filename);\n\n //Set the logo\n $this->setFilename($filename);\n\n $this->setFile();\n\n }",
"public function home_teampicks_upload_logo(Request $request, $id) {\n Session::put('menu_item_parent', 'home');\n Session::put('menu_item_child', 'home_teampicks');\n Session::put('menu_item_child_child', '');\n $getfiles = $request->file('uploadedFileLogo');\n $fileName = $id.'.jpg'; \n //image compress start\n SiteHelper::resizeImage($getfiles,HOMETEAMPICKS_TINY_LOGO_WIDTH,HOMETEAMPICKS_TINY_LOGO_HEIGHT,$fileName,HOMETEAMPICKS_IMAGE_UPLOAD_PATH.'/logo/tiny');\n \n \n SiteHelper::resizeImage($getfiles,HOMETEAMPICKS_THUMB_LOGO_WIDTH,HOMETEAMPICKS_THUMB_LOGO_HEIGHT,$fileName,HOMETEAMPICKS_IMAGE_UPLOAD_PATH.'/logo/thumb');\n \n $getfiles->move(public_path('uploads/home/teampicks/logo'), $fileName);\n HomeTeamPicks::find($id)->update(['logo' => $fileName]);\n return \"true\";\n }",
"public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }"
] | [
"0.64447665",
"0.6133097",
"0.60556316",
"0.5999829",
"0.59688705",
"0.59217566",
"0.58979374",
"0.5869364",
"0.58230144",
"0.58054125",
"0.5804607",
"0.5799716",
"0.57951254",
"0.57887733",
"0.57887733",
"0.5780943",
"0.57787466",
"0.57641286",
"0.57621944",
"0.57195693",
"0.5693109",
"0.56915283",
"0.5668733",
"0.56610477",
"0.56608343",
"0.56562275",
"0.565377",
"0.5651807",
"0.56449157",
"0.5630242",
"0.56208104",
"0.5619499",
"0.56111133",
"0.55986434",
"0.5592804",
"0.5571016",
"0.5568044",
"0.55573875",
"0.5555693",
"0.5553123",
"0.5509399",
"0.5503078",
"0.54963845",
"0.5493652",
"0.547458",
"0.5462111",
"0.5457336",
"0.54561126",
"0.5449101",
"0.5434803",
"0.5426084",
"0.5424731",
"0.54230237",
"0.5398292",
"0.53974295",
"0.53947663",
"0.53892475",
"0.53850555",
"0.5382161",
"0.5378627",
"0.537452",
"0.5374292",
"0.5364865",
"0.53623307",
"0.53534853",
"0.5342988",
"0.5336821",
"0.5335786",
"0.53317416",
"0.5323897",
"0.5313795",
"0.5306078",
"0.5304698",
"0.52679515",
"0.5258639",
"0.52528787",
"0.5245114",
"0.5244459",
"0.52351487",
"0.5228113",
"0.5225647",
"0.52221984",
"0.5220247",
"0.52069646",
"0.51962185",
"0.51902163",
"0.51785314",
"0.5171816",
"0.5171302",
"0.51694876",
"0.51635015",
"0.515323",
"0.51450044",
"0.5144288",
"0.51436424",
"0.513967",
"0.51381916",
"0.5134253",
"0.5130046",
"0.5125808"
] | 0.57360405 | 19 |
Get only master result. | public function getMasterResult()
{
$results = $this->getResults();
return isset($results['original']) ? $results['original'] : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggle_master_view_query_result(): Array {\n $model = $this->current_model;\n\n $master_view = $this->master_view_query_result();\n \n // Get result from grants model if feature model list returns empty\n \n if(method_exists($this->CI->$model,'master_view') &&\n is_array($this->CI->$model->master_view()) && \n count($this->CI->$model->master_view()) > 0 \n ){\n \n $master_view = $this->CI->$model->master_view();\n \n }\n \n return $master_view;\n }",
"public function selectdivisonmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM divisionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"function getMaster();",
"private static function getMaster() {\n return self::getRandomPDOLB(self::MASTER);\n }",
"function getMaster() {\n\t\tif (null !== $this->_current && $this->_isMaster)\n\t\t\treturn $this->_current;\n\n\t\tif (!empty($this->_masters)) {\n\t\t\t$dsn = reset($this->_masters);\n\t\t\t$db = DatabaseManager::getConnection($dsn);\n\t\t\t\n\t\t\tif ($db->isNull()) {\n\t\t\t\t$this->_setFailed($dsn);\n\t\t\t\treturn $this->getMaster();\n\t\t\t}\n\t\t\t\n\t\t\t$this->_current = $db;\n\t\t\t$this->_isMaster = true;\n\t\t\treturn $this->_current;\n\t\t}\n\n\t\treturn DatabaseManager::getConnection('null://null');\n\t}",
"public function getRequireMaster()\n {\n $value = $this->get(self::REQUIRE_MASTER);\n\n return $value === null ? (bool) $value : $value;\n }",
"function get_master_id(){\r\n\t\t$result=$this->m_master_ambil_paket->get_master_id();\r\n\t\techo $result;\r\n\t}",
"function get_master_id(){\r\n\t\t$result=$this->m_master_jual_rawat->get_master_id();\r\n\t\techo $result;\r\n\t}",
"public function selectstatusmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM statusmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectworktypemaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM worktypemaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectmandalmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM mandalmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function masterAction()\n {\n //====================================================================//\n // Return Dummy Response\n return new JsonResponse(array('result' => 'Ok'));\n }",
"private function searchMaster() {\n $id = intval($_POST['query']);\n $data = $this->system->getDB()->query(\"SELECT * FROM master WHERE id=?\", array($id));\n echo(json_encode($data[0]));\n }",
"public function isMaster();",
"public function getSingleResult()\n {\n }",
"public function selectreligionmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM religionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function getPrimary();",
"public function selectschememaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM schememaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectpositionmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM positionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"function master_view_query_result(): Array {\n\n $table = strtolower($this->controller);\n \n $model = $this->current_model;\n\n $select_columns = $this->toggle_master_view_select_columns(); \n\n $lookup_tables = $this->CI->grants->lookup_tables($table);\n \n $master_view_query_result = $this->CI->grants_model->run_master_view_query($table,$select_columns,$lookup_tables);\n \n return $this->CI->grants->update_query_result_for_fields_changed_to_select_type($this->controller,$master_view_query_result);\n \n }",
"function GetMasterMainChannel()\n {\n if ( ! is_superadmin()) {\n $this->db->where('is_superadmin', 0);\n }\n $data = $this->db\n ->order_by('master_mainchannel_code', 'asc')\n ->get('master_mainchannel')\n ->result_array();\n\n return $data;\n }",
"public function selectvillagemaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM villagemaster LEFT JOIN mandalmaster ON villagemaster.mandalid=mandalmaster.mandalid\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"private function has_master(){\n\t\tif($this->master==\"None\"){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"protected function is_master() {\n\t\treturn $this->_config->is_master();\n\t}",
"public function selectlocalitymaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM localitymaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectrecievermaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM letterrecievermaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selecteventmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM eventmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectpetitionmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM petitionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function getMasterConnection()\n {\n return $this->getConnection(self::DEFAULT_MASTER_NODE_ID);\n }",
"function getAllMaster($tabel){\n $db = $this->load->database('mhsc_masterdata', TRUE);\n $query = $db->get($tabel);\n return $query;\n }",
"function get_master_search_data($key = false) {\r\n\t\tif (empty ( $key )) {\r\n\t\t\treturn $this->master_search_data;\r\n\t\t} else {\r\n\t\t\treturn $this->master_search_data [$key];\r\n\t\t}\r\n\t}",
"protected function getResult()\n {\n return $this->result ?? true;\n }",
"public function getMasterRequest()\n {\n return $this->masterRequest;\n }",
"public function getFirstResult();",
"public function getFirstResult();",
"public function selectpetitionforwardmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM petitionforwardmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function getMaster()\n {\n $container = $this->getContainer();\n\n if ($container->has('request.master')) {\n return $container->get('request.master');\n }\n return $container->get('request');\n }",
"public function getWaitForMasterVariant();",
"abstract public function getPrimary();",
"private function getResult() {\n return $this->result;\n }",
"public function actionFindAll(){\n\t\tYii::$app->response->format = Response::FORMAT_JSON;\n\n\t\t$response = null;\n\n\t\tif (Yii::$app->request->isGet){\n\t\t\t\n\t\t\t$master_matpel = DataMatpel::find()\n\t\t\t->groupBy('matpel')\n\t\t\t->all();\n\t\t\t\n\t\t\t$response['master'] = $master_matpel;\n\t\t}\n\n\t\treturn $response;\n }",
"function GetMasterFilter() {\n\n\t\t// Master filter\n\t\t$sMasterFilter = \"\";\n\t\tif ($this->getCurrentMasterTable() == \"t_gaji_master\") {\n\t\t\tif ($this->gjm_id->getSessionValue() <> \"\")\n\t\t\t\t$sMasterFilter .= \"`gjm_id`=\" . ew_QuotedValue($this->gjm_id->getSessionValue(), EW_DATATYPE_NUMBER, \"DB\");\n\t\t\telse\n\t\t\t\treturn \"\";\n\t\t}\n\t\treturn $sMasterFilter;\n\t}",
"public function getSSDBMasterResource()\n {\n return $this->SSDBMasterResource;\n }",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n\t{\n\t\treturn parent::getResult();\n\t}",
"public function getResult()\n {\n return parent::getResult();\n }",
"public function getCurrentResult() : string;",
"public function forceMaster()\n {\n return true;\n }",
"public function forceMaster()\n {\n return true;\n }",
"public function getResult();",
"public function getResult();",
"public function getResult();",
"public function getResult();",
"public function getResult();",
"public function getResult();"
] | [
"0.65682006",
"0.6396339",
"0.63761115",
"0.6277591",
"0.62601995",
"0.6230873",
"0.6190991",
"0.61805916",
"0.6174329",
"0.6169014",
"0.61662894",
"0.6044402",
"0.59527785",
"0.58789414",
"0.58752835",
"0.5868419",
"0.58595896",
"0.5850338",
"0.580162",
"0.5797276",
"0.5795399",
"0.57707125",
"0.5762875",
"0.57620245",
"0.5723853",
"0.57154715",
"0.56867486",
"0.5684626",
"0.56639904",
"0.5656763",
"0.56507015",
"0.56265515",
"0.56149244",
"0.55980086",
"0.55980086",
"0.55966496",
"0.5596387",
"0.5585364",
"0.5579689",
"0.5545946",
"0.5528654",
"0.5523137",
"0.5506194",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5504555",
"0.5491944",
"0.548436",
"0.547806",
"0.547806",
"0.5476823",
"0.5476823",
"0.5476823",
"0.5476823",
"0.5476823",
"0.5476823"
] | 0.7969295 | 0 |
Remove file from storage and db. | public function remove($attachmentId, $recursive = true)
{
// Prepare return.
$results = array();
// No data to remove
if (empty($attachmentId)) {
return array();
}
// Find a master.
$sql = $this->getAttachmentProvider()->createModel()->whereId($attachmentId);
// If recursive find related.
if ($recursive == true) {
$sql = $sql->orWhere(function($query) use ($attachmentId) {
$query->whereMaster($attachmentId);
});
}
// Get attachments.
$attachments = $sql->get();
if (count($attachments)) foreach ($attachments as $attachment) {
// Subpath from db.
$subpath = trim($attachment->path, '/');
// Inject a config, then remove a attachment related.
$this->uploader->inject(array(
'subpath' => $subpath,
'onRemove' => function($result) use ($attachment, &$results) {
$attachment->delete(false);
Cache::forget('attachment-'.$attachment->getKey());
array_push($results, $result);
}
))
->open($attachment->toArray())->remove();
}
return $results;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function clear()\n {\n unlink($this->file);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"private function removeEntrada($filePath){\n \\Storage::delete($filePath);\n }",
"public function delete_local_file()\n\t{\n\t\tif(file_exists($this->local_file)) {\n\t\t\t$this->upload_local_file();\n\t\t\tunlink($this->local_file);\n\t\t}\n\t\t$this->local_file = null;\n\t}",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete(): void\n {\n unlink($this->path);\n }",
"protected function removeFile()\n {\n if (@is_file($this->getFilePath())) {\n @unlink($this->getFilePath());\n }\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function unlink($file);",
"public function testDeleteRemovesStorages()\n {\n file_put_contents(self::$temp.DS.'file1.txt', 'Hello World');\n\n Storage::delete(self::$temp.DS.'file1.txt');\n $this->assertTrue(! is_file(self::$temp.DS.'file1.txt'));\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }",
"public function clearStorage(): void\n {\n// foreach ($this->remoteFilesystems as $filesystem) {\n// $contents = $filesystem->listContents('/', true);\n// foreach ($contents as $contentItem) {\n// if ('file' !== $contentItem['type']) {\n// continue;\n// }\n// $filesystem->delete($contentItem['path']);\n// }\n// }\n }",
"public function destroy() {\n\t\tif($this->delete()) {\n\t\t\t// then remove the file\n\t\t // Note that even though the database entry is gone, this object \n\t\t\t// is still around (which lets us use $this->image_path()).\n\t\t\t$target_path = SITE_ROOT.DS.'public'.DS.$this->image_path();\n\t\t\treturn unlink($target_path) ? true : false;\n\t\t} else {\n\t\t\t// database delete failed\n\t\t\treturn false;\n\t\t}\n\t}",
"function remove_file_from_db( $fn ) {\n // Prepare DELETE statement for selected file\n $delete = \"DELETE FROM files WHERE filename = :filename\";\n $stmt = $this->pdo->prepare($delete);\n\n //Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n //Execute statement\n $stmt->execute();\n\n return;\n }",
"private function deleteFileRecord($fileName) {\n /** @var URLRequest $record */\n $record = URLRequest::where('fileName', $fileName)->first();\n shell_exec('cd /Stream && sudo rm ' . $record->fileName);//Remove the file from the /Stream directory.\n $record->delete(); //Delete $record from the database.\n }",
"public function deleteRawFile() {\n if (!$this->rawfiledeleted && !is_null($this->config_dir)) {\n $file_name = config('app.' . $this->config_dir) . $this->name;\n if (file_exists($this->relativepath)) {\n unlink($this->relativepath);\n $this->rawfiledeleted = true;\n $this->save();\n }\n }\n }",
"public function remove() {\n $f = new File(self::CONFIG_FILE_PATH);\n $f->remove();\n }",
"public function remove()\n {\n $file = $this->security->xss_clean($this->input->post(\"file\"));\n $id = $this->security->xss_clean($this->input->post(\"id\"));\n if ($file && file_exists($file)) {\n unlink($file);\n $this->db->where(array('url_image'=>$file,'idProduct'=>$id));\n $this->db->delete('imageProduct');\n }\n }",
"public function destroy(File $file)\n {\n $url=str_replace('storage','public',$file->url);\n Storage::delete($url);\n\n $file->delete();\n return redirect()->route('admin.files.index');\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function removeHard()\r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$userid = ($this->user) ? $this->user->id : $this->owner_id;\r\n\r\n\t\tUserFilesRemoveFile($dbh, $this->id, $userid, false, true);\r\n\t}",
"private function removeUploadedFile()\n {\n if(!isset($_REQUEST['file']))\n {\n exit; \n }\n \n list($file, $src, $size) = explode(':', $_REQUEST['file']);\n \n if(file_exists($src))\n {\n @unlink($src);\n }\n exit;\n }",
"public function delete($filepath);",
"function fileRemove($fileId){\n\tinclude '../../database.php';\n\n\t$stmt = $conn->prepare(\"SELECT * FROM file WHERE file_id=?\");\n\t$stmt->execute(array($fileId));\n\t$filelocation = $stmt->fetch(PDO::FETCH_ASSOC);\n\t$filelocation = $_SERVER[\"DOCUMENT_ROOT\"] . $filelocation;\n\n\tunlink($filelocation);\n\n\t$stmt = $conn->prepare(\"DELETE FROM file WHERE file_id=?\");\n\t$stmt->execute(array($fileId));\n}",
"function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}",
"public function DeleteFile()\r\n\t{\r\n\t\t$queryDeleteFile = \"UPDATE files SET status=\\\"DELETED\\\" WHERE file_id=\".$this->fileId;\r\n\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\tunlink(UPLOAD_PATH. DIRECTORY_SEPARATOR .$this->fileId);\r\n\t}",
"public function Remove()\n {\n $file = __DIR__ . \\Extensions\\PHPImageWorkshop\\ImageWorkshop::UPLOAD_PATH . \"/banners/\" . $this->getSrc();\n if (file_exists($file)) {\n unlink($file);\n }\n parent::Remove();\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"protected function deleteFile($file)\n {\n $oldFile = trim($file, config('app.url'));\n Storage::delete('public/' . $oldFile);\n }",
"public function destroy($id)\n {\n $getFile = Files::find($id);\n\n\n // find if there is any node connected\n $getPost = Posts::where(['image'=>$getFile->file]);\n if ($getPost->count() > 0) {\n $getPost = Posts::where(['image'=>$getFile->file])->update([\n 'image' => 'img/blogImage.png'\n ]);\n }\n\n\n $remove = File::delete($getFile->file);\n $del = Files::destroy($id);\n\n Session::flash('Success', 'File removed succesfully.');\n return redirect()->back();\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"protected function clearStorage(): void\n {\n $this->filename = '__PdfPrintText__';\n Storage::disk('local')->exists(\"test/$this->filename.pdf\") ? Storage::disk('local')->delete(\"test/$this->filename.pdf\") : null;\n Storage::disk('local')->exists(\"$this->filename.pdf\") ? Storage::disk('local')->delete(\"$this->filename.pdf\") : null;\n }",
"public function destroy(File $file)\n {\n\n\n $fileName = $file->file_name;\n $file->delete();\n Storage::disk('public')->delete([$fileName, '/thumb/'.$fileName]);\n\n return redirect( route('files.index') );\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }",
"function __destruct() {\r\n\t\tunlink($this->uploadfile);\r\n\t}",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function delete($id)\n\t{\n\n\t\t $document = Efile::where('id',$id)->first();\n //delete the file from the server\n\n // Storage::delete($document->path);\n $storagePath = Storage::disk('public')->getDriver()->getAdapter()->getPathPrefix();\n\t\tif(file_exists($storagePath.$document->path)){\n\t\t unlink($storagePath.$document->path);\n\t\t}\n\t\t\n $document->delete($id);\n\n\t}",
"public function delete($file) {\n\t}",
"private function delete_file($file){\n\t\t$fileLink = fopen($file,'w');\n\t\tfclose($fileLink);\n\t\tunlink($file);\n\t}",
"public function removeUpload()\n {\n $this->picture = null;\n }",
"public function deleteDownloadFile()\r\n\t{\r\n\t\t@unlink($this->reference);\r\n\t}",
"public function clearAll() {\n $list = scandir(self::ROOT_PATH . \"/public/{$this->storagePath}\");\n foreach ($list as $file) {\n if ($file == '.' || $file == '..') {\n continue;\n }\n $filePath = self::ROOT_PATH . \"/public/{$this->storagePath}/$file\";\n unlink($filePath);\n }\n $this->_tableGw->delete();\n }",
"public static function deleteFile($file){\n\t\t\t//@-> PARA N MOSTRAR ALGUM TIPO DE AVISO\n\t\t\t@unlink('uploads/'.$file);\n\t\t}",
"public function removeFile($file)\n {\n $this->filesystem->remove($file);\n }",
"public function on_delete() {\n $this->remove_dir();\n }",
"protected function removeFiles() {}",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"static public function deleteFile($file = false) {\n\n if ($file)\n unlink($file);\n else\n unlink($this->filePath);\n }",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"function delFile($path)\n {\n unlink($this->dir . DIRECTORY_SEPARATOR . $path);\n }",
"public static function deleteFile($file)\n {\n @unlink('uploads/'.$file);\n }",
"public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }",
"public function deleted(File $file)\n {\n media()->delete($file->filename);\n }",
"protected function removeOldFile(): void\n {\n // delete the old file\n $oldFile = $this->getUploadRootDir() . '/' . $this->oldFileName;\n if (is_file($oldFile) && file_exists($oldFile)) {\n unlink($oldFile);\n }\n\n $this->oldFileName = null;\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function destroy()\n {\n // DB::table('video_uploaded')->delete();\n }",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function delete_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }",
"public function deleteUnused()\n\t{\n\t\t/*$file = Engine_Api::_()->getItem('storage_file', $this->file_id);\n\t\t if ($file) {\n\t\t $table = Engine_Api::_()->getDbtable('albumSongs', 'mp3music');\n\t\t $select = $table->select()\n\t\t ->where('file_id = ?', $file->getIdentity())\n\t\t ->limit(1);\n\t\t $count = count( $table->fetchAll($select) );\n\t\t if ($count >= 0)\n\t\t $file->delete();\n\t\t }\n\t\t $this->delete();*/\n\t\t$table = Engine_Api::_() -> getDbtable('albumSongs', 'mp3music');\n\t\t$data = array('is_delete' => 1, );\n\t\t$where = $table -> getAdapter() -> quoteInto('song_id = ?', $this -> song_id);\n\t\t$table -> update($data, $where);\n\t}",
"protected function cleanup() {\n\t\tif(isset($this->data['attachment'])) {\n\t\t\tunlink($this->data['attachment']);\n\t\t}\n\t\tparent::cleanup();\n\t}",
"public function clean()\n {\n $fileSystem = new Filesystem();\n \n if ($fileSystem->exists($this->getCacheDir())) {\n $fileSystem->remove($this->getCacheDir());\n }\n }",
"public function delete($filename);",
"public function destroy($id)\n {\n\n\n $data = SoftwareMedia::find($id);\n $isDeleted =$data->delete();\n $value = $data->screenshots;\n if(strpos($value, \"+\") !== false){\n $data->screenshots = (explode(\"+\",$value));\n foreach($data->screenshots as $one){\n //$one= substr($one,42);\n $one = str_replace('http://localhost:8000/storage/screenshots/','',$one);\n unlink(storage_path('app/public/screenshots/'.$one));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/screenshots/','',$value);\n unlink(storage_path('app/public/screenshots/'.$value));\n }\n\n if($data->ebooks != null){\n $value = $data->ebooks;\n if(strpos($value, \"+\") !== false){\n $data->ebooks = (explode(\"+\",$value));\n foreach($data->ebooks as $ebook){\n $ebook = str_replace('http://localhost:8000/storage/ebooks/','',$ebook);\n unlink(storage_path('app/public/ebooks/'.$ebook));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/ebooks/','',$value);\n unlink(storage_path('app/public/ebooks/'.$value));\n }\n }\n if($data->whitepapers != null){\n $value = $data->whitepapers;\n if(strpos($value, \"+\") !== false){\n $data->whitepapers = (explode(\"+\",$value));\n foreach($data->whitepapers as $whitepaper){\n $whitepaper = str_replace('http://localhost:8000/storage/whitepapers/','',$whitepaper);\n unlink(storage_path('app/public/whitepapers/'.$whitepaper));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/whitepapers/','',$value);\n unlink(storage_path('app/public/whitepapers/'.$value));\n }\n }\n if($data->pdf != null){\n $value = $data->pdf;\n if(strpos($value, \"+\") !== false){\n $data->pdf = (explode(\"+\",$value));\n foreach($data->pdf as $one){\n $one = str_replace('http://localhost:8000/storage/pdf/','',$one);\n unlink(storage_path('app/public/pdf/'.$one));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/pdf/','',$value);\n unlink(storage_path('app/public/pdf/'.$value));\n }\n }\n if($data->guides != null){\n $value = $data->guides;\n if(strpos($value, \"+\") !== false){\n $data->guides = (explode(\"+\",$value));\n foreach($data->guides as $guide){\n $guide = str_replace('http://localhost:8000/storage/guides/','',$guide);\n unlink(storage_path('app/public/guides/'.$guide));\n }\n }else{\n $value = str_replace('http://localhost:8000/storage/guides/','',$value);\n unlink(storage_path('app/public/guides/'.$value));\n }\n }\n if($isDeleted == true){\n return response()->json(['message'=>'Deleted successfully','isdeleted'=>$isDeleted],200 );\n }else{\n return response()->json(['message'=>'Cannot delete something went wrong']);\n }\n }",
"function deleteFile($db, $strDetailID = \"\")\n{\n global $words;\n $bolNewData = true;\n if ($strDetailID != \"\") {\n $strSQL = \"SELECT * FROM hrd_training_request \";\n $strSQL .= \"WHERE id = '$strDetailID' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n $strFile = $rowDb['doc'];\n if ($strFile != \"\") {\n if (file_exists(\"trainingdoc/\" . $strFile)) {\n unlink(\"trainingdoc/\" . $strFile);\n }\n $strSQL = \"UPDATE hrd_training_request SET doc = '' WHERE id = '$strDetailID' \";\n $resExec = $db->execute($strSQL);\n //writeLog(ACTIVITY_DELETE, MODULE_PAYROLL,\"file $strDetailID\",0);\n }\n }\n }\n return true;\n}",
"public function delete_image_from_storage($image_file_name) {\n\t\t unlink(\"product_images/\".$image_file_name);\n\t }",
"public function destroy(File $file)\n {\n //\n }",
"public function destroy(File $file)\n {\n //\n }",
"public function destroy(File $file)\n {\n //\n }",
"public function removeFromCache()\n {\n Cache::tags('file')->forget(strtolower($this->alias));\n }",
"protected function cleanApplication() {\n @unlink('sql.db');\n }",
"public function deleteFile($file)\n {\n if (!$this->filesystem->has($file)) {\n return;\n }\n\n $this->filesystem->delete($file);\n $this->cacheManager->remove($file);\n }",
"public function file_delete($filename);",
"public function deleteFile($path) {\n \n if($path != null) {\n unlink($path);\n }\n }",
"function delete () {\n $this->clearCache ();\n commentaire::deletePhoto ($this->dir, $this->file);\n return files::deleteFile (luxbum::getFsPath ($this->dir) . $this->file);\n }",
"public function cleanUploadedFiles(): void\n {\n foreach ($this->uploadedFiles as $file) {\n @unlink($file['tmp_name']);\n }\n }",
"public function flushSource()\n {\n if (is_file($this->getStoragePath())) {\n @unlink($this->getStoragePath());\n }\n }",
"public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }",
"public function deleteImage($path)\n {\n // $file_name = end($file);\n File::delete(public_path($path));\n // File::delete($file_name);\n }",
"function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}",
"protected function delete($id) {\n\t\t@unlink(self::getPath($id));\n\t\t$this->db->exec(\"DELETE FROM image WHERE id = '\".SQLite3::escapeString($id).\"'\");\n\t}",
"public function deleteFilePerm(){\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\t\t//Make sure that that file is already trashed\r\n\t\tif($file['trash'] == 1){\r\n\t\t\t//Permanently delete the file\r\n\t\t\t$files = array ();\r\n\t\t\t$files[] = $file;\r\n\t\t\t$this->deleteFilesPermanently($files);\r\n\r\n\t\t}\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}",
"private function _deleteFile($file)\n {\n $this->_files[basename($file)]->delete();\n unset($this->_files[basename($file)]);\n $this->_prune();\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function cleanFileCache()\n {\n if (is_callable(array('SugarAutoLoader', 'buildCache'))) {\n SugarAutoLoader::buildCache();\n } else {\n // delete dangerous files manually\n @unlink(\"cache/file_map.php\");\n @unlink(\"cache/class_map.php\");\n }\n }",
"public function delete($file)\n {\n $file = $this->getFilePath($file);\n\n if (file_exists($file)) {\n unlink($file);\n }\n }",
"public function removeFile($path)\n { $path = $this->_bucket . '/' . $path;\n $this->_internalService->removeObject($path);\n }",
"function deleteFileFromPrivateStorage($path)\n{\n $exists = Storage::disk('local')->exists($path);\n if ($exists) {\n Storage::delete($path);\n }\n}",
"private function deleteTempFile() {\n if ($this->datastreamInfo['content']['type'] == 'file' && $this->copied == TRUE) {\n unlink($this->datastreamInfo['content']['content']);\n }\n }"
] | [
"0.7450772",
"0.74469846",
"0.7441819",
"0.7323561",
"0.72790444",
"0.715711",
"0.71543586",
"0.71385515",
"0.7120811",
"0.71061546",
"0.70888007",
"0.7070013",
"0.7052062",
"0.70233667",
"0.70158577",
"0.7002905",
"0.6983892",
"0.6963413",
"0.69581634",
"0.693217",
"0.69306797",
"0.6900528",
"0.68807524",
"0.6823247",
"0.68143433",
"0.6801155",
"0.6785224",
"0.67759675",
"0.6762944",
"0.6756917",
"0.67182606",
"0.67106664",
"0.6704302",
"0.6704082",
"0.66977394",
"0.66958904",
"0.66939723",
"0.6683994",
"0.66785806",
"0.66175556",
"0.6617012",
"0.6599815",
"0.6598269",
"0.6592934",
"0.6583254",
"0.65738815",
"0.65674585",
"0.656466",
"0.6561204",
"0.6557947",
"0.6555775",
"0.65451175",
"0.6542387",
"0.6531776",
"0.65310615",
"0.6516134",
"0.65156025",
"0.65138716",
"0.65117246",
"0.6511518",
"0.65111494",
"0.65038097",
"0.650277",
"0.64966595",
"0.64945143",
"0.6489954",
"0.6488261",
"0.6485289",
"0.64771384",
"0.64769113",
"0.6475214",
"0.6474971",
"0.64489454",
"0.6444334",
"0.6442804",
"0.64397275",
"0.64282984",
"0.64265543",
"0.6422918",
"0.6422918",
"0.6422918",
"0.6409281",
"0.6408506",
"0.64007723",
"0.6398169",
"0.63831896",
"0.6380837",
"0.63794047",
"0.6368535",
"0.63614905",
"0.6358754",
"0.63491225",
"0.6347988",
"0.6338543",
"0.6332694",
"0.6328099",
"0.63251615",
"0.6318968",
"0.6314619",
"0.6311582",
"0.6303365"
] | 0.0 | -1 |
Resize if scale if not exists. | public function resizeFromMasterFile($masterId, $scale)
{
$master = $this->getAttachmentProvider()->findById($masterId);
$attachment = null;
if (! empty($master) and $scale) {
$config = array(
'subpath' => trim($master->path, '/')
);
$this->uploadInit()->inject($config)->open($master->toArray())->resize($scale);
$attachment = $this->getAttachmentProvider()->findById($master->id.'_'.$scale);
}
return $attachment;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resize_scale($scale){\n\n $width = $this->get_width() * $scale / 100;\n $height = $this->get_height() * $scale / 100;\n $this->resize($width, $height);\n\n return true;\n }",
"private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }",
"public function scale($scale = 1) {\n\t\tif(stristr($scale, '%') !== false) {\n\t\t\t$scale = (float) preg_replace('/[^0-9\\.]/', '', $scale);\n\t\t\t$scale = $scale/100;\n\t\t}\n\t\t$scale = (float) $scale;\n\t\t$new_width = ceil($this->width * $scale);\n\t\t$new_height = ceil($this->height * $scale);\n\n\t\t$working_image = imagecreatetruecolor($new_width, $new_height);\n\n\t\tif(imagecopyresampled($working_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height)) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = $new_width;\n\t\t\t$this->height = $new_height;\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Resize failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}",
"function scale($scale) {\r\n\t\t$width = $this->getWidth() * $scale/100;\r\n\t\t$height = $this->getheight() * $scale/100;\r\n\t\t$this->resize($width,$height);\r\n\t}",
"public function scale() { }",
"protected function scaleImages() {}",
"public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }",
"function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }",
"public function shrink($width = 0, $height = 0, $enlarge=false) {\n\n //if ($scale > 1) {\n // $scale = 1;\n //}\n\n //$this->resizeWithScale($this->info['width'] * $scale, $this->info['height'] * $scale, $scale);\n //$this->resizeWithScaleExact($width, $height, 1);\n\n //$this->resizeWithScale($width, $height, $scale);\n\n\t\t//$scale=$width/$height;\n //$this->resizeWithScale($this->info['width'] * $scale, $this->info['height'] * $scale, $scale);\n\n\t\t$s_ratio = $this->info['width']/$this->info['height'];\n\t\t$d_ratio = $width/$height;\n\n if ( $s_ratio > $d_ratio )\n {\n $cwidth = $this->info['width'];\n $cheight = round($this->info['width']*(1/$d_ratio));\n }\n elseif( $s_ratio < $d_ratio )\n {\n $cwidth = round($this->info['height']*$d_ratio);\n $cheight = $this->info['height'];\n }\n else\n {\n $cwidth = $this->info['width'];\n $cheight = $this->info['height'];\n }\n\n\t\tif ( ($this->info['width']<=$width) && ($this->info['height']<=$height) && !$enlarge )\n\t\t{\n\t\t\t$this->resizeWithScaleExact($cwidth, $cheight, 1);\n\t\t}\n\t\telse\n\t\t{\n\t $this->resizeWithScaleExact($width, $height, 1);\n\t\t}\n }",
"public static function resize(){\n\n}",
"public function scale($scaleX, $scaleY) {}",
"public function scale($scaleX, $scaleY) {}",
"public function scale($scaleX, $scaleY) {}",
"public function autoScale($img, $size) {\n\t// NOT YET IMPLEMENTED.\n}",
"function __resize(&$tmp, $width, $height) {\n\t\t\n\t\t// call `convert -geometry`\n\t\t//\n\t\t$cmd = $this->__command(\n\t\t\t'convert',\n \t\"-geometry {$width}x{$height}! \"\n \t\t. escapeshellarg(realpath($tmp->target))\n \t\t. \" \"\n \t\t. escapeshellarg(realpath($tmp->target))\n \t);\n\n exec($cmd, $result, $errors);\n\t\treturn ($errors == 0);\n\t\t}",
"function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }",
"protected function widenResizeMagic(): void\n {\n $this->image->widen($this->widenResize, function ($constraint) {\n $constraint->upsize();\n });\n }",
"function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}",
"function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}",
"public function resize($width=null, $height=null, $master=null);",
"public function resize($width, $height = null);",
"public function _set_new_size_auto()\n {\n if (empty($this->source_width) || empty($this->source_height)) {\n if ( ! $this->SILENT_MODE) {\n trigger_error('Missing source image sizes!', E_USER_WARNING);\n }\n return false;\n }\n $k1 = $this->source_width / $this->limit_x;\n $k2 = $this->source_height / $this->limit_y;\n $k = $k1 >= $k2 ? $k1 : $k2;\n if ($this->reduce_only && $k1 <= 1 && $k2 <= 1) {\n $this->output_width = $this->source_width;\n $this->output_height = $this->source_height;\n } else {\n $this->output_width = round($this->source_width / $k, 0);\n $this->output_height = round($this->source_height / $k, 0);\n }\n return true;\n }",
"function scaleByLength($size)\r\n {\r\n if ($this->img_x >= $this->img_y) {\r\n $new_x = $size;\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n } else {\r\n $new_y = $size;\r\n $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);\r\n }\r\n return $this->_resize($new_x, $new_y);\r\n }",
"function _resize() {\r\n return null; //PEAR::raiseError(\"No Resize method exists\", true);\r\n }",
"public function scaleImage($scale)\n {\n if ($scale == 1) {\n return;\n }\n\n $scaledSize = $this->getScaledImageSize($scale);\n\n $image = $this->createNewTransparentImage($scaledSize->width, $scaledSize->height);\n\n imagecopyresampled(\n $image,\n $this->image,\n 0,\n 0,\n 0,\n 0,\n $scaledSize->width,\n $scaledSize->height,\n $this->width,\n $this->height\n );\n\n imagedestroy($this->image);\n $this->image = $image;\n $this->width = $scaledSize->width;\n $this->height = $scaledSize->height;\n }",
"function __resize(&$tmp, $width, $height) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}",
"protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }",
"function resize_fit_or_smaller($width, $height) {\n\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\t$ratio = $width / $w;\n\t\tif (($h*$ratio)>$height)\n\t\t\t$ratio = $height / $h;\n\t\t\n\t\t$h *= $ratio;\n\t\t$w *= $ratio;\n\n\t\t$this->resize($w, $h);\n\t}",
"function wp_shrink_dimensions($width, $height, $wmax = 128, $hmax = 96)\n {\n }",
"function resize_axis( $size = 0, $axis = 'x' )\n\t{\n\t\tif( $size == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t$old_size = $this->size();\n\t\t\n\t\t//Y Axis\n\t\tif( !strcasecmp( $axis, 'Y' ) )\n\t\t{\n\t\t\t$new_w = $old_size->w * ( $size / $old_size->h );\n\t\t\t$new_h = $size;\n\t\t}\n\t\telse //X axis\n\t\t{\n\t\t\t$new_w = $size;\n\t\t\t$new_h = $old_size->h * ( $size / $old_size->w );\t\t\n\t\t}\n\n\t\t//resize the image\n\t\t$this->resize( $new_w, $new_h );\n\t}",
"public function scale($scale)\n {\n $this->width = round($this->width * $scale);\n $this->height = round($this->height * $scale);\n\n return $this->resizeImage($this->width, $this->height, $this->imageFilter, $this->imageBlur);\n }",
"public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}",
"private function _scale()\n\t{\n\t\t//scale down the image by 55%\n\t\t$weaponImageSize = $this->weapon->getImageGeometry();\n\t\t$this->weaponScale['w'] = $weaponImageSize['width'] * 0.55;\n\t\t$this->weaponScale['h'] = $weaponImageSize['height'] * 0.55;\n\n\t\t$this->weapon->scaleImage($this->weaponScale['w'], $this->weaponScale['h']);\n\n\t\t//scale down the image by 30%\n\t\t$emblemImageSize = $this->emblem->getImageGeometry();\n\t\t$this->emblemScale['w'] = $emblemImageSize['width'] * 0.30;\n\t\t$this->emblemScale['h'] = $emblemImageSize['height'] * 0.30;\n\n\t\t$this->emblem->scaleImage($this->emblemScale['w'], $this->emblemScale['h']);\n\n\t\t//scale down the image by 70%\n\t\t$profileImageSize = $this->profile->getImageGeometry();\n\t\t$this->profileScale['w'] = $profileImageSize['width'] * 0.70;\n\t\t$this->profileScale['h'] = $profileImageSize['height'] * 0.70;\n\n\t\t$this->profile->scaleImage($this->profileScale['w'], $this->profileScale['h']);\n\t}",
"public function testResizeIfNeededNotNeeded()\n {\n $resized = Processor::resizeIfNeeded('/app/tests/small-image.jpg', true);\n $this->assertFalse($resized);\n\n // wide image to be resized\n $resized = Processor::resizeIfNeeded('/app/tests/wide-image.jpg', true);\n $this->assertTrue($resized);\n }",
"private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}",
"function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}",
"public function resize($width = NULL, $height = NULL, $master = NULL)\n {\n if ($master === NULL)\n {\n // Choose the master dimension automatically\n $master = Image::AUTO;\n }\n // Image::WIDTH and Image::HEIGHT depricated. You can use it in old projects,\n // but in new you must pass empty value for non-master dimension\n elseif ($master == Image::WIDTH AND ! empty($width))\n {\n $master = Image::AUTO;\n\n // Set empty height for backvard compatibility\n $height = NULL;\n }\n elseif ($master == Image::HEIGHT AND ! empty($height))\n {\n $master = Image::AUTO;\n\n // Set empty width for backvard compatibility\n $width = NULL;\n }\n\n if (empty($width))\n {\n if ($master === Image::NONE)\n {\n // Use the current width\n $width = $this->width;\n }\n else\n {\n // If width not set, master will be height\n $master = Image::HEIGHT;\n }\n }\n\n if (empty($height))\n {\n if ($master === Image::NONE)\n {\n // Use the current height\n $height = $this->height;\n }\n else\n {\n // If height not set, master will be width\n $master = Image::WIDTH;\n }\n }\n\n switch ($master)\n {\n case Image::AUTO:\n // Choose direction with the greatest reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::WIDTH : Image::HEIGHT;\n break;\n case Image::INVERSE:\n // Choose direction with the minimum reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::HEIGHT : Image::WIDTH;\n break;\n }\n\n switch ($master)\n {\n case Image::WIDTH:\n // Recalculate the height based on the width proportions\n $height = $this->height * $width / $this->width;\n break;\n case Image::HEIGHT:\n // Recalculate the width based on the height proportions\n $width = $this->width * $height / $this->height;\n break;\n }\n\n // Convert the width and height to integers\n $width = round($width);\n $height = round($height);\n\n $this->_do_resize($width, $height);\n\n return $this;\n }",
"function scaleByFactor($size)\r\n {\r\n $new_x = round($size * $this->img_x, 0);\r\n $new_y = round($size * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }",
"function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}",
"function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}",
"function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}",
"function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }",
"function image_scale_im_obj(\\Imagick $im, $aspect, $width, $strategy)\n{\n\n $height = round(($width/$aspect['width'])*$aspect['height']);\n\n $source_w = $im->getImageWidth();\n $source_h = $im->getImageHeight();\n $source_a = $source_h / $source_w;\n $target_a = $aspect['height'] / $aspect['width'];\n\n switch ($strategy) {\n case 'resize':\n $im->scaleImage($width, $height);\n break;\n case 'crop-top':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, 0);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, 0, 0);\n }\n break;\n case 'crop-bottom':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, $im->getImageHeight() - $height);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, $im->getImageWidth() - $width, 0);\n }\n break; \n case 'crop':\n default:\n $im->cropThumbnailImage($width, $height);\n break; \n }\n $im->setImageFormat('jpeg');\n $im->gaussianBlurImage(0.05, 0.5);\n $im->setImageCompressionQuality(75);\n $im->setInterlaceScheme(\\Imagick::INTERLACE_PLANE);\n $im->stripImage();\n return $im;\n}",
"public static function scale()\n {\n return new CropMode(CropMode::SCALE);\n }",
"function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }",
"function resize_fit_or_bigger($width, $height) {\n\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\t$ratio = $width / $w;\n\t\tif (($h*$ratio)<$height)\n\t\t\t$ratio = $height / $h;\n\t\t\n\t\t$h *= $ratio;\n\t\t$w *= $ratio;\n\n\t\t$this->resize($w, $h);\n\t}",
"public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }",
"private function _resizeThumbnailImage($thumb_image_name, $image, $width, $height, $src_width, $src_height, $scale){\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t$source = imagecreatefromjpeg($image);\n\t\timagecopyresampled($newImage,$source,0,0,0,0,$width,$height,$src_width,$src_height);\n\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\tchmod($thumb_image_name, 0777);\n\t\t//return $thumb_image_name;\n\t}",
"public static function scale($fname,$max_image_size=600,$flag='image',$quality=100,$max_image_side=600,$max_thumb_size=300,$max_thumb_height=120,$thumb_scale=1) // scale image/thumbnail\n\t{\n\t\tif(ini_get('memory_limit')<100)\n\t\t\tini_set('memory_limit','100M'); // fix for serevrs with low memory limit\n\n\t\tif($flag=='rescaleimage')\n\t\t{\n\t\t\t$full_fname=substr($fname,0,strrpos($fname,\".\")).\"_full\".substr($fname,strrpos($fname,\".\"));\n\t\t\tif(file_exists($full_fname))\n\t\t\t\tlist($orig_width,$orig_height,$img_type,$img_attr)=@getimagesize($full_fname);\n\t\t\telse\n\t\t\t\tlist($orig_width,$orig_height,$img_type,$img_attr)=@getimagesize($fname);\n\t\t}\n\t\telse\n\t\t\tlist($orig_width,$orig_height,$img_type,$img_attr)=@getimagesize($fname);\n\n\t\t$thumb=$flag=='thumb'||$flag=='rescalethumb';\n\t\t$max_size_param=$thumb?$max_thumb_size:$max_image_size;\n\t\tif($orig_width>$max_size_param||$orig_height>$max_size_param)\n\t\t{\n\t\t\tif($flag=='image')\n\t\t\t{\n\t\t\t\t$new_fname=$fname;\n\t\t\t\t$fname=substr($fname,0,strrpos($fname,\".\")).\"_full\".substr($fname,strrpos($fname,\".\"));\n\t\t\t\trename($new_fname,$fname);\n\t\t\t}\n\t\t\telseif($flag=='rescaleimage')\n\t\t\t{\n\t\t\t\t$final_name=$fname;\n\t\t\t\t$new_fname=substr($fname,0,strrpos($fname,\".\")).\"_tempimg\".substr($fname,strrpos($fname,\".\"));\n\t\t\t\tif(file_exists($full_fname))\n\t\t\t\t{\n\t\t\t\t\tcopy($full_fname,$fname);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($flag=='rescalethumb')\n\t\t\t{\n\t\t\t\t$final_name=substr($fname,0,strrpos($fname,\".\")).\"_thumb\".substr($fname,strrpos($fname,\".\"));\n\t\t\t\t$new_fname=substr($fname,0,strrpos($fname,\".\")).\"_thumb_tempimg\".substr($fname,strrpos($fname,\".\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$new_fname=substr($fname,0,strrpos($fname,\".\")).\"_thumb\".substr($fname,strrpos($fname,\".\"));\n\t\t\t}\n\n\t\t\t$ratio=$orig_width/$orig_height;\n\n\t\t\tif($thumb_scale==2)\n\t\t\t\t$scaling='crop';\n\t\t\telse\n\t\t\t\t$scaling='default';\n//scaling_mode\n\t\t\tif(!$thumb||$scaling=='default') //old scaling\n\t\t\t{\n\t\t\t\tif($orig_width>=$orig_height)\n\t\t\t\t{\n\t\t\t\t\t$new_width=$max_size_param;\n\t\t\t\t\t$new_height=intval($max_size_param/$ratio);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$new_width=intval($max_size_param*$ratio);\n\t\t\t\t\t$new_height=$max_size_param;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($orig_width>=$orig_height)\n\t\t\t\t{\n\t\t\t\t\t$new_height=$max_thumb_height;\n\t\t\t\t\t$new_width=intval($new_height*$ratio);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$new_width=$max_size_param;\n\t\t\t\t\t$new_height=intval($new_width/$ratio);\n\t\t\t\t}\n\t\t\t}\n// Resample\n\t\t\t$image_p=@imagecreatetruecolor($new_width,$new_height);\n\t\t\t$image=self::gdCreate($img_type,$fname);\n//transparency\n\t\t\tif($img_type==1||$img_type==3)\n\t\t\t{\n\t\t\t\t$trnprt_indx=imagecolortransparent($image);\n\t\t\t\tif($trnprt_indx>=0)\n\t\t\t\t{\n\t\t\t\t\t$trnprt_color=imagecolorsforindex($image,$trnprt_indx);\n\t\t\t\t\t$trnprt_indx=imagecolorallocate($image_p,$trnprt_color['red'],$trnprt_color['green'],$trnprt_color['blue']);\n\t\t\t\t\timagefill($image_p,0,0,$trnprt_indx);\n\t\t\t\t\timagecolortransparent($image_p,$trnprt_indx);\n\t\t\t\t}\n\t\t\t\telseif($img_type==3)\n\t\t\t\t{\n\t\t\t\t\timagealphablending($image_p,false);\n\t\t\t\t\t$color=imagecolorallocatealpha($image_p,0,0,0,127);\n\t\t\t\t\timagefill($image_p,0,0,$color);\n\t\t\t\t\timagesavealpha($image_p,true);\n\t\t\t\t}\n\t\t\t}\n//end transparency\n\t\t\tif($image!='')\n\t\t\t{\n\t\t\t\timagecopyresampled($image_p,$image,0,0,0,0,$new_width,$new_height,$orig_width,$orig_height);\n\n\t\t\t\tself::gdSave($image_p,$new_fname,$quality,$img_type); // Save image\n\t\t\t\timagedestroy($image_p);\n\t\t\t\timagedestroy($image);\n\t\t\t\tif($flag=='rescalethumb'||$flag=='rescaleimage')\n\t\t\t\t{\n\t\t\t\t\tunlink($final_name);\n\t\t\t\t\trename($new_fname,$final_name);\n\t\t\t\t}\n\t\t\t\treturn $new_fname;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telseif($flag=='image')\n\t\t{\n\t\t\t$full_fname=substr($fname,0,strrpos($fname,\".\")).\"_full\".substr($fname,strrpos($fname,\".\"));\n\t\t\tcopy($fname,$full_fname);\n\t\t\treturn $fname;\n\t\t}\n\t\telse\n\t\t\treturn $fname;\n\t}",
"function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}",
"function shoestrap_image_resize( $data ) {\n\n $defaults = array(\n \"url\" => \"\",\n \"width\" => \"\",\n \"height\" => \"\",\n \"crop\" => true,\n \"retina\" => \"\",\n \"resize\" => true,\n );\n\n $settings = wp_parse_args( $data, $defaults );\n\n if ( empty($settings['url']) )\n return;\n\n // Generate the @2x file if retina is enabled\n if ( shoestrap_getVariable( 'retina_toggle' ) == 1 && empty( $settings['retina'] ) )\n $results['retina'] = matthewruddy_image_resize( $settings['url'], $settings['width'], $settings['height'], $settings['crop'], true );\n\n return matthewruddy_image_resize( $settings['url'], $settings['width'], $settings['height'], $settings['crop'], false ); \n}",
"abstract public function resize($properties);",
"private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}",
"public function resize($value) {\n return $this->setProperty('resize', $value);\n }",
"public function testResizeIfNeededNeeded()\n {\n $resized = Processor::resizeIfNeeded('/app/tests/tall-image.jpg', true);\n $this->assertTrue($resized);\n }",
"function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}",
"function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$thumb_image_name); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\tbreak;\n }\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}",
"function _resize(&$model, $name) {\n $setting = $this->settings[$model->name][$name];\n \n if (!empty($setting['resize']['original'])) unset($setting['resize']['original']);\n \n # loop through the resize options\n foreach (!empty($setting['resize']) && is_array($setting['resize']) ? $setting['resize'] : array() as $k => $v) {\n \n # create resized data to save into the database\n $versioned = array(\n 'parent_id' => $model->{$name}->id,\n 'model' => $model->name,\n 'foreign_key' => $model->id,\n 'field' => $name,\n 'version' => strtolower($k),\n 'filename' => assetFileName($model->data[$name]['filename'], $k),\n 'mime' => $model->data[$name]['type'],\n 'size' => null,\n );\n \n # move the versioned file\n if (!assetSaveFile($model, $this->directory.$model->data[$name]['filename'], $versioned['filename'], false)) {\n $this->_setError($model, 'Critical Error found while saving file in Resize: '. $name, 'error');\n return false;\n }\n \n # initialize and perform the resize task\n $resize = new Resize($this->directory.$versioned['filename'], $v);\n \n if (!$resize) {\n $this->_setError($model, 'Could not perform resizing tasks on: type: '. $k .' file: '. $model->data[$name]['filename'] .'.', 'error');\n return false;\n } else {\n \n # save remaining values\n $versioned['size'] = filesize($this->directory.$versioned['filename']);\n list($versioned['width'], $versioned['height']) = getimagesize($this->directory.$versioned['filename']);\n \n # save the new entry\n $versionModel = new $model->{$name};\n $versionModel->create();\n \n # save the versioned file data\n if (!$versionModel->save($versioned, false)) {\n $this->_setError($model, 'Critical Error found while saving record in Resize: '. $name, 'error');\n return false;\n }\n }\n }\n }",
"function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}",
"function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}",
"public static function isWindowResized() : bool {}",
"function _resizeImageIM($src_file, $dest_file, $new_size) {\r\n \t$retval = $output = null;\r\n $cmd = $this->_IM_path.\"convert -resize $new_size \\\"$src_file\\\" \\\"$dest_file\\\"\";\r\n exec($cmd, $output, $retval);\r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }",
"function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}",
"public function resize(int $size, $value = 0): void {}",
"public static function ScaleThumbnailSizes($image, $maxwidth = -1, $maxheight = -1,\n $behaviour = 1, $upscale = false)\n {\n if(empty($image) ||\n (is_string($image) && !is_file($image)) ||\n !is_resource($image) )\n return false;\n\n if(is_string($image))\n {\n list($width, $height) = @getimagesize($image);\n $maxwidth = intval($maxwidth);\n $maxheight = intval($maxheight);\n }\n else\n {\n $maxwidth = $width = imagesx($image);\n $maxheight = $height = imagesy($image);\n }\n $maxwidth = Is_Valid_Number($maxwidth,0,1,SD_MEDIA_MAX_DIM);\n $maxheight = Is_Valid_Number($maxheight,0,1,SD_MEDIA_MAX_DIM);\n\n if(empty($maxwidth) || empty($maxheight))\n {\n return false;\n }\n\n //Calculate the width:height ratio\n $owidth = $width;\n $oheight = $height;\n $ratio = $height/$width;\n if($maxheight < 0 || $maxwidth < 0)\n {\n if($maxheight < 0 && $maxwidth < 0)\n {\n //Do nothing\n }\n elseif ($maxheight < 0)\n {\n $width = $maxwidth;\n $height = round($width*$ratio);\n }\n elseif ($maxwidth < 0)\n {\n $height = $maxheight;\n $width = round($height/$ratio);\n }\n }\n elseif ($ratio == 1)\n {\n //Same Height/Width\n if ($maxheight === $maxwidth)\n {\n $width = $maxwidth;\n $height = $maxheight;\n }\n else\n {\n $height = min($maxheight,$maxwidth);\n $width = min($maxheight,$maxwidth);\n }\n }\n else\n {\n $case1_width = $maxwidth;\n $case1_height = round($case1_width*$ratio);\n $case1_area = round($case1_width*$case1_height);\n\n $case2_height = $maxheight;\n $case2_width = round($case2_height/$ratio);\n $case2_area = round($case2_width*$case2_height);\n\n //Check if it is an ambiguous case\n if(($case1_width <= $maxwidth) && ($case1_height <= $maxheight) &&\n ($case2_width <= $maxwidth) && ($case2_height <= $maxheight))\n {\n //$behaviour Sometimes, 2 values are obtained. Set this to 1 to return the\n //one with the bigger pixel area or 2 to return the one with smaller pixel area.\n if($behaviour == 1)\n {\n if($case1_area >= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n else\n {\n if($case1_area <= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n else\n {\n if ($case1_width <= $maxwidth && $case1_height <= $maxheight)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n\n if(($height > $oheight) || ($width > $owidth))\n {\n $width = $owidth;\n $height = $oheight;\n }\n $array = array((int)$width,(int)$height);\n return $array;\n\n }",
"public function resizing(Resizable $model)\n {\n if ($this->queueIt()) {\n $this->app[Dispatcher::class]->dispatch(new ResizeImage($model));\n } else {\n $this->doIt($model);\n }\n }",
"function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$thumb_image_name,90);\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}",
"function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }",
"public function addPictureScaled($row, $column, $picture_id, $scale) {\n\t}",
"public function shrink(string $source, string $destination, ?int $width = null, ?int $height = null, int $quality = self::DEFAULT_JPEG_QUALITY): bool\n {\n $shrunk = $this->resize($source, $width, $height);\n\n if ($shrunk === null) {\n return false;\n }\n\n $success = imagejpeg($shrunk, $destination, $quality);\n\n imagedestroy($shrunk); // don't hog the RAM, we're not Slack or Chrome.\n\n return $success;\n }",
"static function resize($filename , $width, $height, $disk='local' ){\n\n $pathinfo = pathinfo( $filename );\n $resized = $pathinfo['filename'] . '-' . $width . 'x' . $height . '.' . $pathinfo['extension'];\n\n if( !Storage::disk( $disk )->exists( $resized ) ){\n\n Image::make( self::path( $filename , $disk ) )->resize( $width , $height , function($constraint){\n\n $constraint->aspectRatio();\n\n })->save( self::path( $resized , $disk ) );\n\n }\n\n return $resized;\n\n }",
"private function switchDimensions()\r\n {\r\n if (($this->ControlState & csLoading) != csLoading)\r\n {\r\n $temp=$this->_width;\r\n $this->_width=$this->_height;\r\n $this->_height=$temp;\r\n }\r\n }",
"function scaleMaxX($new_x)\r\n {\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }",
"public function AutoSize()\n\t{\n\t\tif ($this->img->img == null) {\n\t\t\t// The predefined left, right, top, bottom margins.\n\t\t\t// Note that the top margin might incease depending on\n\t\t\t// the title.\n\t\t\t$hadj = $vadj = 0;\n\t\t\tif ($this->doshadow) {\n\t\t\t\t$hadj = $this->shadow_width;\n\t\t\t\t$vadj = $this->shadow_width + 5;\n\t\t\t}\n\n\t\t\t$lm = $this->img->left_margin;\n\t\t\t$rm = $this->img->right_margin + $hadj;\n\t\t\t$rm += 2;\n\t\t\t$tm = $this->img->top_margin;\n\t\t\t$bm = $this->img->bottom_margin + $vadj;\n\t\t\t$bm += 2;\n\n\t\t\t// If there are any added Plot\\GanttVLine we must make sure that the\n\t\t\t// bottom margin is wide enough to hold a title.\n\t\t\t$n = safe_count($this->iObj);\n\t\t\tfor ($i = 0; $i < $n; ++$i) {\n\t\t\t\tif ($this->iObj[$i] instanceof Plot\\GanttVLine) {\n\t\t\t\t\t$bm = max($bm, $this->iObj[$i]->title->GetHeight($this->img) + 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// First find out the height\n\t\t\t$n\t = $this->GetBarMaxLineNumber() + 1;\n\t\t\t$m\t = max($this->GetMaxLabelHeight(), $this->GetMaxBarAbsHeight());\n\t\t\t$height = $n * ((1 + $this->iLabelVMarginFactor) * $m);\n\n\t\t\t// Add the height of the scale titles\n\t\t\t$h = $this->scale->GetHeaderHeight();\n\t\t\t$height += $h;\n\n\t\t\t// Calculate the top margin needed for title and subtitle\n\t\t\tif ($this->title->t != '') {\n\t\t\t\t$tm += $this->title->GetFontHeight($this->img);\n\t\t\t}\n\t\t\tif ($this->subtitle->t != '') {\n\t\t\t\t$tm += $this->subtitle->GetFontHeight($this->img);\n\t\t\t}\n\n\t\t\t// ...and then take the bottom and top plot margins into account\n\t\t\t$height += $tm + $bm + $this->scale->iTopPlotMargin + $this->scale->iBottomPlotMargin;\n\t\t\t// Now find the minimum width for the chart required\n\n\t\t\t// If day scale or smaller is shown then we use the day font width\n\t\t\t// as the base size unit.\n\t\t\t// If only weeks or above is displayed we use a modified unit to\n\t\t\t// get a smaller image.\n\t\t\tif ($this->scale->IsDisplayHour() || $this->scale->IsDisplayMinute()) {\n\t\t\t\t// Add 2 pixel margin on each side\n\t\t\t\t$fw = $this->scale->day->GetFontWidth($this->img) + 4;\n\t\t\t} elseif ($this->scale->IsDisplayWeek()) {\n\t\t\t\t$fw = 8;\n\t\t\t} elseif ($this->scale->IsDisplayMonth()) {\n\t\t\t\t$fw = 4;\n\t\t\t} else {\n\t\t\t\t$fw = 2;\n\t\t\t}\n\n\t\t\t$nd = $this->scale->GetNumberOfDays();\n\n\t\t\tif ($this->scale->IsDisplayDay()) {\n\t\t\t\t// If the days are displayed we also need to figure out\n\t\t\t\t// how much space each day's title will require.\n\t\t\t\tswitch ($this->scale->day->iStyle) {\n\t\t\t\t\tcase DAYSTYLE_LONG:\n\t\t\t\t\t\t$txt = 'Monday';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_LONGDAYDATE1:\n\t\t\t\t\t\t$txt = 'Monday 23 Jun';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_LONGDAYDATE2:\n\t\t\t\t\t\t$txt = 'Monday 23 Jun 2003';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORT:\n\t\t\t\t\t\t$txt = 'Mon';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDAYDATE1:\n\t\t\t\t\t\t$txt = 'Mon 23/6';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDAYDATE2:\n\t\t\t\t\t\t$txt = 'Mon 23 Jun';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDAYDATE3:\n\t\t\t\t\t\t$txt = 'Mon 23';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE1:\n\t\t\t\t\t\t$txt = '23/6';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE2:\n\t\t\t\t\t\t$txt = '23 Jun';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE3:\n\t\t\t\t\t\t$txt = 'Mon 23';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_SHORTDATE4:\n\t\t\t\t\t\t$txt = '88';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_CUSTOM:\n\t\t\t\t\t\t$txt = date($this->scale->day->iLabelFormStr, strtotime('2003-12-20 18:00'));\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DAYSTYLE_ONELETTER:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$txt = 'M';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$fw = $this->scale->day->GetStrWidth($this->img, $txt) + 6;\n\t\t\t}\n\n\t\t\t// If we have hours enabled we must make sure that each day has enough\n\t\t\t// space to fit the number of hours to be displayed.\n\t\t\tif ($this->scale->IsDisplayHour()) {\n\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t// of space. We therefore create a typical string for the choosen format\n\t\t\t\t// and determine the length of that string.\n\t\t\t\tswitch ($this->scale->hour->iStyle) {\n\t\t\t\t\tcase HOURSTYLE_HMAMPM:\n\t\t\t\t\t\t$txt = '12:00pm';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_H24:\n\t\t\t\t\t\t// 13\n\t\t\t\t\t\t$txt = '24';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_HAMPM:\n\t\t\t\t\t\t$txt = '12pm';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_CUSTOM:\n\t\t\t\t\t\t$txt = date($this->scale->hour->iLabelFormStr, strtotime('2003-12-20 18:00'));\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOURSTYLE_HM24:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$txt = '24:00';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$hfw = $this->scale->hour->GetStrWidth($this->img, $txt) + 6;\n\t\t\t\t$mw = $hfw;\n\t\t\t\tif ($this->scale->IsDisplayMinute()) {\n\t\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t\t// of space. We therefore create a typical string for the choosen format\n\t\t\t\t\t// and determine the length of that string.\n\t\t\t\t\tswitch ($this->scale->minute->iStyle) {\n\t\t\t\t\t\tcase HOURSTYLE_CUSTOM:\n\t\t\t\t\t\t\t$txt2 = date($this->scale->minute->iLabelFormStr, strtotime('2005-05-15 18:55'));\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase MINUTESTYLE_MM:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$txt2 = '15';\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$mfw = $this->scale->minute->GetStrWidth($this->img, $txt2) + 6;\n\t\t\t\t\t$n2 = ceil(60 / $this->scale->minute->GetIntervall());\n\t\t\t\t\t$mw = $n2 * $mfw;\n\t\t\t\t}\n\t\t\t\t$hfw = $hfw < $mw ? $mw : $hfw;\n\t\t\t\t$n = ceil(24 * 60 / $this->scale->TimeToMinutes($this->scale->hour->GetIntervall()));\n\t\t\t\t$hw = $n * $hfw;\n\t\t\t\t$fw = $fw < $hw ? $hw : $fw;\n\t\t\t}\n\n\t\t\t// We need to repeat this code block here as well.\n\t\t\t// THIS iS NOT A MISTAKE !\n\t\t\t// We really need it since we need to adjust for minutes both in the case\n\t\t\t// where hour scale is shown and when it is not shown.\n\n\t\t\tif ($this->scale->IsDisplayMinute()) {\n\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t// of space. We therefore create a typical string for the choosen format\n\t\t\t\t// and determine the length of that string.\n\t\t\t\tswitch ($this->scale->minute->iStyle) {\n\t\t\t\t\tcase HOURSTYLE_CUSTOM:\n\t\t\t\t\t\t$txt = date($this->scale->minute->iLabelFormStr, strtotime('2005-05-15 18:55'));\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MINUTESTYLE_MM:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$txt = '15';\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$mfw = $this->scale->minute->GetStrWidth($this->img, $txt) + 6;\n\t\t\t\t$n = ceil(60 / $this->scale->TimeToMinutes($this->scale->minute->GetIntervall()));\n\t\t\t\t$mw = $n * $mfw;\n\t\t\t\t$fw = $fw < $mw ? $mw : $fw;\n\t\t\t}\n\n\t\t\t// If we display week we must make sure that 7*$fw is enough\n\t\t\t// to fit up to 10 characters of the week font (if the week is enabled)\n\t\t\tif ($this->scale->IsDisplayWeek()) {\n\t\t\t\t// Depending on what format the user has choose we need different amount\n\t\t\t\t// of space\n\t\t\t\t$fsw = strlen($this->scale->week->iLabelFormStr);\n\t\t\t\tif ($this->scale->week->iStyle == WEEKSTYLE_FIRSTDAY2WNBR) {\n\t\t\t\t\t$fsw += 8;\n\t\t\t\t} elseif ($this->scale->week->iStyle == WEEKSTYLE_FIRSTDAYWNBR) {\n\t\t\t\t\t$fsw += 7;\n\t\t\t\t} else {\n\t\t\t\t\t$fsw += 4;\n\t\t\t\t}\n\n\t\t\t\t$ww = $fsw * $this->scale->week->GetFontWidth($this->img);\n\t\t\t\tif (7 * $fw < $ww) {\n\t\t\t\t\t$fw = ceil($ww / 7);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$this->scale->IsDisplayDay() && !$this->scale->IsDisplayHour() &&\n\t\t\t\t!(($this->scale->week->iStyle == WEEKSTYLE_FIRSTDAYWNBR ||\n\t\t\t\t\t$this->scale->week->iStyle == WEEKSTYLE_FIRSTDAY2WNBR) && $this->scale->IsDisplayWeek())) {\n\t\t\t\t// If we don't display the individual days we can shrink the\n\t\t\t\t// scale a little bit. This is a little bit pragmatic at the\n\t\t\t\t// moment and should be re-written to take into account\n\t\t\t\t// a) What scales exactly are shown and\n\t\t\t\t// b) what format do they use so we know how wide we need to\n\t\t\t\t// make each scale text space at minimum.\n\t\t\t\t$fw /= 2;\n\t\t\t\tif (!$this->scale->IsDisplayWeek()) {\n\t\t\t\t\t$fw /= 1.8;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$cw = $this->GetMaxActInfoColWidth();\n\t\t\t$this->scale->actinfo->SetMinColWidth($cw);\n\t\t\tif ($this->img->width <= 0) {\n\t\t\t\t// Now determine the width for the activity titles column\n\n\t\t\t\t// Firdst find out the maximum width of each object column\n\t\t\t\t$titlewidth = max(\n\t\t\t\t\tmax(\n\t\t\t\t\t\t$this->GetMaxLabelWidth(),\n\t\t\t\t\t\t$this->scale->tableTitle->GetWidth($this->img)\n\t\t\t\t\t),\n\t\t\t\t\t$this->scale->actinfo->GetWidth($this->img)\n\t\t\t\t);\n\n\t\t\t\t// Add the width of the vertivcal divider line\n\t\t\t\t$titlewidth += $this->scale->divider->iWeight * 2;\n\n\t\t\t\t// Adjust the width by the user specified zoom factor\n\t\t\t\t$fw *= $this->iZoomFactor;\n\n\t\t\t\t// Now get the total width taking\n\t\t\t\t// titlewidth, left and rigt margin, dayfont size\n\t\t\t\t// into account\n\t\t\t\t$width = $titlewidth + $nd * $fw + $lm + $rm;\n\t\t\t} else {\n\t\t\t\t$width = $this->img->width;\n\t\t\t}\n\n\t\t\t$width = round($width);\n\t\t\t$height = round($height);\n\t\t\t// Make a sanity check on image size\n\t\t\tif ($width > MAX_GANTTIMG_SIZE_W || $height > MAX_GANTTIMG_SIZE_H) {\n\t\t\t\tUtil\\JpGraphError::RaiseL(6007, $width, $height);\n\t\t\t\t//(\"Sanity check for automatic Gantt chart size failed. Either the width (=$width) or height (=$height) is larger than MAX_GANTTIMG_SIZE. This could potentially be caused by a wrong date in one of the activities.\");\n\t\t\t}\n\t\t\t$this->img->CreateImgCanvas($width, $height);\n\t\t\t$this->img->SetMargin($lm, $rm, $tm, $bm);\n\t\t}\n\t}",
"function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}",
"public function test_resize() {\n\t\t$file = DIR_TESTDATA . '/images/waffles.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 75,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}",
"function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }",
"public function test_resize() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\t}",
"function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}",
"public function getResize($size, $dir, $filename) {\t\n\t\t$parts = explode(\".\", $filename);\n\t\tif(count($parts > 1)) {\n\t\t\t$filename = $parts[0];\n\t\t\t$extension = $parts[1]; \n\t\t}\t\n\n\t\tif($size === \"original\") {\n\t\t\t$size = $dir . $filename .\".\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minOriginal);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxOriginal);\n\t\t\t}\n\t\t} elseif($size === \"large\") {\n\t\t\t$size = $dir . $filename .\"_l.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minLarge);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxLarge);\n\t\t\t}\n\t\t} elseif($size === \"medium\") {\t\t\t\n\t\t\t$size = $dir . $filename .\"_m.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\t$this->resize(_maxMedium, _minMedium);\n\t\t\t\n\t\t\t/*\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minMedium);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxMedium);\n\t\t\t}\n\t\t\t*/\n\t\t} elseif($size === \"small\") {\n\t\t\t$size = $dir . $filename .\"_s.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\t$this->resize(_maxSmall, _minSmall);\n\t\t\t\n\t\t\t/*\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minSmall);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxSmall);\n\t\t\t}\n\t\t\t*/\n\t\t} elseif($size === \"miniature\") {\n\t\t\t$size = $dir . $filename . \"_min.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minMini);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxMini);\n\t\t\t}\n\t\t}\n\n\t\t$this->save($size);\n\t\t\n\t\treturn $size;\n \t}",
"protected function update_size($width = \\false, $height = \\false)\n {\n }",
"private function _isResize()\n {\n if ($this->download || $this->output == 'pptx' || $this->output == 'docx') {\n return true;\n }\n return false;\n }",
"function scaleby_maxwidth($filename, $width = 500, $fillpath = true, $rnd_dir) \n\t\t{\n\t\t\treturn $this->scale($filename, $width, NULL, $fillpath, \"maxwidth\", $rnd_dir);\t\t\n\t\t}",
"function scale($inFile, $outFile, $width, $height) {\n if ($inFile == $outFile) {\n // cannot write to source file\n return FALSE;\n }\n $cmd = sprintf(\n '%s -i %s -sameq -s %dx%d %s',\n escapeshellcmd($this->encoder),\n escapeshellarg($inFile),\n escapeshellcmd($width),\n escapeshellcmd($height),\n escapeshellcmd($outFile)\n );\n $this->execCmd($cmd, $null, $info);\n }",
"public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}",
"public function setScaling($scaling = 100) {}",
"public function setScaling($scaleing) {}",
"function smart_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = \"file\", $delete_original = true, $use_linux_commands = false){\n\t\tif(($height <= 0) && ($width <= 0)){\n\t\t\treturn(false);\n\t\t}\n\t\t$info = getimagesize($file); // Paramètres par défaut de l'image\n\t\t$image = \"\";\n\t\t$final_width = 0;\n\t\t$final_height = 0;\n\t\tlist($width_old,$height_old) = $info;\n\t\t$trop_petite = false;\n\t\tif(($height > 0) && ($height > $height_old)){\n\t\t\t$trop_petite = true;\n\t\t}\n\t\tif(($width > 0) && ( $width > $width_old)){\n\t\t\t$trop_petite = true;\n\t\t}else{\n\t\t\t$trop_petite = false;\n\t\t}\n\t\tif($trop_petite){\n\t\t\treturn(false);\n\t\t}\n\t\tif($proportional){ // Calculer la proportionnalité\n\t\t\tif($width == 0){\n\t\t\t\t$factor = $height / $height_old;\n\t\t\t}elseif($height == 0){\n\t\t\t\t$factor = $width / $width_old;\n\t\t\t}else{\n\t\t\t\t$factor = min($width / $width_old,$height / $height_old);\n\t\t\t}\n\t\t\t$final_width = round($width_old * $factor);\n\t\t\t$final_height = round($height_old * $factor);\n\t\t}else{\n\t\t\t$final_width = ($width <= 0) ? $width_old : $width;\n\t\t\t$final_height = ($height <= 0) ? $height_old : $height;\n\t\t}\n\t\tswitch($info[2]){ // Charger l'image en mémoire en fonction du format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\t$image = imagecreatefromgif($file); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\t$image = imagecreatefromjpeg($file); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\t$image = imagecreatefrompng($file); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\t$image_resized = imagecreatetruecolor($final_width, $final_height); // Transparence pour les gif et les png\n\t\tif(($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)){\n\t\t\t$transparency = imagecolortransparent($image);\n\t\t\tif($transparency >= 0){\n\t\t\t\t$transparent_color = imagecolorsforindex($image,$trnprt_indx);\n\t\t\t\t$transparency = imagecolorallocate($image_resized,$trnprt_color[\"red\"],$trnprt_color[\"green\"],$trnprt_color[\"blue\"]);\n\t\t\t\timagefill($image_resized,0,0,$transparency);\n\t\t\t\timagecolortransparent($image_resized,$transparency);\n\t\t\t}elseif($info[2] == IMAGETYPE_PNG){\n\t\t\t\timagealphablending($image_resized,false);\n\t\t\t\t$color = imagecolorallocatealpha($image_resized,0,0,0,127);\n\t\t\t\timagefill($image_resized,0,0,$color);\n\t\t\t\timagesavealpha($image_resized,true);\n\t\t\t}\n\t\t}\n\t\timagecopyresampled($image_resized,$image,0,0,0,0,$final_width,$final_height,$width_old,$height_old);\n\t\tif($delete_original){ // Suppression de l'image d'origine éventuelle\n\t\t\tif($use_linux_commands){\n\t\t\t\texec(\"rm \".$file);\n\t\t\t}else{\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\t\tswitch(strtolower($output)){\n\t\t\tcase \"browser\": // Envoyer l'image par http avec son type MIME\n\t\t\t\t$mime = image_type_to_mime_type($info[2]); header(\"Content-type: $mime\"); $output = NULL; break;\n\t\t\tcase \"file\": // Ecraser l'image donnée (cas défaut)\n\t\t\t\t$output = $file; break;\n\t\t\tcase \"return\": // Retourner les infos de l'image redimensionnée en conservant celles de l'image d'origine\n\t\t\t\treturn($image_resized); break;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch($info[2]){ // Retourner l'image redimensionnée en fonction de son format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\timagegif($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\timagejpeg($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\timagepng($image_resized,$output); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\treturn(true);\n\t}",
"public function resize( $size, $to = null, $prefix = '', $file_index = null ) {\r\n\t\t\t$this->thumb( $size, '', $prefix, true, $to, false, $file_index );\r\n\t\t}",
"private function __setOptimalSizeByAuto() {\n \n if ($this->__originalImageHeight < $this->__originalImageWidth) {\n $this->__setOptimalSizeByLandscape();\n }\n \n if ($this->__originalImageHeight > $this->__originalImageWidth) {\n $this->__setOptimalSizeByPortrait();\n }\n \n if ($this->__requestedHeight < $this->__requestedWidth) {\n $this->__setOptimalSizeByLandscape();\n }\n \n if ($this->__requestedHeight > $this->__requestedWidth) {\n $this->__setOptimalSizeByPortrait();\n }\n \n if (empty($this->__optimalHeight) && empty($this->__optimalWidth)) {\n $this->__optimalWidth = $this->__requestedWidth;\n $this->__optimalHeight = $this->__requestedHeight;\n }\n \n }",
"function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}",
"function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}",
"public function resize($width, $height = NULL, $resizeMode = NULL)\n {\n if(!$height)\n {\n $height = $width;\n }\n\n $this->effect[] = new Resize($width, $height, $resizeMode);\n }",
"function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }",
"function media_upload_max_image_resize()\n {\n }",
"function resize($new_x = 0, $new_y = 0)\r\n {\r\n // 0 means keep original size\r\n $new_x = (0 == $new_x) ? $this->img_x : $this->_parse_size($new_x, $this->img_x);\r\n $new_y = (0 == $new_y) ? $this->img_y : $this->_parse_size($new_y, $this->img_y);\r\n // Now do the library specific resizing.\r\n return $this->_resize($new_x, $new_y);\r\n }",
"public function runStretchResize(Image $image, int $width, int $height) : Image\n\t{\n\t\treturn $image->resize($width, $height);\n\t}",
"public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }",
"public function getResize()\n {\n $ratio = 1.0;\n $image = Input::get('img');\n $dir = Input::get('dir');\n\n $original_width = Image::make(base_path() . \"/\" . Config::get('lfm.images_dir') . $dir . \"/\" . $image)->width();\n $original_height = Image::make(base_path() . \"/\" . Config::get('lfm.images_dir') . $dir . \"/\" . $image)->height();\n\n $scaled = false;\n\n if ($original_width > 600)\n {\n $ratio = 600 / $original_width;\n $width = $original_width * $ratio;\n $height = $original_height * $ratio;\n $scaled = true;\n } else\n {\n $height = $original_height;\n $width = $original_width;\n }\n\n if ($height > 400)\n {\n $ratio = 400 / $original_height;\n $width = $original_width * $ratio;\n $height = $original_height * $ratio;\n $scaled = true;\n }\n\n return View::make('laravel-filemanager::resize')\n ->with('img', Config::get('lfm.images_url') . $dir . \"/\" . $image)\n ->with('dir', $dir)\n ->with('image', $image)\n ->with('height', number_format($height, 0))\n ->with('width', $width)\n ->with('original_height', $original_height)\n ->with('original_width', $original_width)\n ->with('scaled', $scaled)\n ->with('ratio', $ratio);\n }",
"public function resize($width, $height)\n\t{\n\t\t$wScale = $this->width / $width;\n\t\t$hScale = $this->height / $height;\n\t\t$maxScale = max($wScale, $hScale);\n\t\t// Decrease image dimensions\n\t\tif($maxScale > 1)\n\t\t{\n\t\t\t$width = $this->width / $maxScale;\n\t\t\t$height = $this->height / $maxScale;\n\t\t}\n\t\t// Increase image dimensions\n\t\telse\n\t\t{\n\t\t\t$minScale = min($wScale, $hScale);\n\t\t\t$width = $this->width / $minScale;\n\t\t\t$height = $this->height / $minScale;\n\t\t}\n\t\t$image = imagecreatetruecolor($this->width, $this->height);\n\t\timagecopyresampled($image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height);\n\n\t\t$this->image = $image;\n\t\t$this->width = $width;\n\t\t$this->height = $height;\n\t}",
"function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }"
] | [
"0.71044135",
"0.7013781",
"0.6791672",
"0.6779624",
"0.6640509",
"0.64300925",
"0.6331725",
"0.62811965",
"0.6259849",
"0.62117106",
"0.62046397",
"0.62046397",
"0.6204098",
"0.6160525",
"0.6155931",
"0.60877806",
"0.60513276",
"0.6006957",
"0.59886986",
"0.5983413",
"0.5970911",
"0.59447163",
"0.59385514",
"0.59288985",
"0.59130996",
"0.59127754",
"0.5904241",
"0.58811176",
"0.5866164",
"0.58375543",
"0.5835038",
"0.5831338",
"0.5818731",
"0.58126855",
"0.5794177",
"0.5757976",
"0.5742454",
"0.5730496",
"0.57075566",
"0.57036847",
"0.5703611",
"0.57033676",
"0.56999135",
"0.5680824",
"0.5677797",
"0.5671369",
"0.5655701",
"0.5651315",
"0.564701",
"0.5640796",
"0.5640591",
"0.5621536",
"0.5616882",
"0.56067926",
"0.55794823",
"0.55599356",
"0.5557811",
"0.55456686",
"0.5536787",
"0.55367446",
"0.5525753",
"0.551011",
"0.5496106",
"0.5495813",
"0.5495503",
"0.54918593",
"0.54879427",
"0.5474178",
"0.54661083",
"0.5457528",
"0.5455703",
"0.5452903",
"0.5442622",
"0.5440325",
"0.5437994",
"0.54359853",
"0.5433125",
"0.542889",
"0.5415035",
"0.54110163",
"0.53836495",
"0.5379092",
"0.53785366",
"0.5375285",
"0.53720707",
"0.5363005",
"0.53602546",
"0.53558975",
"0.5355226",
"0.5353757",
"0.53491324",
"0.5342149",
"0.5337311",
"0.5335667",
"0.5335031",
"0.533433",
"0.5331763",
"0.5322218",
"0.532037",
"0.53188455",
"0.5316431"
] | 0.0 | -1 |
Look up file location. | public function lookup($attachmentId)
{
$this->attachmentId = $attachmentId;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFoundPath() {}",
"public function getFileLocation()\n {\n return $this->fileLocation;\n }",
"public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$config[\"log\"][\"file\"] : __DIR__.\"/app.log\";\n }",
"public function myFileLocation()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return dirname($reflection->getFileName());\r\n }",
"public static function getLookupPath() {\n return self::$lookup_path;\n }",
"public function getFileLocation() {\n $file_location = false;\n if (isset($this->_file_location)) {\n $file_location = $this->_file_location;\n }\n\n return $file_location;\n }",
"protected function _locateFile ($base) {\n $filename = null;\n if (substr ($base, 0, 1) != '/') {\n\n # Relative file name supplied. Traverse the directory\n # tree from current directory up to disk root while looking for\n # configuration file in each step\n $arr = explode ('/', __DIR__);\n for ($i = count ($arr); $i > 0; $i--) {\n\n # Construct absolute directory name from root to ith directory\n # component\n $dir = implode ('/', array_slice ($arr, 0, $i));\n\n # Does configuration file reside in directory $dir?\n if (file_exists (\"$dir/$base\")) {\n # Yes, stop search\n $filename = \"$dir/$base\";\n break;\n }\n }\n\n } else {\n\n # Absolute pathname supplied so return the argument as is\n $filename = $base;\n\n }\n return $filename;\n }",
"public function getLocalConfigurationFileLocation() {}",
"abstract public function getLocalPath(File $file);",
"function getLocalFilePath($fileName) {\n return PATHS[$fileName];\n}",
"public static function locate_file_url($filename) {\r\n //$path = '/tpl/' . $dir . '/' . $file;\r\n $located = FALSE;\r\n if (file_exists(get_stylesheet_directory() . '/' . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_template_directory() . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_stylesheet_directory() . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_template_directory() . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_stylesheet_directory() . '/' . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(get_template_directory() . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(STYLESHEETPATH . '/' . $filename)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(TEMPLATEPATH . '/' . $filename)):\r\n $file = get_template_directory_uri() . '/' . $filename;\r\n return $located = true;\r\n elseif (file_exists(CWP_URL . '/' . $filename)):\r\n $file = CWP_URL . '/' . $filename;\r\n return $file;\r\n endif;\r\n if (!$located):\r\n return false;\r\n else :\r\n return $file;\r\n endif;\r\n }",
"public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}",
"public function getLocalPath();",
"public function get_human_readable_file_location($file)\n {\n }",
"public function getLocation() {\n\t\tif(isset($this->data['mdid'])) {\n\t\t\treturn $this->data['md_folder'] . $this->data['md_filename'];\n\t\t}\n\t\treturn ;\n\t}",
"abstract public function directoryLocation();",
"public function getFileUploadLocation()\n {\n $config = $this->getServiceLocator()->get('config');\n return $config['module_config']['upload_location'];\n }",
"public function locate();",
"public function find($file);",
"protected static function find_file_custom($file)\n\t{\n\t\tif (file_exists($file))\n\t\t{\n\t\t\treturn $file;\n\t\t}\n\n\t\t$uri = THEMEPATH . $file;\n\t\tif (file_exists($uri))\n\t\t{\n\t\t\treturn $uri;\n\t\t}\n\n\t\t$uri = APPPATH . $file;\n\t\tif (file_exists($uri))\n\t\t{\n\t\t\treturn $uri;\n\t\t}\n\n\t\t$modules = Kohana::modules();\n\t\tforeach ($modules as $module)\n\t\t{\n\t\t\t$uri = $module . $file;\n\t\t\tif (file_exists($uri))\n\t\t\t{\n\t\t\t\treturn $uri;\n\t\t\t}\n\t\t}\n\n\t\t$uri = SYSPATH . $file;\n\t\tif (file_exists($uri))\n\t\t{\n\t\t\treturn $uri;\n\t\t}\n\n\t\tthrow new Gleez_Exception('Unable to locate file `:file`. No file exists with the specified file name.', array(\n\t\t\t':file' => $file\n\t\t));\n\t}",
"function pullFile($hash,$location);",
"function abp01_wrapper_locate_file_from_uri($requestUriPath) {\n if (!empty($requestUriPath)) {\n return ABSPATH . $requestUriPath;\n } else {\n return null;\n }\n}",
"public function getFilepath();",
"public function getFullPath();",
"protected function get_file() {\n\n\t\treturn __FILE__;\n\t}",
"public function getFileAbsolutePath($file);",
"function getAbsolutePath() ;",
"public static function fileReadingLocation()\n {\n return '/app/public/excels/';\n }",
"public function locate($file, $first = true);",
"public function filePath($file) {\r\n $file = $this->fileLoad($file);\r\n return drupal_realpath($file->uri);\r\n }",
"public function getAbsolutePath() {}",
"public function getAbsolutePath() {}",
"public function getFilePath();",
"public function getFilePath();",
"public function getFilePath();",
"public function getFilePath();",
"public function getPathLocation(): string;",
"public function get_file() {\n\t\treturn __FILE__;\n\t}",
"public static function file() {\r\n\t\treturn __FILE__;\r\n\t}",
"function getTargetFile() ;",
"public function getAbsolutePath();",
"public function getLocation($getAbsoluteLocation = true)\n {\n $fileLocation = strtolower(str_replace(['App\\\\', '\\\\'], ['', '_'], $this->object_type)) . \"/\" . directoryLogicSeparator($this->object_id) . \"/\" . $this->object_id;\n\n if ($getAbsoluteLocation) {\n // get source path from configs\n $attachmentBaseLocation = config('app.api.attachmentBaseLocation');\n return $attachmentBaseLocation . \"/\" . $fileLocation;\n }\n return $fileLocation;\n }",
"public static function location()\n\t{\n\t\tstatic $location;\n\n\t\tif($location === null)\n\t\t{\n\t\t\t$location = Config::get('mako.asset_location');\n\t\t}\n\n\t\treturn $location;\n\t}",
"function getServerFilePath($fileName) {\n return $_SERVER['DOCUMENT_ROOT'].PATHS[$fileName];\n}",
"function acf_get_external_path($file, $path = '')\n{\n}",
"protected function getCurrentAbsolutePath() {\n\t\treturn dirname(SS_ClassLoader::instance()->getManifest()->getItemPath(get_class($this)));\n\t}",
"protected abstract function getAbsolutePath(): string;",
"public function getFullPath(): string;",
"public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}",
"public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}",
"private static function findEnvFile() {\n\n // Loop through array of possible environment file paths.\n foreach( LoadEnvironment::$envFilePaths as $filePath ){\n\n // If an environment file is found, return the path.\n if ( file_exists($filePath) ) {\n return $filePath;\n }\n }\n }",
"public function getFilepath() {\n\t\treturn RuntimeDirectoryManager::getDocumentRoot().$this->filename;\n\t}",
"function findFile($type, $file)\n {\n // get the set of paths\n $set = $this->getPath($type);\n \n // start looping through them\n foreach ($set as $path) {\n $fullname = $path . $file;\n if (file_exists($fullname) && is_readable($fullname)) {\n return $fullname;\n }\n }\n \n // could not find the file in the set of paths\n return false;\n }",
"abstract public function getCurrentPath();",
"function tfuse_get_file_uri($file) {\r\n $file = ltrim($file, '/');\r\n if (file_exists(STYLESHEETPATH . '/' . $file))\r\n return get_stylesheet_directory_uri() . '/' . $file;\r\n else if (file_exists(get_template_directory() . '/' . $file))\r\n return get_template_directory_uri() . '/' . $file;\r\n else\r\n return $file;\r\n }",
"public function get_file_path($file = '')\n {\n }",
"public function path();",
"public function getCurrentFile() {}",
"private function getArticleFile()\r\n {\r\n //check for file in project in current locale\r\n $file = $this->articlePath($this->_helper->getLang(), true);\r\n if(file_exists($file)){\r\n return $file;\r\n }\r\n\r\n //check for file in project for default locale\r\n $file = $this->articlePath(self::DEFAULT_LOCALE, true);\r\n if(file_exists($file)){\r\n return $file;\r\n }\r\n\r\n //check for file in default location in current locale\r\n $file = $this->articlePath($this->_helper->getLang(), false);\r\n if(file_exists($file)){\r\n return $file;\r\n }\r\n\r\n //check for file in default location for default locale\r\n $file = $this->articlePath(self::DEFAULT_LOCALE, false);\r\n if(file_exists($file)){\r\n return $file;\r\n }\r\n\r\n return null;\r\n }",
"private function getFilePath() {\n\t\treturn $this->options['path'].'/'.md5($this->options['revision']).'/'.$this->path;\n\t}",
"public function getFileUrl()\n {\n\n return get_bloginfo('url') . \"/\" . $this->getFileName();\n\n }",
"public function PathAndUri(){\n\n $evald_path = $this->getPath();\n\n if( $evald_path ){\n\n $import_dirs = array();\n\n if( Less_Environment::isPathRelative($evald_path) ){\n //if the path is relative, the file should be in the current directory\n $import_dirs[ $this->currentFileInfo['currentDirectory'] ] = $this->currentFileInfo['uri_root'];\n\n }else{\n //otherwise, the file should be relative to the server root\n $import_dirs[ $this->currentFileInfo['entryPath'] ] = $this->currentFileInfo['entryUri'];\n\n //if the user supplied entryPath isn't the actual root\n $import_dirs[ $_SERVER['DOCUMENT_ROOT'] ] = '';\n\n }\n\n // always look in user supplied import directories\n $import_dirs = array_merge( $import_dirs, Less_Parser::$options['import_dirs'] );\n\n\n foreach( $import_dirs as $rootpath => $rooturi){\n if( is_callable($rooturi) ){\n list($path, $uri) = call_user_func($rooturi, $evald_path);\n if( is_string($path) ){\n $full_path = $path;\n return array( $full_path, $uri );\n }\n }else{\n $path = rtrim($rootpath,'/\\\\').'/'.ltrim($evald_path,'/\\\\');\n\n if( file_exists($path) ){\n $full_path = Less_Environment::normalizePath($path);\n $uri = Less_Environment::normalizePath(dirname($rooturi.$evald_path));\n return array( $full_path, $uri );\n }\n }\n }\n }\n }",
"public function getAbsolutePath()\n {\n }",
"public function filePath();",
"protected function get_path()\n {\n $path_found = false;\n $found_path = null;\n foreach ($this->get_paths() as $path) {\n if ($path_found) {\n continue;\n }\n $path = wp_normalize_path($path);\n if (file_exists($path)) {\n $path_found = true;\n $found_path = $path;\n }\n }\n\n return $found_path;\n\n }",
"public function getFilePath() {\n\t\t$path = SPREADSHEET_FILES_DIR . \"/\" . $this->file_name;\n\t\tif (file_exists($path)) {\n\t\t\treturn $path;\n\t\t}\n\t}",
"public static function getFilePath()\n {\n $path = dirname(__FILE__) . \"/i18n.xml\";\n if(file_exists($path)) {\n return $path;\n }\n \n $path = '@data_dir@/Ilib_Countries/Ilib/Countries/i18n.xml';\n if(file_exists($path)) {\n return $path;\n }\n \n throw new Exception('Unable to locate data file');\n }",
"function getCodeFile()\r\n\t{\r\n\t\t$haveServer= isset( $_SERVER );\r\n\t\tif ($haveServer && array_key_exists( \"PATH_TRANSLATED\", $_SERVER ) ) {\r\n\t\t\t$codefile = $_SERVER[\"PATH_TRANSLATED\"];\r\n\t\t}\r\n\t\telse if ( $haveServer && array_key_exists( \"ORIG_PATH_TRANSLATED\", $_SERVER ) ) {\r\n\t\t\t$codefile = $_SERVER[\"ORIG_PATH_TRANSLATED\"];\r\n\t\t}\r\n\t\telse if ( $haveServer && array_key_exists( \"SCRIPT_FILENAME\", $_SERVER ) ) {\r\n\t\t\t$codefile = $_SERVER[\"SCRIPT_FILENAME\"];\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$codefile = getcwd() . \"/\" . $_SERVER[ \"argv\" ][0];\r\n\t\t}\r\n\t\treturn( $codefile );\r\n\t}",
"public function getFile_path() {\n return $this->_file_path ? $this->_file_path : null;\n }",
"public function getAdditionalConfigurationFileLocation() {}",
"public function getFilePath()\n {\n if (array_key_exists(\"filePath\", $this->_propDict)) {\n return $this->_propDict[\"filePath\"];\n } else {\n return null;\n }\n }",
"protected static function find_file($file) {\n\t\t// use kohana filesystem to find file with the assets directories\n\t\t$localFile = Kohana::find_file(Kohana::$config->load(self::CONFIG)->get('assets_dir', 'assets'), $file, false);\n\t\t\n\t\t// File Exists?\n\t\tif( file_exists($localFile) ){\n\t\t\treturn $localFile;\n\t\t}\n\t\treturn null;\n\t}",
"public function getPath(): string {\n $meta_data = stream_get_meta_data($this->file);\n return $meta_data[\"uri\"];\n }",
"public function getAdditionalSearchPath() {}",
"protected function getFileLocatorService()\n {\n return $this->services['file_locator'] = new \\phpbb\\routing\\file_locator(${($_ = isset($this->services['filesystem']) ? $this->services['filesystem'] : ($this->services['filesystem'] = new \\phpbb\\filesystem\\filesystem())) && false ?: '_'}, './../');\n }",
"function findFile($href,$sites){\n $href = str_replace(\"http://\",'',$_GET['href']);\n $href = explode(\"/\",$href);\n array_unshift($href,\"http:/\");\n $address = '';\n $folder = '';\n\n for ($i=0,$l=count($href);$i<$l;$i++){\n $address .= $href[$i] .\"/\";\n if (isset($sites->{$address})){\n $folder= $sites->{$address};\n break;\n }\n }\n if (!$folder) return false;\n \n $location = $folder .str_replace($address,\"\",$_GET['href']);\n \n return $location;\n}",
"protected function getFactoryConfigurationFileLocation() {}",
"public function getFilepath()\n {\n return $this->filepath;\n }",
"public function lookup($src) {}",
"public function lookup($src) {}",
"public function getCanonicalLocation(): string;",
"abstract protected function getFileWithPath();",
"private function getImageSourcePath()\r\n {\r\n // check if relative\r\n if(substr($this->_imagesource, 0, 2) == \"..\" || $this->_imagesource{0} == \".\")\r\n {\r\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $this->_imagesource;\r\n }\r\n else\r\n {\r\n return $this->_imagesource;\r\n }\r\n }",
"public function getDataLocation() : string\n {\n return \"s3://\" . $this->getBucketName() . \"/\" . $this->getFilepath();\n }",
"public function __toString()\n {\n return $this->getFileLocation();\n }",
"public function locate($type, $filename, $return = 'relative')\n {\n // otherwise returns array of attempted locations.\n // Specify empty filename to find location.\n\n // Imants: dirty fix for finding files with complex namespaces like\n // Vendor\\MyAddon otherwise these are not found on *Nix systems\n\n $filename = str_replace('\\\\', '/', $filename);\n\n $attempted_locations = array();\n $locations = array();\n $location = null;\n\n // first - look if type is explicitly defined in\n if (isset($this->contents[$type])) {\n if (is_array($this->contents[$type])) {\n $locations = $this->contents[$type];\n } else {\n $locations = array($this->contents[$type]);\n }\n // next - look if locations claims to have all resource types\n } elseif (isset($this->contents['all'])) {\n $locations = array($type);\n echo (string) $this;\n }\n\n foreach ($locations as $path) {\n $pathfile = $path.'/'.$filename;\n\n // If this location represents CDN, it always finds URl files\n if ($this->is_cdn && $return == 'url') {\n return $this->getURL($pathfile);\n }\n\n $f = $this->getPath($pathfile);\n\n if (file_exists($f)) {\n if (!is_readable($f)) {\n throw $this->exception('File found but it is not readable')\n ->addMoreInfo('type', $type)\n ->addMoreInfo('filename', $filename)\n ->addMoreInfo('f', $f)\n ;\n }\n\n if ($return == 'array') {\n return array(\n 'name' => $filename,\n 'relative' => $pathfile,\n 'url' => $this->base_url ? $this->getURL($pathfile) : null,\n 'path' => $f,\n 'location' => $this,\n );\n }\n if ($return == 'location') {\n return $this;\n }\n if ($return == 'relative') {\n return $pathfile;\n }\n if ($return == 'url') {\n return $this->getURL($pathfile);\n }\n if ($return == 'path') {\n return $f;\n }\n\n throw $this->exception('Wrong return type for locate()');\n } else {\n $attempted_locations[] = $f;\n }\n }\n\n return $attempted_locations;\n }",
"abstract public function getLocalPathByFileHandle($handle);",
"public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}",
"public function findFile(): string\n {\n if (file_exists(self::VALUE_1)) {\n return self::VALUE_1;\n }\n if (file_exists(self::VALUE_2)) {\n return self::VALUE_2;\n }\n throw new \\RuntimeException('No deeployer config file was found.');\n }",
"function getActualFile(){\n\t\treturn $this->xmldir;\n\t}",
"private function _getPathInfo ($file)\n {\n return pathinfo($file);\n }",
"function fn_find_file($prefix, $file, $company_id = null)\n{\n $file = Bootstrap::stripSlashes($file);\n\n // Url\n if (strpos($file, '://') !== false) {\n return $file;\n }\n\n $prefix = fn_normalize_path(rtrim($prefix, '/'));\n $file = fn_normalize_path($file);\n $files_path = fn_get_files_dir_path($company_id);\n\n // Absolute path\n if (is_file($file) && strpos($file, $files_path) === 0) {\n return $file;\n }\n\n // Path is relative to files directory\n if (is_file($files_path . $file)) {\n return $files_path . $file;\n }\n\n // Path is relative to prefix inside files directory\n if (is_file($files_path . $prefix . '/' . $file)) {\n return $files_path . $prefix . '/' . $file;\n }\n\n // Prefix is absolute path\n if (strpos($prefix, $files_path) === 0 && is_file($prefix . '/' . $file)) {\n return $prefix . '/' . $file;\n }\n\n return false;\n}",
"protected function getTemplatePathAndFilename() {}",
"public static function location()\r\n {\r\n $logDir = Mage::getBaseDir('var') . DIRECTORY_SEPARATOR . 'log';\r\n $logFile = $logDir . DIRECTORY_SEPARATOR . self::DEFAULT_FILE;\r\n\r\n return $logFile;\r\n }",
"public static function find_file($rel_filename){\n if (isset(self::$_abs_file_paths[$rel_filename])) {\n $candidate = self::$_abs_file_paths[$rel_filename];\n if ( ! is_null(self::$_path_cache_file) && ! file_exists($candidate)) {\n unset(self::$_abs_file_paths[$rel_filename]);\n self::$_cache_invalid = TRUE;\n } else {\n return $candidate;\n }\n }\n \n foreach (self::$_roots as $root_path) {\n $candidate = $root_path . $rel_filename;\n if (file_exists($candidate)) {\n self::$_cache_invalid = TRUE;\n self::$_abs_file_paths[$rel_filename] = $candidate;\n return $candidate;\n }\n }\n return FALSE;\n }",
"public function getPathToFile(): string;",
"public function getFile($path = '/'){\n\t\t$path = preg_replace($this->__config['pb.regexp.path'], '', $path);\n\n\t\tif ($path) $file = $this->__config['pb.contents.dir'].$path;\n\t\telse $file = $this->__config['pb.contents.dir'].'index';\n\t\t\n\t\tif (is_dir($file)) $file .= '/index';\n\t\t$file .= $this->__config['pb.contents.extension'];\n\n\t\tif (file_exists($file)) return $file;\n\t\treturn null;\n\t}",
"protected function getCurrentAbsolutePath() \n\t{\n\t\t$filename = self::$test_class_manifest->getItemPath(get_parent_class($this));\n\t\tif(!$filename) throw new LogicException(\"getItemPath returned null for \" . get_parent_class($this));\n\t\treturn dirname($filename);\n\t}",
"public function getFileBaseUrl()\n {\n return Mage::getBaseUrl('media').'family'.'/'.'file';\n }",
"public static function wdtFileReadingLocation()\n {\n return '/app/public/excels/wdt/';\n }",
"public function get_path()\n\t\t{\n\t\t\tif ($this->path) {\n\t\t\t\treturn $this->path.'/'.$this->get_full_name();\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$hash = $this->hash();\n\t\t\t\t} catch(\\System\\Error\\File $e) {\n\t\t\t\t\t$hash = null;\n\t\t\t\t}\n\n\t\t\t\tif ($hash) {\n\t\t\t\t\treturn $this->get_path_hashed();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}"
] | [
"0.701784",
"0.697948",
"0.692902",
"0.6897371",
"0.68053204",
"0.67642975",
"0.6665987",
"0.65930516",
"0.6541964",
"0.64895713",
"0.64368534",
"0.64029443",
"0.6396638",
"0.6319895",
"0.62819827",
"0.6268754",
"0.6216853",
"0.6209404",
"0.61944956",
"0.61857754",
"0.6182206",
"0.6171209",
"0.6168712",
"0.6165315",
"0.6156998",
"0.6146594",
"0.61379343",
"0.61204946",
"0.60969275",
"0.6080405",
"0.6069786",
"0.6069786",
"0.60648924",
"0.60648924",
"0.60648924",
"0.60648924",
"0.6059475",
"0.6017155",
"0.595358",
"0.59481966",
"0.59438807",
"0.59395486",
"0.5924004",
"0.58823025",
"0.58777213",
"0.5846946",
"0.58462805",
"0.5842398",
"0.5840763",
"0.5840763",
"0.582567",
"0.58185714",
"0.58141434",
"0.5809366",
"0.5805682",
"0.57924527",
"0.57908595",
"0.5790646",
"0.5771414",
"0.57702434",
"0.57646346",
"0.5750799",
"0.5750094",
"0.57466245",
"0.57354087",
"0.57277936",
"0.5709124",
"0.5707192",
"0.57021695",
"0.5701115",
"0.56955093",
"0.5686878",
"0.56854784",
"0.5682116",
"0.5681",
"0.56732374",
"0.56687635",
"0.56658477",
"0.5654938",
"0.5654938",
"0.5651214",
"0.565073",
"0.5647325",
"0.5645578",
"0.5642806",
"0.564244",
"0.5634561",
"0.56337893",
"0.56334275",
"0.5627498",
"0.56254596",
"0.56235003",
"0.5622733",
"0.5622409",
"0.5615559",
"0.5612629",
"0.5609151",
"0.5605022",
"0.5604129",
"0.56029",
"0.56013495"
] | 0.0 | -1 |
Chaining from lookup to scale. | public function scale($scale)
{
$this->attachmentId = $this->attachmentId.'_'.$scale;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scale() { }",
"public function getScaling() {}",
"function load_scale() {\n if (!empty($this->scaleid)) {\n $this->scale = grade_scale::fetch('id', $this->scaleid);\n $this->scale->load_items();\n }\n return $this->scale;\n }",
"public function scale($by) {}",
"public function scale()\n {\n return $this->belongsTo(Scale::class);\n }",
"private function _scale()\n\t{\n\t\t//scale down the image by 55%\n\t\t$weaponImageSize = $this->weapon->getImageGeometry();\n\t\t$this->weaponScale['w'] = $weaponImageSize['width'] * 0.55;\n\t\t$this->weaponScale['h'] = $weaponImageSize['height'] * 0.55;\n\n\t\t$this->weapon->scaleImage($this->weaponScale['w'], $this->weaponScale['h']);\n\n\t\t//scale down the image by 30%\n\t\t$emblemImageSize = $this->emblem->getImageGeometry();\n\t\t$this->emblemScale['w'] = $emblemImageSize['width'] * 0.30;\n\t\t$this->emblemScale['h'] = $emblemImageSize['height'] * 0.30;\n\n\t\t$this->emblem->scaleImage($this->emblemScale['w'], $this->emblemScale['h']);\n\n\t\t//scale down the image by 70%\n\t\t$profileImageSize = $this->profile->getImageGeometry();\n\t\t$this->profileScale['w'] = $profileImageSize['width'] * 0.70;\n\t\t$this->profileScale['h'] = $profileImageSize['height'] * 0.70;\n\n\t\t$this->profile->scaleImage($this->profileScale['w'], $this->profileScale['h']);\n\t}",
"function scale($scale) {\r\n\t\t$width = $this->getWidth() * $scale/100;\r\n\t\t$height = $this->getheight() * $scale/100;\r\n\t\t$this->resize($width,$height);\r\n\t}",
"public function setScale($scale)\n {\n $this->scale = $scale;\n return $this;\n }",
"public function setScaling($scaling = 100) {}",
"protected function getLiipImagine_Filter_Loader_ScaleService()\n {\n return $this->services['liip_imagine.filter.loader.scale'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\ScaleFilterLoader();\n }",
"public function getScale()\n {\n return $this->scale;\n }",
"public function getScale()\n {\n return $this->scale;\n }",
"public function getScale()\n\t{\n\t\treturn $this->scale;\n\t}",
"public function setScaleControl()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof ScaleControl)) {\n $this->scaleControl = $args[0];\n $this->mapOptions['scaleControl'] = true;\n } elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) && is_string($args[1]))) {\n if ($this->scaleControl === null) {\n $this->scaleControl = new ScaleControl();\n }\n\n $this->scaleControl->setControlPosition($args[0]);\n $this->scaleControl->setScaleControlStyle($args[1]);\n\n $this->mapOptions['scaleControl'] = true;\n } elseif (!isset($args[0])) {\n $this->scaleControl = null;\n\n if (isset($this->mapOptions['scaleControl'])) {\n unset($this->mapOptions['scaleControl']);\n }\n } else {\n throw MapException::invalidScaleControl();\n }\n }",
"public abstract function scale(float $x = 1, float $y = 1): Shape;",
"protected function resultScale($a, $b, ?int $scale = null): int\n {\n if ($scale === null) {\n $scale = max($a->scale(), $b->scale());\n }\n\n return $scale;\n }",
"public function scale($scaleX, $scaleY) {}",
"public function scale($scaleX, $scaleY) {}",
"public function scale($scaleX, $scaleY) {}",
"public function setScale(int $scale)\n\t{\n\t\t$this->scale = $scale;\n\t\t\n\t\treturn $this;\n\t}",
"public function getScaling()\n {\n return $this->scaling;\n }",
"public function getScaling()\n {\n return $this->scaling;\n }",
"public function scale(float $scale_x = 0, float $scale_y = 0, float $scale_z = 0): EntityInterface;",
"protected function scaleImages() {}",
"public function getScales() {\n return $this->scales;\n }",
"public function setScaling($scaleing) {}",
"public function testScaleWithString()\n {\n $box = $this->box->scale('2.0');\n static::assertEquals(200, $box->getHeight());\n static::assertEquals(200, $box->getWidth());\n }",
"public function setScale($newScale)\n {\n $this->domain->setScale($newScale);\n }",
"public function scale($s_)\n\t{\n\t\t$this->setX( $this->x*$s_ );\n\t\t$this->setY( $this->y*$s_ );\n\t}",
"private function map($value, $low1, $high1, $low2, $high2) {\n // https://github.com/processing/p5.js/blob/master/src/math/calculation.js#L463\n return ($value - $low1) / ($high1 - $low1) * ($high2 - $low2) + $low2;\n }",
"public function setScale($var)\n {\n GPBUtil::checkInt32($var);\n $this->scale = $var;\n\n return $this;\n }",
"public function setScale($var)\n {\n GPBUtil::checkDouble($var);\n $this->scale = $var;\n\n return $this;\n }",
"public function getScale()\n {\n return $this->domain->getScale();\n }",
"function scale($size)\r\n {\r\n if ((strlen($size) > 1) && (substr($size,-1) == '%')) {\r\n return $this->scaleByPercentage(substr($size, 0, -1));\r\n } elseif ($size < 1) {\r\n return $this->scaleByFactor($size);\r\n } else {\r\n return $this->scaleByLength($size);\r\n }\r\n }",
"private function scaleX() : void\n\t{\n\t\t$this->domain = abs($this->rangeXLow) + abs($this->rangeXHigh);\n\n\t\t$this->scaleX = ((float)$this->sizeX / $this->domain);\n\t\t$this->originX = $this->sizeX >> 1;\n\t\t\n\t}",
"public function getScale($index) {\n if (isset($this->scales[$index])) {\n return $this->scales[$index];\n }\n\n return null;\n }",
"function scaleByFactor($size)\r\n {\r\n $new_x = round($size * $this->img_x, 0);\r\n $new_y = round($size * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }",
"public function scalePrices($product)\n {\n \n // Get the configurable Id\n $configurableId = $this->getConfigurableId($product);\n \n // Check we actually have a configurable product\n if ($configurableId > 0)\n {\n // Get the configurable product and associated base price\n // Please note the price will not be the actual configurable, price but the cheapest price from all the simple products\n $configurableProduct = Mage::getSingleton(\"catalog/Product\")->load($configurableId);\n $configurablePrice = $configurableProduct->getPrice();\n \n // Get current attribute data\n $configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();\n $configurableProductsData = array();\n \n // We need to identify the attribute name and Id\n $prodAttrName = $this->getAttributeName($configurableProduct);\n $prodAttrId = $this->getAttributeId($prodAttrName);\n \n // Get associates simple products\n $associatedProducts = $configurableProduct->getTypeInstance()->getUsedProducts();\n foreach ($associatedProducts as $prodList)\n {\n // For each associated simple product gather the data and calculate the extra fixed price\n $prodId = $prodList->getId();\n $prodAttrLabel = $prodList->getAttributeText($prodAttrName);\n $prodAttrValueIndex = $prodList[$prodAttrName];\n $prodScalePrice = $prodList['price'] - $configurablePrice;\n \n $productData = array(\n 'label' => $prodAttrLabel,\n 'attribute_id' => $prodAttrId,\n 'value_index' => $prodAttrValueIndex,\n 'pricing_value' => $prodScalePrice,\n 'is_percent' => '0'\n );\n $configurableProductsData[$prodId] = $productData;\n $configurableAttributesData[0]['values'][] = $productData;\n }\n \n $configurableProduct->setConfigurableProductsData($configurableProductsData);\n $configurableProduct->setConfigurableAttributesData($configurableAttributesData);\n $configurableProduct->setCanSaveConfigurableAttributes(true);\n Mage::log($configurableProductsData, null, 'configurableProductsData.log', true);\n Mage::log($configurableAttributesData, null, 'configurableAttributesData.log', true);\n \n try\n {\n $configurableProduct->save(); \n }\n catch (Exception $e)\n {\n $this->_debug($e->getMessage());\n }\n \n } \n }",
"public function multiply(string $multiplier): self;",
"private function compute($base){\n\t\t$amount = \n\t\t $this->getSkillPercent($this->miningSkill) *\n\t\t $this->getSkillPercent($this->astroSkill) *\n\t\t $this->getSkillPercent($this->frigateSkill) *\n\t\t $this->getSkillPercent($this->upgradeLaser)\t\t\n\t\t;\n\t\treturn $base * $amount * $this->getVentureBonus();\n\t}",
"function vitero_scale_used($viteroid, $scaleid) {\n return false;\n}",
"function bookking_scale_used($cmid, $scaleid) {\n global $DB;\n\n $return = false;\n\n // Note: scales are assigned using negative index in the grade field of the appointment (see mod/assignement/lib.php).\n $rec = $DB->get_record('bookking', array('id' => $cmid, 'scale' => -$scaleid));\n\n if (!empty($rec) && !empty($scaleid)) {\n $return = true;\n }\n\n return $return;\n}",
"public function getScaleControl()\n {\n return $this->scaleControl;\n }",
"function scaleByLength($size)\r\n {\r\n if ($this->img_x >= $this->img_y) {\r\n $new_x = $size;\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n } else {\r\n $new_y = $size;\r\n $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);\r\n }\r\n return $this->_resize($new_x, $new_y);\r\n }",
"public function zoom() {\n\t}",
"public function scale($scale)\n {\n $this->width = round($this->width * $scale);\n $this->height = round($this->height * $scale);\n\n return $this->resizeImage($this->width, $this->height, $this->imageFilter, $this->imageBlur);\n }",
"public function getProdScale()\n {\n return $this->prod_scale;\n }",
"public function __call($method, $arguments)\n {\n $arguments = array_map(function($value) {\n return is_a($value, Price::class) ? $value->base() : $value;\n }, $arguments);\n\n $result = call_user_func_array([$this->base, $method], $arguments);\n\n if(! is_a($result, Money::class)) {\n return $result;\n }\n\n $this->base = $result;\n \n $this->invalidate();\n\n return $this;\n }",
"function select() {\n\t\t// PHP doesn't allow direct use as function argument\n\t\t$args=func_get_args();\n\t\treturn call_user_func_array(array($this,'lookup'),$args);\n\t}",
"function scale_image($arg)\n\t{\n\t\t// max_width, max_height, cur_width, cur_height\n\t\t\n\t\t$ret = array(\n\t\t\t\t\t 'img_width' => $arg['cur_width'],\n\t\t\t\t\t 'img_height' => $arg['cur_height']\n\t\t\t\t\t);\n\t\t\n\t\tif ( $arg['cur_width'] > $arg['max_width'] )\n\t\t{\n\t\t\t$ret['img_width'] = $arg['max_width'];\n\t\t\t$ret['img_height'] = ceil( ( $arg['cur_height'] * ( ( $arg['max_width'] * 100 ) / $arg['cur_width'] ) ) / 100 );\n\t\t\t$arg['cur_height'] = $ret['img_height'];\n\t\t\t$arg['cur_width'] = $ret['img_width'];\n\t\t}\n\t\t\n\t\tif ( $arg['cur_height'] > $arg['max_height'] )\n\t\t{\n\t\t\t$ret['img_height'] = $arg['max_height'];\n\t\t\t$ret['img_width'] = ceil( ( $arg['cur_width'] * ( ( $arg['max_height'] * 100 ) / $arg['cur_height'] ) ) / 100 );\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}",
"public function testScaleWithInteger()\n {\n $box = $this->box->scale(2);\n static::assertEquals(200, $box->getHeight());\n static::assertEquals(200, $box->getWidth());\n }",
"public abstract function compute();",
"function length_scale($sqlen){\n global $SPLim,$SPSFac,$LPLim,$LPSFac;\n\t$LS = 1;\n\tif($sqlen < $SPLim){ \n $LS = 1 + $SPSFac * ($SPLim - $sqlen);\n }elseif($sqlen > $LPLim){\n $LS = 1 / (1 + $LPSFac * ($sqlen - $LPLim)); \n }\n\treturn $LS;\n}",
"public function resolvePrice();",
"protected abstract function map();",
"public function __get( $key )\n {\n $p = parent::__get( $key );\n if ( !is_null( $p ) ) {\n return $p;\n }\n\n switch ( $key ) {\n case 'oid':\n return $this->scale_no->value;\n break;\n case 'name':\n return $this->scale_name->value;\n break;\n case 'level':\n return $this->level_name->value;\n break;\n case 'start':\n case 't0':\n return $this->early_age->value;\n break;\n case 'end':\n case 't1':\n case 'tf':\n return $this->late_age->value;\n break;\n default:\n throw new \\DomainException( sprintf( 'Invalid property %s', $key ) );\n }\n\n return null;\n }",
"public function __invoke()\n {\n return $this->apply(func_get_args());\n }",
"function scale_get_scalings($cognitivefactoryid, $userid=null, $groupid=0, $excludemyself=false, $configdata) {\n global $CFG, $DB;\n\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, $excludemyself, 'od.');\n $orderClause = (@$configdata->ordereddisplay) ? ' ORDER BY intvalue, floatvalue ' : '' ;\n\n $sql = \"\n SELECT\n r.id,\n r.response,\n od.intvalue,\n od.floatvalue,\n od.blobvalue,\n od.userid,\n od.groupid\n FROM\n {cognitivefactory_responses} as r,\n {cognitivefactory_opdata} as od\n WHERE\n r.id = od.itemsource AND\n operatorid = 'scale' AND\n r.cognitivefactoryid = {$cognitivefactoryid} \n {$accessClause}\n {$orderClause}\n \";\n if (!$records = $DB->get_records_sql($sql)) {\n return array();\n }\n return $records;\n}",
"public function __construct()\n {\n parent::__construct();\n $this->endpoint = 'scales';\n $this->init();\n }",
"public function apply();",
"public function apply();",
"function compute($name, $from, $to);",
"function scaleByPercentage($size)\r\n {\r\n return $this->scaleByFactor($size / 100);\r\n }",
"function distance_lookup($c1,$c2,$distance_table){\n //TODO make this return infinite if there's nothing in the table\n return $distance_table[$c1][$c2]['duration']['value'];\n}",
"public function testScaleWithFloat()\n {\n $box = $this->box->scale(2.0);\n static::assertEquals(200, $box->getHeight());\n static::assertEquals(200, $box->getWidth());\n }",
"public function multiply($value);",
"public function stats($scale = 1024)\n {\n return $this->db()->command_safe(array(\n 'collStats' => $this->name,\n 'scale' => $scale\n ));\n }",
"public function convertToScale(float $degrees, self $scale): float\n {\n // Converting from current scale to given via Celsius\n return $scale->convertFromCelsius($this->convertToCelsius($degrees));\n }",
"function resize_scale($scale){\n\n $width = $this->get_width() * $scale / 100;\n $height = $this->get_height() * $scale / 100;\n $this->resize($width, $height);\n\n return true;\n }",
"public function apply($value);",
"public function multiply($value, ?int $scale = null)\n {\n $decimal = static::create($value);\n if ($scale === null) {\n $scale = $this->scale() + $decimal->scale();\n }\n\n return new static(bcmul($this, $decimal, $scale));\n }",
"public function apply() {}",
"public function select() {\n\t\t// PHP doesn't allow direct use as function argument\n\t\t$_args=func_get_args();\n\t\treturn call_user_func_array(array($this,'lookup'),$_args);\n\t}",
"public function setCertificateValidityPeriodScale($val)\n {\n $this->_propDict[\"certificateValidityPeriodScale\"] = $val;\n return $this;\n }",
"public function getCertificateValidityPeriodScale()\n {\n if (array_key_exists(\"certificateValidityPeriodScale\", $this->_propDict)) {\n if (is_a($this->_propDict[\"certificateValidityPeriodScale\"], \"\\Beta\\Microsoft\\Graph\\Model\\CertificateValidityPeriodScale\") || is_null($this->_propDict[\"certificateValidityPeriodScale\"])) {\n return $this->_propDict[\"certificateValidityPeriodScale\"];\n } else {\n $this->_propDict[\"certificateValidityPeriodScale\"] = new CertificateValidityPeriodScale($this->_propDict[\"certificateValidityPeriodScale\"]);\n return $this->_propDict[\"certificateValidityPeriodScale\"];\n }\n }\n return null;\n }",
"function bigbluebuttonbn_scale_used_anywhere($scaleid) {\n $return = false;\n\n return $return;\n}",
"public function calc($key);",
"public function scale($scale = 1) {\n\t\tif(stristr($scale, '%') !== false) {\n\t\t\t$scale = (float) preg_replace('/[^0-9\\.]/', '', $scale);\n\t\t\t$scale = $scale/100;\n\t\t}\n\t\t$scale = (float) $scale;\n\t\t$new_width = ceil($this->width * $scale);\n\t\t$new_height = ceil($this->height * $scale);\n\n\t\t$working_image = imagecreatetruecolor($new_width, $new_height);\n\n\t\tif(imagecopyresampled($working_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height)) {\n\t\t\t$this->image = $working_image;\n\t\t\t$this->width = $new_width;\n\t\t\t$this->height = $new_height;\n\t\t\treturn true;\n\t\t} else {\n\t\t\ttrigger_error('Resize failed.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}",
"function econsole_scale_used ($econsoleid,$scaleid) {\r\n $return = false;\r\n\r\n //$rec = get_record(\"console\",\"id\",\"$econsoleid\",\"scale\",\"-$scaleid\");\r\n //\r\n //if (!empty($rec) && !empty($scaleid)) {\r\n // $return = true;\r\n //}\r\n \r\n return $return;\r\n}",
"public function applyScale($number, $scale = null)\n\t{\n\t\tif(is_numeric($number))\n\t\t{\n\t\t\t$scale = (int)$scale;\n\n\t\t\t$number = $this->exp2dec($number);\n\t\t\tif(strpos($number, '.') === false)\n\t\t\t{\n\t\t\t\t$number_of_decimals = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$number_of_decimals = strlen(substr($number, strpos($number, '.') + 1));\n\t\t\t}\n\n\t\t\tif($number_of_decimals > 0 && $number_of_decimals < $scale)\n\t\t\t{\n\t\t\t\t$number = str_pad($number, $scale - $number_of_decimals, '0');\n\t\t\t}\n\t\t\telse if($number_of_decimals > $scale)\n\t\t\t{\n\t\t\t\t$number = substr($number, 0, -($number_of_decimals - $scale));\n\t\t\t}\n\t\t}\n\n\t\treturn $number;\n\t}",
"public function getReadNamespacedScaleScale(\n $name,\n $mnamespace,\n $pretty = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.\n '/oapi/v1/namespaces/{namespace}/deploymentconfigs/{name}/scale';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'name' => $name,\n 'namespace' => $mnamespace,\n ));\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'pretty' => $pretty,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1beta1Scale');\n }",
"public function setModularScale(string $id, string $scale, float $modifier = null)\n {\n $scale = (float) $scale;\n $steps = array(6, 5, 4, 3, 2, 1, 0);\n for ($i = 1; $i <= 6; $i++) {\n $value = self::modularScale($steps[$i], 16, $scale, true);\n $value = $modifier != null ? $value * $modifier : $value;\n $this->transport->setStyle($id, '{font-size:' . $value . 'em;}', 'h' . $i);\n }\n }",
"static private function _mul($value1, $value2){\n\t\treturn LocaleMath::mul($value1, $value2);\n\t}",
"abstract public function transform();",
"public static function resolve($value, $key = null) : Chain\n {\n if (is_int($key) && ! $value instanceof Validator) {\n return new Chain(new IsSame($value, true));\n }\n\n if ($value instanceof Validator) {\n return new Chain($value);\n }\n\n if ($value instanceof Chain) {\n return $value;\n }\n\n throw new RuntimeException('NOT IMPLEMENTED YET');\n }",
"function product() {\n static $product = false;\n $product = $product ?: curry('array_product');\n return _apply($product, func_get_args());\n}",
"protected function getLiipImagine_Filter_Loader_DownscaleService()\n {\n return $this->services['liip_imagine.filter.loader.downscale'] = new \\Liip\\ImagineBundle\\Imagine\\Filter\\Loader\\DownscaleFilterLoader();\n }",
"function values($price, $weight=0.45){\n $price = $price + ($price * $weight);\n return $price;\n}",
"private function _addLegendScalebar()\n {\n if ($this->download && array_key_exists('legend', $this->options) && $this->options['legend']) {\n $this->addLegend();\n } else if (!$this->download) {\n $this->addLegend();\n }\n if ($this->download && array_key_exists('scalebar', $this->options) && $this->options['scalebar']) {\n $this->addScalebar();\n } else if (!$this->download) {\n $this->addScalebar();\n }\n }",
"public function askFieldScale(InputInterface $input, OutputInterface $output): ?int\n {\n $question = new Question($this->getQuestion('Scale', 0), 0);\n $question->setValidator(WameValidators::getScaleValidator());\n return (int) $this->ask($input, $output, $question);\n }",
"final public function useFactor($value) {\n\t\treturn $this->factor*$value;\n\t}",
"public function scaleX($by) {}",
"private function getValueLookup() : \\GraphQL\\Utils\\MixedStore\n {\n }",
"public function multiply($with) {}",
"function flashcard_scale_used($flashcardid, $scaleid) {\n\n $return = false;\n\n return $return;\n}",
"abstract protected function calculateValue();",
"public function prod($prod);",
"function vitero_scale_used_anywhere($scaleid) {\n return false;\n}",
"public static function scale()\n {\n return new CropMode(CropMode::SCALE);\n }",
"public function getReticleDifficultyScale()\n {\n return $this->reticle_difficulty_scale;\n }"
] | [
"0.6370533",
"0.5822046",
"0.56585085",
"0.54804677",
"0.525824",
"0.52413654",
"0.5208612",
"0.52080727",
"0.5099064",
"0.5088876",
"0.50651646",
"0.50651646",
"0.5023246",
"0.50086343",
"0.5000667",
"0.49667034",
"0.48952675",
"0.4893999",
"0.4893999",
"0.48900926",
"0.48808357",
"0.48808357",
"0.4842939",
"0.48116466",
"0.4799666",
"0.47780845",
"0.47698423",
"0.47661692",
"0.47582987",
"0.4734721",
"0.47255352",
"0.47071546",
"0.46759948",
"0.46480677",
"0.4629929",
"0.45923668",
"0.45807824",
"0.4569434",
"0.4559396",
"0.45531115",
"0.4520767",
"0.45206222",
"0.45163524",
"0.45037976",
"0.44921514",
"0.44920108",
"0.44876304",
"0.44614875",
"0.43877462",
"0.43811244",
"0.43788138",
"0.43538272",
"0.4353019",
"0.4340996",
"0.43384537",
"0.43355423",
"0.43243396",
"0.42860258",
"0.42801255",
"0.42687312",
"0.42687312",
"0.42546415",
"0.42476723",
"0.4246479",
"0.42427713",
"0.42369175",
"0.4236083",
"0.42336598",
"0.4229824",
"0.4229111",
"0.4222324",
"0.4215927",
"0.42156836",
"0.420726",
"0.42032048",
"0.42029035",
"0.4200972",
"0.41975933",
"0.41941074",
"0.41922998",
"0.41880542",
"0.418475",
"0.41759422",
"0.4165803",
"0.41601354",
"0.41588274",
"0.41555664",
"0.4138562",
"0.41335636",
"0.41010013",
"0.4099619",
"0.40970847",
"0.40947163",
"0.4082558",
"0.407789",
"0.407523",
"0.40740553",
"0.40700856",
"0.40700248",
"0.40647486"
] | 0.47844583 | 25 |
Render an image path with HTML. | public function get()
{
$that = $this;
// Using cache to reduce request.
$ckey = 'attachment-'.$this->attachmentId;
if (! $attachment = Cache::get($ckey)) {
$attachment = $that->getAttachmentProvider()->findById($that->attachmentId);
Cache::put($ckey, $attachment, 60);
}
// Having scale, but not generate yet!
if (! is_object($attachment) and strpos($this->attachmentId, '_')) {
preg_match('|(.*)_(.*)|', $this->attachmentId, $matches);
$attachment = $this->resizeFromMasterFile($matches[1], $matches[2]);
}
if (is_object($attachment)) {
$location = $attachment->getAttribute('location');
if (preg_match('/^http/', $location)) {
return $location;
}
return $this->uploader->url($location);
}
$failure = array_get($this->config, 'placeholder');
return ($failure instanceof Closure) ? $failure($this->attachmentId, $this) : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }",
"public function image($path, array $options = array()) {\n\t$defaults = array('alt' => '');\n\t$options += $defaults;\n\n\treturn $this->_render('image', compact('path', 'options'), $options);\n }",
"public function render()\n {\n return view('components.img');\n }",
"public function render()\n {\n header('Content-Type: image/png');\n\n imagepng($this->imageResource);\n imagedestroy($this->imageResource);\n }",
"public function render() {\n if (!$this->layout) return false;\n \n $mime = $this->layoutInfo['mime'] ? $this->layoutInfo['mime'] : 'image/png';\n \n header('Content-Type: ' . $mime);\n switch ($mime) {\n case 'image/jpeg':\n imagejpeg($this->layout);\n break;\n case 'image/gif':\n imagegif($this->layout);\n case 'image/png':\n default:\n imagepng($this->layout);\n break;\n }\n }",
"public function render(): string\n {\n $image_attributes = '';\n foreach ($this->attributes as $attribute => $value) {\n if (\n is_string($attribute) &&\n is_string($value) &&\n in_array($attribute, Settings::ignoredCustomAttributes()) === false\n ) {\n $image_attributes .= \"{$attribute}=\\\"{$value}\\\" \";\n }\n }\n return \"<img src=\\\"{$this->insert}\\\" {$image_attributes}/>\";\n }",
"public function render()\n {\n Response::setContentType('png');\n\n $fontSize = rand(0, 30);\n $string = StringUtility::getRandomString($this->length, true);\n foreach (str_split($string) as $char) {\n if (!$this->fixedSpacing) {\n $fontSize = rand(0, 30);\n }\n imagettftext($this->image, 30, $fontSize, $this->left, $this->top, $this->getFontColor(), $this->getFont(), $char);\n $this->left += $this->getSpacing();\n }\n\n Processor::setInternalSessionValue($this->name, $string);\n imagepng($this->image);\n imagedestroy($this->image);\n }",
"public function render()\n {\n $style = $this->getStyle();\n $text = $this->getText();\n $id = $this->objectName;\n $func = $this->getFunction();\n\n switch ($this->getValue()) {\n case \"0\":\n $image_url = $this->myPrivateImg;\n break;\n case \"1\":\n $image_url = $this->mySharedImg;\n break;\n case \"2\":\n $image_url = $this->groupSharedImg;\n break;\n case \"3\":\n $image_url = $this->otherSharedImg;\n break;\n case \"4\":\n $image_url = $this->myAssignedImg;\n break;\n case \"5\":\n $image_url = $this->myDistributedImg;\n break;\n default:\n if ($this->defaultImg == '{OPENBIZ_RESOURCE_URL}/common/images/icon_data_shared_other.gif') {\n $this->defaultImg = $this->otherSharedImg;\n }\n $image_url = $this->defaultImg;\n break;\n }\n\n if (preg_match(\"/\\{.*\\}/si\", $image_url)) {\n $formobj = $this->getFormObj();\n $image_url = Expression::evaluateExpression($image_url, $formobj);\n } else {\n $image_url = Openbizx::$app->getImageUrl() . \"/\" . $image_url;\n }\n if ($this->width) {\n $width = \"width=\\\"$this->width\\\"\";\n }\n if ($this->link) {\n $link = $this->getLink();\n $target = $this->getTarget();\n $sHTML = \"<a id=\\\"$id\\\" href=\\\"$link\\\" $target $func $style><img $width src='$image_url' /></a>\";\n } else {\n $sHTML = \"<img id=\\\"$id\\\" alt=\\\"\" . $text . \"\\\" title=\\\"\" . $text . \"\\\" $width src='$image_url' />\";\n }\n return $sHTML;\n }",
"public function getImage()\n\t{\n\t\treturn $this->generator->render($this->generateCode(), $this->params);\n\t}",
"public function render(){\n\t\t$out = \"<img\".($this->getID() ? \" id=\\\"\".$this->getID().\"\\\"\" : \"\");\n\t\t\n\t\t$out .= \" src=\\\"\".$this->link.\"\\\"\";\n\t\t\n\t\tforeach( $this->getProperties() as $key => $value ) {\n\t\t\t$out .= \" \".$key.\"=\\\"\".$value.\"\\\"\"; //example: _width=\"100px\"\n\t\t}\n\t\t$out .= \" />\"; //end of opening html tag and html properties\n\t\t\n\t\treturn $out;\n\t}",
"protected function image_render()\r\n {\r\n // Send the correct HTTP header\r\n \\header(\"Cache-Control:no-cache,must-revalidate\");\r\n \\header(\"Pragma:no-cache\");\r\n \\header('Content-Type: image/'.static::$image_type);\r\n \\header(\"Connection:close\");\r\n\r\n // Pick the correct output function\r\n $function = '\\\\image'.static::$image_type;\r\n $function(static::$image);\r\n\r\n // Free up resources\r\n \\imagedestroy(static::$image);\r\n }",
"public function render()\n\t{\n\t\t//set our header to display an image\n\t\theader('Content-Type: image/png');\n\n\t\t//print the image\n\t\techo $this->bg;\n\t}",
"public function display() { ImageLib::serve($this->source_image, $this->source_image_mimetype); }",
"public function render()\n\t{\n\t\tif ($this->_getWidth() <= $this->_getMaxWidth() && $this->_getHeight() <= $this->_getMaxHeight())\n\t\t{\n\t\t\t$backgroundColor = $this->_getBackgroundColor();\n\t\t\t$textColor = $this->_getTextColor();\n\t\t\t$cachePath = $this->_getCacheDir() . '/' . $this->_getWidth() . '_' . $this->_getHeight() . '_' . (strlen($backgroundColor) === 3 ? $backgroundColor[0] . $backgroundColor[0] . $backgroundColor[1] . $backgroundColor[1] . $backgroundColor[2] . $backgroundColor[2] : $backgroundColor) . '_' . (strlen($textColor) === 3 ? $textColor[0] . $textColor[0] . $textColor[1] . $textColor[1] . $textColor[2] . $textColor[2] : $textColor) . '.png';\n\t\t\theader('Content-type: image/png');\n\t\t\theader('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', time () + $this->_getExpires()));\n\t\t\theader('Cache-Control: public');\n\t\t\tif ($this->cacheIsEnabled() && Lumia_Utility_Filesystem::isReallyWritable($cachePath))\n\t\t\t{\n\t\t\t\t// send header identifying cache hit & send cached image\n\t\t\t\theader('img-src-cache: hit');\n\t\t\t\tprint file_get_contents($cachePath);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t// cache disabled or no cached copy exists\n\t\t\t\t// send header identifying cache miss if cache enabled\n\t\t\t\tif ($this->cacheIsEnabled())\n\t\t\t\t{\n\t\t\t\t\theader('img-src-cache: miss');\n\t\t\t\t}\n\n\t\t\t\t$image = $this->_createImage();\n\t\t\t\timagepng($image);\n\n\t\t\t\t// write cache\n\t\t\t\tif ($this->cacheIsEnabled() && Lumia_Utility_Filesystem::isReallyWritable($this->_getCacheDir()))\n\t\t\t\t{\n\t\t\t\t\timagepng($image, $cachePath);\n\t\t\t\t}\n\n\t\t\t\timagedestroy($image);\n\t\t\t}\n\t\t\t\t\n\t\t\texit;\n\t\t} \n\t\t\n\t\tthrow new Lumia_Placeholder_Exception(__METHOD__ . '() Placeholder size may not exceed ' . $this->_getMaxWidth() . 'x' . $this->_getMaxHeight() . ' pixels.');\n\t}",
"abstract public function render($path, array $args = null);",
"public function render() {\n\t\tif (TYPO3_MODE === 'BE') {\n\t\t\t$this->simulateFrontendEnvironment();\n\t\t}\n\t\t$pathinfo = pathinfo($this->arguments['src']);\n\t\tif ($pathinfo['filename'] === '*') {\n\t\t\t$images = $this->documentHead->getFilenamesOfType($pathinfo['dirname'], $pathinfo['extension']);\n\t\t} elseif ($this->arguments['path']) {\n\t\t\t$src = trim(trim($this->arguments['src']), ',');\n\t\t\tif (strlen($src) === 0) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$images = explode(',', $src);\n\t\t\t\t// patch for CSV files missing relative pathnames and possible missing files\n\t\t\tforeach ($images as $k => $v) {\n\t\t\t\t$images[$k] = $this->arguments['path'] . $v;\n\t\t\t}\n\t\t} elseif (is_array($this->arguments['src'])) {\n\t\t\t$images = $this->arguments['src'];\n\t\t} else {\n\t\t\t$images = array(trim($this->arguments['src'], ', '));\n\t\t}\n\t\tif ($this->arguments['sortBy'] !== NULL) {\n\t\t\t$images = $this->sortImages($images);\n\t\t}\n\n\t\tif ($this->arguments['limit'] > 0) {\n\t\t\t$images = array_slice($images, 0, $this->arguments['limit']);\n\t\t}\n\n\n\t\tif (count($images) === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\t\t// use altsrc for any image not present\n\t\tforeach ($images as $k => $v) {\n\t\t\tif (is_file(t3lib_div::getFileAbsFileName($v)) === FALSE) {\n\t\t\t\t$images[$k] = $this->arguments['altsrc'];\n\t\t\t}\n\t\t}\n\t\t$files = $this->renderImages($images);\n\t\tif (TYPO3_MODE === 'BE') {\n\t\t\t$this->resetFrontendEnvironment();\n\t\t}\n\t\t$this->templateVariableContainer->add($this->arguments['as'], $files[0]);\n\t\t$output = $this->renderChildren();\n\t\t$this->templateVariableContainer->remove($this->arguments['as']);\n\t\treturn $output;\n\t}",
"public function displayImage()\r\n {\r\n $imagePath = $this->root.'/'.$this->route;\r\n \r\n if (!self::isImage($this->route)) {\r\n throw new Exception('The route is not an image.');\r\n }\r\n if (!file_exists($this->root.'/'.$this->route)) {\r\n throw new Exception('The image '.$imagePath.' does not exists.');\r\n }\r\n \r\n $fp = fopen($imagePath, 'rb');\r\n \r\n // Headers\r\n $extension = self::getExtension($this->route);\r\n switch ($extension) {\r\n case '.png':\r\n header('Content-Type: image/png');\r\n break;\r\n case '.gif':\r\n header('Content-Type: image/gif');\r\n break;\r\n default:\r\n header('Content-Type: image/jpeg');\r\n break;\r\n }\r\n \r\n header('Content-Length: ' . filesize($imagePath));\r\n \r\n // Dump\r\n fpassthru($fp);\r\n }",
"public function renderTagImage($result);",
"public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }",
"function render($values) {\n $image = $this->get_value($values);\n if (isset($image)) {\n return theme_image(array(\n 'path' => $image->src, \n 'width' => 350,\n 'height' => 200,\n 'alt' => $image->alt, \n 'attributes' => array()\n ));\n }\n }",
"function htmlImages($src)\n{\n\treturn '<img src=' . $src . '>';\n}",
"public function image()\n {\n $user_id = $this->request->getIntegerParam('user_id');\n $size = $this->request->getStringParam('size', 48);\n $hash = $this->request->getStringParam('hash');\n\n if ($size > 100) {\n $this->response->status(400);\n return;\n }\n\n $filename = $this->avatarFileModel->getFilename($user_id);\n $etag = md5($filename.$size);\n\n if ($hash !== $etag) {\n $this->response->status(404);\n return;\n }\n\n $this->response->withCache(365 * 86400, $etag);\n $this->response->withContentType('image/png');\n\n if ($this->request->getHeader('If-None-Match') !== '\"'.$etag.'\"') {\n $this->response->send();\n $this->render($filename, $size);\n } else {\n $this->response->status(304);\n }\n }",
"public function image($img) {\n\t\tif (strpos($img, 'http') === false) {\t\t\n\t\t} else {\n\t\t\techo \"<img src='img/{$img}'>\";\n\t\t}\n\t}",
"public static function renderFile();",
"public static function img($path) {\n return get_template_directory_uri() . '/assets/img/' . $path;\n }",
"public function render()\n {\n $fallbackLogo = FileUtility::findFilesBy(1, 'pages', 'logo');\n\n $page = $this->getPage();\n $logo = FileUtility::findFilesBy($page['uid'], 'pages', 'logo');\n\n if (!is_array($logo) || empty($logo)) {\n $logo = $fallbackLogo;\n }\n\n if (is_array($logo)) {\n $this->templateVariableContainer->add('logo', $logo[0] ?? null);\n }\n }",
"public function render($pid, $dsid) {\n global $base_url;\n $url = $base_url . '/viewer/' . $pid . '/' . $dsid . '/download';\n return \"<img src='$url'/>\";\n }",
"public function display() {\n //send header to browser\n header( \"Content-type: {$this->mimetype}\" );\n\n //output image\n if ( $this->mimetype == 'image/jpeg' ) {\n imagejpeg( $this->image );\n }\n if ( $this->mimetype == 'image/png' ) {\n imagepng( $this->image );\n }\n if ( $this->mimetype == 'image/gif' ) {\n imagegif( $this->image );\n }\n }",
"public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }",
"public function html($path, $data=[]) {\n // Global\n if(isset($this->dataGlobal['*'])){\n $global = $this->dataGlobal['*'];\n }else{\n $global = array();\n }\n\n // Data\n $data = array_merge($this->data, $global, $data);\n $this->data = array();\n\n // Render\n $this->clean();\n $content = $this->run($path, $data);\n return $this->runString($content, $data);\n }",
"function render($src = '', $index_page = FALSE, $additional = '') {\n $link = array();\n if (is_array($src)) {\n $link = $src;\n $link['class'] = isset($src['class']) ? $src['class'] . ' img-responsive' : 'img-responsive';\n $title = isset($src['title']) ? $src['title'] : '';\n $data_title = isset($src['data-title']) ? $src['data-title'] : $title;\n $url = isset($src['src']) ? $src['src'] : '';\n $link['src'] = isset($src['thumb']) ? $src['thumb'] : $url;\n unset($link['thumb']);\n } else {\n $link['class'] = 'img-responsive';\n $link['src'] = $src;\n $title = $data_title = '';\n $url = $src;\n }\n $image = img($link, $index_page);\n return <<<EOF\n <a href=\"$url\" data-toggle=\"lightbox\" data-title=\"$data_title\" $additional>\n $image\n </a>\nEOF;\n }",
"public function render()\n {\n // Different conditions for different types of tags\n switch ($this->element) {\n\n // Img tags use the src\n case 'img':\n if (empty($this->getAttribute('src'))) {\n return '';\n }\n break;\n\n // Divs have the image as a background-image\n // https://regex101.com/r/eF0oD0/1\n default:\n if (!preg_match('#background-image:\\s*url\\([\\'\"]?[\\w\\/]#',\n $this->getAttribute('style'))) {\n return '';\n }\n }\n\n // Carry on with normal rendering\n return parent::render();\n }",
"public static function fromHtmlFile(string $path): Renderer;",
"public function show()\n {\n $path = Storage::url('public/IMG-20180930-WA0004.jpg.jpg');\n\n return '<img src=\"' .$path. '\" alt=\"\">';\n }",
"abstract public function render();",
"abstract public function render();",
"abstract public function render();",
"abstract public function render();",
"abstract public function render();",
"abstract public function render();",
"function img($file = NULL, $attrs = '', $folder = NULL)\n {\n if (strlen($file) > 0) {\n return '<img src=\"'.img_url($file, $folder).'\"'._stringify_attributes($attrs).' />';\n }\n return NULL;\n }",
"function show( $img )\n {\n\t\theader( \"Content-type: image/\" . substr( $img, strlen( $img ) - 4, 4 ) == \"jpeg\" ? \"jpeg\" : substr( $img, strlen( $img ) - 3, 3 ) );\n \treadfile( $img );\n }",
"public abstract function render();",
"public abstract function render();",
"public function render($name = ''){\n \n $ret_str = '';\n $extension = $this->getField('public_file')->getExtension();\n $ext = mb_strtolower($extension);\n \n switch($ext){\n \n case 'css':\n \n $ret_str = $this->renderStylesheet();\n break;\n \n case 'js':\n \n $ret_str = $this->renderJavascript();\n break;\n \n default:\n \n $ret_str = $this->renderImage();\n break;\n \n }//switch\n \n return $ret_str;\n \n }",
"public function renderUri();",
"abstract public function show($img);",
"public function render()\n\t{\n\t\t// get stylehseet base & source\n\t\t$base = (isset($this->params->base)) ? strtolower($this->params->base) : 'uploads';\n\t\t$source = (isset($this->params->source)) ? trim($this->params->source) : null;\n\n\t\t// if we want base to be template,\n\t\t// shortcut to template/assets/css folder\n\t\tif ($base == 'template')\n\t\t{\n\t\t\t$base = 'template' . DS . 'assets' . DS . 'js';\n\t\t}\n\n\t\t// we must have a source\n\t\tif ($source === null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// get download path for source (serve up file)\n\t\tif ($path = $this->group->downloadLinkForPath($base, $source))\n\t\t{\n\t\t\t// add stylsheet to document\n\t\t\t\\Document::addScript($path);\n\t\t}\n\t}",
"abstract function render();",
"function print_image($path){\n $image = new Imagick();\n $image->readImage(_LOCAL_.$path);\n $height = $image->getImageHeight();\n $width = $image->getImageWidth();\n\n $canvas = new Imagick();\n $canvas->newImage($width,$height,new ImagickPixel('white'));\n $canvas->setImageFormat('png');\n $canvas->compositeImage($image,imagick::COMPOSITE_OVER, 0, 0);\n\n header('Content-type: image/png');\n echo $canvas;\n $image->destroy();\n $canvas->destroy();\n}",
"public function render()\n {\n $brandImage = config('laravolt.ui.brand_image');\n $isSvg = Str::of($brandImage)->startsWith('<svg');\n\n if (!$brandImage) {\n $brandImage = 'laravolt/img/default/logo.png';\n }\n\n return view('laravolt::components.brand-image', compact('brandImage', 'isSvg'));\n }",
"function image($path, $phpThumbAttributes = array(), $htmlAttributes = array(), $useAltSyntax = false) {\n $thumb_attr = NULL;\n $w = NULL;\n $h = NULL;\n\n foreach ($phpThumbAttributes as $attr => $value) {\n if ($useAltSyntax) {\n if ($attr == 'w' || $attr == 'h') {\n $res = $attr;\n $$res = $value;\n } else {\n $thumb_attr .= $attr.'='.$value.';';\n }\n } else {\n $thumb_attr .= '&'.$attr.'='.$value;\n }\n }\n\n if ($useAltSyntax) {\n $thumb_path = $this->phpThumb.'/'.$thumb_attr.$w.'x'.$h.';'.$path;\n } else {\n $thumb_path = $this->phpThumb.'&src='.$path.$thumb_attr;\n }\n\n return $this->Html->image($thumb_path, $htmlAttributes);\n }",
"public function image($file) {\n\t\theader('Content-Type: image/png');\n\t\tdie(file_get_contents(APPPATH.'third_party/blog/images/'.$file));\n\t}",
"public function renderImageAction()\n {\n $config = \\Zend_Registry::get('configs');\n $path = $config['upload']['rodape']['destination'];\n\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_getAllParams();\n\n $entity = $this->getService('Artefato')->findBy(array(\n 'sqArtefato' => $params['sqArtefato']\n ));\n $enderecoImagem = $path . '/' . $entity[0]->getDeImagemRodape();\n $dto = new \\Core_Dto_Search(\n array(\n 'resize' => true,\n 'width' => 120,\n 'height' => 120\n )\n );\n\n return $this->showImage($dto, $enderecoImagem);\n }",
"public function renderHTML() \n\t{\n\t\t$viewTemplate = file_get_contents('view_file.html');\n\t\techo $viewTemplate;\n\t}",
"public function output()\n {\n $imageFile = $this->storage->getPath($this);\n\n if(file_exists($imageFile))\n {\n header('Content-Type: image');\n header('Content-Length: ' . filesize($imageFile));\n\n readfile($imageFile);\n exit;\n }\n }",
"public function outputAvatarImage()\n\t{\n\t\techo $this->app->html->img($this->avatar_url, $this->avatar_width, $this->avatar_height, $this->username);\n\t}",
"public function actionImg()\n {\n $title = '微站设置/音乐设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('img',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }",
"public function draw(){\n\t\t$this->doOutputResource();\n\t\t$defExt=\"gif\";\n\t\t$ext = ($this->outputFilename && strtolower(substr($this->outputFilename,-3))==\"$defExt\") ? substr($this->outputFilename,-4) :\".$defExt\";\n\t\t$out = $this->outputFilename.$ext;\n\t\tif(!$this->outputFilename){\n\t\t\theader(\"Content-Type: image/gif\");\n\t\t\t$out=null;\n\t\t}\n\t\t$this->outputFilename = $out;\n\t\treturn imagegif($this->outImage,$this->outputFilename);\n\t}",
"public function render() {\n\t\tif (!isset($_SESSION['admin'])) {\n\t\t\theader('Location: login');\n\t\t}\n\t\tif (isset($_GET['logout'])) {\n\t\t\tsession_destroy();\n\t\t\theader('Location: login');\n\t\t}\n\t\tif (isset($_FILES['image'])){\n\t\t\tmove_uploaded_file(\n\t\t\t\t$_FILES['image']['tmp_name'],\n\t\t\t\tdirname(__FILE__).'/../../web/images/'.$_FILES['image']['name']);\n\t\t\tfront()\n\t\t\t\t->portfolio()\n\t\t\t\t->create(\n\t\t\t\t\t$_FILES['image']['name']);\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn $this->_page();\n\t}",
"public function render() {\n\t\treturn sq::base().$this->getFilePath();\n\t}",
"function ShowImageByPath($img_with_path = NULL, $size = NULL, $quality = NULL, $wtm = NULL, $parameters = NULL, $return_src = false)\n {\n $imgSmall = ImageK::getResizedImg($img_with_path, $size, $quality, $wtm);\n if(empty($imgSmall)){\n return false;\n }\n if($return_src){\n return $imgSmall;\n }else{\n return '<img src=\"'.$imgSmall.'\" '.$parameters.' />';\n }\n }",
"public function renderTagImage($result) {\n\t\treturn sprintf('<img src=\"%s%s\" title=\"%s\" alt=\"%s\" %s/>',\n\t\t\t$result,\n\t\t\t$this->getAppendTimeStamp() ? '?' . $this->file->getProperty('tstamp') : '',\n\t\t\t$this->getTitle(),\n\t\t\t$this->getTitle(),\n\t\t\t$this->renderAttributes()\n\t\t);\n\t}",
"abstract public function render() ;",
"protected function _render()\r\n\t{\r\n\t\tCore::getLang()->load(\"Signature\");\r\n\t\t$config = $this->getConfig()->getChildren(\"image\");\r\n\t\t$statsConfig = $config->getChildren(\"stats\");\r\n\t\t$planetsConfig = $config->getChildren(\"planets\");\r\n\r\n\t\t$user = $this->getUser();\r\n\t\t$img = imagecreatefrompng(AD.\"img/\".$config->getString(\"background\"));\r\n\r\n\t\tif($statsConfig->getInteger(\"show\"))\r\n\t\t{\r\n\t\t\t$result = Core::getQuery()->select(\"user\", array(\"userid\"));\r\n\t\t\t$totalUser = fNumber(Core::getDB()->num_rows($result));\r\n\t\t\tCore::getDB()->free_result($result);\r\n\t\t\t$this->_addParamToImage($img, \"stats\", Core::getLang()->get(\"RANK\").\" \".$user->getFormattedRank().\"/\".$totalUser);\r\n\t\t}\r\n\r\n\t\tif($planetsConfig->getInteger(\"show\"))\r\n\t\t{\r\n\t\t\t$result = Core::getQuery()->select(\"planet\", array(\"planetid\"), \"\", \"userid = '{$user->getUserid()}' AND ismoon = 0\");\r\n\t\t\t$planets = Core::getLang()->get(\"NUMBER_OF_COLONY\").\" \".fNumber(Core::getDB()->num_rows($result) - 1);\r\n\t\t\tCore::getDB()->free_result($result);\r\n\t\t\t$this->_addParamToImage($img, \"planets\", $planets);\r\n\t\t}\r\n\r\n\t\t$this->_addParamToImage($img, \"username\", $user->getUsername());\r\n\t\t$this->_addParamToImage($img, \"gamename\", Core::getConfig()->get(\"pagetitle\"));\r\n\t\t$this->_addParamToImage($img, \"planet\", $user->getHomePlanet()->getPlanetname().\" [\".$user->getHomePlanet()->getCoords(false).\"]\");\r\n\t\t$this->_addParamToImage($img, \"points\", Core::getLang()->get(\"POINTS\").\" \".$user->getFormattedPoints());\r\n\r\n\t\tif($user->getAid())\r\n\t\t{\r\n\t\t\t$this->_addParamToImage($img, \"alliance\", Core::getLang()->get(\"ALLIANCE\").\" \".$user->getAlliance()->getTag());\r\n\t\t}\r\n\r\n\t\timagepng($img, $this->getCachePath().$this->getUserId().self::IMAGE_FILE_EXTENSION, $config->getInteger(\"quality\"));\r\n\t\timagedestroy($img);\r\n\t\treturn $this;\r\n\t}",
"public function html($attributes = array()) {\n\t\t\t$properties = '';\n\t\t\tif (is_array($attributes)) {\n\t\t\t\tforeach ($attributes as $key => $val) {\n\t\t\t\t\t$properties .= \"{$key}=\\\"{$val}\\\" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$html = '<img src=\"' . $this->toEncodedURI() . '\" ' . $properties . '/>';\n\t\t\treturn $html;\n\t\t}",
"public function actionShow($path) {\n $imagePath = $path;\n Yii::app()->clientScript->scriptMap['jquery.js'] = false;\n $this->renderPartial('viewImage', array('imagePath' => $imagePath,), false, true);\n }",
"function image($img,$attribute = array()){\r\n\t\t$tmp = '';\r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\r\n\t\t$default = ''; $width = 0;\r\n\t\t$folder = ''; $height = 0;\r\n\r\n\t\t$att = array();\r\n\t\tif(isset($attribute['default'])){\r\n\t\t\t$att['default'] = $attribute['default'];\r\n\t\t\tunset($attribute['default']);\r\n\t\t}\r\n\t\tif(isset($attribute['folder'])){\r\n\t\t\t$att['folder'] = $attribute['folder'];\r\n\t\t\tunset($attribute['folder']);\r\n\t\t}\r\n\t\tif(isset($attribute['fixed'])){\r\n\t\t\t$att['fixed'] = $attribute['fixed'];\r\n\t\t\tunset($attribute['fixed']);\r\n\t\t}\r\n\t\tif(isset($attribute['absolute'])){\r\n\t\t\t$att['absolute'] = $attribute['absolute'];\r\n\t\t\tunset($attribute['absolute']);\r\n\t\t}\r\n\t\tif(isset($attribute['fullpath'])){\r\n\t\t\t$att['fullpath'] = $attribute['fullpath'];\r\n\t\t\tunset($attribute['fullpath']);\r\n\t\t}else{\r\n\t\t\t$att['fullpath'] = 'true';\r\n\t\t}\r\n\r\n\t\tBASIC::init()->imported('media.mod');\r\n\t\t$media = new BASIC_MEDIA($img, $att);\r\n\r\n\t\tif(isset($attribute['width'])) $width = $attribute['width'];\r\n\t\tif(isset($attribute['height'])) $height = $attribute['height'];\r\n\r\n\t\tif($media->info['type'] == 13 || $media->info['type'] == 4){\r\n\t\t\t$this->headSpecial('<!--[if IE]><script type=\"text/javascript\" src=\"'.BASIC::init()->ini_get('root_virtual').BASIC::init()->ini_get('basic_path').'scripts/flash/flash.js\" defer=\"defer\"></script><![endif]-->','Flash');\r\n\t\t}\r\n\t\treturn $media->view($width,$height,$attribute) . $tmp;\r\n\t}",
"function img($src = '', bool $indexPage = false, $attributes = ''): string\n {\n if (! is_array($src)) {\n $src = ['src' => $src];\n }\n if (! isset($src['src'])) {\n $src['src'] = $attributes['src'] ?? '';\n }\n if (! isset($src['alt'])) {\n $src['alt'] = $attributes['alt'] ?? '';\n }\n\n $img = '<img';\n\n // Check for a relative URI\n if (! preg_match('#^([a-z]+:)?//#i', $src['src']) && strpos($src['src'], 'data:') !== 0) {\n if ($indexPage === true) {\n $img .= ' src=\"' . site_url($src['src']) . '\"';\n } else {\n $img .= ' src=\"' . slash_item('baseURL') . $src['src'] . '\"';\n }\n\n unset($src['src']);\n }\n\n // Append any other values\n foreach ($src as $key => $value) {\n $img .= ' ' . $key . '=\"' . $value . '\"';\n }\n\n // Prevent passing completed values to stringify_attributes\n if (is_array($attributes)) {\n unset($attributes['alt'], $attributes['src']);\n }\n\n return $img . stringify_attributes($attributes) . _solidus() . '>';\n }",
"protected function renderPreviewImage($options = [])\n {\n $htmlOptions = array_replace([\n 'title' => '{%= o.name %}',\n 'alt' => '{%= o.name %}',\n ], isset($options['htmlOptions']) ? $options['htmlOptions'] : []);\n\n $urlTemplate = isset($options['format'])\n ? '{%= o.formats.' . $options['format'] . ' %}'\n : '{%= o.url %}';\n\n return Html::img($urlTemplate, $htmlOptions);\n }",
"public function render()\n {\n ddd($this->name, $this->image, $this->description);\n return view('components.wallpaper');\n }",
"public function renderTagImage($result) {\n\n\t\t// Variable $result corresponds to an URL in this case.\n\t\t// Analyse the URL and compute the adequate separator between arguments.\n\t\t$parameterSeparator = strpos($result, '?') === FALSE ? '?' : '&';\n\n\t\treturn sprintf('<img src=\"%s%s\" title=\"%s\" alt=\"%s\" %s/>',\n\t\t\t$result,\n\t\t\t$this->thumbnailService->getAppendTimeStamp() ? $parameterSeparator . $this->getTimeStamp() : '',\n\t\t\t$this->getTitle(),\n\t\t\t$this->getTitle(),\n\t\t\t$this->renderAttributes()\n\t\t);\n\t}",
"public function getIMG($img, $options = NULL) {\r\n\t\tif (! file_exists ( \"www-static\" . DS . \"assets\" . DS . \"images\" . DS . $img )) {\r\n\t\t\tthrow new Exception ( \"No such img as $img\" );\r\n\t\t}\r\n\t\t\r\n\t\t// epic fix / kalo dihapus jadinya ya cacat\r\n\t\t$img = \"/www-static\" . DS . \"assets\" . DS . \"images\" . DS . $img;\r\n\t\techo '<img ' . $options . ' src=\"' . $img . '\" />';\r\n\t}",
"public function image() {\n\t\t$image = new WkImage();\n\n\t\t$command = new Command($image->getImage()->getCommand() . ' --htmldoc');\n\n\t\tif ($command->execute()) {\n\t\t\techo $command->getOutput();\n\t\t} else {\n\t\t\techo $command->getError();\n\t\t}\n\t}",
"protected function render() {}",
"public function DrawPicture() { \r\n\r\n $hogerarm = $this->GetHogerArm();\r\n $vansterarm = $this->GetVansterArm();\r\n $vansterben = $this->GetVansterBen();\r\n $hogerben = $this->GetHogerBen();\r\n $kroppen = $this->GetKroppen();\r\n $huvud = $this->GetHuvud();\r\n $repet = $this->GetRepet();\r\n $stolpen = $this->GetStolpen();\r\n $kullen = $this->GetKullen();\r\n $header = $this->GetSvgHeader();\r\n\r\n $html = <<<EOD\r\n {$header}\r\n {$kullen}\r\n {$stolpen}\r\n {$kroppen} \r\n {$hogerarm} \r\n {$vansterarm} \r\n {$vansterben} \r\n {$hogerben}\t\r\n {$repet} \t\t\r\n {$huvud}\r\n </svg>\r\nEOD;\r\n\r\n return $html;\r\n }",
"protected function render() {}",
"protected function render() {}",
"public function picture() {\n $picture = $this->_model->getPicture(explode(\"/\", $this->_url)[1]);\n if ($picture === null) {\n $this->redirect(\"/index\");\n }\n $this->render(\"General.Picture\", compact('picture'));\n }",
"public function display_image($data) {\n global $ID;\n if (file_exists(mediaFN($ID))) {\n echo '<img class=\"proofreadpage\" alt=\"\" width=\"500\" src=\"' . ml($ID, array('w' => '500')) . '\" />';\n }\n }",
"public function imageTag($arrMatch) {\n \n $em = $this->getDoctrine()->getEntityManager();\n\n $image = $em->getRepository('BloggerGalleryBundle:Image')->find($arrMatch[1]);\n \n if (!$image) {\n throw $this->createNotFoundException('Unable to find image.');\n }\n \n return $this->renderView('BloggerGalleryBundle:Gallery:image.html.twig', array(\n 'image' => $image,\n ));\n \n }",
"public function img()\n {\n return '<img src=\"'.$this->src().'\" alt=\"captcha\">';\n }",
"public function img($src = \"\", $alt = \"\") {\n echo \"<img src=assets/img/'\" . $src . \"' alt='\" . $alt . \"'>\";\n }",
"public function render($file);",
"public function build()\n {\n if ($this->_inline) {\n $encoded_image = base64_encode(file_get_contents($this->_attributes['src']));\n $mime_type = image_type_to_mime_type($this->_image_type);\n $this->_attributes['src'] = \"data:{$mime_type};base64,{$encoded_image}\";\n\n if (isset($this->_attributes['async'])) {\n unset($this->_attributes['async']);\n }\n }\n\n $attributes = join(' ', $this->_makeAttributesArr());\n if (!empty($attributes)) {\n $attributes = ' ' . $attributes;\n }\n return \"<img{$attributes}>\";\n }",
"abstract public function render(FileInterface $file, $width, $height, array $options = [], $usedPathsRelativeToCurrentScript = false);",
"function createImage($idName) { //TODO: Add parameter for passing image files to use instead \n echo '<img src=\"/php/cms-img/file2.png\" id=\"' . $idName . '\" class=\"nested\"/>';\n }",
"public function render() {\n\t\textract($this->data);\n\t\trequire($this->path);\n\t}",
"public function filerendererAction() {\n\t\t$filename = basename($this->_getParam('image'));\n\t\t$this->_helper->layout()->disableLayout();\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->getResponse()\n\t\t\t\t->setHeader('Content-Type', 'image/jpeg')\n\t\t\t\t->setBody(file_get_contents(ROOT_DIR . '/files/' . $filename));\n\t}",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();"
] | [
"0.6978498",
"0.69218516",
"0.67418283",
"0.6529205",
"0.64532566",
"0.6415844",
"0.64077353",
"0.63982195",
"0.63643473",
"0.6357268",
"0.63541627",
"0.6284216",
"0.62400454",
"0.6210754",
"0.6148866",
"0.61467713",
"0.6101545",
"0.60890144",
"0.6084994",
"0.60308206",
"0.60109717",
"0.600417",
"0.59623516",
"0.5954279",
"0.5950332",
"0.59038377",
"0.58860296",
"0.58701414",
"0.58682674",
"0.5853868",
"0.5822246",
"0.58191764",
"0.5804974",
"0.57729095",
"0.5769025",
"0.5769025",
"0.5769025",
"0.5769025",
"0.5769025",
"0.5769025",
"0.5762405",
"0.57559997",
"0.57502097",
"0.57502097",
"0.57330143",
"0.5731602",
"0.5730831",
"0.5724034",
"0.5700927",
"0.5682207",
"0.56763816",
"0.56755096",
"0.5670062",
"0.56689227",
"0.56617635",
"0.5653327",
"0.5649211",
"0.5623181",
"0.56193554",
"0.56166595",
"0.56108105",
"0.5600943",
"0.5595965",
"0.55924785",
"0.559037",
"0.55778337",
"0.55773574",
"0.55772483",
"0.5572561",
"0.5566498",
"0.555428",
"0.5550963",
"0.55503863",
"0.5548165",
"0.554323",
"0.5543023",
"0.55420417",
"0.55420417",
"0.5540999",
"0.55360556",
"0.55319124",
"0.5528814",
"0.55216795",
"0.5520879",
"0.551938",
"0.55172384",
"0.5514989",
"0.550933",
"0.5508569",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446",
"0.54937446"
] | 0.0 | -1 |
To string will return path. | public function __toString()
{
try {
return $this->get() ?: '';
} catch (Exception $e) {
restore_error_handler();
trigger_error($e->getMessage());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toString() {\n return url::buildPath($this->toArray());\n }",
"public function __toString()\n {\n return (string)$this->_sPath;\n }",
"public function toString() {\n\t\treturn $this->path();\n\t}",
"public function __toString()\n {\n return $this->path;\n }",
"public function __toString(): string\n {\n return $this->getAbsolutePath();\n }",
"public function __toString() : string\n {\n return $this->getPathname();\n }",
"public function __toString() {\r\n return $this->getPath();\r\n }",
"public function __toString()\n {\n return $this->getPath();\n }",
"public function path(): string;",
"public function path(): string;",
"public function __toString() {\n\t\treturn $this->getPath();\n\t}",
"public function __toString()\n\t{\n\t\treturn $this->getPath();\n\t}",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"function __toString()\n {\n return $this->getPath();\n }",
"function getPath(): string;",
"public function __toString()\n\t{\n\t\t$parts = $this->parts;\n\t\tif(count($parts) == 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$name = '';\n\t\tif($this->absolute) {\n\t\t\t$name = $parts[0];\n\t\t\t$parts = array_slice($parts, 1);\n\t\t}\n\t\t$path = '';\n\t\tif(count($parts)) {\n\t\t\t$path = sprintf('[%s]', implode('][', $parts));\n\t\t}\n\n\t\treturn $name . $path;\n\t}",
"public function toString()\n {\n $path = '';\n if (!empty($this->dirs)) {\n foreach ($this->dirs as $dir) {\n $path .= $dir . DIRECTORY_SEPARATOR;\n }\n }\n $path .= $this->file;\n return $path;\n }",
"public function path();",
"public function getPath() : string;",
"public function get_path() : string\n {\n return $this->path;\n }",
"public function path(): string\n {\n return components_path($this->name);\n }",
"public function path(): string\n {\n return $this->path;\n }",
"public function path()\n {\n $prefix = (isset($this->attributes[self::PREFIX]) ? $this->attributes[self::PREFIX] : '');\n\n return $prefix . $this->path;\n }",
"public function get_path(): string\n {\n return $this->path;\n }",
"public function path() {}",
"public function path() {}",
"public function toRelativePath () {\n return new S (str_replace (DOCUMENT_ROOT, _NONE, $this->varContainer));\n }",
"public function getPathToFile(): string;",
"public function getPath() : string\n {\n return $this->path;\n }",
"public function path(): string\n {\n return realpath($this->file);\n }",
"public function getPath() : string\n {\n return $this->path;\n }",
"public function getPath() : string\n {\n return $this->path;\n }",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath();",
"public function getPath() {}",
"public function getPath() {}",
"public function getPath() {}",
"public function getPath() {}",
"public function getPath() {}",
"public function getPath() {}",
"public function GetPath()\n\t{\n\t\tif (!empty($this->path))\n\t\t\treturn $this->path;\n\n\t\treturn '';\n\t}",
"public function createPath(string $path): string;",
"public function toAbsolutePath () {\n return new S (DOCUMENT_ROOT . str_replace (DOCUMENT_ROOT, _NONE, $this->varContainer));\n }",
"public function getPath()\n {\n\n if (empty($this->_path))\n return '';\n\n return $this->_path;\n }",
"public function toString(): string\n\t{\n\t\t$url = $this->base();\n\t\t$slash = true;\n\n\t\tif (empty($url) === true) {\n\t\t\t$url = '/';\n\t\t\t$slash = false;\n\t\t}\n\n\t\t$path = $this->path->toString($slash) . $this->params->toString(true);\n\n\t\tif ($this->slash && $slash === true) {\n\t\t\t$path .= '/';\n\t\t}\n\n\t\t$url .= $path;\n\t\t$url .= $this->query->toString(true);\n\n\t\tif (empty($this->fragment) === false) {\n\t\t\t$url .= '#' . $this->fragment;\n\t\t}\n\n\t\treturn $url;\n\t}",
"public static function path($object) \n {\n if (null === $object || empty($object)) {\n throw new \\InvalidArgumentException(\n sprintf(\"[%s]: Esperavamos um objeto ou uma string, recebemos um(a) %s.\", __CLASS__, gettype($object))\n ); \n }\n return str_replace('\\\\', '/', self::full($object));\n }",
"public function getPath(): string\r\n {\r\n return $this->path;\r\n }",
"public function getPath(): string\r\n {\r\n return $this->path;\r\n }",
"public function getPath(): string\n {\n return $this->path;\n }",
"public function getPath(): string\n {\n return $this->path;\n }",
"public function getPath(): string\n {\n return $this->path;\n }",
"public function getPath(): string\n {\n return $this->path;\n }",
"public function getPath(): string\n {\n return $this->path;\n }",
"public function getPathEncoded();",
"public static function getPath() {\n\t\tif ($args = func_get_args()) {\n\t\t\t$path = self::_getPath($args);\n\t\t} else {\n\t\t\t$path = '';\n\t\t}\n\t\treturn self::fixSlash($path);\n\t}",
"public function getPath()\n {\n return str_replace(\n ['/', '\\\\'],\n Storage::GetSeparator(),\n Storage::GetPath() . '/' . $this->dirname . '/' . $this->basename\n );\n }",
"public function getFullPath(): string;",
"public function getPath() : string\n {\n return $this->path;\n }",
"function completePath(){\n \treturn $this->path . $this->name;\n }",
"private function getPath() {\n return '%2F' . urlencode($this->source) . '%2F' . urlencode($this->campaign) .'%2F' . urlencode($this->content);\n }",
"public function to(string $to);",
"public static function pathize(string $string): string\n {\n return '[' . $string . ']';\n }",
"abstract function to_str();",
"public function getPathLocation(): string;",
"function string_to_path($str)\n{\n\t$str = preg_replace('`(?:^\\.?/|/\\./|/$)`', '', trim($str));\n\tif(empty($str) || $str == '.') return '';\n\treturn $str;\n}",
"public function getPath(){ }",
"public function getPath(){ }",
"public function __toString()\n {\n return $this->getFileLocation();\n }",
"public function getPath(): string {\n\t\treturn $this->path;\n\t}",
"public function path(): string\n {\n return $this->path ??= trim(\n $this->api->stripBasePath($this->request->getUri()->getPath()),\n '/',\n );\n }",
"public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }",
"public function path(): string\n {\n $path = $this->uri()->getPath();\n\n return match (true) {\n empty($path) => '/',\n $path[0] !== '/' => '/' . $path,\n default => $path\n };\n }",
"public function\n\tGetPath():\n\t?String {\n\t/*//\n\treturn(string)\n\tfetch the requested path as a string.\n\t//*/\n\n\t\treturn $this->Path;\n\t}",
"protected function buildPath()\n\t{\n\t\treturn $this->getDir() . DIRECTORY_SEPARATOR . $this->getSubDir()\n\t\t\t. DIRECTORY_SEPARATOR . $this->getName();\n\t}",
"public function __toString() {\n\t\treturn (string) $this->basename; \n\t}",
"public function __toString()\n\t\t{\n\t\t\treturn $this->basePath . $this->archiveFilename;\n\t\t}",
"public function getPath(){\n\t \treturn $this->dirname.'/'.$this->filename.'.'.$this->extension;\n\t }",
"public function path()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" path ?\");\n\t}",
"public function path() {\n return $this->filepath();\n }",
"public function path(): string\n {\n return str_replace('?', '', \"/{$this->route->uri()}\");\n }",
"public function getAbsolutePath();",
"public function getAbsolutePath() {}"
] | [
"0.7061645",
"0.6976408",
"0.6937483",
"0.67838067",
"0.6777886",
"0.6752905",
"0.67480254",
"0.6703624",
"0.66463715",
"0.66463715",
"0.66424465",
"0.6623441",
"0.6580462",
"0.6580462",
"0.6580462",
"0.6580462",
"0.6580462",
"0.6580462",
"0.6580462",
"0.6580462",
"0.65290046",
"0.6520797",
"0.6499936",
"0.6479708",
"0.6464796",
"0.63864166",
"0.63792497",
"0.63577783",
"0.63305324",
"0.62995154",
"0.624157",
"0.62129295",
"0.621271",
"0.621224",
"0.6209698",
"0.6126823",
"0.61168754",
"0.60921127",
"0.60921127",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.607002",
"0.60668546",
"0.60668546",
"0.60668546",
"0.60668546",
"0.6066107",
"0.6065261",
"0.60582405",
"0.60339934",
"0.60335034",
"0.60316753",
"0.60288364",
"0.60214067",
"0.5999611",
"0.5999611",
"0.5994642",
"0.5994642",
"0.5994642",
"0.5994642",
"0.5994642",
"0.5980583",
"0.59768087",
"0.5956847",
"0.59511393",
"0.5948812",
"0.5947761",
"0.5937882",
"0.593277",
"0.5929457",
"0.59245735",
"0.59127134",
"0.59057844",
"0.5900701",
"0.5900701",
"0.58800524",
"0.58722293",
"0.5830032",
"0.5826952",
"0.5825426",
"0.582191",
"0.5821364",
"0.5807035",
"0.5802555",
"0.57960874",
"0.57831734",
"0.5780992",
"0.57754433",
"0.5775352",
"0.57750916"
] | 0.0 | -1 |
Run the database seeds. | public function run()
{
$classification = new \App\Models\Classification();
$classification->description = 'Camara';
$classification->save();
$classification = new \App\Models\Classification();
$classification->description = 'Portero';
$classification->save();
$classification = new \App\Models\Classification();
$classification->description = 'Cerradura';
$classification->save();
$classification = new \App\Models\Classification();
$classification->description = 'Pantalla';
$classification->save();
$classification = new \App\Models\Classification();
$classification->description = 'Luz';
$classification->save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }",
"public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }",
"public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }",
"public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }",
"public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }",
"public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }",
"public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}",
"public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }",
"public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }",
"public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }",
"public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }",
"public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }",
"public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }",
"public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}",
"public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }",
"public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }",
"public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }",
"public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }",
"public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }",
"public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }",
"public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }",
"public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }",
"public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }",
"public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}",
"public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }",
"public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }",
"public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }"
] | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.7841468",
"0.7834583",
"0.7827792",
"0.7819104",
"0.78088796",
"0.7802872",
"0.7802348",
"0.78006834",
"0.77989215",
"0.7795819",
"0.77903426",
"0.77884805",
"0.77862066",
"0.7778816",
"0.7777486",
"0.7765202",
"0.7762492",
"0.77623445",
"0.77621746",
"0.7761383",
"0.77606887",
"0.77596676",
"0.7757001",
"0.7753607",
"0.7749522",
"0.7749292",
"0.77466977",
"0.7729947",
"0.77289546",
"0.772796",
"0.77167094",
"0.7714503",
"0.77140456",
"0.77132195",
"0.771243",
"0.77122366",
"0.7711113",
"0.77109736",
"0.7710777",
"0.7710086",
"0.7705484",
"0.770464",
"0.7704354",
"0.7704061",
"0.77027386",
"0.77020216",
"0.77008796",
"0.7698617",
"0.76985973",
"0.76973504",
"0.7696405",
"0.7694293",
"0.7692694",
"0.7691264",
"0.7690576",
"0.76882726",
"0.7687433",
"0.7686844",
"0.7686498",
"0.7685065",
"0.7683827",
"0.7679184",
"0.7678287",
"0.76776296",
"0.76767945",
"0.76726556",
"0.76708084",
"0.76690495",
"0.766872",
"0.76686716",
"0.7666299",
"0.76625943",
"0.7662227",
"0.76613766",
"0.7659881",
"0.7656644",
"0.76539344",
"0.76535016",
"0.7652375",
"0.7652313",
"0.7652022"
] | 0.0 | -1 |
Handle the incoming request. | public function __invoke(Request $request)
{
$user = auth()->user();
$roles = Role::get();
return view('roles.index', compact('roles'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function handle_request();",
"public function handleRequest() {}",
"public function handleRequest();",
"public function handleRequest();",
"public function handleRequest();",
"protected abstract function handleRequest();",
"function handleRequest() ;",
"abstract public function handleRequest(Request $request);",
"abstract public function handleRequest($request);",
"public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }",
"protected function handle(Request $request) {}",
"public function handle($request);",
"protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }",
"public function processRequest();",
"public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }",
"public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }",
"public function handle(Request $request);",
"public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }",
"public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }",
"public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"abstract public function processRequest();",
"public abstract function processRequest();",
"abstract protected function process(Request $request);",
"protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }",
"public static function process_http_request()\n {\n }",
"public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}",
"private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}",
"public function handleRequest(Request $request, Response $response);",
"public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }",
"public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }",
"public function handle(array $request);",
"public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}",
"public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}",
"public function handle(ServerRequestInterface $request);",
"public function serve_request()\n {\n }",
"public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}",
"abstract function handle(Request $request, $parameters);",
"public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}",
"public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }",
"public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }",
"protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}",
"function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }",
"public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }",
"public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }",
"public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }",
"public function handle(Request $request): Response;",
"public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }",
"public function handle(array $request = []);",
"function handle(Request $request = null, Response $response = null);",
"public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }",
"protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}",
"public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }",
"private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }",
"public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}",
"public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}",
"public function process(Request $request, Response $response, RequestHandlerInterface $handler);",
"public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }",
"function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}",
"public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }",
"public function run() {\r\n $this->routeRequest(new Request());\r\n }",
"public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }",
"public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}",
"function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }",
"public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}",
"public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }",
"abstract public function handle(ServerRequestInterface $request): ResponseInterface;",
"public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }",
"final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }",
"public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }",
"public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}",
"public function run()\n\t{\n\t\t$response = $this->dispatch($this['request']);\n\n\t\t$response->send();\n\n\t\t$this->callFinishMiddleware($response);\n\t}",
"public function runRequest() {\n }",
"private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}",
"private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }",
"public function listen() {\n\t\t$requestType = $this->getRequestType();\n\t\t$prefix = '';\n\t\t$params = array();\n\t\tswitch ($requestType) {\n\t\t\tcase 'GET':\n\t\t\t\t$prefix = 'get';\n\t\t\t\t$params = $_GET;\n\t\t\t\tbreak;\n\n\t\t\tcase 'POST':\n\t\t\t\t$prefix = 'post';\n\t\t\t\t$params = $_POST;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PUT':\n\t\t\t\t$prefix = 'put';\n\t\t\t\t$params = $this->getRestParams();\n\t\t\t\tbreak;\n\n\t\t\tcase 'DELETE':\n\t\t\t\t$prefix = 'delete';\n\t\t\t\t$params = $this->getRestParams();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new CHttpException(400, 'Invalid request');\n\t\t}\n\n\t\ttry {\n\t\t\t$paramsSet = $this->getActionParamsSet($params['cmd']);\n\t\t\tif ($this->validateRequestParams($params, $paramsSet)) {\n\t\t\t\t$accessTokenModel = $this->getAccessTokenModel();\n\t\t\t\t$method = $prefix . $params['cmd'];\n\t\t\t\tif (method_exists($this, $method)) {\n\t\t\t\t\tif ($this->accessRules()) {\n\t\t\t\t\t\t$this->_appAccessControlFilter->checkFiler($this->getApplicationModel(), $method);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->prolongAccessTokenLifeTime) {\n\t\t\t\t\t\t$this->prolongAccessTokenLifeTime($accessTokenModel);\n\t\t\t\t\t}\n\n\t\t\t\t\t$result = call_user_func(array($this, $method), $params);\n\n\t\t\t\t\treturn $this->composeResult($result, 200);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new CHttpException(400, 'Unknown command');\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (CHttpException $exc) {\n\t\t\treturn $this->composeResult(null, $exc->statusCode, $exc->getMessage());\n\t\t}\n\t\tcatch (CException $exc) {\n\t\t\treturn $this->composeResult(null, 500, $exc->getMessage());\n\t\t}\n\t}",
"final public function handle() : void\n {\n $method = strtolower($this->context->web()->method());\n $res = (object) [\n 'rest' => $this->context->rest(),\n 'method' => $method,\n 'data' => $this->context->formdata($method == 'patch' ? 'put' : $method)->fetchRaw(),\n ];\n $this->context->web()->sendJSON($res);\n }",
"public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }",
"public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }",
"public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }",
"public function run()\n {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }",
"public function DispatchRequest ();",
"public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }",
"public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}",
"public function handler() {\n\t\t$type = Router::verify_type();\n\n\t\tswitch ( $type ) {\n\t\t\tcase self::TYPE_REFRESH_MAP:\n\t\t\t\t$this->cls( 'Crawler_Map' )->gen();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_EMPTY:\n\t\t\t\t$this->cls( 'Crawler_Map' )->empty_map();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_EMPTY:\n\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_empty();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_DEL:\n\t\t\t\tif ( ! empty( $_GET[ 'id' ] ) ) {\n\t\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_del( $_GET[ 'id' ] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_ADD:\n\t\t\t\tif ( ! empty( $_GET[ 'id' ] ) ) {\n\t\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_add( $_GET[ 'id' ] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Handle the ajax request to proceed crawler manually by admin\n\t\t\tcase self::TYPE_START:\n\t\t\t\tself::start( true );\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_RESET:\n\t\t\t\t$this->reset_pos();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tAdmin::redirect();\n\t}",
"public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }",
"abstract public function request();",
"function handle_request() {\n global $subrosa_config, $cfg, $mt;\n // Initialize SubRosa and handle request\n $subrosa_config = init_subrosa_config();\n\n require_once( 'SubRosa/DebuggingEnv.php' );\n $senv = new SubRosa_DebuggingEnv();\n\n $cfg =& $subrosa_config;\n require_once( $cfg['subrosa_path'] );\n\n apache_setenv('SUBROSA_EVALUATED', 1);\n apache_note('SUBROSA_EVALUATED', '1');\n $_SERVER['SUBROSA_EVALUATED'] = 1;\n $_SESSION['SUBROSA_EVALUATED'] = 1;\n\n $mt = new SubRosa( null, $_SERVER['SUBROSA_BLOG_ID'] );\n if (isset($_GET['debug'])) $mt->debugging = true;\n $mt->bootstrap();\n}",
"final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }",
"public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }",
"public function handle($request, $next);",
"public function run(): void\n {\n // missing routing\n // missing proper controller/model system\n // missing middleware framework\n // hacks incoming :)\n\n self::$config['httpMethod'] = $_SERVER['REQUEST_METHOD'];\n self::$config['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n echo $this->handleRequest(self::$config['uri'] === '/' ? '/site/index' : self::$config['uri']);\n }",
"public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}",
"function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n }\n\n disconnectFromDB();\n }\n }",
"public function handle() {}",
"function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n } else if (array_key_exists('displayTuples', $_GET)) {\n\t\t handleDisplayRequest();\n\t\t} else if (array_key_exists('deleteTuple', $_GET)) {\n\t\t handleDeleteRequest();\n\t\t}\n\n disconnectFromDB();\n }\n }",
"function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }",
"public function run()\n {\n $post = file_get_contents($this->getInputFile());\n if (substr($post, 0, 5) == '<?xml') {\n //pingback\n $xs = xmlrpc_server_create();\n xmlrpc_server_register_method(\n $xs, 'pingback.ping', array($this, 'handlePingbackPing')\n );\n $out = xmlrpc_server_call_method($xs, $post, null);\n\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 200 OK');\n $resp->sendXml($out);\n\n } else if (isset($_POST['source']) && isset($_POST['target'])) {\n //webmention\n $res = $this->handleRequest($_POST['source'], $_POST['target']);\n $resp = $this->getWebmentionResponder();\n $resp->send($res);\n\n } else {\n //unknown\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 400 Bad Request');\n $resp->sendHeader('Content-Type: text/html');\n $resp->sendOutput($this->unknownRequest);\n }\n }",
"function onRequest(){\n\n\t// check if we need to reload the application\n\tcheckApplicationState();\n\n\t// initialize the ViewSate for every request\n\tsetViewState( getFactory()->getBean( 'ViewState' ) );\n\n\t// decide what to do, the front controller\n\thandleAction();\n\n\t// render the application\n\trenderApplication();\n}",
"function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n } \n else if (array_key_exists('avgAgeQueryRequest', $_POST)) {\n //console_log(\"hello\");\n handleAvgAgeRequest();\n //echo \"Average age is 0\";\n } \n\n disconnectFromDB();\n }\n }",
"protected function handleGET() {\n /* ... Do the stuff ... */\n\n return $this->render('default.html', array());\n }"
] | [
"0.81443435",
"0.80565155",
"0.8054052",
"0.8054052",
"0.8054052",
"0.8012054",
"0.76565933",
"0.7453767",
"0.7427182",
"0.74211967",
"0.73596436",
"0.7341611",
"0.7303668",
"0.72207993",
"0.71966445",
"0.71955097",
"0.71865135",
"0.71590275",
"0.7092262",
"0.7065288",
"0.7045881",
"0.7045278",
"0.7036542",
"0.70256114",
"0.6975252",
"0.68973315",
"0.6868569",
"0.6863603",
"0.68358356",
"0.6784327",
"0.67840457",
"0.67543256",
"0.67304766",
"0.6724813",
"0.6715296",
"0.670899",
"0.66867405",
"0.66831625",
"0.6657759",
"0.6627255",
"0.66260797",
"0.6602456",
"0.65990335",
"0.6583801",
"0.6576244",
"0.65641546",
"0.65635693",
"0.65503633",
"0.65183526",
"0.6509255",
"0.6501781",
"0.64996064",
"0.64884627",
"0.645482",
"0.6446267",
"0.64323944",
"0.6419897",
"0.64137155",
"0.6398115",
"0.63862145",
"0.63509065",
"0.6330968",
"0.6321741",
"0.632154",
"0.63173103",
"0.6306707",
"0.6304785",
"0.62610155",
"0.6245076",
"0.6226863",
"0.62268484",
"0.62240636",
"0.6201359",
"0.61768043",
"0.6157829",
"0.61539936",
"0.6126824",
"0.6126824",
"0.6126824",
"0.6115132",
"0.6114553",
"0.61085683",
"0.6094312",
"0.6086701",
"0.60811746",
"0.6080727",
"0.60746986",
"0.6071301",
"0.6067646",
"0.60660446",
"0.6065167",
"0.6064856",
"0.6060916",
"0.6053187",
"0.6035924",
"0.602004",
"0.6015193",
"0.60114783",
"0.6009538",
"0.60087067",
"0.6006069"
] | 0.0 | -1 |
Adds a blank line if the last element is not blank. | private static function space(array $lines)
{
if(end($lines) != '')
{
$lines[] = '';
}
return $lines;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function emptyLine();",
"public function emptyLine()\n\t{\n\t\t//return \"\\t\\t\\t\".'<td colspan=\"2\"> </td>'.\"\\n\";\n\t}",
"private function add_new_line() {\n\n\t\t$this->fields[] = array( 'newline' => true );\n\n\t}",
"public function newLine() {\n\t\t$this->_section=0;\n\t\t$this->_lineNumber++;\n\t\t$this->_text[$this->_lineNumber]=array();\n\t\t$this->_text[$this->_lineNumber][0]['text']='';\n\t\t$this->_text[$this->_lineNumber][0]['encoding']='';\n\t\t$this->_text[$this->_lineNumber][0]['font']=$this->_font;\n\t\t$this->_text[$this->_lineNumber][0]['fontSize']=$this->_fontSize;\n\t\t$this->_text[$this->_lineNumber][0]['width']=0;\n\n\t\t\n\t\t$this->_initializeLine();\n\t\t\n\t\t$this->_text[$this->_lineNumber]['alignment']=$this->_text[$this->_lineNumber-1]['alignment'];\n\t\t//add the last cell's height to the auto height if we have an auto-height box.\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_autoHeight+=$this->_text[$this->_lineNumber-1]['height'];\n\t\t}\n\t}",
"private function isCurrentLineBlank()\n {\n return '' == trim($this->currentLine, ' ');\n }",
"private function isCurrentLineEmpty()\n {\n return $this->isCurrentLineBlank() || $this->isCurrentLineComment();\n }",
"protected function new_line()\n {\n }",
"public function ln()\n {\n $this->entries[] = '';\n }",
"public function newLine()\n {\n\n $stock = $this->getStock();\n $randomIndexStock = mt_rand(0, (count($stock)-1));\n $this->line = array_values(array_slice($stock, $randomIndexStock, 1, true));\n unset($stock[$randomIndexStock]);\n $this->stock = array_values($stock);\n }",
"private function terminateLine()\n {\n if ($this->isInline) {\n $this->isInline = false;\n $this->writeToFile('<br>');\n }\n }",
"function delete_first_line() {\n\t\tarray_shift($this->record);\n\t\treturn true;\n\t}",
"private function term_empty() {\n\n $line = $this->_lines->cur();\n if (empty($line)) {\n // just skip empty lines\n $this->_lines->move();\n return '';\n } else {\n return false;\n }\n }",
"public function getEndLine()\n\t{\n\t\treturn null;\n\t}",
"public function newLine()\n {\n echo \"\\n\";\n }",
"public function lastLine()\n {\n $this->line()->application->cursor->previousLine();\n }",
"private function add_next_line($content) {\r\n\t\treturn $content . \"\\n\";\r\n\t}",
"public function appendLine($value = \"\")\r\n {\r\n $this->addElement($value.PHP_EOL);\r\n }",
"public function eol()\n {\n return current($this->tokens)? false:true;\n\n }",
"public function newLineWritten();",
"function linebreak() {\n $this->doc .= '<br/>'.DOKU_LF;\n }",
"protected function deleteNewLines()\r\n {\r\n if (isset($this->data['event'])) {\r\n $this->data['event'] = str_replace(\"\\r\", '', $this->data['event']);\r\n $this->data['event'] = str_replace(\"\\n\", '', $this->data['event']);\r\n }\r\n }",
"function remove_empty_lines($str) {\n\t\t\treturn preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $str);\n\t\t}",
"public function eol()\n {\n $this->result .= PHP_EOL;\n return $this;\n }",
"public function deleteLastRow()\n {\n array_pop($this->childNodes);\n }",
"public function testEndline()\n {\n $this->assertEquals( \"\\r\\n\", ezcMailTools::lineBreak() );\n\n // now let's set it and check that it works\n ezcMailTools::setLineBreak( \"\\n\" );\n $this->assertEquals( \"\\n\", ezcMailTools::lineBreak() );\n }",
"private function makeLineBreaks(): void {\n\t\tif($this->getMaxLineLength()) {\n\t\t\t$this->setMsg(wordwrap($this->getMsg(), $this->getMaxLineLength(), PHP_EOL));\n\t\t}\n\n\t\t$this->setMsg(str_replace('<br />', PHP_EOL, str_replace('<br>', PHP_EOL, $this->getMsg())));\n\t}",
"public function testAppendLineTerminate() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->appendLine(\"Hello\", true)->appendLine(\"World\", true);\n\n\t\t\t$this->assertEquals(\"Hello\\nWorld\\n\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}",
"protected function pMaybeMultiline(array $nodes, bool $trailingComma = true)\n {\n return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl;\n }",
"public function appendNewLine($data) {\r\n\t\tif ($this->exists) {\r\n\t\t\t\r\n\t\t\t$handle = fopen ( $this->filename, \"a\" ) or die ( $this->error [\"103\"] );\r\n\t\t\tfwrite ( $handle, \"\\n\" . $data );\r\n\t\t\tfclose ( $handle );\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }",
"private static function skip_empty_lines( $file ) {\n $str = file_get_contents( $file );\n $str = preg_replace( \"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\" , \"\\n\" , $str );\n\n file_put_contents( $file, $str );\n }",
"public function testNewLineAppend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->append(\"Hello\")->newLine(true)->newLine(true)->append(\"World\");\n\n\t\t\t$this->assertEquals(\"Hello\\n\\nWorld\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}",
"protected function lineBreak() {\n\n return PHP_EOL;\n }",
"public static function EOL() {\n return self::PP? PHP_EOL : FALSE;\n }",
"public function makeBlankItem() {\n\t\treturn $this->wire(new Fieldgroup());\n\t}",
"public function appendOneLine($text) {\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n $this->currentPage->beginText();\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->currentPage->endText();\n return $text;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed)\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n\n return ($isLastLine ? null : $text);\n }",
"public function lastLine(){\n return $this->file[array_key_last($this->file)] ?? '';\n }",
"function getEOL()\n {\n return [[\"\\n\"],[\"\\r\\n\"]];\n }",
"public function testNewLinePrepend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->append(\"Hello\")->newLine(false)->newLine(false)->append(\"World\");\n\n\t\t\t$this->assertEquals(\"\\n\\nHelloWorld\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}",
"public function getEmptyValue()\n {\n return new TextLineValue();\n }",
"function lineBreak()\r\n {\r\n // have a $count parameter because of speed issues.\r\n return self::$lineBreak;\r\n }",
"function emptyLine(string $address, int $line) {\n modifyLine($address, $line, \"\", \"\", \"\"); //modifies line with empty string.\n}",
"private function isEmpty($line) {\n\t//--\n\treturn (trim($line) === '');\n\t//--\n}",
"private function endItem()\n {\n if ($this->version == self::Turbo) {\n echo '</item>' . PHP_EOL;\n }\n }",
"private function setNewLine() {\n $extension = pathinfo($this->path, PATHINFO_EXTENSION);\n if ($extension === Lexer::LINUX_FILE_EXTENSION) {\n $this->newLine = \"\\n\";\n } else {\n $this->newLine = \"\\r\\n\";\n }\n }",
"private function moveToNextLine()\n {\n if ($this->currentLineNb >= count($this->lines) - 1) {\n return false;\n }\n\n $this->currentLine = $this->lines[++$this->currentLineNb];\n\n return true;\n }",
"private function _isEmptyLine(array $columns): bool {\n\t\tforeach ($columns as $column) {\n\t\t\tif (trim($column) !== '') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"private function resolveLastEmptyLine(string $prettyPrintContent) : string\n {\n $tokens = $this->lexer->getTokens();\n $lastToken = \\array_pop($tokens);\n if ($lastToken && isset($lastToken[1]) && \\Typo3RectorPrefix20210423\\Nette\\Utils\\Strings::contains($lastToken[1], \"\\n\")) {\n $prettyPrintContent = \\trim($prettyPrintContent) . \\PHP_EOL;\n }\n return $prettyPrintContent;\n }",
"private function _setNewLineIds()\n {\n $this->_newLineIds = [];\n\n foreach ($this->get('structure') as $line) {\n if ($line['id'] === 0) {\n continue;\n }\n\n $this->_newLineIds[] = $line['id'];\n }\n\n return $this;\n }",
"public function skipLeadingLines(): void\n {\n if (false === $this->linesSkipped) {\n $this->rewind();\n $skip = $this->getStrategy()->getSkipLeadingLinesCount();\n for ($skipped = 0; $skipped < $skip; $skipped++) {\n $this->current();\n $this->next();\n }\n $this->linesSkipped = true;\n }\n }",
"function appendToLastTextChild ($text) {\r\n $ccount = count ($this->_children);\r\n if ($ccount == 0 || $this->_children[$ccount-1]->_type != STRINGPARSER_NODE_TEXT) {\r\n $ntextnode = new StringParser_Node_Text ($text);\r\n return $this->appendChild ($ntextnode);\r\n } else {\r\n $this->_children[$ccount-1]->appendText ($text);\r\n return true;\r\n }\r\n }",
"private function _generateBlankRow(){\n\n $blankRow = array();\n foreach ($this->_fileHeader as $value){\n\n $blankRow[strtolower(str_replace(' ', '-', $value))] = '';\n }\n\n return $blankRow;\n }",
"function Blank($Number = 1)\n {\n $Blank = '';\n for ($i = 0; $i < $Number; $i++)\n {\n $Blank .= ' ';\n }\n return $Blank;\n }",
"public function IsLast()\n {\n return ($this->Length()) == $this->getItemPointer();\n }",
"public function addSeparator()\n\t{\n\t\t$this->body .= '<hr>';\n\t\treturn $this;\n\t}",
"public function addBorderLine()\r\n {\r\n $this->rowIndex++;\r\n $this->data[$this->rowIndex] = self::HR;\r\n\r\n return $this;\r\n }",
"function _appendToLastTextChild ($text) {\r\n $scount = count ($this->_stack);\r\n if ($scount == 0) {\r\n return false;\r\n }\r\n return $this->_stack[$scount-1]->appendToLastTextChild ($text);\r\n }",
"private function makeLineBreaksHTML(): void {\n\t\t$this->setMsg(str_replace([PHP_EOL, '\\r\\n'], '<br />', $this->getMsg()));\n\n\t\tif($this->getMaxLineLength()) {\n\t\t\t$this->setMsg(wordwrap($this->getMsg(), $this->getMaxLineLength(), '<br />' . PHP_EOL));\n\t\t}\n\t}",
"function separator() {\n echo \"<br>\\n<hr>\";\n }",
"function removeLastNewLine($stationID) {\n $file = fopen('data_' . $stationID . '.xml', 'r+') or die(\"can't open: $php_errormsg\");\n fseek($file, -2, SEEK_END); // place the pointer just before the '>' of the station tag\n fwrite($file, '> '); // overwrite 2 bytes with a '>' and a space \n fclose($file); \n}",
"public function newline(int $count = 1)\n {\n Assert::greaterThan($count, 0, \"Invalid linebreak count given, expected '>0' recieved '%s'!\");\n\n for ($i=0; $i < $count; $i++) {\n $this->climate->br();\n }\n }",
"public function moveToStartOfNextLine() {}",
"public function moveToStartOfNextLine() {}",
"function should_lb($previousIndentation, $lineIndentation = 0) {\n if ($previousIndentation > $lineIndentation) {\n return \"\\n\";\n }\n }",
"function _EndsWithNewLine($data=null) \r\n{ \r\n$data = strval($data); //** ensure that data is a string. \r\nif(strlen($data) == 0) //** no date given to test. \r\nreturn false; //** does not end with newline. \r\n\r\n//** get the position of the last newline character. If the value returned \r\n//** is not numeric it is a boolean, indicating no match. Considered to end \r\n//** with newline if it ends with either a '\\n' or '\\r' character. \r\n\r\n$creturnpos = strrpos($data, \"\\r\"); //** position of '\\n'. \r\n$newlinepos = strrpos($data, \"\\n\"); //** position of '\\r'. \r\n\r\nreturn (is_int($newlinepos) || is_int($creturnpos)); \r\n}",
"public function isBlank()\n {\n return $this->matchesPattern('^[[:space:]]*$');\n }",
"protected function get_line_break()\n {\n $this->buffer = fgets($this->filePointer);\n $this->lineCount++;\n\n if($this->buffer == FALSE)\n {\n $this->buffer = [];\n array_push($this->buffer, Instructions::EOF);\n return;\n }\n \n $this->buffer = trim(preg_replace(\"/\\s+/\", \" \", $this->buffer));\n $this->buffer = explode(\" \", $this->buffer);\n \n $this->check_comments();\n\n\n if($this->buffer[0] == NULL)\n {\n $this->buffer = [];\n array_push($this->buffer, Instructions::EMPTY);\n return;\n }\n\n }",
"public function epilog()\n {\n $block = Block::fromString(\n $this->queryContext('inCell') ? ' ' : \"<br/>\\n\"\n );\n return $block;\n }",
"public function getNewline(): string;",
"function WriteLine($data=null) \r\n{ \r\nreturn $this->Write($data . $this->NewLine); \r\n}",
"public function next() {\r\n\t\t$line = parent::next();\r\n\t\tif (!is_null($line)) {\r\n\t\t\t$this->position++;\r\n\t\t\t$this->lastLine = $this->parse($line);\r\n\t\t\treturn $this->lastLine;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"function MoveLast() {}",
"public function newLineChart()\n {\n return $this->newChart('line');\n }",
"private function getBorderLine()\r\n {\r\n $output = '';\r\n\r\n if (isset($this->data[0])) {\r\n $columnCount = count($this->data[0]);\r\n } elseif (isset($this->data[self::HEADER_INDEX])) {\r\n $columnCount = count($this->data[self::HEADER_INDEX]);\r\n } else {\r\n return $output;\r\n }\r\n\r\n for ($col = 0; $col < $columnCount; $col++) {\r\n $output .= $this->getCellOutput($col);\r\n }\r\n\r\n if ($this->border) {\r\n $output .= '+';\r\n }\r\n $output .= PHP_EOL;\r\n\r\n return $output;\r\n }",
"public function testPrependLineTerminate() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", true)->prependLine(\"World\", true);\n\n\t\t\t$this->assertEquals(\"World\\nHello\\n\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}",
"protected function transpileEndEmpty(): string\n {\n return '<?php endif; ?>';\n }",
"public function nl() {\n $this->contexts[$this->current][self::TEXT] .= \"\\n\";\n return $this;\n }",
"protected function eof() { \n\t\treturn !isset($this->lines[$this->cursor]); \n\t}",
"public function hasLines(){\n return $this->_has(38);\n }",
"abstract public function makeBlankItem();",
"public function blank($value){\r\n if(is_string($value)){\r\n $value = str_replace(array(\" \", \"\\t\", \"\\n\", \"\\r\"), \"\", $value);\r\n }\r\n return empty($value);\r\n }",
"function add_line_return($file_path)\n {\n file_put_contents($file_path, \"\\n\", FILE_APPEND);\n }",
"public function newLinesWritten();",
"function add_br(&$output)\n{\n\t$output = preg_replace(\"~\\n~\", \"<br />\\n\", $output);\n}",
"public function NewLine(string $char = null) : self|string\n {\n if($char == null) return $this->newline;\n else {\n $this->newline = $char;\n return $this;\n }\n\n }",
"public function isMultiline() {}",
"function infy_nl($count = 1)\n {\n return str_repeat(PHP_EOL, $count);\n }",
"public function testAddLineItem()\n {\n $this->addItem();\n $this->addItem();\n\n $this->laracart->addLine(\n 'itemID',\n 'Testing Item',\n 1,\n '1', [\n 'b_test' => 'option_1',\n 'a_test' => 'option_2',\n ]\n );\n\n $this->assertEquals(2, $this->laracart->count(false));\n $this->assertEquals(3, $this->laracart->count());\n }",
"private function makeLines()\n\t{\n\t\t$line = 1;\n\t\t/** @var Token $token */\n\t\tforeach ($this->tokens as $token)\n\t\t{\n\t\t\t$token->line = $line;\n\t\t\tif (preg_match_all(\"/\\\\n/\", $token->text, $m))\n\t\t\t{\n\t\t\t\t$line += count($m[0]);\n\t\t\t}\n\t\t}\n\t}",
"protected function lineBreaks() {\n\t\t$this->text = $this->removeUnneccesaryLinebreaks($this->text);\n\t\t$this->text = nl2br($this->text);\n\t\tReturn $this;\n\t}",
"function countAddedLines()\n {\n }",
"function br2line($item) {\n\t\treturn preg_replace('/<br[^>]*>/i', ' ', $item);\n\t}",
"public static function removeEmptyLines($text)\n {\n return preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n }",
"public function lastElement(): string {\n $len = count($this->elements);\n return $len > 0 ? $this->elements[$len - 1] : '';\n }",
"protected function _newLine($item)\n {\n if (!$item->getId()) {\n $this->setCanSendRequest(false);\n\n return false;\n }\n\n $this->_addGwItemsAmount($item);\n if ($this->isProductCalculated($item)) {\n return false;\n }\n $product = $this->_getProductByProductId($this->_retrieveProductIdFromQuoteItem($item));\n $taxClass = $this->_getTaxClassCodeByProduct($product);\n $price = $item->getBaseRowTotal();\n if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($item->getStoreId())) {\n $price -= $item->getBaseDiscountAmount();\n }\n\n $lineNumber = $this->_getNewLineCode();\n\n $line = $this->_getNewDocumentRequestLineObject();\n $line->setLineCode($lineNumber);\n $line->setItemCode(\n $this->_getCalculationHelper()->getItemCode(\n $this->_getProductForItemCode($item),\n $item->getStoreId()\n )\n );\n $line->setNumberOfItems($item->getTotalQty());\n $line->setlineAmount($price);\n $line->setItemDescription($item->getName());\n $discounted = (float)$item->getDiscountAmount()\n && $this->_getTaxDataHelper()\n ->applyTaxAfterDiscount($item->getStoreId())\n ? 'true'\n : 'false';\n\n $line->setDiscounted($discounted);\n\n if ($this->_getTaxDataHelper()->priceIncludesTax($item->getStoreId())) {\n $line->setTaxIncluded('true');\n }\n\n if ($taxClass) {\n $line->setAvalaraGoodsAndServicesType($taxClass);\n }\n\n $metadata = null;\n $ref1Value = $this->_getRefValueByProductAndNumber($product, 1, $item->getStoreId());\n if ($ref1Value) {\n $metadata['ref1'] = $ref1Value;\n }\n $ref2Value = $this->_getRefValueByProductAndNumber($product, 2, $item->getStoreId());\n if ($ref2Value) {\n $metadata['ref2'] = $ref2Value;\n }\n if ($metadata) {\n $line->setMetadata($metadata);\n }\n\n $this->_lines[$lineNumber] = $line;\n $this->_lineToLineId[$lineNumber] = $item->getId();\n\n return $lineNumber;\n }",
"public function notEmpty()\n {\n $this->non_empty = true;\n }",
"public function addLast($e);",
"private function inlineComment()\n {\n do {\n $this->next();\n if ($this->currentByte === \"\\n\" || $this->currentByte === \"\\r\") {\n $this->next();\n\n return;\n }\n } while ($this->currentByte !== null);\n }",
"public function getEndOfLine()\n {\n return $this->endOfLine;\n }",
"function hr() {\n $this->doc .= '<hr />'.DOKU_LF;\n }"
] | [
"0.67539257",
"0.64209706",
"0.6342353",
"0.62505233",
"0.6163324",
"0.59814924",
"0.59573495",
"0.5922869",
"0.58615535",
"0.57226735",
"0.5545825",
"0.55422246",
"0.5516996",
"0.53848296",
"0.5292114",
"0.52745247",
"0.5273774",
"0.5262848",
"0.52592117",
"0.5251377",
"0.5209727",
"0.5158677",
"0.5135875",
"0.50966287",
"0.50892806",
"0.50691706",
"0.50434625",
"0.50411654",
"0.5040586",
"0.5034038",
"0.503369",
"0.5031722",
"0.5022469",
"0.50154406",
"0.5014015",
"0.50064355",
"0.4994025",
"0.49884847",
"0.49800515",
"0.49738568",
"0.49526042",
"0.49303937",
"0.49052876",
"0.4890697",
"0.48822382",
"0.48817703",
"0.48707408",
"0.4862126",
"0.48557442",
"0.4849847",
"0.48488003",
"0.48452872",
"0.4841031",
"0.48387524",
"0.48377144",
"0.48344377",
"0.48263988",
"0.48249802",
"0.4811571",
"0.48012304",
"0.47950166",
"0.47912154",
"0.47912154",
"0.4791102",
"0.47886983",
"0.47845685",
"0.4781822",
"0.47790074",
"0.4777658",
"0.47730708",
"0.4737327",
"0.47138086",
"0.4706843",
"0.4705003",
"0.47041965",
"0.46985623",
"0.46967962",
"0.46937314",
"0.46918914",
"0.4687575",
"0.46748075",
"0.46705976",
"0.46603918",
"0.46600488",
"0.46538693",
"0.46534008",
"0.46510044",
"0.4646948",
"0.46353176",
"0.46350655",
"0.4633431",
"0.4632818",
"0.463274",
"0.46269497",
"0.4621645",
"0.4619844",
"0.46193406",
"0.4618161",
"0.46140173",
"0.46118087"
] | 0.47652394 | 70 |
Display a listing of the resource. | public function index()
{
try{
return InteressadoResource::collection(Interessado::paginate());
}catch(\Exception $e){
return response()->json([
'erro' => true,
'data' => 'Erro ao consultar interessados: '.$e->getMessage()
], 500);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"function listing() {\r\n\r\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"public function _index(){\n\t $this->_list();\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446377",
"0.7361922",
"0.72984487",
"0.7248631",
"0.7162871",
"0.7148215",
"0.7131838",
"0.71028054",
"0.7102395",
"0.70988023",
"0.7048243",
"0.6993516",
"0.6989079",
"0.69341344",
"0.69001913",
"0.6899167",
"0.68920904",
"0.6887188",
"0.68661547",
"0.6849159",
"0.683002",
"0.6801792",
"0.6796645",
"0.67952746",
"0.678579",
"0.6760132",
"0.6741144",
"0.67304057",
"0.6726034",
"0.6723304",
"0.6723304",
"0.6723304",
"0.67188966",
"0.67061126",
"0.67046595",
"0.67042124",
"0.6664004",
"0.6663109",
"0.66603667",
"0.66595376",
"0.6656908",
"0.66536283",
"0.6648508",
"0.6619696",
"0.66191936",
"0.66145146",
"0.66056865",
"0.6600895",
"0.66007215",
"0.6593214",
"0.6587006",
"0.6585572",
"0.6584028",
"0.65802413",
"0.65751636",
"0.6574276",
"0.6572553",
"0.65703243",
"0.6569474",
"0.6563628",
"0.6563418",
"0.65516967",
"0.655156",
"0.65460885",
"0.65367365",
"0.6533626",
"0.6533064",
"0.6527408",
"0.65251255",
"0.6524834",
"0.65202224",
"0.6517302",
"0.65167385",
"0.6516062",
"0.65148616",
"0.6506742",
"0.65018",
"0.6501768",
"0.6494415",
"0.64921784",
"0.6486631",
"0.6485237",
"0.6484199",
"0.64841217",
"0.6479556",
"0.6478558",
"0.6469807",
"0.646858",
"0.64683306",
"0.6466808",
"0.64637285",
"0.64616066",
"0.6458575",
"0.6457558",
"0.64535207",
"0.64534074",
"0.64524984",
"0.64491946",
"0.6448726",
"0.6447211",
"0.64461327"
] | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view('resource.create');\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }",
"public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create()\n {\n return view ('forms.create');\n }",
"public function create ()\n {\n return view('forms.create');\n }",
"public function create()\n\t{\n\t\treturn view('faith.form');\n\t}",
"public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }",
"public function create()\n {\n return view(\"request_form.form\");\n }",
"public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }",
"public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle école'\n\t\t) ) );\n\t}",
"public function create()\n {\n return view($this->forms . '.create');\n }",
"public function create()\n {\n return view('restful.add');\n }",
"public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }",
"public function create()\n {\n return view('admin.createform');\n }",
"public function create()\n {\n return view('admin.forms.create');\n }",
"public function create()\n {\n return view('backend.student.form');\n }",
"public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function create()\n {\n return view('client.form');\n }",
"public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }",
"public function create()\n {\n return view('Form');\n }",
"public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }",
"public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }",
"public function create()\n {\n return view('backend.schoolboard.addform');\n }",
"public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}",
"public function create()\n {\n //\n return view('form');\n }",
"public function create()\n {\n return view('rests.create');\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return view(\"Add\");\n }",
"public function create(){\n return view('form.create');\n }",
"public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create()\n {\n\n return view('control panel.student.add');\n\n }",
"public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }",
"public function create()\n {\n return $this->cView(\"form\");\n }",
"public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }",
"public function create()\n {\n return view(\"dresses.form\");\n }",
"public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }",
"public function create()\n {\n return view('fish.form');\n }",
"public function create()\n {\n return view('users.forms.create');\n }",
"public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}",
"public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }",
"public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }",
"public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }",
"public function create()\n {\n return view('essentials::create');\n }",
"public function create()\n {\n return view('student.add');\n }",
"public function create()\n {\n return view('url.form');\n }",
"public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}",
"public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }",
"public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}",
"public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view('crud/add'); }",
"public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}",
"public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view(\"List.form\");\n }",
"public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}",
"public function create()\n {\n //load create form\n return view('products.create');\n }",
"public function create()\n {\n return view('article.addform');\n }",
"public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }",
"public function create()\n {\n return view('saldo.form');\n }",
"public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}",
"public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}",
"public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }",
"public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }",
"public function create()\n {\n return view('admin.inverty.add');\n }",
"public function create()\n {\n return view('Libro.create');\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view(\"familiasPrograma.create\");\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}",
"public function create()\n {\n return view(\"create\");\n }",
"public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}",
"public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view('forming');\n }",
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }",
"public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }",
"public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }",
"public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }",
"public function create()\n {\n return view('student::students.student.create');\n }",
"public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}"
] | [
"0.75936973",
"0.75936973",
"0.7585464",
"0.7576766",
"0.7571166",
"0.7498768",
"0.7434969",
"0.7432511",
"0.7387868",
"0.7351811",
"0.7336364",
"0.73113805",
"0.7293885",
"0.72812635",
"0.7273037",
"0.72410345",
"0.7228987",
"0.7225174",
"0.718589",
"0.71786976",
"0.7172516",
"0.71492815",
"0.7143504",
"0.7143484",
"0.71349627",
"0.71274126",
"0.7122271",
"0.7115064",
"0.7115064",
"0.7115064",
"0.7110841",
"0.70930386",
"0.70841706",
"0.7079425",
"0.7079275",
"0.70567256",
"0.70567256",
"0.7054091",
"0.70386195",
"0.7038531",
"0.7034834",
"0.7032825",
"0.7029208",
"0.70263356",
"0.7025177",
"0.7018699",
"0.70156187",
"0.7004536",
"0.7002615",
"0.7000439",
"0.69960874",
"0.6992934",
"0.6991493",
"0.6988563",
"0.698635",
"0.69649065",
"0.6963641",
"0.69552153",
"0.6950279",
"0.69498897",
"0.69465077",
"0.6943029",
"0.6940043",
"0.6939427",
"0.69359136",
"0.69359136",
"0.69357383",
"0.6933012",
"0.6929994",
"0.69270134",
"0.69259113",
"0.6923401",
"0.6917057",
"0.69144267",
"0.6911519",
"0.6909902",
"0.690978",
"0.6905855",
"0.6903688",
"0.6900189",
"0.68999064",
"0.6898482",
"0.6893158",
"0.6892387",
"0.6891021",
"0.68905854",
"0.6890334",
"0.6890334",
"0.68871844",
"0.68864834",
"0.68854547",
"0.6881966",
"0.68814063",
"0.68788683",
"0.68738896",
"0.6871671",
"0.68716353",
"0.68688464",
"0.6868651",
"0.68685114",
"0.686829"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
try {
$data = $request->all();
// dd($data);
foreach ($data as $interessado ){
Interessado::create($interessado);
}
return response()->json([
'erro' => false,
'data' => 'Interessados adicionados com sucesso!'
]);
}catch(\Exception $e){
return response()->json([
'erro' => true,
'data' => 'Erro ao cadastrar Interessado: '.$e->getMessage()
], 500);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
] | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
try{
$interessado = Interessado::findOrFail($id);
$interessado->bolo;
return response()->json([
'erro' => false,
'data' => $interessado
]);
}catch(\Exception $e){
return response()->json([
'erro' => true,
'data' => 'Erro ao consultar interessado: '.$e->getMessage()
], 500);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
] | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245",
"0.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
] | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}"
] | [
"0.7855416",
"0.769519",
"0.72748375",
"0.724256",
"0.7173659",
"0.7064689",
"0.70549816",
"0.6985127",
"0.6949479",
"0.69474626",
"0.694228",
"0.6929372",
"0.6903047",
"0.6899655",
"0.6899655",
"0.688039",
"0.68649715",
"0.68618995",
"0.68586665",
"0.68477386",
"0.68366665",
"0.6812782",
"0.6807947",
"0.68078786",
"0.6803727",
"0.6796845",
"0.67935634",
"0.67935634",
"0.67894953",
"0.67862976",
"0.67815566",
"0.6777874",
"0.67700446",
"0.6764179",
"0.6747784",
"0.6747784",
"0.67476946",
"0.6746584",
"0.67417157",
"0.67370653",
"0.6727131",
"0.6714694",
"0.66953164",
"0.6693583",
"0.6690321",
"0.66898996",
"0.6689058",
"0.66865313",
"0.6684526",
"0.66717213",
"0.6670211",
"0.6666833",
"0.6666833",
"0.66633433",
"0.6663041",
"0.6661699",
"0.6658396",
"0.6657984",
"0.665473",
"0.6644314",
"0.66343915",
"0.6633082",
"0.6629606",
"0.6629606",
"0.6620677",
"0.6620635",
"0.66180485",
"0.66171867",
"0.6612161",
"0.6610249",
"0.660762",
"0.6597593",
"0.6596027",
"0.6595597",
"0.65925545",
"0.65920216",
"0.65896076",
"0.65822965",
"0.6581996",
"0.65817595",
"0.65770084",
"0.65768373",
"0.6575926",
"0.65713066",
"0.6569505",
"0.656938",
"0.65680295",
"0.65636957",
"0.65636957",
"0.65624565",
"0.65597314",
"0.6559697",
"0.65576696",
"0.65573514",
"0.65564495",
"0.6556307",
"0.655628",
"0.65558994",
"0.6549784",
"0.6549675",
"0.65461886"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
try{
$data = $request->all();
$interessado = Interessado::findOrFail($id);
$interessado->update($data);
return response()->json([
'erro' => false,
'data' => $interessado
]);
}catch(\Exception $e){
return response()->json([
'erro' => true,
'data' => 'Erro ao atualizar interessado: '.$e->getMessage()
], 500);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
] | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
try{
$interessado = Interessado::findOrFail($id);
$interessado->delete();
return response()->json([
'erro' => false,
'data' => 'Interessado excluido com sucesso!'
]);
}catch(\Exception $e){
return response()->json([
'erro' => true,
'data' => 'Erro ao excluir Interessado: '.$e->getMessage()
], 500);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }"
] | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
] | 0.0 | -1 |
Get the form element for the element | public function getForm()
{
return $this->getAncestorInstanceOf('FewAgency\FluentForm\FluentForm');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getWebformElement() {\n $element = $this->getElement();\n return ($element) ? $this->elementManager->getElementInstance($element) : NULL;\n }",
"protected function getElement() {\n return $this->getWebform()->getElement($this->configuration['element_key']);\n }",
"public function accessForm(): IFormElement;",
"function getForm()\n {\n return $this->getAttribute(\"form\");\n }",
"public function getFormElement()\n {\n $formElement = 'imageUploader';\n if (version_compare($this->magentoMetadata->getVersion(), '2.3.0', '<')) {\n $formElement = 'fileUploader';\n }\n\n return $formElement;\n }",
"public function getForm() {\n\t\treturn isset($this->attributes['form'])?$this->attributes['form']:null;\n\t}",
"public function getForm() {\n return $this->form;\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 getForm()\n {\n return $this->form;\n }",
"public function getForm()\n {\n return $this->form;\n }",
"function getForm() {\n return $this->form;\n }",
"public function getForm()\n {\n return $this;\n }",
"public function getForm();",
"public function getFormEntry()\n {\n return $this->form->getEntry();\n }",
"public static function getForm();",
"public function getFormNode()\n {\n if (true === empty($this->formNode)) {\n $this->formNode = $this->fetchFormNode();\n }\n\n return $this->formNode;\n }",
"public function element($_element=NULL){\n if(\n isset($this->_elements[$_element]) &&\n $this->_elements[$_element] instanceof Dadiweb_Tags_Abstract\n ){\n return $this->_elements[$_element]->open(\n array('name'=>$this->getFormName())\n );\n }else{\n throw Dadiweb_Throw_ErrorException::showThrow(\n sprintf(\n 'Element \"%s\" is not defined into class \"%s\"',\n $_element,\n get_class($this)\n )\n );\n }\n }",
"public function form(){\n\t\treturn $this->form;\n\t}",
"public function getForm()\n {\n return $this->_form;\n }",
"abstract protected function getForm();",
"protected function fkElement()\n\t{\n\t\treturn $this->formModel->getElement($this->params->get('foreign_key'), true);\n\t}",
"public function getFormElement(&$obj, $title=NULL)\r\n {\r\n if(isset($this->func_getFormElement)) {\r\n $fn= $this->func_getFormElement;\r\n return $fn(&$this, &$obj, $title);\r\n }\r\n else {\r\n return new Form_CustomHTML('');\r\n }\r\n }",
"public function getElement($id)\n\t{\n\t\tif (isset($this->elements[$id]))\n\t\t\treturn $this->elements[$id];\n\t\telse\n\t\t\tthrow new FormError('Element '.$id.' does not exist!');\n\t}",
"public function getElement()\n {\n return $this->element;\n }",
"abstract function getForm();",
"public function getForm()\n {\n if (!isset($this->form)) {\n try {\n $this->form = SimpleForms::$plugin->forms->getFormById($this->formId);\n } catch (\\Exception $e) {\n // Do nothing\n }\n }\n\n return $this->form;\n }",
"public function getForm()\n {\n RETURN $this->strategy->getForm();\n }",
"public function get_form() {\n\t\treturn $this;\n\t}",
"public function getForm($xpath = '//form') {\n\t\treturn $this->getCrawler()->filterXPath($xpath)->form();\n\t}",
"protected function fetchFormNode()\n {\n $list = $this->document->xpath('//form');\n\n if (0 == count($list)) {\n throw new \\InvalidArgumentException(\"Form element not found in passed HTML\");\n }\n\n if (1 < count($list)) {\n throw new \\InvalidArgumentException(\"More than one form found in passed HTML\");\n }\n\n return new HtmlNode($list[0], $this->document->getDocument());\n }",
"public function getElement()\n\t{\n\t\treturn $this->_element;\n\t}",
"public function getElement()\n {\n if ($this->element_id != 0) {\n return $this->getTable('Element')->find($this->element_id);\n }\n }",
"public function &getForm() {\n return $this->form;\n }",
"function getForm(){\r\n\t\t$data = [\r\n\t\t\t'EFORM' => [\r\n\t\t\t\t'formName' => $this->formName,\r\n\t\t\t\t'scope' => $this->scope,\r\n\t\t\t\t'_uid' => $this->uid,\r\n\t\t\t\t'elements' => $this->fields->getFormViewFields($this),\r\n\t\t\t\t'errors' => $this->errors,\r\n\t\t\t\t'buttons' => $this->buttons->get()\r\n\t\t\t]\r\n\t\t];\r\n\r\n\t\tif($this->actions){\r\n\t\t\t$data['EFORM']['actions'] = $this->actions->getForSmarty();\r\n\t\t}\r\n\t\tif(!empty($this->statuses)){\r\n\t\t\t$data['EFORM']['fieldStatuses'] = $this->statuses;\r\n\t\t}\r\n\r\n\t\t$view = new ViewElementClass();\r\n\t\t$view->type = 'form_start';\r\n\t\t$view->data = $data;\r\n\t\treturn $view;\r\n\t}",
"public function getElement();",
"public function getElement();",
"public function getUserDefinedForm()\n {\n if ($userFormsController = $this->getUserFormController()) {\n return $userFormsController->Form();\n }\n\n return null;\n }",
"protected function getForm( $html=false ) { return $this->form_name; }",
"function element_form($element, $record, $options = array())\n{\n $html = '';\n // If we have an array of Elements, loop through the form to display them.\n if (is_array($element)) {\n foreach ($element as $key => $e) {\n $html .= get_view()->elementForm($e, $record, $options);\n }\n } else {\n $html = get_view()->elementForm($element, $record, $options);\n }\n return $html;\n}",
"public function getForm(): string\n {\n return $this->html;\n }",
"public function getForm(): FormInterface;",
"public function getFormSelector()\n {\n return '#form-' . $this->formId;\n }",
"abstract public function getForm($formId);",
"public function getLoginForm()\n {\n return '//form[@id=\"loginForm\"]';\n }",
"public function getLoginForm()\n {\n return '//form[@id=\"loginForm\"]';\n }",
"public function getElement() {\r\n $elementId = (int)$this->getProperty('elementId', 0);\r\n $elementClass = $this->getProperty('elementType', '');\r\n if ($elementId && !empty($elementClass)) {\r\n return $this->modx->getObject($elementClass, $elementId);\r\n }\r\n\r\n return null;\r\n }",
"public function getSlideForm(){\n if(null === $this->slideForm)\n $this->slideForm = $this->getServiceLocator()->get('slide_form');\n return $this->slideForm;\n }",
"public function getForm()\n {\n return $this->getXml()->getElementsByTagName('PlayerForm')->item(0)->nodeValue;\n }",
"protected function getWebform() {\n if (!isset($this->webform)) {\n if (!empty($this->options['webform_nid'])) {\n $this->webform = node_load($this->options['webform_nid']);\n }\n elseif (isset($this->view->argument['nid']) && !empty($this->view->args)) {\n $nid = $this->view->args[$this->view->argument['nid']->position];\n $this->webform = node_load($nid);\n }\n elseif ($menu_object = menu_get_object('webform_menu')) {\n $this->webform = $menu_object;\n }\n elseif (strpos($_GET['q'], 'admin/structure/views/ajax/preview/webform_workflow_submissions') === 0) {\n if (isset($_POST['view_args'])) {\n $this->webform = node_load($_POST['view_args'][0]);\n }\n elseif (arg(7)) {\n $this->webform = node_load(arg(7));\n }\n }\n elseif ($this->view->name == 'webform_workflow_submissions' && strpos(current_path(), '/ajax') && !empty($_POST['view_args'])) {\n $this->webform = node_load($_POST['view_args'][0]);\n }\n }\n return $this->webform ? $this->webform : FALSE;\n }",
"public function getItemForm() {\n if (!$this->itemForm) {\n $this->setItemForm($this->getServiceLocator()->get('bidsite_item_form'));\n }\n return $this->itemForm;\n }",
"function getFormTarget()\n {\n return $this->getAttribute(\"formtarget\");\n }",
"public function getFormInObject()\n {\n $sExKey = null;\n\n if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) {\n\n $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity);\n $oModel = new $sModelName;\n\n $oEntity = new $this->_sSynchronizeEntity;\n $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);\n $sMethodName = 'findOneBy'.$sPrimaryKey;\n $oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity));\n\n if (is_object($oCompleteEntity)) {\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n\t\t\t\t\tif ($sValue instanceof \\Venus\\lib\\Form\\Input && $sValue->getType() == 'submit') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio) {\n\n $sExKey = $sKey;\n $sKey = substr($sKey, 0, -6);\n }\n\n if ($sValue instanceof Form) {\n\n ;\n } else {\n\n $sMethodNameInEntity = 'get_'.$sKey;\n\t\t\t\t\t\tif (method_exists($oCompleteEntity, $sMethodNameInEntity)) {\n\t\t\t\t\t\t\t$mValue = $oCompleteEntity->$sMethodNameInEntity();\n\t\t\t\t\t\t}\n\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) {\n\n $this->_aElement[$sExKey]->setValueChecked($mValue);\n } else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) {\n\n $this->_aElement[$sKey]->setValue($mValue);\n }\n }\n }\n }\n }\n\n $oForm = new \\StdClass();\n $oForm->start = '<form name=\"form'.$this->_iFormNumber.'\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\"1\" name=\"validform'.$this->_iFormNumber.'\">';\n $oForm->form = array();\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n if ($sValue instanceof Container) {\n\n $oForm->form[$sKey] = $sValue;\n } else {\n\n $oForm->form[$sKey] = $sValue->fetch();\n }\n }\n\n $oForm->end = '</form>';\n\n return $oForm;\n }",
"public function get_mform() {\n return $this->_form;\n }",
"public function form($element = 'fields')\n {\n $form = new Form();\n return $form->form($element, true);\n }",
"function getInputElement($alias,$label)\n {\n return new T_Form_Text($alias,$label);\n }",
"public function getForm()\n {\n return $this->getLayout()\n ->createBlock('adminhtml/newsletter_template_edit_form')\n ->toHtml();\n }",
"function jplesson_form_element($element, $value) {\n // This is also used in the installer, pre-database setup.\n $t = get_t();\n\n $output = '<div class=\"form-item '. $element['#attributes']['class'] .'\"';\n if (!empty($element['#id'])) {\n $output .= ' id=\"' . $element['#id'] . '-wrapper\"';\n }\n $output .= \">\\n\";\n $required = !empty($element['#required']) ? '<span class=\"form-required\" title=\"' . $t('This field is required.') . '\">*</span>' : '';\n\n if (!empty($element['#title'])) {\n $title = $element['#title'];\n if (!empty($element['#id'])) {\n $output .= ' <label for=\"' . $element['#id'] . '\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n else {\n $output .= ' <label>' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n }\n\n $output .= \" $value\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n return $output;\n}",
"public function getObject() {\n return $this->form->getObject();\n }",
"public function form_elements() {\n\n\t\t\t// Instantiate Widget Inputs\n\t\t\t$form_elements = new Layers_Form_Elements();\n\n\t\t\t// Return design bar\n\t\t\treturn $form_elements;\n\n\t\t}",
"public function getWebForm( $w_id ) {\n\t\treturn $this->call( 'webforms/' . $w_id );\n\t}",
"public function elementLayoutForm($request = null)\n {\n $factory = ElementLayoutFormFactory::create();\n return $factory->getForm($this);;\n }",
"public function getWebformSubmission() {\n return $this->submission;\n }",
"function getInputForm() {\n\t\treturn new \\Flux\\Lead();\n\t}",
"protected function &getElementItem($element_id, $index = 0) {\n\n $item =& $this->form[$element_id];\n\n if ($item['#type'] != 'container') {\n return $item;\n }\n else {\n $item =& $item['und'];\n }\n\n if (isset($item['#type'])) {\n return $item;\n }\n else {\n $item =& $item[$index];\n }\n // References have a target.\n if (isset($item['target_id'])) {\n $item =& $item['target_id'];\n }\n\n return $item;\n }",
"protected function getForm() {\n\t\tglobal $wgScript;\n\n\t\t$this->opts['title'] = $this->getPageTitle()->getPrefixedText();\n\t\tif ( !isset( $this->opts['target'] ) ) {\n\t\t\t$this->opts['target'] = '';\n\t\t} else {\n\t\t\t$this->opts['target'] = str_replace( '_', ' ', $this->opts['target'] );\n\t\t}\n\n\t\tif ( !isset( $this->opts['namespace'] ) ) {\n\t\t\t$this->opts['namespace'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['nsInvert'] ) ) {\n\t\t\t$this->opts['nsInvert'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['associated'] ) ) {\n\t\t\t$this->opts['associated'] = false;\n\t\t}\n\n\t\tif ( !isset( $this->opts['contribs'] ) ) {\n\t\t\t$this->opts['contribs'] = 'user';\n\t\t}\n\n\t\tif ( !isset( $this->opts['year'] ) ) {\n\t\t\t$this->opts['year'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['month'] ) ) {\n\t\t\t$this->opts['month'] = '';\n\t\t}\n\n\t\tif ( $this->opts['contribs'] == 'newbie' ) {\n\t\t\t$this->opts['target'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['tagfilter'] ) ) {\n\t\t\t$this->opts['tagfilter'] = '';\n\t\t}\n\n\t\tif ( !isset( $this->opts['topOnly'] ) ) {\n\t\t\t$this->opts['topOnly'] = false;\n\t\t}\n\n\t\tif ( !isset( $this->opts['newOnly'] ) ) {\n\t\t\t$this->opts['newOnly'] = false;\n\t\t}\n\n\t\t$form = Html::openElement(\n\t\t\t'form',\n\t\t\tarray(\n\t\t\t\t'method' => 'get',\n\t\t\t\t'action' => $wgScript,\n\t\t\t\t'class' => 'mw-contributions-form'\n\t\t\t)\n\t\t);\n\n\t\t# Add hidden params for tracking except for parameters in $skipParameters\n\t\t$skipParameters = array(\n\t\t\t'namespace',\n\t\t\t'nsInvert',\n\t\t\t'deletedOnly',\n\t\t\t'target',\n\t\t\t'contribs',\n\t\t\t'year',\n\t\t\t'month',\n\t\t\t'topOnly',\n\t\t\t'newOnly',\n\t\t\t'associated'\n\t\t);\n\n\t\tforeach ( $this->opts as $name => $value ) {\n\t\t\tif ( in_array( $name, $skipParameters ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$form .= \"\\t\" . Html::hidden( $name, $value ) . \"\\n\";\n\t\t}\n\n\t\t$tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagfilter'] );\n\n\t\tif ( $tagFilter ) {\n\t\t\t$filterSelection = Html::rawElement(\n\t\t\t\t'td',\n\t\t\t\tarray( 'class' => 'mw-label' ),\n\t\t\t\tarray_shift( $tagFilter )\n\t\t\t);\n\t\t\t$filterSelection .= Html::rawElement(\n\t\t\t\t'td',\n\t\t\t\tarray( 'class' => 'mw-input' ),\n\t\t\t\timplode( ' ', $tagFilter )\n\t\t\t);\n\t\t} else {\n\t\t\t$filterSelection = Html::rawElement( 'td', array( 'colspan' => 2 ), '' );\n\t\t}\n\n\t\t$labelNewbies = Xml::radioLabel(\n\t\t\t$this->msg( 'sp-contributions-newbies' )->text(),\n\t\t\t'contribs',\n\t\t\t'newbie',\n\t\t\t'newbie',\n\t\t\t$this->opts['contribs'] == 'newbie',\n\t\t\tarray( 'class' => 'mw-input' )\n\t\t);\n\t\t$labelUsername = Xml::radioLabel(\n\t\t\t$this->msg( 'sp-contributions-username' )->text(),\n\t\t\t'contribs',\n\t\t\t'user',\n\t\t\t'user',\n\t\t\t$this->opts['contribs'] == 'user',\n\t\t\tarray( 'class' => 'mw-input' )\n\t\t);\n\t\t$input = Html::input(\n\t\t\t'target',\n\t\t\t$this->opts['target'],\n\t\t\t'text',\n\t\t\tarray( 'size' => '40', 'required' => '', 'class' => 'mw-input' ) +\n\t\t\t\t( $this->opts['target'] ? array() : array( 'autofocus' )\n\t\t\t\t)\n\t\t);\n\t\t$targetSelection = Html::rawElement(\n\t\t\t'td',\n\t\t\tarray( 'colspan' => 2 ),\n\t\t\t$labelNewbies . '<br />' . $labelUsername . ' ' . $input . ' '\n\t\t);\n\n\t\t$namespaceSelection = Xml::tags(\n\t\t\t'td',\n\t\t\tarray( 'class' => 'mw-label' ),\n\t\t\tXml::label(\n\t\t\t\t$this->msg( 'namespace' )->text(),\n\t\t\t\t'namespace',\n\t\t\t\t''\n\t\t\t)\n\t\t);\n\t\t$namespaceSelection .= Html::rawElement(\n\t\t\t'td',\n\t\t\tnull,\n\t\t\tHtml::namespaceSelector(\n\t\t\t\tarray( 'selected' => $this->opts['namespace'], 'all' => '' ),\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'namespace',\n\t\t\t\t\t'id' => 'namespace',\n\t\t\t\t\t'class' => 'namespaceselector',\n\t\t\t\t)\n\t\t\t) . ' ' .\n\t\t\t\tHtml::rawElement(\n\t\t\t\t\t'span',\n\t\t\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\t\t\tXml::checkLabel(\n\t\t\t\t\t\t$this->msg( 'invert' )->text(),\n\t\t\t\t\t\t'nsInvert',\n\t\t\t\t\t\t'nsInvert',\n\t\t\t\t\t\t$this->opts['nsInvert'],\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title' => $this->msg( 'tooltip-invert' )->text(),\n\t\t\t\t\t\t\t'class' => 'mw-input'\n\t\t\t\t\t\t)\n\t\t\t\t\t) . ' '\n\t\t\t\t) .\n\t\t\t\tHtml::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),\n\t\t\t\t\tXml::checkLabel(\n\t\t\t\t\t\t$this->msg( 'namespace_association' )->text(),\n\t\t\t\t\t\t'associated',\n\t\t\t\t\t\t'associated',\n\t\t\t\t\t\t$this->opts['associated'],\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'title' => $this->msg( 'tooltip-namespace_association' )->text(),\n\t\t\t\t\t\t\t'class' => 'mw-input'\n\t\t\t\t\t\t)\n\t\t\t\t\t) . ' '\n\t\t\t\t)\n\t\t);\n\n\t\tif ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {\n\t\t\t$deletedOnlyCheck = Html::rawElement(\n\t\t\t\t'span',\n\t\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\t\tXml::checkLabel(\n\t\t\t\t\t$this->msg( 'history-show-deleted' )->text(),\n\t\t\t\t\t'deletedOnly',\n\t\t\t\t\t'mw-show-deleted-only',\n\t\t\t\t\t$this->opts['deletedOnly'],\n\t\t\t\t\tarray( 'class' => 'mw-input' )\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t$deletedOnlyCheck = '';\n\t\t}\n\n\t\t$checkLabelTopOnly = Html::rawElement(\n\t\t\t'span',\n\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\tXml::checkLabel(\n\t\t\t\t$this->msg( 'sp-contributions-toponly' )->text(),\n\t\t\t\t'topOnly',\n\t\t\t\t'mw-show-top-only',\n\t\t\t\t$this->opts['topOnly'],\n\t\t\t\tarray( 'class' => 'mw-input' )\n\t\t\t)\n\t\t);\n\t\t$checkLabelNewOnly = Html::rawElement(\n\t\t\t'span',\n\t\t\tarray( 'style' => 'white-space: nowrap' ),\n\t\t\tXml::checkLabel(\n\t\t\t\t$this->msg( 'sp-contributions-newonly' )->text(),\n\t\t\t\t'newOnly',\n\t\t\t\t'mw-show-new-only',\n\t\t\t\t$this->opts['newOnly'],\n\t\t\t\tarray( 'class' => 'mw-input' )\n\t\t\t)\n\t\t);\n\t\t$extraOptions = Html::rawElement(\n\t\t\t'td',\n\t\t\tarray( 'colspan' => 2 ),\n\t\t\t$deletedOnlyCheck . $checkLabelTopOnly . $checkLabelNewOnly\n\t\t);\n\n\t\t$dateSelectionAndSubmit = Xml::tags( 'td', array( 'colspan' => 2 ),\n\t\t\tXml::dateMenu(\n\t\t\t\t$this->opts['year'] === '' ? MWTimestamp::getInstance()->format( 'Y' ) : $this->opts['year'],\n\t\t\t\t$this->opts['month']\n\t\t\t) . ' ' .\n\t\t\t\tXml::submitButton(\n\t\t\t\t\t$this->msg( 'sp-contributions-submit' )->text(),\n\t\t\t\t\tarray( 'class' => 'mw-submit' )\n\t\t\t\t)\n\t\t);\n\n\t\t$form .= Xml::fieldset( $this->msg( 'sp-contributions-search' )->text() );\n\t\t$form .= Html::rawElement( 'table', array( 'class' => 'mw-contributions-table' ), \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $targetSelection ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $namespaceSelection ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $filterSelection ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $extraOptions ) . \"\\n\" .\n\t\t\tHtml::rawElement( 'tr', array(), $dateSelectionAndSubmit ) . \"\\n\"\n\t\t);\n\n\t\t$explain = $this->msg( 'sp-contributions-explain' );\n\t\tif ( !$explain->isBlank() ) {\n\t\t\t$form .= \"<p id='mw-sp-contributions-explain'>{$explain->parse()}</p>\";\n\t\t}\n\n\t\t$form .= Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' );\n\n\t\treturn $form;\n\t}",
"public function getForm($need = TRUE)\n\t{\n\t\treturn $this->getComponent('form', $need);\n\t}",
"abstract public function getForm() : void;",
"public function getControl()\n {\n $name = $this->getHtmlName();\n return Html::el()\n ->add(Html::el('input')->name($name . '[day]')->id($this->getHtmlId())->value($this->day))\n ->add(\\Nette\\Forms\\Helpers::createSelectBox(\n array(\"zimní měsíce\" => array(1 => \"leden\", 2), \"jarní měsíce\" => array(3 => 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)), array('selected?' => $this->month)\n )->name($name . '[month]'))\n ->add(Html::el('input')->name($name . '[year]')->value($this->year));\n }",
"public function getForm() {\r\n if ($this->_form === null) {\r\n $this->_form = new $this->_formClass;\r\n }\r\n return $this->_form;\r\n }",
"protected function getForm ()\n {\n $id = $this->params()->fromRoute('id');\n\n $form = $this->createForm('\\Panel\\Form\\User\\User');\n if($id)\n {\n $form = $form->bindObjectById($id);\n }\n\n return $form;\n }",
"public function getFormInput() {\r\n\t\t$name\t\t\t= $this->getName();\r\n\t\t$id\t\t\t\t= $this->getId();\r\n\t\t$attr\t\t\t= $this->getAttributes();\r\n\t\t$type \t\t\t= 'file';\r\n\t\t$additional \t= '';\r\n\t\t\r\n\t\t// MAX_FILE_SIZE is no longer used, didn't provide anything useful\r\n\t\t\r\n\t\t// Start building the HTML input\r\n\t\t$html = '<input';\r\n\t\t// Parse Additional Attributes\r\n\t\tif ($attr) {\r\n\t\t\tforeach ($attr as $key => $values) {\r\n\t\t\t\t// @new feature - Some HTML attributes (type) can be overwritten\r\n\t\t\t\t// directly from the Additional Attributes area\r\n\t\t\t\tif ($key == 'type' && strlen($values)) {\r\n\t\t\t\t\t${$key} = $values;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$additional .= $this->attributeToHtml($key, $values);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Set the type\r\n\t\t$html .= ' type=\"'.$this->escape($type).'\"';\r\n\t\t// Name & id\r\n\t\t$html .= ' name=\"'.$this->escape($name).'\"'.\r\n\t\t\t\t ' id=\"'.$this->escape($id).'\"';\r\n\t\t// Additional HTML\r\n\t\t$html .= $additional;\r\n\t\t// Close the tag\r\n\t\t$html .= ' />';\r\n\t\t\r\n\t\treturn $html;\r\n\t}",
"function getForm($value = \"\")\n {\n return FormTemplateProvider::input($this->formType, $this->attrName, \"form-control\", $value, true);\n }",
"public function getParent() {\n return Tracker_FormElementFactory::instance()->getFieldByid($this->parent_id);\n }",
"protected function _getForm()\n {\n if (!$this->_form) {\n $this->_throwException('No form instance set.');\n }\n\n return $this->_form;\n }",
"public function getFormRequestInstance();",
"public function getForm($object = null) : \\Dms\\Core\\Form\\IForm;",
"function getFormHtmlId() {\n\t\t\tif ($this->hasForm( )) {\n\t\t\t\treturn $this->getForm( )->getHtmlId( );\n\t\t\t}\n\n\t\t}",
"public function get()\n {\n $object = $this->_object;\n $this->_object = $this->_form;\n return $object;\n }",
"public function getInput ()\n\t{\n\t\treturn $this->fetchElement($this->name, $this->value, $this->element, $this->options['controls']);\n\t}",
"public function getSelectedElement() {\n $value = null;\n\n if(($selectedIndex = $this->getSelectedIndex()) >= 0) {\n $value = $this->model->getElementAt($selectedIndex);\n }\n\n return $value;\n }",
"function pmi_form_element($element, $value) {\n $t = get_t();\n\n $output = '<div';\n if (!empty($element['#id'])) {\n $output .= ' id=\"' . $element['#id'] . '-wrapper\"';\n }\n $output .= \">\\n\";\n $required = !empty($element['#required']) ? '<span class=\"form-required\" title=\"' . $t('This field is required.') . '\">*</span>' : '';\n\n if (!empty($element['#title'])) {\n $title = $element['#title'];\n if (!empty($element['#id'])) {\n $output .= ' <label for=\"' . $element['#id'] . '\" class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n else {\n $output .= ' <label class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n }\n\n $output .= \" $value\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n//echo $output; exit;\n\n return $output;\n}",
"public function getForm(): Form{\n $name = str_replace('[]', '', $this->widget->get_field_name(''));\n $form = new Form($name);\n $form->setDelimiter('[');\n $form->setSuffix(']');\n ($this->formHandler)($form);\n return $form;\n }",
"public function getFormNode($formIdentifier)\n {\n return $this->formNodes[$formIdentifier];\n }",
"public function getElementJs()\n {\n $jsString = \"var formElement = new OwFormElement(\" . json_encode($this->getId()) . \", \" . json_encode($this->getName()) . \");\";\n\n return $jsString . $this->generateValidatorAndFilterJsCode(\"formElement\");\n }",
"protected function _getId()\n {\n $id = $this->getElement()->getName();\n\n if ($element instanceof Zend_Form_Element) {\n if (null !== ($belongsTo = $element->getBelongsTo())) {\n $belongsTo = preg_replace('/\\[([^\\]]+)\\]/', '-$1', $belongsTo);\n $id = $belongsTo . '-' . $id;\n }\n }\n\n return $id;\n }",
"public function getCommonForm()\n {\n return $this->common_form;\n }",
"protected function getForm() {\n $lUpdate = ($this -> mPhraseTyp == 'product') ? 'yes' : 'no';\n $this -> setParam('ref_update', $lUpdate);\n\n $lRet = '<div id=\"job_form\" class=\"frm\">'.LF;\n\t$lRet.= $this -> getFieldForm();\n $lRet.= '</div>' . LF;\n \n /*if($this -> mCanBuild) {\n $lRet.= '<div id=\"save_dialog\" title=\"Publish PDF\" style=\"display:none;\">'.LF;\n\t $lRet.= '<input id=\"templateId\" type=\"hidden\" value=\"\" />'.LF;\n $lRet.= '<iframe src=\"\" onload=\"javascript:GetEditor()\" id=\"chiliEditor\" class=\"dn\" style=\"width:100%;height:100%;\"></iframe>'.LF;\n $lRet.= '</div>'.LF;\n }*/\n \n $lDlg = new CJob_Cms_Content_Dialog($this -> mJobId, $this -> mSrc, $this -> mJob);\n $lRet.= $lDlg -> getContent();\n \n $lRet.= $lDlg -> getModals();\n \n return $lRet;\n }",
"public function formInput()\n {\n return \\Form::input('email', $this->formSlug, $this->value);\n }",
"public function offsetGet(mixed $name): FormInterface\n {\n return $this->get($name);\n }",
"function render($element, $form)\n {\n }",
"public function getFormAction() { return $this->_formAction; }",
"public static function preRenderWebformElement($element) {\n $webform = ($element['#webform'] instanceof WebformInterface) ? $element['#webform'] : WebformEntity::load($element['#webform']);\n if (!$webform) {\n return $element;\n }\n\n if ($webform->access('submission_create')) {\n $values = [];\n\n // Set data.\n $values['data'] = $element['#default_data'];\n\n // Set source entity type and id.\n if (!empty($element['#entity']) && $element['#entity'] instanceof EntityInterface) {\n $values['entity_type'] = $element['#entity']->getEntityTypeId();\n $values['entity_id'] = $element['#entity']->id();\n }\n elseif (!empty($element['#entity_type']) && !empty($element['#entity_id'])) {\n $values['entity_type'] = $element['#entity_type'];\n $values['entity_id'] = $element['#entity_id'];\n }\n\n // Build the webform.\n $element['webform_build'] = $webform->getSubmissionForm($values);\n\n // Set custom form action.\n if (!empty($element['#action'])) {\n $element['webform_build']['#action'] = $element['#action'];\n }\n }\n elseif ($webform->getSetting('form_access_denied') !== WebformInterface::ACCESS_DENIED_DEFAULT) {\n // Set access denied message.\n $element['webform_access_denied'] = static::buildAccessDenied($webform);\n }\n else {\n // Add config and webform to cache contexts.\n $config = \\Drupal::configFactory()->get('webform.settings');\n $renderer = \\Drupal::service('renderer');\n $renderer->addCacheableDependency($element, $config);\n $renderer->addCacheableDependency($element, $webform);\n }\n\n return $element;\n }",
"function &returnForm()\n\t{\n\t\treturn $this->form;\n\t}",
"public function getFormName();",
"public function getFormName();",
"public function getOrderForm()\n {\n return $this->order_form;\n }",
"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 }",
"public function getElementJs()\n {\n $jsString = \"\n var formElement = new OwFormElement(\" . json_encode($this->getId()) . \", \" . json_encode($this->getName()) . \");\n formElement.resetValue = function(){};\n \";\n\n return $jsString . $this->generateValidatorAndFilterJsCode(\"formElement\");\n }",
"private function submit()\n {\n $element = new Zend_Form_Element_Submit('submit');\n $element->setLabel('Save')\n ->setAttrib('class', 'reg_input_btn');\n\n return $element;\n }",
"public function getForm(): FormInterface\n {\n return $this->form;\n }"
] | [
"0.8445001",
"0.7740248",
"0.7110885",
"0.7031256",
"0.6728191",
"0.6704216",
"0.66984504",
"0.6690174",
"0.66605794",
"0.66605794",
"0.6644118",
"0.66006947",
"0.6595454",
"0.65532523",
"0.65506494",
"0.6543639",
"0.65348387",
"0.65235126",
"0.65091175",
"0.6484143",
"0.64761823",
"0.64622104",
"0.645279",
"0.64511436",
"0.6420724",
"0.64086527",
"0.6383955",
"0.6348354",
"0.63357306",
"0.6310794",
"0.6277394",
"0.6231511",
"0.62137955",
"0.61804694",
"0.6160967",
"0.6160967",
"0.61579436",
"0.6140722",
"0.6139586",
"0.6134813",
"0.6115921",
"0.60819423",
"0.60376805",
"0.6034982",
"0.6034982",
"0.60288835",
"0.60144985",
"0.600958",
"0.5988336",
"0.59856844",
"0.59583384",
"0.59324664",
"0.5930687",
"0.59026647",
"0.58933914",
"0.5885561",
"0.58831346",
"0.5880188",
"0.587517",
"0.5869553",
"0.58654577",
"0.58627635",
"0.58604914",
"0.5847421",
"0.58368695",
"0.5831401",
"0.58272356",
"0.5818339",
"0.5816167",
"0.5812474",
"0.5787081",
"0.57839006",
"0.5770992",
"0.5769559",
"0.576092",
"0.5758752",
"0.5749765",
"0.57479745",
"0.5743749",
"0.5738945",
"0.5713817",
"0.5699742",
"0.56711626",
"0.5657651",
"0.5652063",
"0.5650511",
"0.56502175",
"0.56352514",
"0.56338274",
"0.56310904",
"0.5630108",
"0.56126195",
"0.5604561",
"0.56042606",
"0.56042606",
"0.56009036",
"0.5600546",
"0.5584028",
"0.5576852",
"0.55644697"
] | 0.6438673 | 24 |
Get the the block container element if this element is part of one. | public function getControlBlockContainer()
{
return $this->getAncestorInstanceOf('FewAgency\FluentForm\AbstractControlBlockContainer');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAnotherBlock()\n {\n $data = $this->_coreRegistry->registry('magictoolbox');\n if ($data) {\n $skip = true;\n foreach ($data['blocks'] as $name => $block) {\n if ($name == 'product.info.media.magiczoomplus') {\n $skip = false;\n continue;\n }\n if ($skip) {\n continue;\n }\n if ($block) {\n return $block;\n }\n }\n }\n return null;\n }",
"public function getBlock()\n {\n return $this->block;\n }",
"public static function getTemplateBlock()\n {\n return self::$templateBlock;\n }",
"function get_block ( $template = false, $block = null ) {\r\n $template = $this->get_blocks ( $template );\r\n\r\n if ( empty( $block ) ) {\r\n return false;\r\n }\r\n\r\n return isset( $template[ $block ] ) ? $template[ $block ] : false;\r\n }",
"public function getContainer()\n {\n //Return container\n return $this->contentListContainer;\n }",
"public function getParentBlock()\n {\n $parentBlock = parent::getParentBlock();\n if ($parentBlock instanceof \\Cart2Quote\\Quotation\\Block\\Quote\\Request\\RequestStrategyContainer) {\n return $parentBlock->getParentBlock();\n }\n\n return $parentBlock;\n }",
"public function getRTERootBlockElement()\n\t{\n\t}",
"protected function getBlock() {\n if (!$this->block) {\n // Create an instance of the block.\n /* @var $block BlockPluginInterface */\n $block_id = $this->blockPluginId();\n $block = $this->blockManager->createInstance($block_id);\n\n $this->block = $block;\n }\n\n return $this->block;\n }",
"public function getContentElement(): ?ContentElementInterface\n {\n return $this->getChildElement(1);\n }",
"public function block($name)\n {\n return $this->blocks()->has($name) ? $this->blocks()->get($name) : null;\n }",
"public function getParent() {\n return $this->mediator_->getContainerForName($this->get('parentName'), $this->getType());\n }",
"public function getBlockByIdentifier($identifier)\n\t{\n\t\tforeach ($this->ContentBlocks as $contentBlock)\n\t\t{\n\t\t\tif ($contentBlock->identifier == $identifier)\n\t\t\t{\n\t\t\t\treturn $contentBlock;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getBlock() : Block {\n // return the private property as-is\n return $this->block;\n }",
"public function getContainerElementName() {\n\t\treturn 'div';\n\t}",
"protected function getBaseContainer(array $element) {\n\t\twhile ($parentUid = intval($element['kbnescefe_parentElement'])) {\n\t\t\t$element = BackendUtility::getRecord('tt_content', $parentUid);\n\t\t}\n\t\treturn $element;\n\t}",
"protected function _getContainer()\n {\n if ($this->_oContainer === null) {\n $this->_oContainer = oxNew('bestitAmazonPay4OxidContainer');\n }\n\n return $this->_oContainer;\n }",
"public function getBlock(){\n\t\n\t\tif( empty($this->_block) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 'b.*, t.*, u.*, m.email AS modified_email, m.username AS modified_username, m.name AS modified_name' );\n\t\t\t\n\t\t\t$query->from( '#__zbrochure_content_blocks AS b' );\n\t\t\t\n\t\t\t$query->join( 'LEFT', '#__users AS u ON u.id = b.content_block_created_by' );\n\t\t\t$query->join( 'LEFT', '#__users AS m ON m.id = b.content_block_modified_by' );\n\t\t\t$query->join( 'LEFT', '#__zbrochure_content_types AS t ON t.content_type_id = b.content_block_type' );\n\t\t\t\n\t\t\t$query->where( 'b.content_block_id = '.$this->_id );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_block = $this->_db->loadObject();\n\t\t\t\n\t\t\t$this->_block->render\t= $this->_getContent();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_block;\n\t\n\t}",
"public function is_block ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Block' );\n }",
"public function getDocBlock(): ?DocBlock\n {\n return $this->docBlock;\n }",
"public function getContainer()\n {\n if ($this->_container != null) {\n return $this->_container;\n }\n\n if ($this->space_id != null) {\n $container = $this->space;\n } elseif ($this->user_id != null) {\n $container = $this->user;\n } else {\n throw new Exception(\"Could not determine container type!\");\n }\n\n $this->_container = $container;\n\n return $this->_container;\n }",
"public function getDocBlock()\n {\n return $this->docBlock;\n }",
"function currentElement()\n {\n return $this->current ? $this->current->parentNode : NULL;\n }",
"public function getWrapperElement()\n {\n return $this->config['wrapper'] ?? 'div';\n }",
"public function getFlexiContainer()\n {\n return isset($this->flexiContainer) ? $this->flexiContainer : null;\n }",
"function getBlock() {\n return $this->records[0];\n }",
"public function getWrapperElement();",
"public function getIsBlock();",
"public function getOriginalBlock()\n {\n $data = $this->_coreRegistry->registry('magictoolbox');\n return is_null($data) ? null : $data['blocks']['product.info.media.image'];\n }",
"public function getParentBlockId(): ?UuidInterface\n {\n return $this->parentBlockId;\n }",
"public function getBlock(): ?DerivationType\n {\n return $this->blockAttr;\n }",
"public function getDocBlock()\n {\n $docblocks = $this->getDirectElementsByTagName($this->node, 'docblock');\n\n // if this method does not yet have a docblock; add one; even\n // though DocBlox throws a warning about a missing DocBlock!\n if (count($docblocks) < 1) {\n $docblock = new DOMElement('docblock');\n $this->node->appendChild($docblock);\n } else {\n /** @var DOMElement $docblock */\n $docblock = reset($docblocks);\n }\n\n return new DocBlox_Plugin_Core_Transformer_Behaviour_Inherit_Node_DocBlock(\n $docblock, $this->nodes\n );\n }",
"public function getBlock($name = '')\n\t{\n\t\tif (!$name)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$this->_db->setQuery( \"SELECT * FROM $this->_tbl WHERE block=\" . $this->_db->quote($name) . \" LIMIT 1\" );\n\t\t$result = $this->_db->loadObjectList();\n\t\treturn $result ? $result[0] : false;\n\t}",
"public function getMatch()\n {\n if(is_null($this->_match)) {\n /* @var $block Mage_Core_Block_Abstract */\n $block = new Mage_Core_Block_Template();\n\n if(count($this->getAllMatches()) == 1) {\n $matchingBlockName = array_pop($this->getAllMatches());\n $blockCandidate = $this->_getLayout()->getBlock($matchingBlockName);\n if($blockCandidate && $blockCandidate instanceof Mage_Core_Block_Abstract) {\n $block = $blockCandidate;\n }\n }\n\n /* @var $match Magenifieddebugging_Blockinformation_Model_Match_Data */\n $this->_match = Mage::getModel('mmdebugging_blockinformation/match_data', array(\n 'block' => $block,\n 'form' => $this->getForm()\n ));\n }\n\n return $this->_match;\n }",
"public function getContainer() : ?string\n {\n return $this->container;\n }",
"private function getBlock(): AbstractEmail\n {\n return $this->_type === 'price'\n ? $this->_getPriceBlock()\n : $this->_getStockBlock();\n }",
"public function getContainer()\n {\n return $this->getModule()->getContainer();\n }",
"protected function getTemplateBlock()\n {\n return $this->blockFactory->create(\n \\Magento\\Backend\\Test\\Block\\Template::class,\n ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)]\n );\n }",
"public function getNetblock()\n {\n if (array_key_exists(\"netblock\", $this->_propDict)) {\n return $this->_propDict[\"netblock\"];\n } else {\n return null;\n }\n }",
"private function idBlock(Attr $attr = null): ?Block\n {\n if ($attr === null || !$attr->value instanceof Mixin) {\n // not a proper block definition\n return null;\n }\n\n $nodes = $attr->value->nodes;\n if (!isset($nodes[1]) || !$nodes[1] instanceof Block) {\n return null;\n }\n\n return $nodes[1];\n }",
"public function getFirst()\n {\n return (\n is_null($this->parent) ?\n null :\n $this->parent->content[0]\n );\n }",
"public function container() : ?Container;",
"public function blocks()\n {\n return $this->blocks ?: $this->blocks = $this->loadBlocks();\n }",
"public function getContainerByCode(string $code): ?PageBlockInterface;",
"public function getOuterMostParent() {}",
"public function getCmsContentElement()\n {\n return $this->hasOne(CmsContentElement::className(), ['id' => 'cms_content_element_id']);\n }",
"function get_the_block_template_html()\n {\n }",
"public function getDefinition(): BlockDefinitionInterface\n {\n return $this->definition;\n }",
"public function getDefaultContainer()\n {\n return $this->defaultContainer;\n }",
"public function getParentElement() {}",
"public function block()\n {\n return $this->hasOne(Block::class, 'user_id');\n }",
"public function getBreadcrumbsBlock()\n {\n return $this->getLayout()->getBlock(\"breadcrumbs\");\n }",
"public function BlockView()\n {\n if ($proxiedBlock = $this->getProxiedObject()) {\n // For search results and other contexts, cast as HTMLText so {@link Text::ContextSummary)} can be called.\n $content = $proxiedBlock->Content();\n if (!$content instanceof HTMLText) {\n $htmlTextObj = HTMLText::create();\n $htmlTextObj->setValue($content);\n $content = $htmlTextObj->getValue();\n }\n \n return $content;\n }\n\n return null;\n }",
"public function current()\n {\n return current($this->container);\n }",
"public function getContainer()\n {\n return $this->Container;\n }",
"final public function getContainerPrototype()\n\t{\n\t\treturn $this->container;\n\t}",
"public function getChildContainer()\n {\n return $this->childContainer;\n }",
"public function getRackspaceContainer() {\n return @$this->attributes['rackspace_container'];\n }",
"function wp_restore_group_inner_container($block_content, $block)\n {\n }",
"public function getProductMediaBlock()\n {\n $data = $this->_coreRegistry->registry('imagetoolbox');\n if ($data && $data['blocks']['product.info.media.image360']) {\n return $data['blocks']['product.info.media.image360'];\n }\n return null;\n }",
"protected function get_element() {\n\t\tif ( ! $this->element ) {\n\t\t\t$this->element = \\esc_attr( \\apply_filters( 'wpseo_breadcrumb_single_link_wrapper', 'span' ) );\n\t\t}\n\n\t\treturn $this->element;\n\t}",
"public function getContainer() {}",
"public function getRoot() : ElementInterface\n {\n return $this->root;\n }",
"public function getNextBlock()\n {\n return $this->nextBlock;\n }",
"public function block(): Repository\n {\n return $this->belongsTo('Neoflow\\\\CMS\\\\Model\\\\BlockModel', 'block_id');\n }",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getContainer();",
"public function getAzureBlobStorageContainer() {\n return @$this->attributes['azure_blob_storage_container'];\n }",
"function wp_get_first_block($blocks, $block_name)\n {\n }",
"public function getParent() {\r\n\t\tif ($this->pzkParentId) {\r\n\t\t\treturn pzk_store_element($this->pzkParentId);\r\n\t\t}\r\n\t\treturn NULL;\r\n\t}",
"public function getTemplate()\n {\n return $this->repeatParent;\n }",
"public function get_container_class() {\n\t\t$class = '';\n\t\tif ( $this->field['label'] == 'inline' ) {\n\t\t\t$class = ' frm_scale_container';\n\t\t}\n\t\treturn $class;\n\t}",
"public function getBlock() /*: IBlockStatement*/ {\n if ($this->block === null) {\n throw new \\Exception(\"Block is not initialized\");\n }\n return $this->block;\n }",
"function getFormBlockType() {\n\t\t\treturn $this->_formBlockType;\n\t\t}",
"function wp_get_elements_class_name($block)\n {\n }",
"public function current() {\n $element = current($this->elements);\n\n return $element;\n }",
"public function pop(): LayoutBlock\n {\n return $this->blocks->pop();\n }",
"public function inner()\n {\n return $this->inner;\n }",
"public function inner()\n {\n return $this->inner;\n }",
"public function get_blocks ()\n {\n return $this->_blocks;\n }",
"public function getBlockLoader()\n {\n return $this['pantono.service.blocks'];\n }",
"public function blocks() { return $this->_m_blocks; }",
"public function getParsedDocBlock()\n {\n if (!$this->parsedDocblock) {\n if (strlen($this->docBlock) > 0) {\n $parser = new DocblockParser(\"/\" . $this->docBlock .\"/\");\n $this->parsedDocblock = $parser->parse();\n } else {\n return null;\n }\n }\n return $this->parsedDocblock;\n }",
"public function getHolder()\n {\n return $this->holder;\n }",
"public function getThemeBlocks()\n {\n return $this->blocks;\n }",
"public function current() {\n $element = current($this->elements);\n return $element;\n }",
"public function getContainer()\n {\n if ($this->_container === null) {\n $this->_container = new CContainer();\n }\n return $this->_container;\n }",
"public function peek() {\n if (empty($this->_elements)) return NULL; else return $this->_elements[0];\n }",
"public function get_parent() {\n\t\treturn $this->parent();\n\t}",
"function wp_restore_image_outer_container($block_content, $block)\n {\n }",
"public function element(): ?string\n {\n return $this->element ?: $this->first();\n }",
"public function getHolder()\n {\n return $this->holder;\n }",
"public function selector()\n {\n return '.container';\n }",
"public function getContainer(): ContainerInterface\n {\n return parent::getContainer();\n }",
"public function parentNode()\n {\n return new Element($this->node->parentNode);\n }",
"public function getHolder()\r\n {\r\n return $this->holder;\r\n }",
"public function getFolder()\n {\n if ($this->isExtension) {\n return $this->blockSlug;\n }\n $folder = $this->theme->getFolder() . '/blocks/archived/' . basename($this->blockSlug);\n if (file_exists($folder)) {\n return $folder;\n }\n $folder = $this->theme->getFolder() . '/blocks/elements/' . basename($this->blockSlug);\n if (file_exists($folder)) {\n return $folder;\n }\n $folder = $this->theme->getFolder() . '/blocks/php/' . basename($this->blockSlug);\n if (file_exists($folder)) {\n return $folder;\n }\n return $this->theme->getFolder() . '/blocks/' . basename($this->blockSlug);\n }",
"public function getBlock(string $name) : Block {\n\n\t\t\treturn ($this->blocks[$name] ?? new Block);\n\t\t}"
] | [
"0.65993506",
"0.6481887",
"0.62601477",
"0.6202864",
"0.615974",
"0.6153783",
"0.61376804",
"0.6102674",
"0.599154",
"0.5966898",
"0.5940808",
"0.5935668",
"0.59266484",
"0.59188133",
"0.58521175",
"0.5779442",
"0.5757671",
"0.5750264",
"0.5747328",
"0.57429284",
"0.5734372",
"0.5723374",
"0.5698582",
"0.56961066",
"0.56927043",
"0.5681085",
"0.5665811",
"0.5653788",
"0.564063",
"0.563836",
"0.56253207",
"0.55715835",
"0.5546937",
"0.54884243",
"0.54673004",
"0.54594177",
"0.5452376",
"0.5439678",
"0.54364806",
"0.54317236",
"0.5427417",
"0.5425777",
"0.5424947",
"0.5410447",
"0.5409591",
"0.53966254",
"0.5385578",
"0.5380058",
"0.5350206",
"0.5340669",
"0.5338554",
"0.5320583",
"0.5319608",
"0.531827",
"0.53176546",
"0.5312343",
"0.5310922",
"0.53055346",
"0.5301794",
"0.52951336",
"0.5293992",
"0.5282065",
"0.5280153",
"0.52466935",
"0.52439976",
"0.52439976",
"0.52439976",
"0.52439976",
"0.52439976",
"0.5230339",
"0.5227889",
"0.5226429",
"0.522572",
"0.5218343",
"0.52165204",
"0.52157104",
"0.5215583",
"0.5204459",
"0.5198108",
"0.51842433",
"0.51842433",
"0.5182244",
"0.51754695",
"0.51736206",
"0.5163048",
"0.51602936",
"0.51602584",
"0.5157687",
"0.5155077",
"0.51539546",
"0.51539534",
"0.5153881",
"0.5147969",
"0.5147934",
"0.5144522",
"0.51431024",
"0.513913",
"0.5134902",
"0.5122828",
"0.510959"
] | 0.69294834 | 0 |
Get input values set higher up in the form structure. | protected function getValueFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->getValue($key);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getInputValues();",
"public function getInputValues()\n {\n return $this->input_values;\n }",
"public function getFormInput()\n {\n $values = $this->getFormValues();\n\n return $values->all();\n }",
"function getInputValues();",
"public function getFormValues()\n {\n return $this->form->getValues();\n }",
"function pnFormGetValues()\n {\n $result = array();\n\n $this->pnFormGetValues_rec($this->pnFormPlugins, $result);\n\n return $result;\n }",
"public function getFormValues() {\n return $this->values[HVAL_FORMPARAM];\n }",
"private function getHiddenInputFields()\r\n {\r\n $inputArray = array();\r\n $inputNodes = $this->scraper->xPathQuery(\"//form[@id='mainform']/div/input\");\r\n foreach ($inputNodes as $node) {\r\n $name = $node->getAttribute('name');\r\n $inputArray[$name] = $node->getAttribute('value');\r\n }\r\n\r\n return $inputArray;\r\n }",
"public function GetFormPostedValues() {\n\t\t$req_fields=array(\"description\",\"date_open\",\"date_closed\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"public static function get_input_fields()\n {\n }",
"function getInputValues() {\r\n $vals = array();\r\n \r\n $vals['datetime'] = @$_REQUEST['datetime'];\r\n $vals['mileage'] = @$_REQUEST['mileage'];\r\n $vals['location'] = @$_REQUEST['location'];\r\n $vals['pricepergallon'] = @$_REQUEST['pricepergallon'];\r\n $vals['gallons'] = @$_REQUEST['gallons'];\r\n $vals['grade'] = @$_REQUEST['grade'];\r\n $vals['pumpprice'] = @$_REQUEST['pumpprice'];\r\n $vals['notes'] = @$_REQUEST['notes'];\r\n \r\n return $vals;\r\n}",
"public function getFormValues()\n {\n return array(\n 'title' => $this->issue['subject'],\n 'reference' => $this->issue['id'],\n 'date_started' => $this->issue['start_date'],\n 'description' => $this->issue['description']\n );\n }",
"function get_input_array () {\n\t$input = array();\n\n\t// collect input values from the form\n\t$input['maker'] = isset($_POST['maker']) ? $_POST['maker'] : '';\n\t$input['model'] = isset($_POST['model']) ? $_POST['model'] : '';\n\t$input['speed'] = isset($_POST['speed']) ? $_POST['speed'] : '';\n\t$input['ram'] = isset($_POST['ram']) ? $_POST['ram'] : '';\n\t$input['hd'] = isset($_POST['hd']) ? $_POST['hd'] : '';\n\t$input['price'] = isset($_POST['price']) ? $_POST['price'] : '';\n\n\t// use the new_maker field instead of the maker field if it's set\n\t$new_maker = isset($_POST['new_maker']) ? $_POST['new_maker'] : '';\n\tif (!empty($new_maker)) {\n\t\t$input['maker'] = $new_maker;\n\t}\n\n\treturn $input;\n}",
"public function getValues(): array\n {\n $values = [];\n foreach ($this->getInputNames() as $name) {\n $values[$name] = $this->$name;\n }\n return $values;\n }",
"public function getInputFields() {\n\t\treturn $this->inputFields;\n\t}",
"public function getFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n $value = $element['object']->getSubmittedValue();\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }",
"public function getValues()\n\t{\n\t\tif ($this->use_defaults) {\n\t\t\tforeach ($this->form_def['field_groups'] as $gi => $g) {\n\t\t\t\t// Read-only values are input-only\n\t\t\t\tif ($this->readonly || !empty($g['readonly'])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// $this->field_defaults should contain all defaults by now, but maybe some of values are missing.\n\t\t\t\tif (!isset($this->field_defaults[$gi])) {\n\t\t\t\t\t$this->field_defaults[$gi] = array();\n\t\t\t\t\tif (empty($g['collection_dimensions'])) {\n\t\t\t\t\t\t// Values for the group are missing, use defaults from the form definition.\n\t\t\t\t\t\tforeach ($g['fields'] as $fi => $f) {\n\t\t\t\t\t\t\tif (isset($f['default'])) {\n\t\t\t\t\t\t\t\t$this->field_defaults[$gi][$fi] = $f['default'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Empty collection by default.\n\t\t\t\t\t\t$this->field_defaults[$gi] = array();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->field_defaults;\n\t\t} else {\n\t\t\tif ($this->field_values === null) {\n\t\t\t\t$this->field_values = array();\n\t\t\t\t//$this->field_values = $this->raw_input;\n\n\t\t\t\tforeach ($this->form_def['field_groups'] as $gi => $g) {\n\t\t\t\t\tif ($this->readonly || !empty($g['readonly'])) {\n\t\t\t\t\t\t// Read-only values are input-only\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (empty($g['collection_dimensions'])) {\n\t\t\t\t\t\t// Simple group\n\t\t\t\t\t\tif (isset($this->raw_input[$gi])) {\n\t\t\t\t\t\t\t$this->getValues_processCollection($this->raw_input[$gi], 0, $gi, $g['fields'],\n\t\t\t\t\t\t\t\t$this->field_values[$gi]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// No data, use empty \"object\"\n\t\t\t\t\t\t\t$this->field_values[$gi] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($g['collection_dimensions'] >= 1) {\n\t\t\t\t\t\t// Validate fields for each item in collection.\n\t\t\t\t\t\tif (isset($this->raw_input[$gi])) {\n\t\t\t\t\t\t\t// Non-empty collection, walk it recursively.\n\t\t\t\t\t\t\t$this->getValues_processCollection($this->raw_input[$gi], $g['collection_dimensions'], $gi, $g['fields'],\n\t\t\t\t\t\t\t\t$this->field_values[$gi]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Missing data, it should not happen, but whatever ... use empty collection instead.\n\t\t\t\t\t\t\t$this->field_values[$gi] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->http_method == 'get') {\n\t\t\t\t\t// FIXME: This does not work with collections\n\t\t\t\t\t$this->field_values = array_replace_recursive($this->field_defaults, $this->field_values);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->field_values;\n\t\t}\n\t}",
"protected function getConfigFormValues()\n {\n $formValues = array(\n 'WI_WEATHER_ENABLED' => Configuration::get('WI_WEATHER_ENABLED', ''),\n 'WI_WEATHER_PROVIDER' => Configuration::get('WI_WEATHER_PROVIDER', ''),\n 'WI_WEATHER_KEY' => Configuration::get('WI_WEATHER_KEY', ''),\n 'WI_WEATHER_CITY' => Configuration::get('WI_WEATHER_CITY', ''),\n );\n return $formValues;\n }",
"function populate() {\n // @todo We inject client input directly into the form. What about\n // security issues?\n if (isset($this->form->request['raw_input'][$this->attributes['name']])) {\n // Disabled input elements do not accept new input.\n if (!$this->disabled) {\n $this->value = $this->form->request['raw_input'][$this->attributes['name']];\n }\n }\n }",
"private static function getInputVars() {\n\t\tif (static::$vars === null) {\n\t\t\t// take those vars only once\n\t\t\tparse_str(static::getRawData(), $vars);\n\t\t\tstatic::$vars = (array) $vars;\n\t\t}\n\t\t\n\t\treturn static::$vars;\n\t}",
"public static function input_fields()\n {\n }",
"public function getValue()\n\t{\n\t\t$data = array();\n\t\tforeach($this->_collection as $subform)\n\t\t{\n\t\t\tforeach($subform->_collection as $name => $item)\n\t\t\t{\n\t\t\t\t$data[$name] = $item->getValue();\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"protected function getConfigFormValues()\n {\n $formValues = array(\n 'WI_SPENT_AMOUNT' => Configuration::get('WI_SPENT_AMOUNT', ''),\n 'WI_SPENT_COUPON' => Configuration::get('WI_SPENT_COUPON', ''),\n 'WI_SPENT_ENABLED' => Configuration::get('WI_SPENT_ENABLED', ''),\n 'WI_SPENT_DAYS' => Configuration::get('WI_SPENT_DAYS', ''),\n );\n return $formValues;\n }",
"function getRawInputValues();",
"public function getFormValues()\n {\n $values = $this->getCreateOrderModel()->getBillingAddress()->getData();\n\n //Set default values if original value is null\n foreach (Mage::helper('borriglione_ordercreatedefault/data')\n ->getUnserializedDefaultValues($this->getStore(), $this->getQuote()->getId()) as $defaultValue) {\n if (true === array_key_exists($defaultValue['element_id'], $values)\n && '' == $values[$defaultValue['element_id']]) {\n $values[$defaultValue['element_id']] = $defaultValue['value'];\n }\n }\n\n return $values;\n }",
"function setInputValues()\n {\n // Set input type based on GET/POST\n $inputType = ($_SERVER['REQUEST_METHOD'] === 'POST') ? INPUT_POST : INPUT_GET;\n // Init global variables\n global $typeID, $classID, $makeID, $price, $model, $year;\n global $sort, $sortDirection;\n // Set each variable, escape special characters\n $typeID = filter_input($inputType, 'typeID', FILTER_VALIDATE_INT);\n $classID = filter_input($inputType, 'classID', FILTER_VALIDATE_INT);\n $makeID = filter_input($inputType, 'makeID', FILTER_VALIDATE_INT);\n $sort = filter_input($inputType, 'sort', FILTER_VALIDATE_INT);\n $sortDirection = filter_input($inputType, 'sortDirection', FILTER_VALIDATE_INT);\n $price = filter_input($inputType, 'price', FILTER_VALIDATE_INT);\n $year = filter_input($inputType, 'year', FILTER_VALIDATE_INT);\n $model = htmlspecialchars(filter_input($inputType, 'model'));\n }",
"public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}",
"public function getFormParameters()\n {\n return $this->form_parameters;\n }",
"public function getPostValues() {\n $post_check_array = array(\n// submit action\n 'add' => array('filter' => FILTER_SANITIZE_STRING),\n 'update' => array('filter' => FILTER_SANITIZE_STRING),\n // List all update form fields !!!\n// event type name.\n 'datum' => array('filter' => FILTER_SANITIZE_STRING),\n 'prioriteit' => array('filter' => FILTER_SANITIZE_STRING),\n 'username' => array('filter' => FILTER_SANITIZE_STRING),\n 'user' => array('filter' => FILTER_SANITIZE_STRING),\n 'password' => array('filter' => FILTER_SANITIZE_STRING),\n // Help text\n 'status' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'alarm_id' => array('filter' => FILTER_VALIDATE_INT),\n 'alarm_noticed' => array('filter' => FILTER_VALIDATE_INT),\n\t\t\t'alarm_origin' => array('filter' => FILTER_SANITIZE_STRING)\n );\n// Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n// RTS\n return $inputs;\n }",
"public function valuesFromPost()\n {\n return $this->setDefaultValues($_POST);\n }",
"public function getInput()\n {\n $result = array();\n\n $table = new Application_Model_DbOptions();\n $options = array();\n\t\t$options['optRegion'] = $table->getRegion();\n\n // elements\n\t\t$result['src_region_code'] = array(\n 'type' => 'select',\n 'name' => 'src_region_code',\n 'value' => '',\n 'options' => $options['optRegion'],\n 'ext' => 'onChange=\\'$(\"#src_ba\").val(\"\");\\'', //src_afd\n\t\t\t'style' => 'width:200px;background-color: #e6ffc8;'\n );\n\t\t\n\t\t$options['optMatStage'] = $table->getMaturityStage();\n\t\t$result['src_matstage_code'] = array(\n 'type' => 'select',\n 'name' => 'src_matstage_code',\n 'value' => '',\n 'options' => $options['optMatStage'],\n 'ext' => '',\n\t\t\t'style' => 'width:200px;'\n );\n\n return $result;\n }",
"protected function _readFormFields() {}",
"public function prepareForm()\n {\n // Searching for the data to populate the Form\n\n // Adding default value to the list\n\n // Setting the lists in $data array\n $data = [\n ];\n\n //dd($data);\n\n return $data;\n }",
"function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}",
"protected function getInputData()\n {\n (new HCECOrderAddressValidator())->validateForm();\n\n $_data = request()->all();\n\n if( array_has($_data, 'id') )\n array_set($data, 'record.id', array_get($_data, 'id'));\n\n array_set($data, 'record.order_id', array_get($_data, 'order_id'));\n array_set($data, 'record.email', array_get($_data, 'email'));\n array_set($data, 'record.first_name', array_get($_data, 'first_name'));\n array_set($data, 'record.last_name', array_get($_data, 'last_name'));\n array_set($data, 'record.country', array_get($_data, 'country'));\n array_set($data, 'record.street_address', array_get($_data, 'street_address'));\n array_set($data, 'record.city', array_get($_data, 'city'));\n array_set($data, 'record.district', array_get($_data, 'district'));\n array_set($data, 'record.postal_code', array_get($_data, 'postal_code'));\n array_set($data, 'record.phone', array_get($_data, 'phone'));\n array_set($data, 'record.notes', array_get($_data, 'notes'));\n array_set($data, 'record.company_name', array_get($_data, 'company_name'));\n array_set($data, 'record.company_code', array_get($_data, 'company_code'));\n array_set($data, 'record.company_vat', array_get($_data, 'company_vat'));\n\n return $data;\n }",
"public function getInputs()\n {\n return $this->inputs;\n }",
"public function getPostValues()\n {\n // Define the check for params\n $post_check_array = array(\n // submit action\n 'toevoegen' => array('filter' => FILTER_SANITIZE_STRING),\n 'bijwerken' => array('filter' => FILTER_SANITIZE_STRING),\n 'verwijderen' => array('filter' => FILTER_SANITIZE_STRING),\n // question\n 'vraag' => array('filter' => FILTER_SANITIZE_STRING),\n // question type (open or closed)\n 'vraagId' => array('filter' => FILTER_SANITIZE_INT),\n // question type (open or closed)\n 'vraagSoort' => array('filter' => FILTER_SANITIZE_STRING),\n // Education\n 'opleiding' => array('filter' => FILTER_SANITIZE_STRING),\n // question send time\n 'verstuurTijd' => array('filter' => FILTER_SANITIZE_STRING)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_POST, $post_check_array);\n // RTS\n return $inputs;\n }",
"protected function getConfigFormValues()\n {\n return array(\n 'APISFACT_PRESTASHOP_TOKEN' => Configuration::get('APISFACT_PRESTASHOP_TOKEN', true),\n 'APISFACT_PRESTASHOP_SERIEF' => Configuration::get('APISFACT_PRESTASHOP_SERIEF', true),\n 'APISFACT_PRESTASHOP_NUMEROF' => Configuration::get('APISFACT_PRESTASHOP_NUMEROF', true),\n 'APISFACT_PRESTASHOP_SERIEB' => Configuration::get('APISFACT_PRESTASHOP_SERIEB', true),\n 'APISFACT_PRESTASHOP_NUMEROB' => Configuration::get('APISFACT_PRESTASHOP_NUMEROB', true)\n );\n }",
"public function inputs()\n {\n return $this->inputs;\n }",
"public static function getInput(){\n $inputs = [];\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST'){\n\n $args = [\n 'wpmg' => [\n 'filter' => FILTER_SANITIZE_STRING,\n 'flags' => FILTER_REQUIRE_ARRAY\n ]\n ];\n\n $inputs = filter_input_array(INPUT_POST, $args);\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'GET'){\n $inputs['pg'] = filter_input(INPUT_GET, 'pg', FILTER_VALIDATE_INT);\n\n\n $tax_type = get_query_var('wpmg_tax_type');\n $tax_value = get_query_var('wpmg_tax_value');\n\n if($tax_type && $tax_value){\n $inputs['wpmg']['tax'][$tax_type] = $tax_value;\n }\n\n\n }\n\n\n return $inputs;\n }",
"function getFormValues($selectList = false)\n\t{\n\t\tif (!$this->formSubmitted())\n\t\t\treturn false;\n\t\t\t\n\t\t$returnList = array();\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\t// Don't return custom types\n\t\t\tif ($element->type == 'custom') {\n\t\t\t\tcontinue;\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif ($selectList && is_array($selectList))\n\t\t\t{\n\t\t\t\t// Only add if in the list of specified elements.\n\t\t\t\tif (in_array($element->name, $selectList)) {\t\t\t\n\t\t\t\t\t$returnList[$element->name] = $element->value;\n\t\t\t\t}\n\t\t\t} \n\t\t\t// Add anyway, no list to choose from.\n\t\t\telse {\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$returnList[$element->name] = $element->value;\n\t\t\t}\n\t\t\t\n\t\t} // end of foreach\n\t\t\n\t\treturn $returnList;\n\t}",
"public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }",
"public function getFormValues()\n {\n $validator = App::make(SubmitForm::class);\n return $validator->getSubmissions();\n }",
"function getFormParams() {\n\t\treturn $this->_formParams;\n\t}",
"public function input()\n\t{\n\t\treturn $this->parameters;\n\t}",
"private function extractFormValues(FormView $formView): array\n {\n $values = [];\n foreach ($formView->children as $child) {\n $name = $child->vars['name'];\n if (\\count($child->children) > 0) {\n $values[$name] = $this->extractFormValues($child);\n\n continue;\n }\n\n if (\\array_key_exists('checked', $child->vars)) {\n // special handling for check boxes\n $values[$name] = $child->vars['checked'] ? $child->vars['value'] : null;\n } else {\n $values[$name] = $child->vars['value'];\n }\n }\n\n return $values;\n }",
"public function getRichFormdata() {\n $formdata = array();\n\n foreach($this->elements as $element) {\n $key = $element['object']->getName();\n\n $value = array (\n \t'value' => $element['object']->getSubmittedValue(),\n \t'description' => $element['object']->getDescription()\n );\n\n $formdata[$key] = $value;\n }\n\n return $formdata;\n }",
"public function get_submitted_values_for_step_parameters() {\n $report = $this->workflow->get_report_instance();\n $report->require_dependencies();\n $report->init_filter($report->id);\n $filters = $report->get_filters();\n //Check for report filter\n if (isset($report->filter)) {\n $report_filter = $report->filter;\n } else {\n $report_filter = null;\n }\n $form = new scheduling_form_step_parameters(null, array('page' => $this, 'filterobject' => $report_filter));\n\n $data = $form->get_data(false);\n // get rid of irrelevant data\n unset($data->MAX_FILE_SIZE);\n unset($data->_wfid);\n unset($data->_step);\n unset($data->action);\n unset($data->_next_step);\n\n if (isset($report_filter) && isset($data)) {\n // Remove any false parameters\n $parameters = $data;\n\n // Use this object to find our parameter settings\n $filter_object = $report_filter;\n $filter_object_fields = $filter_object->_fields;\n // Merge in any secondary filterings here...\n if (isset($filter_object->secondary_filterings)) {\n foreach ($filter_object->secondary_filterings as $key => $secondary_filtering) {\n $filter_object_fields = array_merge($filter_object_fields, $secondary_filtering->_fields);\n }\n }\n\n if (!empty($filter_object_fields)) {\n $fields = $filter_object_fields;\n foreach($filter_object_fields as $fname=>$field) {\n $sub_data = $field->check_data($parameters);\n if ($sub_data === false) {\n // unset any filter that comes back from check_data as false\n unset($data->$fname);\n }\n }\n }\n }\n return $data;\n }",
"protected function getPostValues() {}",
"public function getInputData()\n {\n return array_only($this->inputData, [\n 'title', 'description', 'tags', 'categories', 'code'\n ]);\n }",
"public static function GetFormValues(){\n self::$KeyValue = isset($_REQUEST[\"KeyValue\"]) ? $_REQUEST[\"KeyValue\"] : \"\"; \n \n if (self::$KeyValue == \"\"){\n\t self::$KeyValue = \"new zealand\"; \n\t }\n\t \n\t \n\t self::$KeyValue = urlencode(self::$KeyValue);\n\t \n\t self::$MapLattitude = isset($_REQUEST[\"MapLattitude\"]) ? $_REQUEST[\"MapLattitude\"] : \"\"; \n\t self::$MapLongtitude= isset($_REQUEST[\"MapLongtitude\"]) ? $_REQUEST[\"MapLongtitude\"] : \"\"; \n\t \n }",
"function getInputForm() {\n\t\treturn new \\Flux\\LeadSplit();\n\t}",
"public function getInputs()\n {\n return array();\n }",
"public function get_data()\n {\n return $this->form_data;\n }",
"public function getInputs()\r\n {\r\n $this->inputs = $this->getReflection('inputs');\r\n }",
"public function form() {\n\t\treturn array();\n\t}",
"protected function get_inputs_rules(){return $this->input['inputs_rules'];}",
"protected function _getLastInput() {\n \n $_vValue = AdminPageFramework_WPUtility::getTransient( 'apf_tfd' . md5( 'temporary_form_data_' . $this->sClassName . get_current_user_id() ) );\n if ( is_array( $_vValue ) ) {\n return $_vValue;\n }\n return array();\n \n }",
"protected function getConfigFormValues()\n {\n return array(\n 'MF_TITLE' => Configuration::get('MF_TITLE', 'Our Favourite Brands'),\n 'MF_DESCRIPTION' => Configuration::get('MF_DESCRIPTION', 'Browse our favourite brands'),\n 'MF_MAN_NUMBER' => Configuration::get('MF_MAN_NUMBER', 0),\n 'MF_PER_ROW_DESKTOP' => Configuration::get('MF_PER_ROW_DESKTOP', 0),\n 'MF_PER_ROW_TABLET' => Configuration::get('MF_PER_ROW_TABLET', 0),\n 'MF_PER_ROW_MOBILE' => Configuration::get('MF_PER_ROW_MOBILE', 0),\n 'MF_MAN_ORDER' => Configuration::get('MF_MAN_ORDER', 'name_asc'),\n 'MF_SHOW_MAN_NAME' => Configuration::get('MF_SHOW_MAN_NAME', 0),\n );\n }",
"private function getSelectFormValues()\n {\n $program_id = User::getLoggedInUser()->getCurrentProgram()->id;\n $selection_by = $this->_getParam('selection_by');\n $all_students = true;\n\n if ($selection_by == \"by-requirements\") {\n $default_filters = array('graduationStatus' => array(1), 'show_instructors' => 1);\n\n // format sub-filters for the students\n $filters = [];\n\n if ($this->_getParam('graduationMonth')) {\n $filters['graduationMonth'] = $this->_getParam('graduationMonth');\n }\n if ($this->_getParam('graduationYear')) {\n $filters['graduationYear'] = $this->_getParam('graduationYear');\n }\n if ($this->_getParam('certs')) {\n $filters['certificationLevels'] = $this->_getParam('certs');\n }\n if ($this->_getParam('status')) {\n $filters['graduationStatus'] = $this->_getParam('status');\n }\n if ($this->_getParam('groups')) {\n $filters['section'] = $this->_getParam('groups');\n }\n $filters['show_instructors'] = $this->_getParam('show_instructors');\n\n // if the filters are different than our standard set\n if ($filters != $default_filters) {\n $all_students = false;\n } else {\n $all_students = true;\n }\n\n if ($this->_getParam('all_students')) {\n $all_students = true;\n $filters = $default_filters;\n }\n $userContextIds = $this->getRoleDataIds($filters, $this->getParam('show_instructors'));\n $requirement_ids = array_unique($this->_getParam('requirement_ids'));\n } else {\n $userContextIds = $this->getParam('userContextIds');\n $requirement_ids = $this->requirementRepository->getRequirements($program_id, true, true, true, true);\n }\n\n $selectFormValues = [\n \"selection-by\" => $selection_by,\n \"userContextIds\" => $userContextIds,\n \"requirementIds\" => $requirement_ids,\n \"people_sub_filters\" => $filters,\n \"all_students\" => $all_students\n ];\n\n return $selectFormValues;\n }",
"protected function getInputFieldStore(){\n return Input::only(self::NAME, self::DEPARTMENT_ID);\n }",
"function NormalizeFormVars()\r\n {\r\n //the element means false. Explicitely setting this false here\r\n //to help in later form value processing\r\n $arr_elements = \r\n $this->config->element_info->GetElements($this->GetCurrentPageNum());\r\n \r\n foreach($arr_elements as $ename => $e)\r\n {\r\n $preparsed_var = $this->config->GetPreParsedVar($ename);\r\n if(isset($this->formvars[$preparsed_var]))\r\n {\r\n $disp_var = $this->config->GetDispVar($ename);\r\n $this->formvars[$disp_var] = $this->formvars[$ename];\r\n $this->formvars[$ename] = $this->formvars[$preparsed_var];\r\n }\r\n if(isset($this->formvars[$ename])){continue;}\r\n \r\n switch($e['type'])\r\n {\r\n case 'single_chk':\r\n {\r\n $this->formvars[$ename] = false;\r\n break;\r\n }\r\n case 'chk_group':\r\n case 'multiselect':\r\n {\r\n $this->formvars[$ename] = array();\r\n break;\r\n }\r\n default:\r\n {\r\n $this->formvars[$ename]='';\r\n }\r\n }\r\n }\r\n }",
"public function getForm();",
"function readInputData() {\n\t\t$this->readUserVars(array('seriesId', 'title', 'division', 'affiliation'));\n\t\t$this->readUserVars(array('gridId', 'rowId'));\n\t}",
"public function getData()\n\t{\n\t\treturn $this->value ? $this->value : $this->input;\n\t}",
"public function transactionFormGetFormParms ();",
"public function getConfigFieldsValues()\n {\n $id_shop = Shop::getContextShopID(true);\n $id_shop_group = Shop::getContextShopGroupID(true);\n\n $fields_values = array();\n foreach ($this->fields_form as $k => $f) {\n foreach ($f['form']['input'] as $i => $input) {\n if (isset($input['ignore']) && $input['ignore'] == true) {\n continue;\n }\n\n if (isset($input['lang']) && $input['lang'] == true) {\n foreach (Language::getLanguages(false) as $lang) {\n $values = Tools::getValue($input['name'].'_'.$lang['id_lang'], (Configuration::hasKey($input['name'], $lang['id_lang']) ? Configuration::get($input['name'], $lang['id_lang'], (int)$id_shop_group, (int)$id_shop) : $input['default']));\n $fields_values[$input['name']][$lang['id_lang']] = $values;\n }\n } else {\n if ($input['type'] == 'checkbox' && isset($input['values'])) {\n $input['name'] = str_replace(array('[]'), array(''), $input['name']);\n\n $values = (Configuration::hasKey($input['name'], null, (int)$id_shop_group, (int)$id_shop) ? Tools::jsonDecode(Configuration::get($input['name']), true) : $input['default']);\n\n if (is_array($values)) {\n foreach ($input['values']['query'] as $id_cms => $val) {\n if (in_array($id_cms, $values)) {\n $fields_values[$input['name'].'[]_'.$id_cms] = $id_cms;\n }\n }\n }\n } else {\n $values = Tools::getValue($input['name'], (Configuration::hasKey($input['name'], null, (int)$id_shop_group, (int)$id_shop) ? Configuration::get($input['name']) : $input['default']));\n $fields_values[$input['name']] = $values;\n }\n }\n }\n }\n\n $this->assignCustomConfigs($fields_values);\n\n return $fields_values;\n }",
"protected function getConfigFormValues()\n {\n return array(\n 'ORDERREF_LENGTH' => Configuration::get('ORDERREF_LENGTH'),\n 'ORDERREF_MODE' => Configuration::get('ORDERREF_MODE'),\n );\n }",
"public function getGetValues()\n {\n // Define the check for params\n $get_check_array = array(\n // Action\n 'action' => array('filter' => FILTER_SANITIZE_STRING),\n // Id of current row\n 'vraagId' => array('filter' => FILTER_VALIDATE_INT)\n );\n // Get filtered input:\n $inputs = filter_input_array(INPUT_GET, $get_check_array);\n // RTS\n return $inputs;\n }",
"abstract public function get_gateway_form_fields();",
"public function getForm(): array\n {\n return $this->form;\n }",
"protected function getConfigFormValues()\n {\n return array(\n 'MYETICKETS_CGV' => Configuration::get('MYETICKETS_CGV', '[email protected]'),\n 'MYETICKETS_PERIOD' => Configuration::get('MYETICKETS_PERIOD', null),\n );\n }",
"public function getInput()\n {\n $result = array();\n\n $table = new Application_Model_DbOptions();\n $options = array();\n\t\t$options['optRegion'] = $table->getRegion();\n\n // elements\n\t\t$result['src_region_code'] = array(\n 'type' => 'select',\n 'name' => 'src_region_code',\n 'value' => '',\n 'options' => $options['optRegion'],\n 'ext' => 'onChange=\\'$(\"#src_ba\").val(\"\");\\'', //src_afd\n\t\t\t'style' => 'width:200px;background-color: #e6ffc8;'\n );\n\n return $result;\n }",
"function setInputValues( array $values );",
"public function getContactValues()\n\t{\n\n\t\t$settings = $this->setup->getClient()->getAllSettings();\n\n\t\t$values = $settings;\n\n\t\t$values[\"inst_name\"] = ($this->setup->getClient()->getName())\n\t\t\t? $this->setup->getClient()->getName()\n\t\t\t: $this->setup->getClient()->getId();\n\t\t$values[\"inst_info\"] = $this->setup->getClient()->getDescription();\n\n\t\t$this->form->setValuesByArray($values);\n\t}",
"protected function getInputData ()\n {\n (new HCRivilePaymentsValidator())->validateForm();\n\n $_data = request()->all();\n\n if (array_has($_data, 'id'))\n array_set($data, 'record.id', array_get($_data, 'id'));\n\n array_set($data, 'record.COUNT', array_get($_data, 'COUNT'));\n array_set($data, 'record.I04_KODAS_CH', array_get($_data, 'I04_KODAS_CH'));\n array_set($data, 'record.I04_DOK_NR', array_get($_data, 'I04_DOK_NR'));\n array_set($data, 'record.I04_OP_RUSIS', array_get($_data, 'I04_OP_RUSIS'));\n array_set($data, 'record.I04_OP_TIPAS', array_get($_data, 'I04_OP_TIPAS'));\n array_set($data, 'record.I04_OP_STORNO', array_get($_data, 'I04_OP_STORNO'));\n array_set($data, 'record.I04_OP_DATA', array_get($_data, 'I04_OP_DATA'));\n array_set($data, 'record.I04_KODAS_SS', array_get($_data, 'I04_KODAS_SS'));\n array_set($data, 'record.I04_MOKETOJAS', array_get($_data, 'I04_MOKETOJAS'));\n array_set($data, 'record.I04_KODAS_KS', array_get($_data, 'I04_KODAS_KS'));\n array_set($data, 'record.I04_PAV', array_get($_data, 'I04_PAV'));\n array_set($data, 'record.I04_ADR', array_get($_data, 'I04_ADR'));\n array_set($data, 'record.I04_ATSTOVAS', array_get($_data, 'I04_ATSTOVAS'));\n array_set($data, 'record.I04_KODAS_VS', array_get($_data, 'I04_KODAS_VS'));\n array_set($data, 'record.I04_SUMA', array_get($_data, 'I04_SUMA'));\n array_set($data, 'record.I04_SUMA_DSK', array_get($_data, 'I04_SUMA_DSK'));\n array_set($data, 'record.I04_SUMA_PLK', array_get($_data, 'I04_SUMA_PLK'));\n array_set($data, 'record.I04_PASTABOS', array_get($_data, 'I04_PASTABOS'));\n array_set($data, 'record.I04_PERKELTA', array_get($_data, 'I04_PERKELTA'));\n array_set($data, 'record.I04_IMP_EXP', array_get($_data, 'I04_IMP_EXP'));\n array_set($data, 'record.I04_KODAS_VL', array_get($_data, 'I04_KODAS_VL'));\n array_set($data, 'record.I04_SUMA_VAL', array_get($_data, 'I04_SUMA_VAL'));\n array_set($data, 'record.I04_KOEF', array_get($_data, 'I04_KOEF'));\n array_set($data, 'record.I04_USERIS', array_get($_data, 'I04_USERIS'));\n array_set($data, 'record.I04_R_DATE', array_get($_data, 'I04_R_DATE'));\n array_set($data, 'record.I04_ADDUSR', array_get($_data, 'I04_ADDUSR'));\n array_set($data, 'record.I04_KODAS_SM', array_get($_data, 'I04_KODAS_SM'));\n array_set($data, 'record.I04_APRASYMAS', array_get($_data, 'I04_APRASYMAS'));\n array_set($data, 'record.I04_SUMA_PER', array_get($_data, 'I04_SUMA_PER'));\n array_set($data, 'record.I04_SUMA_WK', array_get($_data, 'I04_SUMA_WK'));\n array_set($data, 'record.I04_KODAS_LS_1', array_get($_data, 'I04_KODAS_LS_1'));\n array_set($data, 'record.I04_KODAS_LS_2', array_get($_data, 'I04_KODAS_LS_2'));\n array_set($data, 'record.I04_KODAS_LS_3', array_get($_data, 'I04_KODAS_LS_3'));\n array_set($data, 'record.I04_KODAS_LS_4', array_get($_data, 'I04_KODAS_LS_4'));\n array_set($data, 'record.I04_KODAS_ZN', array_get($_data, 'I04_KODAS_ZN'));\n array_set($data, 'record.I04_BUSENA', array_get($_data, 'I04_BUSENA'));\n\n return makeEmptyNullable($data);\n }",
"function readInputData() {\n\t\t$this->readUserVars(array(\n\t\t\t'representativeId',\n\t\t\t'agentRole',\n\t\t\t'supplierRole',\n\t\t\t'representativeIdType',\n\t\t\t'representativeIdValue',\n\t\t\t'name',\n\t\t\t'phone',\n\t\t\t'fax',\n\t\t\t'email',\n\t\t\t'url',\n\t\t\t'isSupplier',\n\t\t));\n\t}",
"protected function getConfigFormValues()\n {\n return array(\n 'CAPTURELEADSXAVIER_LIVE_MODE' => Configuration::get('CAPTURELEADSXAVIER_LIVE_MODE', true),\n 'CAPTURELEADSXAVIER_ACCOUNT_EMAIL' => Configuration::get('CAPTURELEADSXAVIER_ACCOUNT_EMAIL', '[email protected]'),\n 'CAPTURELEADSXAVIER_ACCOUNT_PASSWORD' => Configuration::get('CAPTURELEADSXAVIER_ACCOUNT_PASSWORD', null),\n 'CAPTURELEADSXAVIER_COL_SEL' => Configuration::get('CAPTURELEADSXAVIER_COL_SEL', \"left\"),\n 'CAPTURELEADSXAVIER_NBR' => Configuration::get('CAPTURELEADSXAVIER_NBR', 3)\n );\n }",
"public function get_input_attributes() {\n\n\t\t$attributes = parent::get_input_attributes();\n\n\t\t$attributes['type'] = 'hidden';\n\t\t$attributes['value'] = ! is_null( $this->args['value'] ) ? wp_json_encode( $this->args['value'] ) : '';\n\t\t$attributes['data-parent'] = $this->args['_unique_id'];\n\n\t\treturn $attributes;\n\t}",
"public function getValues()\n {\n return $this->getVal('value', []);\n }",
"public function inputOptions()\n {\n if (!isset($this->inputOptions)) {\n $this->inputOptions = $this->createInputOptions();\n }\n return $this->inputOptions;\n }",
"public function valiteForm();",
"function readInputData() {\n\t\t$this->_metadataFormImplem->readInputData();\n\t\t$this->readUserVars(array('categories', 'seriesId', 'seriesPosition'));\n\t\tListbuilderHandler::unpack($request, $this->getData('categories'));\n\t}",
"function tidypics_prepare_form_vars($entity = null) {\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'access_id' => ACCESS_DEFAULT,\n\t\t'tags' => '',\n\t\t'container_guid' => elgg_get_page_owner_guid(),\n\t\t'guid' => null,\n\t\t'entity' => $entity,\n\t);\n\n\tif ($entity) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($entity->$field)) {\n\t\t\t\t$values[$field] = $entity->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('tidypics')) {\n\t\t$sticky_values = elgg_get_sticky_values('tidypics');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\t}\n\n\telgg_clear_sticky_form('tidypics');\n\n\treturn $values;\n}",
"public function getInputsArray()\n\t{\n\t return $this->arrInputs;\n\t}",
"public function getFormFields() {\n $fields = array(\n 'shapes[]' => array(\n 'type' => 'select',\n 'multiplicate' => '5',\n 'values' => array(\n '-' => '-',\n 'cube' => 'cube',\n 'round' => 'round',\n )\n ),\n 'width[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Width'\n ),\n 'higth[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Higth'\n ),\n 'x_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'X position'\n ),\n 'y_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Y position'\n ),\n 'red[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color red',\n ),\n 'green[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color green',\n ),\n 'blue[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color blue',\n ),\n 'size[]' => array(\n 'type' => 'text',\n 'multiplicate' => '1',\n 'label' => 'Size holst'\n ),\n 'enable[]' => array(\n 'type' => 'checkbox',\n 'multiplicate' => '5',\n 'label' => 'enable'\n )\n );\n return $fields;\n }",
"protected function inputs()\n {\n return [];\n }",
"public function valueSet() //use visitor to check if value is set on each leaf\n\n {\n\n $visitor = new \\cmu\\html\\form\\visitors\\ValueSetVisitor();\n\n return $this->accept($visitor);\n \n }",
"public function getLevelValues()\n\t{\n\t\t$values = array();\n\n\t\t$data = $this->node_object->getLevelData((int) $_GET[\"level_id\"]);\n\t\t$values[\"title\"] = $data[\"title\"];\n\t\t$values[\"description\"] = $data[\"description\"];\n\t\t$this->form->setValuesByArray($values);\n\t}"
] | [
"0.7166528",
"0.71647483",
"0.7059991",
"0.69937605",
"0.68336165",
"0.6744844",
"0.6649693",
"0.6613065",
"0.6574843",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.65634346",
"0.6437178",
"0.63068014",
"0.6202718",
"0.61986494",
"0.6187201",
"0.6153951",
"0.6139403",
"0.6118412",
"0.61180484",
"0.6082952",
"0.60712445",
"0.6070154",
"0.60690904",
"0.6067333",
"0.6062294",
"0.6059183",
"0.60521185",
"0.60478085",
"0.60365915",
"0.6023372",
"0.6011912",
"0.600047",
"0.59838355",
"0.5979483",
"0.59771633",
"0.5954217",
"0.593542",
"0.5923276",
"0.59132797",
"0.5888927",
"0.5888808",
"0.587678",
"0.58686364",
"0.5839951",
"0.5796217",
"0.5787704",
"0.5786619",
"0.57803434",
"0.5775871",
"0.5775435",
"0.5773524",
"0.5766143",
"0.57638556",
"0.5763475",
"0.57633066",
"0.5762284",
"0.5761112",
"0.5747295",
"0.5741195",
"0.5733032",
"0.5727388",
"0.5725559",
"0.57153153",
"0.5698458",
"0.5695876",
"0.56910294",
"0.56832075",
"0.5682629",
"0.5679297",
"0.5672965",
"0.566805",
"0.56645656",
"0.5664267",
"0.5659523",
"0.5657849",
"0.5655955",
"0.56311077",
"0.5630667",
"0.5627166",
"0.5618608",
"0.56079626",
"0.5606234",
"0.56045616",
"0.5596066",
"0.55928504",
"0.55903184",
"0.558211",
"0.5581545",
"0.55793536"
] | 0.0 | -1 |
Get labels set higher up in the form structure. | protected function getLabelFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->getLabel($key);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFormFieldLabels()\n {\n return craft()->coalescentForms->getFormFieldLabels();\n }",
"public function getLabels()\n {\n return isset($this->labels) ? $this->labels : null;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n return $this->labels;\n }",
"public function getLabels() {\r\n return $this->labels;\r\n }",
"public function getLabels();",
"public function getLabels();",
"public function getLabels();",
"public function labels()\n {\n return array();\n }",
"public function getLabelsList(){\n return $this->_get(6);\n }",
"public function getLabels()\n {\n return array_values(array_unique($this->labels));\n }",
"public function getLabels(): array\n {\n return $this->labels;\n }",
"public function labels() {\n\t\treturn array(\n\t\t\t'id' => 'ID',\n\t\t\t'name' => 'Name',\n\t\t\t'email' => 'Email',\n\t\t\t'phone' => 'Phone',\n\t\t\t'message' => 'Message',\n\t\t\t'date_submitted' => 'Date Submitted',\n\t\t\t'ip_address' => 'IP Address',\n\t\t);\n\t}",
"public function getLabelsList(){\n return $this->_get(2);\n }",
"public function getLabels()\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\t// Get the fields\n\t\t$fields = $model->getFieldsAsContainer();\n\t\t$labels = array();\n\n\t\tforeach ($fields as $key => $value) {\n\t\t\t$labels[$key] = isset($this->_labels[$key]) ? $this->_labels[$key] : $key;\n\t\t}\n\n\t\treturn $this->_labels;\n\t}",
"public function labels(): array\n {\n return [\n 'firstname' => 'First Name',\n 'lastname' => 'Last Name',\n 'email' => 'Email',\n 'password' => 'Password',\n 'confirmPassword' => 'Confirm Password'\n ];\n }",
"public function labels()\r\n {\r\n \treturn array(\r\n\t\t\t 'id_post'\t\t=> 'Id post',\r\n\t\t\t 'id_user'\t\t=> 'Id user',\r\n\t\t\t 'id_category'\t=> 'Id category',\r\n\t\t\t 'id_location'\t=> 'Id location',\r\n\t\t\t 'type'\t\t\t=> 'Type',\r\n\t\t\t 'title'\t\t\t=> 'Title',\r\n\t\t\t 'seotitle'\t\t=> 'SEO title',\r\n\t\t\t 'description'\t=> 'Description',\r\n\t\t\t 'adress'\t\t=> 'Adress',\r\n\t\t\t 'price'\t\t\t=> 'Price',\r\n\t\t\t 'phone'\t\t\t=> 'Phone',\r\n\t\t\t 'ip_address'\t=> 'Ip address',\r\n\t\t\t 'created'\t\t=> 'Created',\r\n\t\t\t 'published'\t\t=> 'Published',\r\n\t\t\t 'status'\t\t=> 'Status',\r\n\t\t\t 'has_images'\t=> 'Has images',\r\n\t\t\t );\r\n }",
"public function getLabels()\n {\n if (is_null($this->labels)) {\n $this->labels = collect();\n $testlabel_models = TestLabel::where([\n ['buildid', '=', $this->buildid],\n ['outputid', '=', $this->outputid],\n ])->get();\n foreach ($testlabel_models as $testlabel_model) {\n $label = new Label();\n $label->Id = $testlabel_model->labelid;\n $text = $label->GetText();\n $this->labels->put($text, $label);\n }\n }\n return $this->labels;\n }",
"function getLabel() \n {\n return $this->getValueByFieldName( 'label_label' );\n }",
"public static function getLabels(): array;",
"public function labels(){\n\t\treturn array(\n\t\t\t'name' => __($this->options('plural_name')),\n\t\t\t'singular_name' => __($this->options('singular_name')),\n\t\t\t'add_new_item' => __($this->options('add_new_item')),\n\t\t\t'edit_item' => __($this->options('edit_item')),\n\t\t\t'new_item' => __($this->options('new_item')),\n\t\t);\n\t}",
"function getLabelField() \n {\n return \"label_label\";\n }",
"public function attributeLabels()\n\t{\n\t\t$labels = array();\n\t\tforeach($this->searchFields as $field=>$data)\n\t\t\t$labels[$field] = isset($data['label']) ? $data['label'] : parent::generateAttributeLabel($field);\n\t\treturn $labels;\n\t}",
"function wpsl_labels() {\n\n $labels = array(\n 'search',\n 'search_btn',\n 'preloader',\n 'radius',\n 'no_results',\n 'results',\n 'more',\n 'directions',\n 'no_directions',\n 'back',\n 'street_view',\n 'zoom_here',\n 'error',\n 'phone',\n 'fax',\n 'email',\n 'url',\n 'hours',\n 'start',\n 'limit',\n 'category',\n 'category_default'\n );\n\n return $labels;\n}",
"public function getLabels() {\n\t\tif ($this->labels === null) {\n\t\t\t$this->labels = new LabelList();\n\t\t\t$this->labels->getConditionBuilder()->add(\"label.objectTypeID IN (?)\", array(array_keys($this->cache['objectTypes'])));\n\t\t\t$this->labels->sqlLimit = 0;\n\t\t\t$this->labels->readObjects();\n\t\t}\n\t\t\n\t\treturn $this->labels;\n\t}",
"public function get_label();",
"public function get_label();",
"public function labels()\n {\n return [\n 'name' => __('Name'),\n 'email' => __('Email'),\n 'message' => __('Message'),\n 'captcha' => __('Captcha')\n ];\n }",
"public function createLabels()\n {\n // default labels\n $labels = [\n 'name' => $this->plural,\n 'singular_name' => $this->singular,\n 'menu_name' => $this->plural,\n 'all_items' => \"All {$this->plural}\",\n 'edit_item' => \"Edit {$this->singular}\",\n 'view_item' => \"View {$this->singular}\",\n 'update_item' => \"Update {$this->singular}\",\n 'add_new_item' => \"Add New {$this->singular}\",\n 'new_item_name' => \"New {$this->singular} Name\",\n 'parent_item' => \"Parent {$this->plural}\",\n 'parent_item_colon' => \"Parent {$this->plural}:\",\n 'search_items' => \"Search {$this->plural}\",\n 'popular_items' => \"Popular {$this->plural}\",\n 'separate_items_with_commas' => \"Seperate {$this->plural} with commas\",\n 'add_or_remove_items' => \"Add or remove {$this->plural}\",\n 'choose_from_most_used' => \"Choose from most used {$this->plural}\",\n 'not_found' => \"No {$this->plural} found\",\n ];\n\n return array_replace($labels, $this->labels);\n }",
"public function labels()\n {\n return $this->morphToMany(\\VentureDrake\\LaravelCrm\\Models\\Label::class, config('laravel-crm.db_table_prefix').'labelable');\n }",
"public function getLabelField() {}",
"abstract function labels();",
"public function labels() : array\n {\n return [\n 'username' => 'username',\n 'email' => 'email address',\n 'password' => 'password',\n ];\n }",
"public function getCustomLabels() {\r\n return $this->labels->getItems();\r\n }",
"public function getLabel()\n\t{\t\t\t\n\t\treturn $this->label;\n\t}",
"private function getLabelsArray()\n{\n \n $returnArray=array();\n \n //set up labels array.\n if (isset($this->tableStructure)) {\n foreach ($this->tableStructure as $ind => $fieldArray) {\n $returnArray[$fieldArray['columnName']]=isset($fieldArray['label']) ? $fieldArray['label'] : $fieldArray['columnName'];\n }\n }\n \n return $returnArray; \n}",
"public function getLabel()\n\t{\n\t\t$label = parent::getLabel();\n\t\t$label->for = $this->getId();\n\t\treturn $label;\n\t}",
"public function labels()\n {\n }",
"function getLabel(){\r\n\t\treturn $this->label;\r\n\t}",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function get_label(){ return $this->label; }",
"public function getLabel() {}",
"public function getLabel() {}",
"function field_views_field_label($field_name) {\n $label_counter = array();\n $all_labels = array();\n // Count the amount of instances per label per field.\n $instances = field_info_instances();\n foreach ($instances as $entity_name => $entity_type) {\n foreach ($entity_type as $bundle) {\n if (isset($bundle[$field_name])) {\n $label_counter[$bundle[$field_name]['label']] = isset($label_counter[$bundle[$field_name]['label']]) ? ++$label_counter[$bundle[$field_name]['label']] : 1;\n $all_labels[$entity_name][$bundle[$field_name]['label']] = TRUE;\n }\n }\n }\n if (empty($label_counter)) {\n return array($field_name, $all_labels);\n }\n // Sort the field lables by it most used label and return the most used one.\n arsort($label_counter);\n $label_counter = array_keys($label_counter);\n return array($label_counter[0], $all_labels);\n}",
"public function getLabels($field_names=array()){\n\t\tif(!is_array($field_names)){\n\t\t\t$field_names = $this->getFields();\n\t\t}\n\t\t\n\t\t$labels = array();\n\t\tforeach($field_names as $field_name){\n\t\t\tif(isset($this->Fields[$field_name])){\n\t\t\t\t$labels[$field_name] = $this->Fields[$field_name]->label;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $labels;\n\t}",
"function getLabel() {\n global $Language;\n if ($this->isLabelMustBeLocalized()) {\n return $Language->getText('plugin_tracker_common_fieldset', $this->label);\n } else {\n return $this->label;\n }\n }",
"public function labels() {\n return [\n 'name' => 'Имя',\n 'email' => 'E-mail',\n 'repassword' => 'Повторите пароль',\n 'password' => 'Пароль',\n 'subject' => 'Тема',\n 'message' => 'Сообщение',\n ];\n }",
"public function labels()\n {\n return new Labels($this->getClient());\n }",
"abstract public function getLabel();",
"public function fieldLabels($includerelations = true)\n {\n // Obtain Field Labels (from parent):\n \n $labels = parent::fieldLabels($includerelations);\n \n // Define Field Labels:\n \n $labels['Email'] = _t(__CLASS__ . '.EMAIL', 'Email');\n $labels['EmailSubject'] = _t(__CLASS__ . '.SUBJECT', 'Subject');\n $labels['EmailMessage'] = _t(__CLASS__ . '.MESSAGE', 'Message');\n \n // Answer Field Labels:\n \n return $labels;\n }",
"public function fieldLabels($includerelations = true)\n {\n // Obtain Field Labels (from parent):\n \n $labels = parent::fieldLabels($includerelations);\n \n // Define Field Labels:\n \n $labels['Title'] = _t(__CLASS__ . '.TITLE', 'Title');\n $labels['Value'] = _t(__CLASS__ . '.VALUE', 'Value');\n $labels['HideTitle'] = _t(__CLASS__ . '.HIDETITLE', 'Hide title');\n $labels['TitleOptions'] = _t(__CLASS__ . '.TITLE', 'Title');\n \n // Answer Field Labels:\n \n return $labels;\n }",
"protected function addNamesLabelsValues() {\n foreach ($this->__fields() as $field) {\n $this->$field->__name = $field;\n if (!$this->$field->label && $this->$field->label !== '') $this->$field->label = strtoupper($field[0]) . substr ($field, 1);\n $this->setFieldValue($field);\n $this->$field->setForm($this);\n }\n }",
"public function labels(): array\n {\n return [];\n }",
"public function fieldLabels($includerelations = true)\n {\n // Obtain Field Labels (from parent):\n \n $labels = parent::fieldLabels($includerelations);\n \n // Define Field Labels:\n \n $labels['SendTo'] = _t(__CLASS__ . '.SENDTO', 'Send to');\n $labels['SendFrom'] = _t(__CLASS__ . '.SENDFROM', 'Send from');\n $labels['EmailSubject'] = _t(__CLASS__ . '.EMAILSUBJECT', 'Email subject');\n $labels['OnSendMessage'] = _t(__CLASS__ . '.ONSENDMESSAGE', 'On Send message');\n \n $labels['Name'] = $labels['NameTo'] = $labels['NameFrom'] = _t(__CLASS__ . '.NAME', 'Name');\n $labels['Email'] = $labels['EmailTo'] = $labels['EmailFrom'] = _t(__CLASS__ . '.EMAIL', 'Email');\n $labels['Disabled'] = $labels['Disabled.Nice'] =_t(__CLASS__ . '.DISABLED', 'Disabled');\n \n // Answer Field Labels:\n \n return $labels;\n }",
"public function getLabel()\n\t{\n\t\treturn $this->get('label');\n\t}",
"public function fieldLabels($includerelations = true)\n {\n // Obtain Field Labels (from parent):\n \n $labels = parent::fieldLabels($includerelations);\n \n // Define Field Labels:\n \n $labels['Options'] = _t(__CLASS__ . '.OPTIONS', 'Options');\n $labels['Portfolio'] = _t(__CLASS__ . '.PORTFOLIO', 'Portfolio');\n $labels['DetailsHeading'] = _t(__CLASS__ . '.DETAILSHEADING', 'Details heading');\n \n // Answer Field Labels:\n \n return $labels;\n }",
"public function getPageLabels() {}",
"public function getStoreLabels();",
"public function getLabel()\n {\n return $this->_label;\n }",
"public function getLabel()\n {\n return $this->_label;\n }",
"public function defaultLabels(): array;",
"private function setLabels(){\n\t\t$this->labels = array(\n\t\t\t'name' => $this->name,\n\t\t\t'singular_name' => $this->nameMenuSingular,\n\t\t\t'menu_name' => $this->nameMenu,\n\t\t\t'all_items' => $this->nameAll,\n\t\t\t'add_new' => $this->nameAddNew,\n\t\t\t'add_new_item' => $this->nameNewItem,\n\t\t\t'edit_item' => $this->nameEdit,\n\t\t\t'new_item' => $this->nameNewItem,\n\t\t\t'view_item' => $this->nameView,\n\t\t\t'search_items' => $this->nameSearch,\n\t\t\t'not_found' => $this->msgNotFound,\n\t\t\t'not_found_in_trash' => $this->msgNotFoundTash,\n\t\t\t'parent_item_colon' => $this->msgParentItemColon\n\t\t);\n\t}",
"public function fieldLabels($includerelations = true)\n {\n // Obtain Field Labels (from parent):\n \n $labels = parent::fieldLabels($includerelations);\n \n // Define Field Labels:\n \n $labels['Caption'] = _t(__CLASS__ . '.CAPTION', 'Caption');\n $labels['ImageID'] = _t(__CLASS__ . '.IMAGE', 'Image');\n $labels['HideCaption'] = _t(__CLASS__ . '.HIDECAPTION', 'Hide caption');\n \n // Define Relation Labels:\n \n if ($includerelations) {\n $labels['Image'] = _t(__CLASS__ . '.has_one_IMAGE', 'Image');\n }\n \n // Answer Field Labels:\n \n return $labels;\n }",
"public function getLabel() {\n return $this->label;\n }",
"public function getLabel() {\n return $this->label;\n }",
"public function getLabel()\n\t{\n\t\treturn $this->_label;\n\t}",
"public function fieldLabels($includerelations = true)\n {\n // Obtain Field Labels (from parent):\n \n $labels = parent::fieldLabels($includerelations);\n \n // Define Field Labels:\n \n $labels['Gallery'] = _t(__CLASS__ . '.GALLERY', 'Gallery');\n $labels['ShowImageCounts'] = _t(__CLASS__ . '.SHOWIMAGECOUNTS', 'Show image counts');\n \n // Answer Field Labels:\n \n return $labels;\n }",
"public function labels(): array\n {\n return [\n 'db.driver' => __('Database type'),\n 'db.host' => __('Host'),\n 'db.username' => __('User name'),\n 'db.password' => __('User password'),\n 'db.database' => __('Database name'),\n 'db.prefix' => __('Table prefix'),\n 'mail.enable' => __('Use mail features'),\n 'mail.from' => __('From'),\n 'mail.dsn' => __('DSN connection'),\n 'singleLanguage' => __('Default language'),\n 'multiLanguage' => __('Multi language'),\n 'user.email' => __('Email'),\n 'user.password' => __('Password'),\n 'user.repassword' => __('Repeat password'),\n 'mainpage' => __('Main page')\n ];\n }",
"public function getLabel()\n {\n return $this->label;\n }",
"public function getLabel()\n {\n return $this->label;\n }",
"public function getLabel()\n {\n return $this->label;\n }",
"public function getLabel()\n {\n return $this->label;\n }",
"public function getLabel()\n {\n return $this->label;\n }"
] | [
"0.74787265",
"0.71919334",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.7182694",
"0.71572393",
"0.7146363",
"0.7146363",
"0.7146363",
"0.6988296",
"0.67838156",
"0.67550415",
"0.67056006",
"0.6705565",
"0.670027",
"0.66334337",
"0.6598127",
"0.6596717",
"0.6595979",
"0.65371466",
"0.645266",
"0.64219916",
"0.6396852",
"0.63814586",
"0.6371253",
"0.636996",
"0.6329391",
"0.6329391",
"0.6321262",
"0.6315469",
"0.63081634",
"0.6307898",
"0.6291154",
"0.6278655",
"0.6260886",
"0.62472844",
"0.6244352",
"0.62327665",
"0.6229892",
"0.62191004",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6208776",
"0.6206399",
"0.6206227",
"0.6206227",
"0.6186002",
"0.6178776",
"0.6146142",
"0.614604",
"0.6143322",
"0.61398876",
"0.6117566",
"0.6114075",
"0.6110446",
"0.61032134",
"0.609948",
"0.60974693",
"0.6073205",
"0.6064488",
"0.6059356",
"0.6053533",
"0.6053533",
"0.6049951",
"0.60367453",
"0.6032532",
"0.6022392",
"0.6022392",
"0.60160774",
"0.6015266",
"0.601176",
"0.60049605",
"0.60049605",
"0.60049605",
"0.60049605",
"0.60049605"
] | 0.0 | -1 |
Get error messages set higher up in the form structure. | protected function getErrorsFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->getErrors($key);
}
return [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getErrorMessages() {}",
"public function getValidationErrorMessages() {}",
"public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The field ' . $message->getField() . ' is required');\n break;\n case 'Uniqueness':\n $message->setMessage('The field ' . $message->getField() . ' must be unique');\n break;\n case 'Email':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid email');\n break;\n case 'Url':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid url');\n break;\n case 'InclusionIn':\n $message->setMessage('The field ' . $message->getField() . ' must contain a value in [' . implode(',', $message->getDomain()) . ']');\n break;\n case 'DateValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid date.');\n break;\n case 'TimestampValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid timestamps.');\n break;\n }\n }\n\n return parent::getMessages();\n }",
"public function getErrorMessages()\n {\n $errors = [];\n foreach ($this->fields as $field) {\n if ($field instanceof AbstractFormField && !$field->isValid()) {\n $fldErrors = $field->getErrorMessages();\n $errors = array_merge($errors, $fldErrors);\n }\n }\n\n return $errors;\n }",
"public function getErrorMessages()\n {\n return $this->errorMessages;\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"public function get_error_messages();",
"public function getMessages()\n {\n return $this->_errorMessages;\n }",
"public function validation_errors()\n\t{\n\t\t$errors = array();\n\n\t\tforeach ($this->validators as $fld=>$arr)\n\t\t{\n\t\t\tforeach ($arr as $vl)\n\t\t\t{\n\t\t\t\t$vl->page = $this;\n\n\t\t\t\tif (!$vl->validate($fld, $this->vars))\n\t\t\t\t{\n\t\t\t\t\t$errors[$fld] = $vl->error_message($fld, $this->vars);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $errors;\n\t}",
"public function getErrors()\n {\n return $this->getInputFilter()->getMessages();\n }",
"public function getFormErrors()\n {\n return $this->form->getErrors();\n }",
"public function getErrorMessages() {\n\t\t$errorMessages = '';\n\t\tforeach ($this->errorMessages as $index => $error) {\n\t\t\t$errorMessages .= \"[Error:\" . $index . '] ' . $error . \"\\n<br />\";\n\t\t}\n\t\treturn $errorMessages;\n\t}",
"public function getErrors() {\r\n \t$this->getForm()->getErrors();\r\n }",
"public function getValidationMessages();",
"function getMessages() {\n\t\t$fields = $this->getFields();\n\t\t$allMessages = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldMessages = $field->getValidationMessages();\n\t\t\tif ($fieldMessages) {\n\t\t\t\t$allMessages[$field->getName()] = $fieldMessages;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $allMessages;\n\t}",
"public function errorMessages()\n {\n return [\n self::RULE_REQUIRED => 'This field is required',\n self::RULE_EMAIL => 'This field must be a valid email address',\n self::RULE_MIN => 'Min length of this field must be {min}',\n self::RULE_MAX => 'Max length of this field must be {max}',\n self::RULE_MATCH => 'This field must be the same as {match}',\n self::RULE_UNIQUE => 'Record with this {field} already exists'\n ];\n }",
"public function getValidationErrors()\n {\n $fields = $this->getFields();\n if (!$fields) {\n return [];\n }\n\n $result = [];\n foreach ($fields as $field) {\n if ($field instanceof AbstractFormField) {\n if (!$field->isValid()) {\n $result = array_merge($result, $field->getErrorMessages());\n }\n }\n }\n\n return $result;\n }",
"public function getError(): array\n {\n return $this->errorMessages;\n }",
"public function getErrorMessages() : array\n {\n return $this->errors_messages;\n }",
"public function getErrorMessagesList(){\n \t$errors = $this->getMessages();\n \tif(count($errors)){\n \t\t$result = [];\n \t\tforeach ($errors as $elementName => $elementErrors){\n \t\t\tforeach ($elementErrors as $errorMsg){\n \t\t\t\t$result[] = $errorMsg;\n \t\t\t}\n \t\t}\n \t\treturn $result;\n \t}\n \treturn null;\n }",
"public function errors()\n {\n return $this->getRules()->getMessageBag()->all();\n }",
"public function getFormErrors(): array\n {\n $errors = [];\n $getPropertyPath = function(FormError $error, FormInterface $form) {\n $path = $error->getCause() && method_exists($error->getCause(), 'getPropertyPath') ? $error->getCause()->getPropertyPath() : null;\n if (is_null($path) && $error->getOrigin()->getPropertyPath()) {\n $pathParts = [];\n $form = $error->getOrigin();\n while ($form->getParent()) {\n array_unshift($pathParts, $form->getPropertyPath());\n $form = $form->getParent();\n }\n $path = join('.', $pathParts);\n }\n $path = preg_replace('/children\\[([^\\]]+)\\]/', '${1}', $path);\n $path = preg_replace('/\\[(\\d+)\\]/', '.${1}', $path);\n if (substr($path, 0, 5) === 'data.') {\n $path = substr($path, 5);\n }\n if (substr($path, -5) === '.data') {\n $path = substr($path, 0,-5);\n }\n return $path;\n };\n $form = $this->getForm();\n foreach ($form->getErrors(true, true) as $error) {\n $path = $getPropertyPath->call($this, $error, $form);\n if (!isset($errors[$path])) {\n $errors[$path] = [];\n }\n $errors[$path][] = $error->getMessage();\n }\n\n return $errors;\n }",
"public function getErrors()\n\t{\n\t\t$errors = array();\n\t\t/** @var Miao_Form_Control $control */\n\t\t/** @var Miao_Form_Validate $validator */\n\t\tforeach ( $this->getControls() as $control )\n\t\t{\n\t\t\tif ( !$control->isValid() )\n\t\t\t{\n\t\t\t\t$validator = $control->error();\n\t\t\t\t$errors[] = array(\n\t\t\t\t\t'name' => $control->getName(),\n\t\t\t\t\t'error' => $validator->getMessage() );\n\t\t\t}\n\t\t}\n\t\treturn $errors;\n\t}",
"public function getFormErrors(): array\n {\n return $this->formErrors;\n }",
"public function get_validation_messages() {\n\t\t$field = $this->field;\n\t\t$id = $this->get_id( $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$messages = '';\n\n\t\t$post_title = self::get_property( 'post_title', $field, '' );\n\t\t$post_content = self::get_property( 'post_content', $field, '' );\n\t\t$post_excerpt = self::get_property( 'post_excerpt', $field, '' );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$setting_required_message = self::get_property( 'required_message', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\n\t\t$post_title_enabled = ! empty( $post_title );\n\t\t$post_content_enabled = ! empty( $post_content );\n\t\t$post_excerpt_enabled = ! empty( $post_excerpt );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$category_list = forminator_post_categories( $post_type );\n\n\t\tif ( $is_required ) {\n\t\t\tif ( $post_title_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-title\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_title_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post title', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_content_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-content\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_content_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post content', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_excerpt_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-excerpt\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_excerpt_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post excerpt', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_image_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-image\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_image_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please upload a post image', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif( ! empty( $category_list ) ) {\n\t\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\t\tif ( $post_category_enabled ) {\n\t\t\t\t\t\t$post_category_multiple = self::get_property( $category['value'].'_multiple', $field, '' );\n\t\t\t\t\t\tif( $post_category_multiple ){\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '[]\": {' . \"\\n\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '\": {' . \"\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t\t\t'forminator_postdata_field_' . $category['value'] . '_validation_message',\n\t\t\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please select a '. $category['singular'], Forminator::DOMAIN ) ),\n\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t$field\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $messages;\n\t}",
"public function getErrorMessages(){\n return $this->arr_msg; \n }",
"public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }",
"public function getErrors(): array\n {\n return $this->getInputFilter()->getMessages();\n }",
"public function errors() {\n $Errors = array();\n foreach ($this->__fields() as $field) {\n $E = $this->$field->errorsList();\n if ($E) $Errors[$field] = $E;\n }\n return $Errors;\n }",
"public function getErrors()\n {\n return $this->messageBag->all();\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function get_errors() {\n\t\treturn $this->errors->get_error_messages();\n\t}",
"public function getErrorMessages()\n {\n $translator = Mage::helper('importexport');\n $messages = array();\n\n foreach ($this->_errors as $errorCode => $errorRows) {\n if (isset($this->_messageTemplates[$errorCode])) {\n $errorCode = $translator->__($this->_messageTemplates[$errorCode]);\n }\n foreach ($errorRows as $errorRowData) {\n $key = $errorRowData[1] ? sprintf($errorCode, $errorRowData[1]) : $errorCode;\n $messages[$key][] = $errorRowData[0];\n }\n }\n return $messages;\n }",
"private function getErrorMessages() {\n\t\tif (empty($this->errorMessages)) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$this->template->setMarker(\n\t\t\t'message_no_permissions',\n\t\t\t$this->doc->spacer(5) .\n\t\t\t\t$GLOBALS['LANG']->getLL('message_no_permission')\n\n\t\t);\n\t\t$errorList = implode('</li>' . LF . '<li>', $this->errorMessages);\n\t\t$this->template->setMarker('error_list', '<li>' . $errorList .'</li>');\n\n\t\treturn $this->template->getSubpart('IMPORT_ERRORS');\n\t}",
"private function getErrorMessages(\\Symfony\\Component\\Form\\Form $form) {\n $errors = array();\n\n foreach ($form->getErrors() as $key => $error) {\n if ($form->isRoot()) {\n $errors['#'][] = $error->getMessage();\n } else {\n $errors[] = $error->getMessage();\n }\n }\n\n foreach ($form->all() as $child) {\n if (!$child->isValid()) {\n $errors[$child->getName()] = $this->getErrorMessages($child);\n }\n }\n\n return $errors;\n }",
"private function getErrorMessages($form) : array\n {\n $errors = array();\n\n foreach ($form->getErrors() as $error) {\n if ($form->isRoot()) {\n $errors['#'][] = $error->getMessage();\n } else {\n $errors[] = $error->getMessage();\n }\n }\n\n foreach ($form->all() as $child) {\n if (!$child->isValid()) {\n $errors[$child->getName()] = $this->getErrorMessages($child);\n }\n }\n\n return $errors;\n }",
"public function getValidationErrors() {\n\t\t$out = array();\n\t\t$this->loadFields();\n\t\tforeach($this->fields as $field) {\n\t\t\t$out = array_merge($out, $field->getValidationErrors());\n\t\t}\n\t\tif ((!$this->lat || !$this->lng) && !$this->feature_id) {\n\t\t\t$out[] = \"You must set a location!\";\n\t\t}\n\t\treturn $out;\n\t}",
"public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}",
"public function errors()\n {\n return $this->validation->messages()->messages();\n }",
"public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function get_clear_error_msgs()\n {\n $msgs = array();\n foreach ($this->errors as $e) {\n $msgs[$e['field']][$e['rule']] = $this->get_validation_error_msg($e['field'], $e['rule'], $e['value']);\n\n }\n return $msgs;\n }",
"function getErrors()\n {\n $errMsg = '';\n foreach ($this->errors as $error) {\n $errMsg .= $error;\n $errMsg .= '<br/>';\n }\n return $errMsg;\n }",
"public function getValidationMessages()\n {\n return $this->validationMessages;\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"protected function validationErrorMessages()\n {\n return [\n 'password.required' => trans('strings.request_password_required'),\n 'password.confirmed' => trans('strings.request_password_confirmed'),\n 'password.min' => trans('strings.request_password_min', ['chars' => config('db_limits.users.minPasswordLength')]),\n ];\n }",
"public function getErrors(){\n if( !isset($this->openForm) ) return false;\n if( !is_bool($this->openForm) && !is_array($this->openForm) )\n return self::getFormErrors($this->openForm);\n if( is_array($this->openForm) )\n return self::getFormErrors($this->openForm['formid']);\n return false;\n }",
"private function errorMessages()\n {\n return [\n 'question_category_id.required' => 'Atleast one question-category '.\n 'is required',\n ];\n }",
"private function getErrors() {\n \n $inError = $this->getInErrorWords();\n $errors = array();\n $length = count($inError);\n if ($length === 0) {\n return $errors;\n }\n $error = null;\n $currentErrorType = null;\n for ($i = 0; $i <= $length; $i++) {\n \n if ($i === $length) {\n $errors[] = $error;\n break;\n }\n \n if (!isset($currentErrorType) || $currentErrorType === $inError[$i]['error']) {\n $message = (isset($error) ? $error['message'] . ' ' : '') . $inError[$i]['word'];\n }\n else {\n $errors[] = $error;\n $message = $inError[$i]['word'];\n }\n \n $currentErrorType = $inError[$i]['error'];\n $error = array(\n 'error' => $currentErrorType,\n 'message' => (isset($error) ? $error['message'] . ' ' : '') . $inError[$i]['word']\n );\n }\n return $errors;\n }",
"public function getValidationErrors();",
"public function getValidationErrors();",
"public function messages()\n {\n /*\n return [\n 'bio.required' => 'Bio is required',\n 'state.required' => 'State is required',\n 'city.required' => 'City name is required',\n 'postalcode.required' => 'Postal Code is required',\n 'gender.required' => 'Gender is required',\n 'seeking_gender.requred' => 'Gender you are searching for is required',\n ];\n */\n }",
"public function getErrors()\n {\n return $this->_getChildrenByName('error');\n }",
"public function messages()\n {\n return [\n 'code_area.required' => 'Code area cannot be blank',\n 'name.required' => 'Name area cannot be blank'\n ];\n }",
"public function messages() {\n return [\n 'name.required' => 'Missing name.',\n 'description.required' => 'Missing description.',\n 'max_level.required' => 'Missing max level.',\n 'bonus_per_level.required' => 'Missing bonus per level.',\n 'effect_type.required' => 'Missing effect type.',\n 'hours_per_level.required' => 'Missing length of time per level.'\n ];\n }",
"protected function getErrorMessages(\\Symfony\\Component\\Form\\Form $form) {\n $errors = array();\n\n foreach ($form->getErrors() as $key => $error) {\n $errors[] = $error->getMessage();\n }\n\n foreach ($form->all() as $child) {\n if (!$child->isValid()) {\n $errors[$child->getName()] = $this->getErrorMessages($child);\n }\n }\n\n return $errors;\n }",
"public function getMessages() {\r\n \t$this->getForm()->getMessages();\r\n }",
"private function getErrorMessages(): array\n {\n return [\n 'notEmpty' => 'Campo {{name}} obligatorio',\n 'date' => '{{name}} debe tener una fecha valida. Ejemplo de formato: {{format}}\\'',\n 'intVal' => '',\n 'between' => '',\n 'in' => '',\n 'floatVal' => '',\n 'length' => '',\n 'stringType' => '',\n 'objectType' => '',\n 'cantidadRegistros' => 'dsfsdfsd',\n 'periodo.notEmpty' => 'Campo Periodo: es obligatorio',\n 'periodo' => 'Campo Periodo: Debe tener el formato AAAAMM, donde AAAA indica el año y MM el mes en números',\n 'orden.notEmpty' => 'Campo Orden: es obligatorio',\n 'orden' => 'Campo Orden: Debe ser igual a 1 ó 2.',\n 'codigoComprobante.notEmpty' => 'Campo Codigo de Comprobante: es obligatorio',\n 'codigoComprobante' => 'Campo Codigo de Comprobante: Debe debe estar comprendido entre 1 y 9998.',\n 'numeroComprobante.notEmpty' => 'Campo Numero de Comprobante: es obligatorio',\n 'numeroComprobante' => 'Campo Numero de Comprobante: Debe debe estar comprendido entre 1 y 99999999.',\n 'puntoVenta.notEmpty' => 'Punto de venta: es obligatorio',\n 'puntoVenta' => 'Punto de venta: Debe debe estar comprendido entre 1 y 9998.',\n ];\n }",
"public function messages()\n {\n return [\n 'name.required' => 'Email is required!',\n 'year.required' => 'Year is required!',\n 'artist_id.required' => 'Artist is required!'\n ];\n }",
"public function messages()\n {\n $items = [];\n foreach (static::attributes() as $key => $val) {\n $items[$key . '.required'] = t('common.form.errors.required', [\n 'attribute' => $val,\n ]);\n }\n \n return $items;\n }",
"public function errorMessages() {\n if(empty($this->errors)) {\n return;\n }\n \n $message = 'The following errors have occured: <ul>';\n foreach($this->errors as $error) {\n $message .= \"<li>$error</li>\";\n }\n $message .= '</ul>';\n\n return '<div class=\"error\">'.$message.'</div>';\n }",
"function errors() \n {\n $str = \"<ul class=\\\"form-error\\\">\\n\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n #busca metodos de validacion definido por usuario\n if ($obj != NULL) \n {\n if (!$obj->errors->not_errors())\n {\n $str .= \"<li>\".$name.\"\\n\";\n $str .= $obj->errors;\n $str .= \"</li>\\n\";\n }\n }\n }\n $str .= \"</ul>\\n\";\n return $str;\n }",
"protected function validationErrorMessages()\n {\n return [\n 'password.regex' => 'Password must contain at least 1 uppercase letter and 1 number.',\n ];\n }",
"public function errors()\n {\n return $this->provider->getMessageBag();\n }",
"public function messages() \n {\n return[\n 'name.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.numeric' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.major' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity']\n ];\n }",
"public function messages()\n {\n return $messages = [\n 'source_funds.required' => trans('common.error_messages.req_this_field'),\n 'jurisdiction_funds.required' => trans('common.error_messages.req_this_field'),\n 'annual_income.required' => trans('common.error_messages.req_this_field'),\n 'other_source.required' => trans('common.error_messages.req_this_field'),\n 'estimated_wealth.required' => trans('common.error_messages.req_this_field'),\n 'wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'other_wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'tin_code.required' => trans('common.error_messages.req_this_field'),\n 'is_abandoned.required' => trans('common.error_messages.req_this_field'),\n 'date_of_abandonment.required' => trans('common.error_messages.req_this_field'),\n 'abandonment_reason.required' => trans('common.error_messages.req_this_field'),\n 'justification.required' => trans('common.error_messages.req_this_field'),\n 'tin_country_name.required' => trans('common.error_messages.req_this_field'),\n 'tin_number.required' => trans('common.error_messages.req_this_field'),\n ];\n }",
"public function getErrors()\r\n\t\t{\r\n\t\t\treturn $this->_controlErrors;\r\n\t\t}",
"public function messages() {\n $messages['title.required'] = trans('common.error_messages.req_this_field');\n \n $messages['f_name.required'] = trans('common.error_messages.req_this_field');\n $messages['f_name.regex']=trans('common.error_messages.alphnum_hyp_uscore');\n $messages['f_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['f_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['l_name.required'] = trans('error_messages.req_this_field');\n $messages['l_name.regex']=trans('common.error_messages.alphnum_hyp_uscore'); \n $messages['l_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['l_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['m_name.regex']=trans('common.error_messages.alphnum_hyp_uscore');\n $messages['m_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['m_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['gender.required'] = trans('common.error_messages.req_this_field');\n $messages['date_of_birth.required'] = trans('common.error_messages.req_this_field');\n \n \n $messages['father_name.required'] = trans('common.error_messages.req_this_field');\n $messages['father_name.regex'] = trans('common.error_messages.alphnum_hyp_uscore_space'); \n $messages['father_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['father_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['mother_f_name.required'] = trans('error_messages.req_this_field');\n $messages['mother_f_name.regex'] = trans('common.error_messages.alphnum_hyp_uscore');\n $messages['mother_f_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['mother_f_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['mother_m_name.required'] = trans('error_messages.req_this_field');\n $messages['mother_m_name.regex'] = trans('common.error_messages.alphnum_hyp_uscore');\n $messages['mother_m_name.max'] = trans('common.error_messages.max_60_chars');\n $messages['mother_m_name.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['birth_country_id.required'] = trans('error_messages.req_this_field');\n\n $messages['birth_city_id.required'] = trans('common.error_messages.req_this_field');\n $messages['birth_city_id.regex'] = trans('common.error_messages.alphnum_hyp_uscore_space');\n $messages['birth_city_id.max'] = trans('common.error_messages.max_60_chars');\n $messages['birth_city_id.min'] = trans('common.error_messages.least_3_chars');\n \n \n $messages['reg_no.alpha_num'] = trans('common.error_messages.alpha_num');\n $messages['reg_no.max'] = trans('common.error_messages.max_60_chars');\n\n \n \n $messages['reg_place.regex'] = trans('common.error_messages.alphnum_hyp_uscore_space');\n $messages['reg_place.max'] = trans('common.error_messages.max_60_chars');\n $messages['reg_place.min'] = trans('common.error_messages.least_3_chars');\n \n $messages['f_nationality_id.required'] = trans('common.error_messages.req_this_field');\n $messages['residence_status.required'] = trans('common.error_messages.req_this_field');\n $messages['family_status.required'] = trans('common.error_messages.req_this_field');\n $messages['educational_level.required'] = trans('common.error_messages.req_this_field');\n $messages['is_residency_card.required'] = trans('common.error_messages.req_this_field');\n\n $messages['legal_maturity_date.required'] = trans('common.error_messages.req_this_field');\n\n\n $messages['document_type_id.*.required'] = trans('common.error_messages.req_this_field');\n $messages['social_media_id.*.required'] = trans('common.error_messages.req_this_field');\n \n $messages['social_media_link.*.url'] = trans('common.error_messages.enter_valid_url');\n $messages['social_media_link.*.max'] = trans('common.error_messages.max_120_chars');\n \n $messages['document_number.*.alpha_num'] = trans('common.error_messages.alpha_num');\n $messages['document_number.*.max'] = trans('common.error_messages.max_20_chars');\n \n \n return $messages;\n }",
"public function messages()\n {\n return [\n 'code_day.required' => 'Code day must required!',\n 'name.required' => 'Name must required!',\n ];\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function messages()\n {\n return [\n 'style.required' => 'Please the style is required',\n 'service.required' => 'Please select service type',\n 'session.required' => 'Please select session'\n ];\n }",
"public function messages()\n {\n return [\n 'zipcode.required' => 'A Zipcode is required',\n 'publicPlace.required' => 'A Public Place is required',\n 'neighbordhood.required' => 'A Neighbordhood is required',\n 'complement.required' => 'A Complement Name is required',\n 'number.required' => 'A Number is required',\n 'city.required' => 'A City is required',\n 'state.required' => 'A State is required',\n\n 'zipcode.max' => 'A Zipcode max 255 characteres required.',\n 'publicPlace.max' => 'A Public Place max 255 characteres required.',\n 'neighbordhood.max' => 'A Neighbordhood max 255 characteres required.',\n 'complement.max' => 'A Complementmax 255 characteres required.',\n 'number.max' => 'A Number max 255 characteres required.',\n 'city.max' => 'A City max 255 characteres required.',\n 'state.max' => 'A State max 255 characteres required.',\n ];\n }",
"public function getErrors()\n\t{\n\t\treturn $this->_errorMessage;\n\t}",
"public function messages()\n {\n return [\n 'name.required' => 'A name is required.',\n 'color.required' => 'Please select a color.'\n ];\n }",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"public function getErrors();",
"public function messages()\n {\n return [\n 'logo.dimensions' => 'Invalid logo - should be minimum 226*48',\n 'favicon.dimensions' => 'Invalid icon - should be 16*16',\n 'logo.required' => 'The logo field is required in seo settings.',\n 'favicon.required' => 'The favicon field is required in seo settings.',\n 'from_name.required' => 'The from name field is required in mail settings.',\n 'from_email.required' => 'The from email field is required in mail settings.',\n ];\n }",
"public function getInnerErrors()\n {\n return [];\n }",
"public function messages()\n {\n return VALIDATION_MESSAGE;\n }",
"public function messages()\n {\n return VALIDATION_MESSAGE;\n }",
"public function messages()\n {\n return [\n 'baskets.required' => trans('validation.recipe baskets'),\n 'steps.required' => trans('validation.recipe steps'),\n 'ingredients.required' => trans('validation.recipe ingredients'),\n ];\n }",
"public function messages() : array\n {\n return [\n 'department_id.required' => 'The department field is required.',\n 'user_group_id.required' => 'The user group field is required.',\n 'password.required_if' => 'The password field is required.',\n ];\n }",
"protected function getErrors()\n {\n return $this->errors ?: $this->errors = app()->make(MessageBag::class);\n }",
"public function renderGlobalErrorMessage()\n {\n $message = \"\";\n $nberror = count($this->getErrorSchema());\n if ($nberror > 0) {\n $tmp = $this->getErrorSchema()->getErrors();\n $message = \"<div class='alert alert-danger'>Please check your form, $nberror field(s) seem(s) not correctly filled </br>\";\n foreach ($tmp as $key => $e) {\n if ($key == 'Description'){\n $message .= \"- Problem description field is too long (4000 characters max): Please use verbose mode and reduce this field.\";\n }\n\n }\n $message .= \"</div>\";\n }\n return $message;\n }",
"public function getErrors(){\r\n return $this->_errors['error'];\r\n }",
"public function messages() {\n return [\n 'first_name.required' => 'First name is required.',\n 'middle_name.required' => 'Middle name is required.',\n 'surname.required' => 'Surname is required.',\n\n 'email.required' => 'Email is required.',\n 'email.email' => 'Email is invalid.',\n 'email.unique' => 'Email already registered.',\n\n 'password.required' => 'Password is required.',\n 'password.min' => 'Password is too weak.',\n 'password.max' => 'Password is too long.',\n\n 'password_again.required' => 'Enter your password again.',\n 'password_again.same' => 'Passwords do not match.'\n ];\n }",
"public function messages()\n {\n return [\n 'form_template_id.required' => 'Form template not found',\n 'form_template_id.exists' => 'Form template not found',\n\n 'event_category_id.exists' => 'Event category not found', \n \n 'title.required' => 'Please input the form title',\n\n 'limit.numeric' => 'Limit must be a number',\n 'limit.min' => 'Limit cannot be a negative value',\n\n 'color.size' => 'Invalid color',\n\n 'hours.numeric' => 'No of. Hours must be a number',\n 'hours.min' => 'Hours cannot be a negative value',\n\n 'description' => 'Please input the description',\n\n 'start_date.date_format' => \"The start date does not match the required format (1990-01-01)\",\n\n 'end_date.after_or_equal' => \"The end date must be less than or equal to the start date\",\n 'end_date.date_format' => \"The end date does not match the required format (1990-01-01)\",\n\n 'times.required' => 'Please input the start/end time',\n 'times.array' => 'Please input the start/end time',\n 'times.size' => 'Please input the start/end time',\n 'times.min' => 'There seems to be a problem w/ the time settings',\n 'times.max' => 'There seems to be a problem w/ the time settings',\n 'times.*.start_time.required' => 'Please input the start/end time',\n 'times.*.start_time.date_format' => 'The start time does not match the required format (12:00 AM/PM)',\n 'times.*.end_time.required' => 'Please input the start/end time',\n 'times.*.end_time.after' => 'The end date must be greater than the start date',\n 'times.*.end_time.date_format' => 'The end time does not match the required format (12:00 AM/PM)',\n ];\n }",
"public function messages()\n {\n $messages = [];\n foreach($this->request->get('users') as $key => $val)\n {\n $messages['users.'. $key . '.name.max'] = 'The field labeled \"Name ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.phone.max'] = 'The field labeled \"Phone ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.name.min'] = 'The field labeled \"Name ' . $key . '\" must be more than :min characters.';\n $messages['users.'. $key . '.phone.min'] = 'The field labeled \"Phone ' . $key . '\" must be more than :min characters.';\n }\n return $messages;\n }",
"public function messages()\n {\n return [\n 'started_at.required_if' => __('validation.required'),\n 'ended_at.required_if' => __('validation.required'),\n 'subject_id.required_if' => __('validation.required'),\n 'competency.required_if' => __('validation.required'),\n 'learning_goals.required_if' => __('validation.required'),\n 'behavior.required_if' => __('validation.required'),\n ];\n }",
"public function messages()\n {\n return [\n 'curp.required' => 'Falta la C.U.R.P.',\n 'curp.unique' => 'Esta C.U.R.P. ya existe',\n 'curp.min' => 'C.U.R.P. incorrecta',\n 'curp.max' => 'C.U.R.P. incorrecta',\n 'nombre1.required' => 'Falta el nombre',\n 'nombre1.min' => 'Nombre incorrecto',\n 'nombre1.max' => 'Nombre incorrecto',\n 'apellido1.required' => 'Falta el apellido',\n 'apellido1.min' => 'Apellido incorrecto',\n 'apellido1.max' => 'Apellido incorrecto',\n 'fechanacimiento.required' => 'Falta la fecha de nac.',\n 'genero.required' => 'Obligatorio'\n ];\n }",
"public function allError() {\n return $this->errorMsg;\n }",
"public function get_error_objects() {\n return $this->errors;\n }",
"public function messages()\n {\n return [\n 'name' => 'required',\n 'address' => 'required',\n 'city' => 'required',\n 'latitude' => 'required',\n 'longitude' => 'required',\n 'type' => 'required',\n 'is_public' => 'required',\n 'school_zone' => 'required',\n ];\n }",
"public function messages()\n {\n return [\n 'first_name.required' => 'First name cannot be blank.',\n 'first_name.string' => 'First name must be formatted as a string.',\n 'first_name.max' => 'First name exceeded the max number of characters.',\n 'last_name.required' => 'Last name cannot be blank.',\n 'last_name.string' => 'Last name must be formatted as a string.',\n 'last_name.max' => 'Last name exceeded the max number of characters.',\n 'email.required' => 'Email cannot be blank.',\n 'email.string' => 'Email name must be formatted as a string.',\n 'email.email' => 'Email must be formatted as a valid email address',\n 'email.max' => 'Email exceeded the max number of characters.',\n ];\n }",
"public function messages()\n {\n return [\n 'title.required' => 'A title is required',\n 'title.max' => 'Title is too long',\n 'image.required' => 'An image is required',\n ];\n }",
"function getErrors()\n\t{\n\t\treturn [];\n\t}",
"public function messages() {\n\t\treturn [\n\t\t\t'form_submit.in' => trans('exception.something_wrong.message'),\n\t\t\t'date_from.date_format' => trans('report::content-user-report.errors.date_format'),\n\t\t\t'date_to.date_format' => trans('report::content-user-report.errors.date_format')\n\t\t];\n\t}",
"public function getErrors() {\n\t\treturn $this->errorBag;\n\t}"
] | [
"0.766728",
"0.7527198",
"0.74471724",
"0.743385",
"0.74277323",
"0.74069923",
"0.74069923",
"0.74053794",
"0.7386021",
"0.7316022",
"0.73122793",
"0.7275165",
"0.7260082",
"0.7252588",
"0.7232897",
"0.7217269",
"0.71712077",
"0.7170784",
"0.71699893",
"0.71543086",
"0.7144544",
"0.71436405",
"0.71383905",
"0.71263266",
"0.71208763",
"0.7103957",
"0.71015114",
"0.7065254",
"0.70115167",
"0.7011001",
"0.7003888",
"0.6997008",
"0.6983766",
"0.698234",
"0.6971216",
"0.6966791",
"0.6961091",
"0.6949249",
"0.6948869",
"0.69284594",
"0.69273466",
"0.6921915",
"0.6905737",
"0.690331",
"0.6903215",
"0.6898341",
"0.689357",
"0.68787056",
"0.6875979",
"0.68656176",
"0.68538547",
"0.68538547",
"0.6848916",
"0.68481934",
"0.6844418",
"0.68292254",
"0.6823742",
"0.68230635",
"0.6820616",
"0.6818872",
"0.6813671",
"0.6807338",
"0.68020093",
"0.6799698",
"0.6796717",
"0.6794496",
"0.67913336",
"0.6790117",
"0.67875075",
"0.6774265",
"0.67660266",
"0.67644423",
"0.6762892",
"0.67627066",
"0.67595994",
"0.67570513",
"0.67570513",
"0.67570513",
"0.67570513",
"0.67536724",
"0.6751498",
"0.6748795",
"0.6748795",
"0.6745264",
"0.67387635",
"0.67352265",
"0.6732922",
"0.6732005",
"0.6729968",
"0.6727772",
"0.6727648",
"0.6719805",
"0.67097986",
"0.6708187",
"0.670623",
"0.66963285",
"0.6691689",
"0.66880476",
"0.6685207",
"0.6675479",
"0.66734064"
] | 0.0 | -1 |
Get warning messages set higher up in the form structure. | protected function getWarningsFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->getWarnings($key);
}
return [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getWarnings()\n {\n return $this->_getChildrenByName('warning');\n }",
"public function allWarning() {\n return $this->warningMsg;\n }",
"public function getWarnings()\n {\n return self::$warnings;\n }",
"public function getWarningList() {\n\t\treturn array();\n\t}",
"public function getWarnings(): array\n {\n return $this->warnings;\n }",
"public function getWarnings(): array\n {\n return $this->warnings;\n }",
"public function get_warnings() {\n\n\t\t$output = '';\n\t\t\n\t\t$warnings = $this->warnings;\n\t\t\n\t\tif ($warnings) {\n\t\t\t$items = '';\n\t\t\tforeach ($warnings as $w) {\n\t\t\t\t$items .= '<li>'.$w.'</li>' .\"\\n\";\n\t\t\t}\n\t\t\t$output = '<ul>'.\"\\n\".$items.'</ul>'.\"\\n\";\n\t\t}\n\t\telse {\n\t\t\t$output = __('There were no warnings.', CCTM_TXTDOMAIN);\n\t\t}\n\t\treturn sprintf('<h2>%s</h2><div class=\"summarize-posts-warnings\">%s</div>'\n\t\t\t, __('Warnings', CCTM_TXTDOMAIN)\n\t\t\t, $output);\n\t}",
"public function getValidationErrorMessages() {}",
"public function getWarningList()\n {\n return [];\n }",
"public function getWarningList()\n {\n return [];\n }",
"public function getWarningList()\n {\n return [];\n }",
"public function getWarningList()\n {\n return [];\n }",
"public function getWarningList()\n {\n return [];\n }",
"public function getWarningList() {\n\t\treturn [];\n\t}",
"public function getWarnings() : array;",
"public function messages() {\n \n $messages['group_name.unique'] ='No';\n $messages['student.required'] = trans('admin/voucher.discount_error');\n// $messages['password.required'] = trans('admin/admin.password_error');\n// $messages['confirm_password.required'] = trans('admin/admin.confirm_password_error');\n return $messages;\n }",
"public function messages() {\n return [\n 'name.required' => 'Missing name.',\n 'description.required' => 'Missing description.',\n 'max_level.required' => 'Missing max level.',\n 'bonus_per_level.required' => 'Missing bonus per level.',\n 'effect_type.required' => 'Missing effect type.',\n 'hours_per_level.required' => 'Missing length of time per level.'\n ];\n }",
"function getMessages() {\n\t\t$fields = $this->getFields();\n\t\t$allMessages = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldMessages = $field->getValidationMessages();\n\t\t\tif ($fieldMessages) {\n\t\t\t\t$allMessages[$field->getName()] = $fieldMessages;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $allMessages;\n\t}",
"public function messages()\n {\n $illegalFields = [ 'email', 'type', 'status', 'branches', ];\n $messages = [];\n\n foreach ($illegalFields as $key => $attribute) {\n $messages[\"{$attribute}.not_present\"] = __('The field :attribute must not be present.');\n }\n\n return $messages;\n }",
"public function messages()\n {\n return Lang::get('validation/createBorrowing');\n }",
"public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The field ' . $message->getField() . ' is required');\n break;\n case 'Uniqueness':\n $message->setMessage('The field ' . $message->getField() . ' must be unique');\n break;\n case 'Email':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid email');\n break;\n case 'Url':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid url');\n break;\n case 'InclusionIn':\n $message->setMessage('The field ' . $message->getField() . ' must contain a value in [' . implode(',', $message->getDomain()) . ']');\n break;\n case 'DateValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid date.');\n break;\n case 'TimestampValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid timestamps.');\n break;\n }\n }\n\n return parent::getMessages();\n }",
"public function get_error_messages();",
"public function messages()\n {\n /*\n return [\n 'bio.required' => 'Bio is required',\n 'state.required' => 'State is required',\n 'city.required' => 'City name is required',\n 'postalcode.required' => 'Postal Code is required',\n 'gender.required' => 'Gender is required',\n 'seeking_gender.requred' => 'Gender you are searching for is required',\n ];\n */\n }",
"public function getWarnings(): array;",
"public function messages()\n {\n\t // Load the variables\n return [\n\t 'branch_library.required' => 'Please select a branch library',\n\t 'prof_name.required' => 'Professor name is required',\n\t 'prof_dept.required' => 'Professor department is required',\n\t 'prof_email.email' => 'Please enter a valid email for the professor',\n\t 'prof_email.required' => 'Please enter the professor\\'s email',\n\t 'prof_telephone.required' => 'Please enter the Professor\\'s phone number',\n\t \t'borrower_category.required' => 'Please select a borrowing category for the borrower',\n\t \t'borrower_name.required' => 'Please enter the borrower name',\n\t 'borrower_email.required' => 'Please enter the borrower\\'s email',\n\t 'borrower_email.email' => 'Please enter a valid email for the borrower',\n\t \t'borrower_startdate.required' => 'Please enter the start date of the sponsorship',\n\t \t'borrower_enddate.required' => 'Please enter the end date of the sponsorship',\n\t \t'borrower_status.required' => 'Please select the status of the borrower',\n\t 'borrower_terms.required' => 'You must accept the terms before submitting the form',\n\t 'borrower_address1.required' => 'Please enter the address of the borrower',\n 'borrower_city' => 'Please enter the city',\n 'borrower_province_state' => 'Please enter the state or province',\n 'borrower_postal_code' => 'Please enter the postal code',\n\t 'borrower_fname.max' => 'Borrowers first name may not be greater than 50 characters',\n\t 'borrower_lname.max' => 'Borrowers last name may not be greater than 50 characters',\n\t 'borrower_email.max' => 'Borrowers email may not be greater than 254 characters',\n ];\n }",
"public function getWarningList() {\n\t\treturn array(\n\t\t\t18 => 1,\n\t\t\t19 => 1,\n\t\t\t20 => ( version_compare( PHPCSHelper::get_version(), '3.4.0', '<' ) === true ? 0 : 1 ),\n\t\t\t21 => 1,\n\t\t\t34 => 1,\n\t\t\t35 => 1,\n\t\t\t48 => 1,\n\t\t\t49 => 1,\n\t\t\t64 => 1,\n\t\t\t65 => 1,\n\t\t);\n\t}",
"public function messages()\n {\n\n $messages['specficationLabels.*.label.distinct'] = __tr('The Specification Label must be different.');\n\n return $messages;\n }",
"public function getValidationMessages();",
"public function messages()\n {\n return [\n 'curp.required' => 'Falta la C.U.R.P.',\n 'curp.unique' => 'Esta C.U.R.P. ya existe',\n 'curp.min' => 'C.U.R.P. incorrecta',\n 'curp.max' => 'C.U.R.P. incorrecta',\n 'nombre1.required' => 'Falta el nombre',\n 'nombre1.min' => 'Nombre incorrecto',\n 'nombre1.max' => 'Nombre incorrecto',\n 'apellido1.required' => 'Falta el apellido',\n 'apellido1.min' => 'Apellido incorrecto',\n 'apellido1.max' => 'Apellido incorrecto',\n 'fechanacimiento.required' => 'Falta la fecha de nac.',\n 'genero.required' => 'Obligatorio'\n ];\n }",
"function validate_presences_non_post($required_fields, $record,$warning_me=false) {\n global $errors;\n global $warnings;\n\n $msg_presence=array();\n foreach($required_fields as $field) {\n $value = trim($record[$field]);\n if (!has_presence($value)) {\n\n if ($warning_me) {\n $warnings[$field] = fieldname_as_text($field) . \" n'est pas rempli\";\n\n $msg_presence[$field]=$warnings[$field];\n // $msg_presence[$field]=get_warning_error($warnings[$field],$warning_me);\n\n // var_dump($warnings[$field]);\n }else{\n $errors[$field] = fieldname_as_text($field) . \" n'est pas rempli \";\n $msg_presence[$field]=$errors[$field];\n // $msg_presence[$field]=get_warning_error($errors[$field],$warning_me);;\n\n\n }\n // var_dump(debug_backtrace());\n\n }\n }\n\n return $msg_presence;\n}",
"public static function getWarnings($event) {\n $warnings = array(\n 'addMark' => array('WAverages'),\n 'addAbsence' => array('WAbsences'),\n );\n return isset($warnings[$event]) ? $warnings[$event] : array();\n }",
"public function getWarningList() {\n\t\treturn [\n\t\t\t110 => 1,\n\t\t\t111 => 1,\n\t\t\t114 => 1,\n\t\t\t118 => 1,\n\t\t\t119 => 1,\n\t\t\t122 => 1,\n\t\t\t125 => 1,\n\t\t\t130 => 1,\n\t\t\t131 => 1,\n\t\t\t132 => 1,\n\t\t\t137 => 1,\n\t\t\t138 => 1,\n\t\t\t139 => 1,\n\t\t\t208 => 1,\n\t\t];\n\t}",
"public function getWarning()\n {\n return $this->warning;\n }",
"public function getWarning()\n {\n return $this->warning;\n }",
"public function messages()\n {\n return [\n 'style.required' => 'Please the style is required',\n 'service.required' => 'Please select service type',\n 'session.required' => 'Please select session'\n ];\n }",
"public function messages()\n {\n return [\n 'code_area.required' => 'Code area cannot be blank',\n 'name.required' => 'Name area cannot be blank'\n ];\n }",
"public function messages() {\n\t\treturn [\n\t\t\t'titulo.required' => 'El :attribute es obligatorio.',\n\t\t\t'descripcion.required' => 'La :attribute es obligatoria',\n\t\t\t'ciudad.required' => 'La :attribute es obligatoria',\n\t\t\t'telefono.required' => 'El :attribute es obligatorio.',\n\t\t\t'latitud.required' => 'La :attribute es obligatoria',\n\t\t\t'longitud.required' => 'La :attribute es obligatoria',\n\t\t\t'subcategoria.required' => 'La :attribute es obligatoria',\n\t\t\t'tags.required' => 'Los :attribute son obligatorios',\n\t\t];\n\t}",
"public function getWarning() {\n return $this->warning;\n }",
"public function messages()\n {\n return [\n 'title.*' => 'Please supply a project title.',\n 'description.*' => 'Please supply a project description.',\n 'category_id.*' => 'Please select a category for the project.',\n ];\n }",
"public function messages()\n {\n return [\n 'time.is_valid_esc_time' => 'Please select valid time.',\n 'date.is_valid_esc_date' => 'You can not select past date.',\n\n ];\n }",
"public function messages()\n {\n return [\n 'title.required' => 'Please enter setting title.',\n //'slug.required' => 'Please enter setting unique Constant/slug!',\n 'slug.unique' => 'Each setting Constant/slug must have a unique Constant/slug! this Constant already added.',\n 'config_value.required' => 'Please enter setting value.',\n ];\n }",
"public function getWarningMessage() {\n\t\treturn $this->warningMessage;\n\t}",
"public function getMessages() {\r\n \t$this->getForm()->getMessages();\r\n }",
"public function allErrorOrWarning() {\n\n return @array_merge($this->errorMsg,$this->warningMsg);\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"protected function validationErrorMessages()\n {\n return [];\n }",
"public function messages() {\n\t\treturn [\n\t\t\t'form_submit.in' => trans('exception.something_wrong.message'),\n\t\t\t'date_from.date_format' => trans('report::content-user-report.errors.date_format'),\n\t\t\t'date_to.date_format' => trans('report::content-user-report.errors.date_format')\n\t\t];\n\t}",
"public function messages()\n {\n return [\n 'name.required' => 'A name is required.',\n 'color.required' => 'Please select a color.'\n ];\n }",
"public function messages()\n {\n return [\n 'status_id.not_in' => 'The selected status is invalid.',\n 'status_id.in' => 'The selected status is invalid.',\n ];\n }",
"public function getWarnings() : ?array\n {\n return $this->warnings;\n }",
"function getWarningMessages()\r\n {\r\n if(isset($_SESSION['warning_message']))\r\n {\r\n /**\r\n * This is for storing the session array\r\n * @var array\r\n */\r\n $warning_message_array = $_SESSION['warning_message'];\r\n\r\n /**\r\n * This is for creating the warning message\r\n * @var string\r\n */\r\n $response = \"<table>\";\r\n\r\n foreach ($warning_message_array as $array_key\t=>\t$array_value)\r\n {\r\n $response .= \"<tr><td class='warning_message'>\".$array_value.\"</td></tr><tr><td class='warning_message_seperator'></td></tr>\";\r\n }\r\n\r\n $response .= \"</table>\";\r\n\r\n unset ($_SESSION['warning_message']);\r\n\r\n return $response;\r\n }\r\n }",
"public function messages() {\n return [\n 'hnd_ticket_id.required' => 'The Ticket Id is Required.',\n 'input_feed_back.required' => 'The FeedBack is Required.',\n 'drp_stauts.not_in' =>'Please select Ticket Status'\n ];\n }",
"public function warnings($options = array()) {\n\t\tif(!is_array($options)) $options = explode(' ', strtolower($options));\n\t\t$options[] = 'warnings';\n\t\treturn $this->messages($options); \n\t}",
"function get_warning_message()\n {\n return trim($this->_warning_message);\n clear_warning_message();\n }",
"public function getWarningList() {\n\t\treturn array(\n\t\t\t47 => 1,\n\t\t\t48 => 1,\n\t\t\t49 => 1,\n\t\t\t50 => 1,\n\t\t\t51 => 1,\n\t\t\t52 => 1,\n\t\t\t53 => 1,\n\t\t\t54 => 1,\n\t\t\t55 => 1,\n\t\t\t56 => 1,\n\t\t\t57 => 1,\n\t\t\t58 => 1,\n\t\t\t59 => 1,\n\t\t\t60 => 1,\n\t\t\t61 => 1,\n\t\t\t62 => 2,\n\t\t\t64 => 1,\n\t\t\t65 => 1,\n\t\t\t68 => 1,\n\t\t\t69 => 1,\n\t\t\t70 => 1,\n\t\t\t71 => 1,\n\t\t\t72 => 1,\n\t\t\t73 => 1,\n\t\t\t74 => 1,\n\t\t\t76 => 1,\n\t\t\t78 => 1,\n\t\t\t81 => 2,\n\t\t\t85 => 1,\n\t\t\t86 => 2,\n\t\t\t89 => 1,\n\t\t\t91 => 1,\n\t\t\t93 => 1,\n\t\t\t105 => 1,\n\t\t\t106 => 1,\n\t\t\t107 => 2,\n\t\t\t108 => 1,\n\t\t\t109 => 1,\n\t\t\t110 => 2,\n\t\t\t111 => 3,\n\t\t);\n\n\t}",
"protected function renderWarnings() {\n\t\trequire_once(SLS_DIR.\"lib/data/warning/WarningList.class.php\");\n\t\t$objWarningList = new WarningList();\n\t\t$objWarningList->readWarnings();\n\t\t$this->warnings = $objWarningList->warning;\n\t\t\n\t}",
"public function messages()\n {\n return [\n 'laboratory_id.required' => ':attribute harus dipilih.',\n 'selected_packages.required' => ':attribute harus dipilih.',\n 'acceptance' => 'Pastian Anda telah memeriksa kembali pemesanan Anda.',\n ];\n }",
"public function actionWarnmessage() {\n $model = new \\common\\models\\WarningReasons();\n $reason_array = array('Please Select');\n if (Yii::$app->request->post()) {\n $post = Yii::$app->request->post();\n $value = $post['value'];\n\n $reasons = $model->find()->where(['type' => $value])->all();\n\n foreach ($reasons as $reason) {\n $reason_array[$reason['options']] = $reason['options'];\n }\n }\n echo json_encode($reason_array);\n die;\n }",
"public function messages()\n {\n return [\n 'required_without_all' => 'Please fill up at least one field',\n ];\n }",
"public function messages()\n {\n return [\n 'title.required' => Lang::get('controller.title_required'),\n 'title.string' => Lang::get('controller.title_required'),\n 'description.required' => Lang::get('controller.description_required'),\n 'topic_id.required' => Lang::get('controller.topic_id_required'),\n 'grade_id.required' => Lang::get('controller.grade_id_required'),\n 'skill_category_id.required' => Lang::get('controller.skill_category_id_required'),\n 'language_id.required' => Lang::get('controller.language_id_required'),\n 'publish_status.required' => Lang::get('controller.publish_status_required'),\n 'minimum_age.required' => Lang::get('controller.minimum_age_required'),\n 'maximum_age.required' => Lang::get('controller.maximum_age_required'),\n ];\n }",
"public function get_validation_messages() {\n\t\t$field = $this->field;\n\t\t$id = $this->get_id( $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$messages = '';\n\n\t\t$post_title = self::get_property( 'post_title', $field, '' );\n\t\t$post_content = self::get_property( 'post_content', $field, '' );\n\t\t$post_excerpt = self::get_property( 'post_excerpt', $field, '' );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$setting_required_message = self::get_property( 'required_message', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\n\t\t$post_title_enabled = ! empty( $post_title );\n\t\t$post_content_enabled = ! empty( $post_content );\n\t\t$post_excerpt_enabled = ! empty( $post_excerpt );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$category_list = forminator_post_categories( $post_type );\n\n\t\tif ( $is_required ) {\n\t\t\tif ( $post_title_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-title\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_title_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post title', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_content_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-content\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_content_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post content', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_excerpt_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-excerpt\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_excerpt_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post excerpt', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_image_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-image\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_image_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please upload a post image', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif( ! empty( $category_list ) ) {\n\t\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\t\tif ( $post_category_enabled ) {\n\t\t\t\t\t\t$post_category_multiple = self::get_property( $category['value'].'_multiple', $field, '' );\n\t\t\t\t\t\tif( $post_category_multiple ){\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '[]\": {' . \"\\n\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '\": {' . \"\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t\t\t'forminator_postdata_field_' . $category['value'] . '_validation_message',\n\t\t\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please select a '. $category['singular'], Forminator::DOMAIN ) ),\n\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t$field\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $messages;\n\t}",
"public function messages()\n {\n return[\n 'lesson.0.required' => 'The lesson-en field is required.',\n 'lesson.1.required' => 'The lesson-ar field is required.',\n 'lesson.0.string' => 'The lesson-en field must be of type string.',\n 'lesson.1.string' => 'The lesson-ar field must be of type string.',\n 'lesson.0.max' => 'The lesson-ar field max length is 255 .',\n 'lesson.1.max' => 'The lesson-ar field max length is 255 .',\n 'doctor_name.0.required' => 'The doctor name_en field is required.',\n 'doctor_name.1.required' => 'The doctor name_ar field is required.',\n 'doctor_name.0.string' => 'The doctor name_en field must be of type string.',\n 'doctor_name.1.string' => 'The doctor name_ar field must be of type string.',\n 'doctor_name.0.max' => 'The doctor name_ar field max length is 255 .',\n 'time.required' => 'The time field is required.',\n 'time.date_format' => 'The time format not valid.',\n\n 1 ];\n }",
"public function messages()\n\t{\n\t\treturn [\n\t\t\t'kategori.required' => ':Attribute wajib dipilih.',\n\t\t\t'syarat_ketentuan.required' => ':Attribute wajib dicentang.'\n\t\t];\n\t}",
"public function getWarningList() {\n\t\treturn array(\n\t\t\t88 => 1, // Whitelist comment deprecation warning.\n\t\t);\n\t}",
"public function messages()\n {\n return [\n 'section.required' => Service::LUCKY_SECTION_REQUIRED\n ];\n }",
"public function getWarningList() : array {\n\t\t$file = func_get_arg( 0 );\n\t\tswitch ( $file ) {\n\t\t\tcase 'SlowMetaQueryUnitTest.success.inc':\n\t\t\t\treturn [];\n\n\t\t\tcase 'SlowMetaQueryUnitTest.fail.inc':\n\t\t\t\treturn [\n\t\t\t\t\t69 => 1,\n\t\t\t\t\t84 => 1,\n\t\t\t\t\t90 => 1,\n\t\t\t\t\t110 => 1,\n\t\t\t\t];\n\t\t}\n\t\treturn [];\n\t}",
"public function getErrorMessages() {}",
"public function messages()\n {\n return [\n 'started_at.required_if' => __('validation.required'),\n 'ended_at.required_if' => __('validation.required'),\n 'subject_id.required_if' => __('validation.required'),\n 'competency.required_if' => __('validation.required'),\n 'learning_goals.required_if' => __('validation.required'),\n 'behavior.required_if' => __('validation.required'),\n ];\n }",
"public function messages()\n {\n return [\n 'primary_connections.*.tariff_id.required' => 'Each Primary Connection must have a tariff name',\n 'secondary_connections.*.tariff_id.required' => 'Each Secondary Connection must have a tariff name',\n 'primary_connections.*.total.min' => 'Each Primary Connection must have a total',\n 'secondary_connections.*.total.min' => 'Each Secondary Connection must have a total',\n 'contributions.*.name.required' => 'Each Contribution must have a name',\n 'handsets.*.handset_id.required' => 'Each Handset must be selected',\n 'accessories.*.name.required' => 'Each Accessory must have a name',\n 'credits.*.name.required' => 'Each Credit must have a name',\n 'overview.profitMargin.min' => 'The profit margin may not be less than 30%. Call AQ to authorise this.',\n 'overview.discountMargin.max' => 'The discount margin may not be greater than 70%. Call AQ to authorise this.',\n ];\n }",
"public function messages()\n {\n return [\n 'report_date.required' => 'Please specify the date of the publication',\n 'reportDate.before:tomorrow' => 'You cannot upload a report into the future. Are you a time traveller?',\n ];\n }",
"public function messages()\n {\n return [\n 'file.required' => trans('validation.downloadable_required'),\n 'category_list.required' => trans('validation.category_list_required'),\n ];\n }",
"public static function msgs()\n\t{\n\t\treturn \n\t\t\t\t[\n\t\t\t\t\t'fname.required' \t\t => 'يجب تحديد الأسم الاول.',\n\t\t\t\t\t'lname.required' \t\t => 'يجب تحديد الأسم الأخير.',\n\t\t\t\t\t'fname.min' \t\t => 'يجب الأ يقل الاسم الأول عن اربع حروف.',\n\t\t\t\t\t'lname.min' \t\t => 'يجب الأ يقل الاسم الأخير عن اربع حروف.',\n\t\t\t\t\t'password.required' \t\t => 'يجب أدخال كلمة السر.',\n\t\t\t\t\t'password.min' \t\t => 'كلمة السر يجب الا تقل عن 6 حروف او ارقام.',\n\t\t\t\t\t'email.required' \t\t => 'يجب أدخال البريد الألكتروني.',\n\t\t\t\t\t'email.unique' \t\t => 'البريد الألكتروني غير متاح.',\n\t\t\t\t\t'email.email' \t\t => 'يجب ان يكون البريد الألمتروني صالح',\n\t\t\t\t\t'sections_controls.required' => 'يجب تحديد الأقسام المسموح بها لهذا الصحفي .',\n\t\t\t\t\t\n\t\t\t ];\t \n\t}",
"function validate_presences($required_fields, $warning_me=false) {\n global $errors;\n global $warnings;\n\n $msg_presence=array();\n\n foreach($required_fields as $field) {\n $value = trim($_POST[$field]);\n \tif (!has_presence($value)) {\n if ($warning_me) {\n $warnings[$field] = fieldname_as_text($field) . \" can't be blank\";\n // $msg_presence[$field]=get_warning_error($warnings[$field],$warning_me);\n $msg_presence[$field]=$warnings[$field];\n\n }else{\n \t\t $errors[$field] = fieldname_as_text($field) . \" can't be blank\";\n // $msg_presence[$field]=get_warning_error($errors[$field],$warning_me);;\n $msg_presence[$field]=$errors[$field];\n\n\n }\n\n }\n }\n\n return $msg_presence;\n\n}",
"public function messages()\n {\n return [\n 'document.required' => 'Nome do documento é requerido mas não foi informado',\n 'status.required' => 'Status é requerido mas não foi informado',\n ];\n }",
"public function messages() : array\n {\n return [\n 'department_id.required' => 'The department field is required.',\n 'user_group_id.required' => 'The user group field is required.',\n 'password.required_if' => 'The password field is required.',\n ];\n }",
"public function messages()\n {\n return [\n 'division_id.required' => 'Select a Division',\n 'district_id.required' => 'Select a District',\n 'upazila_id.required' => 'Select a Upazila',\n ];\n }",
"public function messages()\n {\n return [\n 'title.required' => 'Please enter the ticket title',\n 'description.required' => 'Please enter the ticket description',\n 'type.required' => 'Please enter the ticket description',\n 'type.in' => 'Please choose the ticket type, either a bug (defect) or a new feature',\n ];\n }",
"public function messages() \n {\n $messages = [\n 'invoice_type.in' => 'Please select a type for invoice.',\n ];\n foreach($this->request->get('item_id') as $key => $val)\n {\n $messages['item_qty.'.$key.'.lte'] = 'Maximum invoiceable qty. for <strong>'.$this->item_name[$key].', '.$this->item_unit[$key].'</strong> is <strong>'.$this->invoicable_qty[$key].'</strong> '.$this->q_type;\n $messages['item_qty.'.$key.'.not_in'] = $this->item_name[$key].' quantity cannot be <strong>0</strong>';\n }\n return $messages;\n }",
"public function messages() {\n return [\n 'building_name.required' => '\"CENTER INFORMATION\" section: Building Name field is required.',\n 'sites.required' => '\"CENTER INFORMATION\" section: Sites field is required.',\n 'name.required' => '\"CENTER INFORMATION\" section: Center Name field is required.',\n 'address1.required' => '\"CENTER INFORMATION\" section: Address 1 field is required.',\n 'subhead.required' => '\"CENTER INFORMATION\" section: Subhead field is required.',\n 'sentence1.required' => '\"CENTER INFORMATION\" section: Sentence 1 field is required.',\n 'meta_title.required' => '\"CENTER INFORMATION\" section: Meta Title field is required.',\n 'meta_keywords.required' => '\"CENTER INFORMATION\" section: Meta Keywords field is required.',\n 'h1.required' => '\"CENTER INFORMATION\" section: Headline field is required.',\n 'h2.required' => '\"CENTER INFORMATION\" section: Sub Headline field is required.',\n 'h3.required' => '\"CENTER INFORMATION\" section: Headline 2 field is required.',\n 'seo_footer.required' => '\"CENTER INFORMATION\" section: Seo Footer field is required.',\n 'meta_description.required' => '\"CENTER INFORMATION\" section: Meta Description field is required.',\n 'city_name.required' => '\"CENTER INFORMATION\" section: City Name field is required.',\n 'abcn_description.required' => '\"CENTER INFORMATION\" section: Abcn Description field is required.',\n 'lat.required' => '\"CENTER INFORMATION\" section: Latitude field is required.',\n 'lng.required' => '\"CENTER INFORMATION\" section: Longitude field is required.',\n 'mr_sentence1.required' => '\"MEETING ROOM INFORMATION\" section: Sentnence 1 field is required.',\n 'mr_avo_description.required' => '\"MEETING ROOM INFORMATION\" section: Avo Description field is required.',\n 'mr_meta_title.required' => '\"MEETING ROOM INFORMATION\" section: Meta Title field is required.',\n 'mr_meta_keywords.required' => '\"MEETING ROOM INFORMATION\" section: Meta Keywords field is required.',\n 'mr_meta_description.required' => '\"MEETING ROOM INFORMATION\" section: Meta Description field is required.',\n 'mr_h1.required' => '\"MEETING ROOM INFORMATION\" section: Headline field is required.',\n 'mr_h2.required' => '\"MEETING ROOM INFORMATION\" section: Sub Headline field is required.',\n 'mr_h3.required' => '\"MEETING ROOM INFORMATION\" section: Headline 2 field is required.',\n 'mr_seo_footer.required' => '\"MEETING ROOM INFORMATION\" section: Seo Footer field is required.',\n 'mr_abcn_description.required' => '\"MEETING ROOM INFORMATION\" section: Abcn Description 2 field is required.',\n 'mr_subhead.required' => '\"MEETING ROOM INFORMATION\" section: Subhead field is required.',\n ];\n }",
"public function messages()\n {\n return [\n 'candidates_needed.required' => 'The candidates number field is required!',\n 'start_posting_date.required' => 'The start posting date field is required!',\n 'end_posting_date.required' => 'The end posting date field is required!',\n 'appl_deadline_date.required' => 'The application deadline field is required!',\n 'start_trial_date.required' => 'The start trial field is required!',\n 'end_trial_date.required' => 'The end trial field is required!',\n ];\n }",
"public function messages()\n {\n return [\n 'firstname.required' => Lang::get(\"Le prénom est obligatoire\"),\n 'lastname.required' => Lang::get(\"Le nom est obligatoire\"),\n 'adress.required' => Lang::get(\"Veuillez indiquer votre adresse.\"),\n 'zip_code.required' => Lang::get(\"Veuillez indiquer votre code postal.\"),\n 'city.required' => Lang::get(\"Veuillez indiquer votre ville.\"),\n 'state.required' => Lang::get(\"Veuillez indiquer votre région.\"),\n 'country_id.required' => Lang::get(\"Veuillez indiquer votre pays de résidence.\"),\n ];\n }",
"public function messages()\n {\n return [\n 'allergies.required' => 'Select at least one allergy',\n 'allergies.array' => 'Invalid format for allergies'\n ];\n }",
"public function messages()\n {\n $messages = [];\n foreach($this->request->get('users') as $key => $val)\n {\n $messages['users.'. $key . '.name.max'] = 'The field labeled \"Name ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.phone.max'] = 'The field labeled \"Phone ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.name.min'] = 'The field labeled \"Name ' . $key . '\" must be more than :min characters.';\n $messages['users.'. $key . '.phone.min'] = 'The field labeled \"Phone ' . $key . '\" must be more than :min characters.';\n }\n return $messages;\n }",
"public function getMessages()\n {\n return $this->_errorMessages;\n }",
"public function messages()\n {\n return [\n 'old_password.required' => 'Please enter old password',\n 'password.required' => 'Please enter the password',\n 'confirm_password.same' => \"Password and confirm password doesn't match\",\n 'confirm_password.required' => 'Please enter confirm password'\n ];\n }",
"public function messages()\n {\n return [\n 'namaPengirim.required' => 'Nama Pengirim harus diisi',\n 'namaPelangganDrop.required' => 'Nama pelanggan harus diisi',\n 'telpPelanggan.required' => 'HP pelanggan harus diisi',\n 'alamatPelanggan.required' => 'Alamat pelanggan harus diisi',\n 'propinsiPelanggan.required' => 'Propisnsi pelanggan harus diisi',\n 'kabupatenPelanggan.required' => 'Kabupaten pelanggan harus diisi',\n 'ongkosKirim.required' => 'Ongkis Kirim harus diisi',\n 'ongkosKirimService.required' => 'Layanan Kirim harus diisi',\n 'courier.required' => 'Kurir pelanggan harus diisi',\n ];\n }",
"public function messages()\n {\n return array_merge(trans('news::validation'), trans('news::validation.custom'));\n }",
"public function messages()\n {\n return [\n 'fileuploader-list-file.required' => 'Фото не выбрано',\n 'color.required' => 'Цвет не выбран',\n 'number.required' => 'Номер не выбран',\n 'rent_price_per_day.required' => 'Цена не выбран',\n 'year.required' => 'Год не выбран',\n 'model.gt' => 'Модель не выбрана',\n 'transmission.gt' => 'Коробка передач не выбрана',\n ];\n }",
"public function messages()\n {\n return [\n 'title.required' => 'Title is required!',\n 'content.required' => 'Content is required!',\n //'contributors.required' => 'Contributors is required!',\n 'due_date.required' => 'Due date is required!',\n ];\n }",
"public function messages()\n {\n $items = [];\n foreach (static::attributes() as $key => $val) {\n $items[$key . '.required'] = t('common.form.errors.required', [\n 'attribute' => $val,\n ]);\n }\n \n return $items;\n }",
"public function messages()\n {\n return [\n 'supplier_id.required' => trans('product.supplierRequired'),\n 'import_price.required' => trans('product.importPriceRequired'),\n 'category_id.required' => trans('product.categoryRequired'),\n 'selling_price.required' => trans('product.sellingPriceRequired'),\n 'unit_id.required' => trans('product.unitRequired'),\n ];\n }",
"public function messages()\n {\n return [\n 'old_password.required' => 'old password is required',\n 'new_password.required' => 'new password is required',\n ];\n }",
"public function messages()\n {\n return [\n 'nombres.required' => 'El :attribute es obligatorio',\n 'apellido_paterno.required' => 'El :attribute es obligatorio',\n 'apellido_materno.required' => 'El :attribute es obligatorio',\n 'tipo_documento.required' => 'Seleccione el :attribute',\n 'num_documento.required' => 'El :attribute es obligatorio',\n 'fecha_nacimiento.required' => 'Seleccione la :attribute',\n 'sexo.required' => 'Seleccione el :attribute',\n ];\n }",
"public function getMandatoryValidationMessages() {}",
"public function messages()\n {\n return [\n// 'value_vi.max' => __('admin::validation.config.value_vi_max'),\n// 'value_en.max' => __('admin::validation.config.value_en_max'),\n ];\n }",
"public function messages()\n {\n return [\n 'query.string' => \"Query given must be a string\",\n 'page.integer' => \"Page given must be an integer\",\n 'page.min' => \"page given must be equal or higher than 0\",\n ];\n }",
"public function messages() \n {\n return[\n 'name.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.numeric' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.major' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity']\n ];\n }",
"public function messages()\n {\n return [\n 'g-recaptcha-response.required' => 'Please verify that you are not robocop :)',\n 'g-recaptcha-response.captcha' => 'Captcha error! try again later or contact site admin.',\n 'image.required' => 'The cover photo field is required!',\n 'code.required' => 'The sourcecode link field is required!'\n ];\n }",
"public function messages()\n {\n return [\n 'cc_email.email' => 'L\\'cc-mail non è valida',\n 'bcc_email.email' => 'L\\'bcc-mail non è valida',\n 'soggetto.required' => 'Il campo soggetto e richiesto',\n 'descrizione.required' => 'Il campo descrizione e richiesto'\n ];\n }",
"public function messages()\n {\n return [\n 'new_number.required' => \"Please enter a number\",\n 'new_number.integer' => \"Please enter a valid number\",\n 'new_number_title.required' => \"Please enter a title\",\n 'new_number_description.required' => \"Please enter a description\"\n ];\n }",
"public function messages()\n {\n return [\n 'nama.required' => 'Field nama wajib diisi',\n 'kode.required' => 'Field kode wajib diisi',\n ];\n }"
] | [
"0.7340213",
"0.72617936",
"0.70613706",
"0.69572747",
"0.69408774",
"0.69408774",
"0.69046336",
"0.68679595",
"0.6841677",
"0.6841677",
"0.6841677",
"0.6841677",
"0.6841677",
"0.67735636",
"0.6752713",
"0.67276776",
"0.67227244",
"0.6722343",
"0.6718121",
"0.6653191",
"0.6645942",
"0.664354",
"0.66085595",
"0.6605598",
"0.6603833",
"0.6584312",
"0.6568397",
"0.6563943",
"0.65515673",
"0.65478754",
"0.65093315",
"0.65011096",
"0.64737016",
"0.64737016",
"0.6463187",
"0.6463085",
"0.64546853",
"0.6453563",
"0.6453256",
"0.64477366",
"0.6427219",
"0.6425901",
"0.6422043",
"0.6420586",
"0.64205426",
"0.64205426",
"0.6416859",
"0.64079386",
"0.64075416",
"0.64056003",
"0.64036906",
"0.6399779",
"0.63952273",
"0.6388868",
"0.6385607",
"0.63824624",
"0.6375689",
"0.63613856",
"0.6360428",
"0.63467336",
"0.63431054",
"0.6342653",
"0.6342514",
"0.6333274",
"0.6332994",
"0.63290155",
"0.6328886",
"0.63121015",
"0.6309606",
"0.6308822",
"0.6307205",
"0.63049585",
"0.6301532",
"0.6299977",
"0.6298524",
"0.6298197",
"0.62969136",
"0.62921226",
"0.6285711",
"0.62856346",
"0.62834513",
"0.6282509",
"0.6278344",
"0.62698674",
"0.6269093",
"0.62682885",
"0.62622875",
"0.6257318",
"0.6255058",
"0.6254109",
"0.62522674",
"0.62520176",
"0.6251051",
"0.6248955",
"0.6247545",
"0.6244305",
"0.62388986",
"0.6237975",
"0.6235022",
"0.62339145",
"0.62336177"
] | 0.0 | -1 |
Get success booleans set higher up in the form structure. | protected function hasSuccessFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->hasSuccess($key);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSuccess() {\n\t\tp(\"Checking success status of all\");\n\t\t// set false if error has occurred, can return false immediately\n\t\tif ( $this->success === false ) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->fields as $field) {\n\t\t\tif ( $field->getSuccess() === false) {\n\t\t\t\t$this->success = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $this->success;\n\t}",
"public function formSuccess() {\n return $this->_formSuccess;\n }",
"public function isSuccess()\n {\n return $this->_success;\n }",
"function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }",
"public function allSuccess() {\n return $this->successMsg;\n }",
"function validate_form($filtered_input, &$form) {\n $success = true;\n // All the iput info stays in the field after submitting\n foreach ($form['fields'] as $field_id => &$field) {\n $field_input = $filtered_input[$field_id];\n // makes input field to stay filled after refershing page\n $field['value'] = $field_input;\n // if validate array has functions then calling function to check if the field is empty\n foreach (($field['validate'] ?? []) as $validator) {\n $is_valid = $validator($filtered_input[$field_id], $field); // same as => validate_not_empty($field_input, $field);\n // $is_valid will be false, if validator returns false\n if (!$is_valid) {\n $success = false;\n break;\n }\n }\n }\n \n// var_dump($success);\n\n if ($success) {\n foreach (($form['validators'] ?? []) as $validator_id => $validator) {\n if (is_array($validator)) {\n $is_valid = $validator_id($filtered_input, $form, $validator);\n } else {\n $is_valid = $validator($filtered_input, $form);\n }\n if (!$is_valid) {\n $success = false;\n break;\n }\n }\n }\n \n// var_dump($success);\n \n if ($success) {\n if (isset($form['callbacks']['success'])) {\n $form['callbacks']['success']($filtered_input, $form);\n }\n } else {\n if (isset($form['callbacks']['fail'])) {\n $form['callbacks']['fail']($filtered_input, $form);\n }\n }\n \n return $success;\n \n}",
"public static function getSuccess(): array\n {\n return self::$success;\n }",
"protected function success()\n {\n if ( isset( $this->data['status'] ) && $this->data['status'] == 'SUCCESS' ) {\n return true;\n }\n return false;\n }",
"public function isSubmited(): bool\n {\n return (bool) $this->values();\n }",
"function isSuccess()\n\t{\n\t\treturn($this->getStatus() == 'SUCCESS');\n\t}",
"public function getErrors(){\n if( !isset($this->openForm) ) return false;\n if( !is_bool($this->openForm) && !is_array($this->openForm) )\n return self::getFormErrors($this->openForm);\n if( is_array($this->openForm) )\n return self::getFormErrors($this->openForm['formid']);\n return false;\n }",
"public function isOk()\n {\n return $this->status == 'success' || $this->status == 'incomplete';\n }",
"public function checkSucces() {\n return is_array($this->succes);\n }",
"function formValid()\n\t{\n\t\t// Not submitted, so can't be valid.\n\t\tif (!$this->formSubmitted())\n\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t// Empty error list\n\t\t$this->errorList = array();\n\t\t\t\t\t\t\n\t\t// Check each field is valid.\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\t// Elements with lots of selected values, so copy list of values across.\n\t\t\tif ($element->type == 'checkboxlist') \n\t\t\t{\t\n\t\t\t\t// Dynamic function to retrieve all fields that start with the element name\n\t\t\t\t// for multi-item lists.\t\t\t\n\t\t\t\t$filterFunc = create_function('$v', '$filterStr = \"'.$element->name.'_\"; return (substr($v, 0, strlen($filterStr)) == $filterStr);');\n\t\t\t\t\n\t\t\t\t// Extract all values for this multi-item list.\n\t\t\t\t$itemList = array_filter(array_keys($_POST), $filterFunc);\n\t\t\t\t\n\t\t\t\t// If we've got some values, extract just the values of the list\t\t\t\t\n\t\t\t\tif (count($itemList) > 0) \n\t\t\t\t{\n\t\t\t\t\t$element->value = array();\n\t\t\t\t\t$regexp = sprintf('/%s_(.*)/', $element->name);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($itemList as $fieldname)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Extract the actual field name from the list, and then assign it \n\t\t\t\t\t\t// to the internal list of values for this particular multi-item field.\n\t\t\t\t\t\tif (preg_match($regexp, $fieldname, $matches)) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Proper value is still held in $_POST, so retrieve it using\n\t\t\t\t\t\t\t// full name of field (field name plus sub-item name)\n\t\t\t\t\t\t\t$element->value[$matches[1]] = $this->getArrayValue($_POST, $fieldname); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Merged elements, so extract each of their values\n\t\t\telse if ($element->type == 'merged') \n\t\t\t{\n\t\t\t\t$mergedValueList = array();\n\t\t\t\tif (!empty($element->subElementList))\n\t\t\t\t{\n\t\t\t\t\tforeach ($element->subElementList as $subElem)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Extract the value from the POST array, and add to array for this element\n\t\t\t\t\t\t$mergedValueList[$subElem->name] = $this->getArrayValue($_POST, $subElem->name);\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\t$element->setValue($mergedValueList);\n\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Single value element - just copy standard post value\n\t\t\telse {\n\t\t\t\tif (isset($_POST[$element->name])) {\n\t\t\t\t\t$element->value = $this->getArrayValue($_POST, $element->name);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Validate the element\n\t\t\tif (!$element->isValid())\n\t\t\t{\n\t\t\t\t// Add error to internal list of errors for this form.\n\t\t\t\t$this->errorList[] = $element->getErrorMessage();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we have errors, clearly the form is not valid\n\t\treturn (count($this->errorList) == 0); \n\t}",
"public function success()\n {\n // Success Status Codes\n return (boolean) (substr($this->agent->code(),0,1)==2);\n }",
"public function passed(){\n \n //Loop through all the fields in the ruleset\n foreach($this->rules as $fieldName => $ruleCollection){\n foreach($ruleCollection as $rule => $rule_value){\n $this->validateField($fieldName, $rule, $rule_value); \n }\n }\n \n if($this->useValidationToken){\n if( Input::get(\"form_token\") != Session::get(\"form_token\") ){\n $this->addError(\"form_token\", \"token\", \"Could not process form form at this time. Please try again.\");\n }\n }\n \n //If we're using session flash, add a formatted list of errors to the session flash system\n if($this->useSessionFlash){\n Session::addFlash($this->formattedErrors(\"list\"), \"danger\", \"Please correct the following errors\");\n }\n \n return $this->hasPassed;\n }",
"public function formIsValid()\n {\n $data = array();\n foreach ($this->getSessionNamespace() as $key => $info) {\n $data[$key] = $info;\n }\n \n return $this->getForm()->isValid($data);\n }",
"public function isSuccessful()\n {\n return isset($this->data['customer_id']) && !empty($this->data['customer_id'])\n && isset($this->data['success']) && $this->data['success']\n && (!isset($this->data['ERROR']) || empty($this->data['ERROR']));\n }",
"function validForm()\n{\n global $f3;\n $isValid = true;\n\n if (!validCity($f3->get('city'))) {\n\n $isValid = false;\n $f3->set(\"errors['city']\", \"Please enter a valid city.\");\n }\n\n if (!validDistance($f3->get('distance'))) {\n\n $isValid = false;\n $f3->set(\"errors['distance']\", \"Please enter a valid distance.\");\n }\n\n return $isValid;\n}",
"public function isRequestSuccess(): bool\n {\n return count($this->errors) === 0;\n }",
"function setSuccess($value) {\n\t\t\t$ret = \"true\";\n\t\t\tif (!$value || $value === \"false\") { // If $value is one of the false values (an empty string, 0, false, etc etc) or it has the string \"false\" (which would normally be true, however we wish it to be false in this case) then return a string false\n\t\t\t\t$ret = \"false\";\n\t\t\t}\n\t\t\t$this->updateResponse('success', $ret);\n\t\t}",
"protected function postSuccessResponse()\n {\n return $this->form;\n }",
"public function isSuccess();",
"public function isSuccess();",
"public function isSuccess();",
"public function isSuccess();",
"public function isSuccess() {\n return parent::isSuccess() ? count($this->getResult()) > 0 : FALSE;\n }",
"public function isSuccess()\n {\n return $this->status;\n }",
"public function isValid()\n {\n $this->isSubmitted = true;\n\n foreach($this->getFields() as $name => $field) {\n if (!$field->isValid()) {\n $this->errors = True;\n }\n }\n\n if ($this->processFileUploads() === false) {\n $this->errors = true;\n }\n\n return !$this->errors;\n }",
"public function isSuccessful()\n {\n return isset($this->data['status']) && $this->data['status'] === 'success';\n }",
"public function psxFormIsCompleted()\n {\n // TODO: Remove all code related to PSX form. Since it's not used any more we return true to be sure to not make any breaking changes\n return true;\n//\n// if (getenv('PLATEFORM') === 'PSREADY') { // if on ready, the user is already onboarded\n// return true;\n// }\n//\n// return !empty($this->getPsxForm());\n }",
"public function getSuccess()\r\n {\r\n return $this->success;\r\n }",
"public function success()\n {\n return $this->success;\n }",
"public function getSuccess() {\n\t\tswitch ($this->status) {\n\t\t\tcase self::STATUS_SUCCESS :\n\t\t\tcase self::STATUS_PENDING :\n\t\t\tcase self::STATUS_AWAITING_AUTOMATIC_FUNDS :\n\t\t\t\treturn TRUE;\n\t\t\tdefault :\n\t\t\t\treturn FALSE;\n\t\t}\n\t}",
"function validForm()\n{\n global $f3;\n $isValid = true;\n\n if (!validFood($f3->get('food'))) {\n\n $isValid = false;\n $f3->set(\"errors['food']\", \"Please enter a food item\");\n }\n\n if (!validQty($f3->get('qty'))) {\n\n $isValid = false;\n $f3->set(\"errors['qty']\", \"Please enter 1 or more\");\n }\n\n if (!validMeal($f3->get('meal'))) {\n\n $isValid = false;\n $f3->set(\"errors['meal']\", \"Please select a meal\");\n }\n\n if (!validCondiments($f3->get('cond'))) {\n\n $isValid = false;\n $f3->set(\"errors['cond']\", \"Invalid selection\");\n }\n\n return $isValid;\n}",
"function everythingValid() {\n foreach($this->validation_log as $v) {\n if($v['status'] == self::VALIDATION_ERROR) {\n return false;\n } // if\n } // foreach\n \n return true;\n }",
"public function getSuccess()\n {\n return $this->success;\n }",
"public function isSuccess() : \\bool\n {\n return $this->success;\n }",
"private function validate_registration_form() {\n $array = array();\n $errors = array();\n //set staus key to Success by default\n $array['status'] = \"Success\";\n\n //Check firstname lastname fields are not empty\n if(empty($this->first_name)) {\n $array['status'] = \"Error\";\n $errors[] = \"-First name field is empty\";\n }\n if(empty($this->last_name)) {\n $array['status'] = \"Error\";\n $errors[] = \"-Last name field is empty\";\n }\n //Check email field is not empty and that it is a valid email\n if(empty($this->email)) {\n $array['status'] = \"Error\";\n $errors[] = \"-Email field is empty\";\n } else if(!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $array['status'] = \"Error\";\n $errors[] = \"-Email field does not contain a valid email\";\n }\n\n //Check passwords match and not empty\n if($this->password != $this->confirm_password) {\n $array['status'] = \"Error\";\n $errors[] = \"-Passwords do not match\";\n } else if(empty($this->password)) {\n $array['status'] = \"Error\";\n $errors[] = \"-Password field is empty\";\n }\n //Return array to process whether there is an error or if validation is successful\n $array['errors'] = $errors;\n return $array;\n }",
"public function isSuccess() : bool {\n return $this->isSuccess;\n }",
"public function getSuccess()\n {\n return $this->success;\n }",
"public function IsOkay(){\r\n return [$this->result,$this->msg];\r\n }",
"public function isValid(){\r\n\t\treturn $this->valid;\r\n\t}",
"public function succeeds(): bool\n {\n return $this->_succeeds;\n }",
"function isValid() {\n\t\t$value = $this->getFieldValue();\n\t\tif (empty($value) || $value == 'on') {\n\t\t\t// Make sure that the form will contain a real\n\t\t\t// boolean value after validation.\n\t\t\t$form =& $this->getForm();\n\t\t\t$value = ($value == 'on' ? true : false);\n\t\t\t$form->setData($this->getField(), $value);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function successful()\n\t{\n\t\treturn $this->isSuccess();\n\t}",
"public function wasSuccess() {\n return $this->requestStatus;\n }",
"public function valid () {\n return isset($this->__fields[key($this->__fields)]);\n }",
"function formSuccess() {\n\n // Template\n $this->r->text['back_url'] = suxFunct::getPreviousURL();\n $this->r->title .= \" | {$this->r->gtext['success']}\";\n\n $this->tpl->display('success.tpl');\n\n }",
"public function success()\n {\n return ( \n ! empty($this->result) \n && $this->result->getStatus() == 'Success' \n && $this->result->getCode() == 200 );\n }",
"public function isValidationPassed();",
"public function isValid()\n {\n return $this->data['is_valid'];\n }",
"public function getSuccess();",
"public function is_form_submit_success( $id ) {\n\n\t\t// TODO: Code needs revision. Copy-paste from class-frontend.php.\n\t\t$form = wpforms()->form->get( (int) $id );\n\n\t\tif ( empty( $form ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$form_id = absint( $form->ID );\n\t\t$form_data = apply_filters( 'wpforms_frontend_form_data', wpforms_decode( $form->post_content ) );\n\t\t$errors = empty( wpforms()->process->errors[ $form_id ] ) ? array() : wpforms()->process->errors[ $form_id ];\n\n\t\t// Check for return hash.\n\t\tif (\n\t\t\t! empty( $_GET['wpforms_return'] ) &&\n\t\t\twpforms()->process->valid_hash &&\n\t\t\tabsint( wpforms()->process->form_data['id'] ) === $form_id\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Check for error-free completed form.\n\t\tif (\n\t\t\tempty( $errors ) &&\n\t\t\t! empty( $form_data ) &&\n\t\t\t! empty( $_POST['wpforms']['id'] ) &&\n\t\t\tabsint( $_POST['wpforms']['id'] ) === $form_id\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function formSubmitted()\n\t{\n\t\t// Do we have a form name? If so, if we have this form name, then this\n\t\t// particular form has been submitted.\n\t\tif ($this->formName) {\n\t\t\treturn (isset($_POST['update']) && $_POST['update'] == $this->formName);\t\n\t\t} \n\t\t// No form name, just detect our hidden field.\n\t\telse {\n\t\t\treturn (isset($_POST['update']));\n\t\t}\n\t}",
"function valid(){ \r\n\t return $this->valid; \r\n\t }",
"public function isSuccessful() : bool\n {\n return ! empty($this->getSuccess());\n }",
"public function testSuccessIsTrue(): void\n {\n $this->get_accessible_reflection_property('success');\n $this->assertTrue($this->get_reflection_property_value('success'));\n }",
"public function is_valid(){\n return $this->is_valid;\n }",
"public function isButtonValidAllValuesSetExpectTrue() {}",
"public function IsOk(){\n\t\treturn $this->_isok;\n\t}",
"public function isButtonValidAllValuesSetExpectTrue() {}",
"function ok()\n {\n return (0 == count($this->_errores));\n }",
"protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }",
"public function isSuccess():bool;",
"public function do_success($form)\n\t{\n\t\t$actions = $this->get_setting('actions', array());\n\t\tif(isset($actions[$this->value])) {\n\t\t\t$actions[$this->value]['fn']($form);\n\t\t}\n\t\treturn parent::do_success($form);\n\t}",
"private function check_finish_inputs()\n {\n $output = [];\n if (!isset($_POST[\"token\"]) || !isset($_POST[\"exam_id\"]) || !isset($_POST[\"corrects\"]) || !isset($_POST[\"wrongs\"]) || !isset($_POST[\"emptys\"]))\n return false;\n\n if (empty($_POST[\"token\"]) || empty($_POST[\"exam_id\"]) || empty($_POST[\"corrects\"]) || empty($_POST[\"wrongs\"]) || empty($_POST[\"emptys\"]))\n return false;\n\n $output = [\n (string) \"token\" => $_POST[\"token\"],\n (int) \"exam_id\" => $_POST[\"exma_id\"],\n (array) \"corrects\" => json_decode($_POST[\"corrects\"]),\n (array) \"wrongs\" => json_decode($_POST[\"wrongs\"]),\n (array) \"emptys\" => json_decode($_POST[\"emptys\"]),\n ];\n\n return $output;\n }",
"private function processForm()\n {\n //Validate the form passed The Curator's safety procedures.\n if(!$this->Form->validate())\n {\n array_push($this->Form->formMessagesError, FORM\\MESSAGE\\ERROR_GENERAL);\n\n return FALSE;\n }\n\n //Verify the form is not being flooded\n if($this->Form->checkFormFlood(CONFIG\\ACCOUNT\\FLOOD_DELAY))\n {\n array_push($this->Form->formMessagesError, FORM\\MESSAGE\\FLOOD);\n\n return FALSE;\n }\n\n //Initialize the Rules class for field validation.\n $this->Policy = new Policy($this->Form);\n\n //Check the user field data against Curator rules.\n if($this->Policy->checkRules())\n {\n array_push($this->Form->formMessagesError, FORM\\MESSAGE\\ERROR_FIELD);\n\n return FALSE;\n }\n\n array_push($this->Form->formMessagesSuccess, 'Account Created.');\n\n $this->success = TRUE;\n\n //Since the account was created set up the form flood protection.\n //$this->Form->setFormFlood();\n\n return TRUE;\n \n //Validate each field one at a time.\n //If its a required field it must have data\n //Ensure the data in the field matches the field.\n //Ensure the rules for each field are met.\n\n //Verify if account already exists.\n\n //Create account\n\n //Start authorization process\n }",
"public function valid()\n\t{\n\t\treturn $this->valid;\n\t\t\n\t}",
"public function isSuccess($set = false)\n {\n if ($set) {\n $this->setNumber(PMA_Message::SUCCESS);\n }\n\n return $this->getNumber() === PMA_Message::SUCCESS;\n }",
"public function setSuccess($bool) {\n\t\t$this->success = $bool;\n\t}",
"public function isSuccess(): bool\n {\n return $this->get('json', 'error') === false;\n }",
"protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }",
"public function getSuccess() {\n\t\treturn $this->data[\"success\"];\n\t}",
"function passes() {\n return $this->startValidation();\n }",
"public function validateForm(){\n foreach(self::$fields as $field){\n if(!array_key_exists($field, $this->data)){\n trigger_error(\"$field is not presented in data\");\n return;\n } \n }\n $this->validateUsername();\n $this->validatePassword();\n $this->validateEmail();\n $this->validateFullname();\n return $this->errors;\n }",
"public static function validateSuccess()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 1),\n\t\t);\n\t}",
"public function isSuccessful()\n {\n return $this->isSuccessful;\n }",
"public function isSuccessful()\n {\n return $this->isSuccessful;\n }",
"public function isValid()\n {\n return \\Laminas\\Form\\Form::isValid();\n }",
"function isSuccessful() ;",
"public function getSuccess()\n {\n return $this->_get('success');\n }",
"public function valid()\n\t{\n\t\treturn $this->valid;\n\t}",
"public function isSuccessful() {\n\t\treturn isset($this->data['status']) && $this->data['status'] >= 200 && $this->data['status'] < 300;\n\t}",
"public function isSuccess ()\n {\n return $this->info[ 'http_code' ] == '200';\n }",
"public function valid()\n {\n return $this->valid;\n }",
"public function valid()\n {\n return $this->valid;\n }",
"public function valid()\n {\n return $this->valid;\n }",
"public function setSuccess()\n {\n $this->attributes['status'] = 'success';\n self::save();\n }",
"public function setSuccess()\n {\n $this->attributes['status'] = 'success';\n self::save();\n }",
"public function isValid()\n {\n return $this->isValid;\n }",
"public function isValid() {\n $this->_valid = true;\n if (isset($this->_formName) && isset($this->_domainId) && isset($this->_contragentId) && isset($this->_userId) && isset($this->_nodeId) && isset($this->_items) && isset($this->_expgroup)) {\n $this->_valid = true;\n } else {\n $this->_valid = false;\n }\n\n return $this->_valid;\n }",
"function isSubmitted()\r\n\t\t{\r\n\t\t\tif( isset($_POST[$this->form_id.'-issubmitted'] ) )\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\r\n\t\t}",
"abstract protected function afterSuccessValidation();",
"public function isSuccess()\n {\n return $this->getStatus() === 'Success' && $this->getCode() === 200;\n }",
"public function valid ()\n {\n return $this->inputs->valid();\n }",
"public function isSuccessful()\n {\n return $this->data['status'];\n }",
"public function isValidated()\n\t{\n\t\treturn $this->validated;\n\t}",
"public function isOk() {\n\t\treturn $this->ok;\n\t}",
"public function setSuccess($var)\n {\n GPBUtil::checkBool($var);\n $this->success = $var;\n }",
"public function controlVariables() {\n\n $validacion = false;\n\n if (\n (count($_POST) > 0) && isset($_POST['kk_control_form']) && ($_POST['kk_control_form'] == $this->_kk_control_form)\n ) {\n $validacion = true;\n\n if (count($this->_formulario) > 0) {\n foreach ($this->_formulario[$this->_kk_control_form] as $key => $valor) {\n if ($valor['obligatorio'] == 'no_nulo') {\n if (isset($_POST[$key]) && is_array($_POST[$key])) {\n $valor_nulo = false;\n foreach ($_POST[$key] as $valor_post) {\n if (isset($valor_post) && $valor_post != '') {\n $valor_nulo = true;\n }\n }\n $validacion = $valor_nulo;\n } elseif ((!isset($_POST[$key]) || $_POST[$key] == '')) {\n $validacion = false;\n }\n }\n }\n\n if ($this->_captcha === false) {\n $validacion = false;\n }\n }\n }\n\n return $validacion;\n }"
] | [
"0.7583577",
"0.7182383",
"0.6342821",
"0.62320244",
"0.61959094",
"0.6128763",
"0.6064372",
"0.60322523",
"0.6012358",
"0.6003588",
"0.60031193",
"0.5997077",
"0.59596586",
"0.59596133",
"0.59476954",
"0.5946885",
"0.5907511",
"0.5900741",
"0.5890851",
"0.58753365",
"0.58713573",
"0.5864945",
"0.5864161",
"0.5864161",
"0.5864161",
"0.5864161",
"0.58554035",
"0.5848291",
"0.58233845",
"0.5819215",
"0.5781415",
"0.57727313",
"0.57636946",
"0.5760347",
"0.57471806",
"0.5742856",
"0.5736481",
"0.5732494",
"0.5727085",
"0.572442",
"0.57221055",
"0.5720164",
"0.57171845",
"0.571684",
"0.5716783",
"0.57105625",
"0.5699698",
"0.56952524",
"0.5692591",
"0.56910163",
"0.56739646",
"0.56718624",
"0.5668503",
"0.56682825",
"0.56681585",
"0.56591684",
"0.5659152",
"0.5648293",
"0.56477857",
"0.5647033",
"0.5646476",
"0.5646262",
"0.5645511",
"0.56450135",
"0.5644476",
"0.56433576",
"0.5640789",
"0.56346005",
"0.56318665",
"0.5630732",
"0.56276333",
"0.5626682",
"0.5618485",
"0.5618317",
"0.5610585",
"0.56075805",
"0.5602925",
"0.5600681",
"0.5600681",
"0.5600066",
"0.5595989",
"0.55959314",
"0.5594222",
"0.55808663",
"0.55682874",
"0.55673367",
"0.55673367",
"0.55673367",
"0.5565286",
"0.5565286",
"0.556292",
"0.5558428",
"0.5554129",
"0.5546135",
"0.5544579",
"0.5543182",
"0.5532966",
"0.5532064",
"0.5531524",
"0.553082",
"0.55306363"
] | 0.0 | -1 |
Get disabledbooleans set higher up in the form structure. | protected function isDisabledFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isDisabled($key);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEnableFieldsToBeIgnored() ;",
"public function getIsDisabled() {}",
"public function getBooleanFields()\n {\n return $this->booleanFields;\n }",
"function getIgnoreEnableFields() ;",
"public function getDisableConditions()\n {\n $value = $this->_config->get('general/disable_conditions');\n\n if ($value === null) {\n $value = [];\n }\n\n return $value;\n }",
"public function getDisabled() {\n return @$this->attributes['disabled'];\n }",
"public function getEnableFieldsToBeIgnored() {}",
"function getCanDisable() {\n\t\treturn $this->getData('canDisable');\n\t}",
"public function GetDisabled(){\n\t\treturn $this->disabled;\n\t}",
"public function get_disabled_post_state()\n {\n }",
"public function getDisabled(): bool;",
"public function getDisabled()\n {\n return $this->disabled;\n }",
"public function getDisabled()\n {\n return $this->disabled;\n }",
"public function getDisabled()\n {\n return $this->disabled;\n }",
"public function getDisabled()\n {\n return $this->disabled;\n }",
"public function getIgnoreEnableFields() {}",
"public function getEnabled()\n {\n if ($this->model->where('is_disabled', '=', 0)->get())\n return $this->model->where('is_disabled', '=', 0)->get();\n else return [];\n }",
"protected function getBooleans(){\n return array_keys( array_filter( $this->getOperatorData(),\n function($item){\n return $item['type'] === self::TYPE_BOOLEAN;\n }));\n }",
"public function is_disabled()\n {\n }",
"function getDisabled()\n {\n return $this->getAttribute(\"disabled\");\n }",
"public function isDisabled()\n {\n return $this->getData(self::DISABLED);\n }",
"public function isDisabled()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$record->esta_deshabilitado;\n\t}",
"public function validBooleanFalseProvider() {\n\t\treturn [\n\t\t\t\"string TRUE\"\t=> [\"FALSE\"],\n\t\t\t\"string ON\"\t\t=> [\"OFF\"],\n\t\t\t\"string YES\"\t=> [\"NO\"],\n\t\t\t\"string 1\"\t\t=> [\"0\"],\n\t\t\t\"integer 1\"\t\t=> [0]\n\t\t];\n\t}",
"public function getBooleanFields()\n {\n return array(\n 'email_sent',\n 'send_email'\n );\n }",
"function isDisabled()\n {\n return $this->_disabled;\n }",
"function isDisabled()\n {\n return false;\n }",
"public function getOptions()\r\r\r\n {\r\r\r\n $options = array(\r\r\r\n self::ENABLED_YES => self::ENABLED_YES_TEXT,\r\r\r\n self::ENABLED_NO => self::ENABLED_NO_TEXT\r\r\r\n );\r\r\r\n \r\r\r\n return $options;\r\r\r\n }",
"public function getDisabled()\n {\n return array_filter($this->storage, function($val)\n {\n return $val['status'] === ProviderInterface::STATUS_DISABLED;\n });\n }",
"public function isDisabled();",
"public function isDisabled();",
"public function isDisabled();",
"public static function getBooleans()\n {\n return array_keys((new self())->casts, 'boolean');\n }",
"public function isDisabled() {}",
"public function getSubElementStates() {\r\n\t\t$data = array();\r\n\t\t\t$data[0] = 'Disabled';\r\n\t\t\t$data[1] = 'Enabled';\r\n\t\treturn $data; //array\r\n\t}",
"public function isDisabled()\n\t{\n\t\treturn false;\n\t}",
"public function isDisabled()\n {\n return false;\n }",
"public function getDisabledFlagColumnName() {}",
"public function markDisabled()\n {\n return $this->forceFill([\n 'disabled' => true,\n ])->save();\n }",
"public function disabled();",
"public function disabled();",
"public function enabled(): array;",
"public function getEnabledOptions()\n {\n\tif(!$this->_enabledOptions) {\n\t $this->_enabledOptions = Mage::getModel('temando/checkout_delivery_options')->getEnabledOptions();\n\t}\n\treturn $this->_enabledOptions;\n }",
"function getEnabled() {return $this->_enabled;}",
"public function hasDisabled()\n {\n return $this->disabled;\n }",
"public function getDisabledButtons()\n\t{\n\t}",
"public function canBeDisabledAndEnabled() {}",
"public function isDisabled()\n {\n return parent::isDisabled();\n }",
"public function getConditions($form = null) {\n\t\treturn 'messageTable.isDeleted = 0 AND messageTable.isDisabled = 0';\n\t}",
"public function isDisabled(): bool\n {\n return $this->disabled;\n }",
"public function isDisabled()\n {\n }",
"public function getEnableUserState();",
"function getEnabled() {\n\t\treturn $this->getData('enabled');\n\t}",
"protected function get__enabled()\n\t{\n\t\tif ( $col = static::$databaseColumnEnabledDisabled )\n\t\t{\n\t\t\treturn (bool) $this->$col;\n\t\t}\n\t\treturn NULL;\n\t}",
"protected function getDisabled(array $limits) {\n $element_key = $this->configuration['element_key'];\n $webform_submission = $this->getWebformSubmission();\n $element_values = (array) $webform_submission->getElementOriginalData($element_key) ?: [];\n $disabled = [];\n foreach ($limits as $option_value => $limit) {\n if ($element_values && in_array($option_value, $element_values)) {\n continue;\n }\n if ($limit['status'] === static::LIMIT_STATUS_NONE) {\n $disabled[$option_value] = $option_value;\n }\n }\n return $disabled;\n }",
"public function getIsEnabled()\n\t{\n\t\treturn Mage::getStoreConfig(self::XML_PATH_ENABLE);\n\t}",
"function disable_false() {\r\n return FALSE;\r\n}",
"public function getDisableProducts()\n {\n $value = $this->_config->get('general/disable_products');\n\n if ($value === null) {\n $value = false;\n }\n\n return (bool)$value && $this->getMode() === 'products';\n }",
"public function disabled(): self\n {\n return $this->state(['enabled' => false]);\n }",
"public function disabled()\n\t{\n\t\treturn $this->installed(function($query)\n\t\t{\n\t\t\treturn $query->where('enabled', '=', 0);\n\t\t});\n\t}",
"protected function disableIDMModeFields()\n {\n $idmModeDisabledFields = $this->idpConfig->getIDMModeDisabledFields();\n $this->fieldDefs = array_map(function ($field) use ($idmModeDisabledFields) {\n $field['disabled'] = isset($field['name']) && array_key_exists($field['name'], $idmModeDisabledFields);\n return $field;\n }, $this->fieldDefs);\n }",
"public function getAllowedExcludeFields() {}",
"public static function getStateOptions()\n\t{\n\t\t// Build the filter options.\n\t\t$options = array();\n\t\t$options[] = Html::select('option', '0', Lang::txt('JENABLED'));\n\t\t$options[] = Html::select('option', '1', Lang::txt('JDISABLED'));\n\n\t\treturn $options;\n\t}",
"public static function isDisabled(): bool\n {\n return !empty(static::DISABLED);\n }",
"static public function getOptionArray() {\n /**\n * Returnning an array of values for getOptionArray\n * with enabled and disabled value\n */\n /**\n * Prepare array\n * with Enabled\n * and disabled as options\n */\n return array (\n 1 => Mage::helper ( 'airhotels' )->__ ( 'Enabled' ),\n 2 => Mage::helper ( 'airhotels' )->__ ( 'Disabled' ) \n );\n }",
"public function get_enabled() \n {\n return $this->enabled;\n }",
"function getAliasEnabled()\n {\n return array_keys($this->fieldValues);\n }",
"function blogslog_hide_options() {\n $arr = array(\n 'on' => esc_html__( 'Yes', 'blogslog' ),\n 'off' => esc_html__( 'No', 'blogslog' )\n );\n return apply_filters( 'blogslog_hide_options', $arr );\n }",
"public function deactivateAll(){\n $config = LiteBriteConfig::where('is_active','=',true)->update(['is_active' => false]);\n return;\n }",
"public function provideBoolValues(): array\n {\n return [\n [true],\n [false],\n ];\n }",
"public function setDisabled($disabled = true);",
"public static function booleans()\n {\n return self::elements(false, true);\n }",
"function estatInputs(){\n if ($this->lli_idllibre==0) return \" \";\n else return \" disabled \";\n }",
"public function setDisabled($var)\n {\n GPBUtil::checkBool($var);\n $this->disabled = $var;\n\n return $this;\n }",
"public function setDisabled($var)\n {\n GPBUtil::checkBool($var);\n $this->disabled = $var;\n\n return $this;\n }",
"function codebean_get_enabled_options( $items ) {\n\t$enabled = array();\n\n\tif ( isset( $items['enabled'] ) ) {\n\t\tforeach ( $items['enabled'] as $item_id => $item ) {\n\n\t\t\tif ( $item_id == 'placebo' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$enabled[ $item_id ] = $item;\n\t\t}\n\t}\n\n\treturn $enabled;\n}",
"public function setDisabled($disabled);",
"public function getAllAvaiabled(){\n \treturn $this->select()->where('IsDisabled = 0')->order(\"SubjectId ASC\");\n }",
"public function getOptionsFlag() {\n return 'false';\n }",
"public function enabled();",
"public function enabled();",
"public function enabled();",
"public function enabled();",
"function set_required_false( $field ){\r\n\r\n\t\tif( isset( $field[ 'status' ] ) && isset( $field[ 'required' ] ) ){\r\n\r\n\t\t\tif( $field[ 'status' ] == 'disabled' && $field[ 'required' ] ) $field[ 'required' ] = false;\r\n\r\n\t\t}\r\n\r\n\t\treturn $field;\r\n\r\n\t}",
"protected function getConfigFormAdvanced()\n {\n return [\n 'form' => [\n 'legend' => [\n 'title' => $this->l('Advanced Options'),\n 'icon' => 'icon-cogs',\n ],\n 'input' => [\n [\n 'type' => 'text',\n 'label' => $this->l('Doofinder Api Key'),\n 'name' => 'DF_API_KEY',\n ],\n [\n 'type' => 'text',\n 'label' => $this->l('Region'),\n 'name' => 'DF_REGION',\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('Enable v9 layer (Livelayer)'),\n 'name' => 'DF_ENABLED_V9',\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('Debug Mode. Write info logs in doofinder.log file'),\n 'name' => 'DF_DEBUG',\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('CURL disable HTTPS check'),\n 'name' => 'DF_DSBL_HTTPS_CURL',\n 'desc' => $this->l('CURL_DISABLE_HTTPS_EXPLANATION'),\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n [\n 'type' => (version_compare(_PS_VERSION_, '1.6.0', '>=') ? 'switch' : 'radio'),\n 'label' => $this->l('Debug CURL error response'),\n 'name' => 'DF_DEBUG_CURL',\n 'desc' => $this->l('To debug if your server has symptoms of connection problems'),\n 'is_bool' => true,\n 'values' => $this->getBooleanFormValue(),\n ],\n ],\n 'submit' => [\n 'title' => $this->l('Save Internal Search Options'),\n 'name' => 'submitDoofinderModuleAdvanced',\n ],\n ],\n ];\n }",
"public function getValues() {\n $values = parent::getValues();\n return array_merge($values, Array('0'=>__('general.bool_no'), '1'=>__('general.bool_yes')));\n }",
"public function getBoolField()\n {\n $value = $this->get(self::BOOL_FIELD);\n return $value === null ? (boolean)$value : $value;\n }",
"public function getDeleteDisabledProducts()\n {\n $value = $this->_config->get('general/delete_disabled_products');\n\n if ($value === null) {\n $value = false;\n }\n\n return (bool)$value && $this->getMode() === 'products';\n }",
"public function getFields() {\n\t\treturn true;\n\t\t// not yet used\n\t\t// if activated\n\t\t// return false;\n\t}",
"public function toOptionArray()\n {\n return Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true);\n }",
"function isEnabled();",
"function isEnabled();",
"public function disabled($bool = true)\n\t{\n\t\t$this->manager->attr('disabled', $bool);\n\t\treturn $this;\n\t}",
"public function isDisabled()\n {\n return !$this->enabled;\n }",
"public function getIsEnabled()\n {\n if (array_key_exists(\"isEnabled\", $this->_propDict)) {\n return $this->_propDict[\"isEnabled\"];\n } else {\n return null;\n }\n }",
"public function getIsEnabled()\n {\n if (array_key_exists(\"isEnabled\", $this->_propDict)) {\n return $this->_propDict[\"isEnabled\"];\n } else {\n return null;\n }\n }",
"public function getIsEnabled()\n {\n if (array_key_exists(\"isEnabled\", $this->_propDict)) {\n return $this->_propDict[\"isEnabled\"];\n } else {\n return null;\n }\n }",
"protected function getConfigFormValuesAdvanced()\n {\n return [\n 'DF_API_KEY' => Configuration::get('DF_API_KEY'),\n 'DF_REGION' => Configuration::get('DF_REGION'),\n 'DF_ENABLED_V9' => Configuration::get('DF_ENABLED_V9'),\n 'DF_DEBUG' => Configuration::get('DF_DEBUG'),\n 'DF_DSBL_HTTPS_CURL' => Configuration::get('DF_DSBL_HTTPS_CURL'),\n 'DF_DEBUG_CURL' => Configuration::get('DF_DEBUG_CURL'),\n ];\n }",
"public function getEnabledAttributes() {\n\t\t$list = [];\n\t\tforeach($this->getAttributes() as $idx => $attribute) {\n\t\t\tif($attribute->isEnabled())\n\t\t\t\t$list[$idx] = $attribute;\n\t\t}\n\t\treturn $list;\n\t}",
"public function getDisabledVariants()\n {\n return $this->disabledVariants;\n }",
"public function rules()\n {\n return array(\n array(\n 'dummyConfigCheckbox',\n 'boolean'\n )\n );\n }",
"protected function getDisableActions() {}"
] | [
"0.6614957",
"0.6611278",
"0.64577",
"0.6444632",
"0.643321",
"0.6414927",
"0.6273574",
"0.6254574",
"0.6221239",
"0.6210224",
"0.6203815",
"0.61897266",
"0.61897266",
"0.61897266",
"0.61897266",
"0.61376876",
"0.61091346",
"0.5932332",
"0.5915527",
"0.5899461",
"0.5854109",
"0.5824621",
"0.5807455",
"0.5802495",
"0.5801342",
"0.5788619",
"0.5734596",
"0.5730321",
"0.57160383",
"0.57160383",
"0.57160383",
"0.57073915",
"0.57039815",
"0.5697541",
"0.5687093",
"0.56840944",
"0.565179",
"0.5647946",
"0.564511",
"0.564511",
"0.5606829",
"0.56023633",
"0.5585201",
"0.5576932",
"0.55681944",
"0.55527794",
"0.5521103",
"0.54907286",
"0.5486665",
"0.54849565",
"0.5482429",
"0.5470808",
"0.5467302",
"0.5415819",
"0.54077625",
"0.5403089",
"0.53941697",
"0.5393312",
"0.5390688",
"0.5321759",
"0.53210515",
"0.5295669",
"0.527423",
"0.52740836",
"0.52730435",
"0.52649945",
"0.52580404",
"0.5257265",
"0.5253969",
"0.5252546",
"0.5246813",
"0.5238807",
"0.5238283",
"0.5238283",
"0.52354467",
"0.52348834",
"0.5231886",
"0.52277154",
"0.5225396",
"0.5225396",
"0.5225396",
"0.5225396",
"0.5206281",
"0.5200902",
"0.52005357",
"0.5198933",
"0.5193048",
"0.5185044",
"0.5182545",
"0.51811683",
"0.51811683",
"0.5180926",
"0.5179622",
"0.5175195",
"0.5175195",
"0.5175195",
"0.517208",
"0.5164187",
"0.51591104",
"0.51589",
"0.5158273"
] | 0.0 | -1 |
Get readonlybooleans set higher up in the form structure. | protected function isReadonlyFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isReadonly($key);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBooleanFields()\n {\n return $this->booleanFields;\n }",
"function getReadOnly() { return $this->_readonly; }",
"public function get_readonly() {\n return $this->readonly;\n }",
"public function isReadonly() : bool {\n return (bool) ($this->flags & Class_::MODIFIER_READONLY);\n }",
"public function getReadonly() {\n\t\treturn $this->readonly;\n\t}",
"public function getReadOnlyFields();",
"public function readonly()\n {\n return $this->readOnly;\n }",
"public function getReadOnlyFlag() {}",
"function isReadonly()\n {\n return $this->readonly;\n }",
"public function isReadonly(): bool;",
"public function isReadonly(): bool\n {\n return $this->readonly;\n }",
"public function getReadOnly()\n {\n return $this->readOnly;\n }",
"public function isReadonly()\n {\n return $this->_isReadonly;\n }",
"public function isReadonly()\n {\n return false;\n }",
"public function isReadOnly()\n\t{\n\t\treturn $this->_readOnly;\n\t}",
"public function isReadOnly()\n {\n return $this->_readOnly;\n }",
"public function getBooleanFields()\n {\n return array(\n 'email_sent',\n 'send_email'\n );\n }",
"public function getIsReadOnly()\n {\n if (array_key_exists(\"isReadOnly\", $this->_propDict)) {\n return $this->_propDict[\"isReadOnly\"];\n } else {\n return null;\n }\n }",
"public function isReadOnly()\n {\n return $this->readOnly;\n }",
"public static function booleans()\n {\n return self::elements(false, true);\n }",
"public function isReadOnly ()\n {\n return $this->readOnly;\n }",
"public function isReadOnly(): bool\n {\n return (bool)$this->config['config']['readOnly'];\n }",
"public function readonly()\n {\n foreach ($this as $element) {\n if ($element->getAttribute('type') == 'select' || $element->getAttribute('type') == 'checkbox'):\n $element->setAttribute('disabled', 'disabled'); else:\n $element->setAttribute('readonly', 'readonly');\n endif;\n }\n }",
"protected function getBooleans(){\n return array_keys( array_filter( $this->getOperatorData(),\n function($item){\n return $item['type'] === self::TYPE_BOOLEAN;\n }));\n }",
"public function isReadOnly()\r\n {\r\n return $this->isReadOnly;\r\n }",
"public function performReadonlyTransformation()\n {\n $field = new CheckboxField_Readonly($this->name, $this->title, $this->value);\n $field->setForm($this->form);\n return $field;\n }",
"protected function _getReadonlyProperties()\n {\n return array();\n }",
"public function isReadOnly() {\n\t\treturn false;\n\t}",
"public function isReadOnly(): bool;",
"public static function getBooleans()\n {\n return array_keys((new self())->casts, 'boolean');\n }",
"public function isReadOnly(): bool\n {\n return $this->getPhanFlagsHasState(Flags::IS_READ_ONLY);\n }",
"public function getBoolField()\n {\n $value = $this->get(self::BOOL_FIELD);\n return $value === null ? (boolean)$value : $value;\n }",
"public function isReadOnly() {}",
"public function isReadOnly() {}",
"public function isReadOnly() {}",
"public function isReadOnly();",
"public function isReadOnly();",
"public function isReadOnly();",
"public function getReadProtected() {\n\t\t$readProtected = FALSE;\n\t\tif ($this->getUsersWithReadAccess()->count() > 0) {\n\t\t\t$readProtected = TRUE;\n\t\t}\n\t\tif ($this->getGroupsWithReadAccess()->count() > 0) {\n\t\t\t$readProtected = TRUE;\n\t\t}\n\n\t\treturn $readProtected;\n\t}",
"public function setReadOnlyFlag($readOnly = true) {}",
"public function getIsDisabled() {}",
"public function isReadOnly(): bool\n {\n return $this->getConfig('read_only');\n }",
"private function getCheckableFields()\n {\n return ['index', 'city', 'countryIso', 'text', 'region'];\n }",
"public function isReadOnlyReal(): bool\n {\n return ($this->getFlags() & ast\\flags\\MODIFIER_READONLY) !== 0;\n }",
"public function getFields() {\n\t\treturn true;\n\t\t// not yet used\n\t\t// if activated\n\t\t// return false;\n\t}",
"public function isReadonly()\n\t{\n\t\treturn $this->getSlider()->getContentReadonly();\n\t}",
"public function set_readonly() {\n $this->readonly = true;\n\n return $this;\n }",
"function getMandatoryInputFields_() {\n return $this->__inMandatoryFields;\n }",
"function getEnableFieldsToBeIgnored() ;",
"public function setReadOnly($flag);",
"function readBoolean();",
"public function getBoolean($i);",
"public function readOnly()\n {\n return !$this->_allowModifications;\n }",
"protected function _retrieve($field, $readonly = false)\n {\n return false;\n }",
"private function convert_to_boolean_attributes() {\n foreach ($this->attributes() as $attr => $val) {\n if (preg_match('/^can_/', $attr) || preg_match('/^is_/', $attr)) {\n $this->$attr = ($val == '1');\n }\n }\n }",
"public function setReadonly(bool $readonly): self\n {\n $this->readonly = $readonly;\n\n return $this;\n }",
"public function setReadOnly($readOnly = true) {}",
"public function setReadOnly($readOnly = true) {}",
"public function setReadonly($readonly = true)\n\t{\n\t\t$this->readonly = $readonly;\n\t\treturn $this;\n\t}",
"public function setReadOnly($readOnly = true);",
"public function setReadOnly($readOnly = true);",
"public function provideBoolValues(): array\n {\n return [\n [true],\n [false],\n ];\n }",
"public function isReadOnly()\n {\n }",
"public function getEditableFields() {\n\t\t$fieldsList = array(\n\t\t\tarray('name' => 'presence',\t\t\t'label' => 'Presence',\t\t\t'type' => 'radio'),\n\t\t);\n\n\t\t$fieldModelsList = array();\n\t\tforeach ($fieldsList as $fieldInfo) {\n\t\t\t$fieldModelsList[$fieldInfo['name']] = Settings_Joomlahosts_Field_Model::getInstanceByRow($fieldInfo);\n\t\t}\n\t\treturn $fieldModelsList;\n\t}",
"public function publicReadonly($bool = true)\n {\n $this->publicReadonly = (bool)$bool;\n\n return $this;\n }",
"public function setIsReadOnly($val)\n {\n $this->_propDict[\"isReadOnly\"] = boolval($val);\n return $this;\n }",
"function read()\r\n {\r\n $right = right::get(\"rights\");\r\n if ($right & 1) return(TRUE);\r\n else return(FALSE);\r\n }",
"function testReadonly(){\n\n #mdx:Readonly\n $form = new HtForm();\n $form->readonly(true);\n $form->textin('fst_name')->label('First Name');\n $form->textin('lst_name')->label('Last Name');\n $form->button('Submit');\n #/mdx echo $form\n $this->assertGreaterThanOrEqual(2, substr_count(\"$form\",\"readonly\"));\n\n }",
"function IsRecordEditable($values, $isEditable)\n{\n\n\t\t\n\n$lkd=$values[\"Locked\"];\n\nif($lkd==1) {\n\nreturn $isEditable=false;\n\n}\n\nelse return $isEditable=true;\n;\t\t\n}",
"function performReadonlyTransformation() {\n\t\t$stars = '*****';\n\n\t\t$field = new ReadonlyField($this->name, $this->title ? $this->title : '', $stars);\n\t\t$field->setForm($this->form);\n\t\t$field->setReadonly(true);\n\t\treturn $field;\n\t}",
"public function getEnableFieldsToBeIgnored() {}",
"function get_flag_checked($id, $flag){\n return ((get_val($id, \"RefFlags\") & $flag) != 0);\n}",
"public function getModifyProtected() {\n\t\t$modifyProtected = FALSE;\n\t\tif ($this->getUsersWithModificationAccess()->count() > 0) {\n\t\t\t$modifyProtected = TRUE;\n\t\t}\n\t\tif ($this->getGroupsWithModificationAccess()->count() > 0) {\n\t\t\t$modifyProtected = TRUE;\n\t\t}\n\n\t\treturn $modifyProtected;\n\t}",
"public function getBooleanArray() {\n // explicit type cast just to be sure\n return (array) $this->booleanArray;\n }",
"public function getAllSetFieldsMask()\n {\n return isset($this->all_set_fields_mask) ? $this->all_set_fields_mask : null;\n }",
"public function getEnabled()\n {\n if ($this->model->where('is_disabled', '=', 0)->get())\n return $this->model->where('is_disabled', '=', 0)->get();\n else return [];\n }",
"public function getCanShowDataFields()\n {\n return $this->helper->getCanShowDataFields(\n $this->getCustomer()->getStore()->getWebsite()\n );\n }",
"function wp_readonly($readonly_value, $current = \\true, $display = \\true)\n {\n }",
"function getIgnoreEnableFields() ;",
"public function getDisabled() {\n return @$this->attributes['disabled'];\n }",
"function getEnabled() {return $this->_enabled;}",
"public function setReadOnly(bool $state = true)\n {\n if ($state) {\n $this->config['config']['readOnly'] = true;\n } else {\n unset($this->config['config']['readOnly']);\n }\n \n return $this;\n }",
"public function getGuardeds()\n {\n return $this->filterDatas(function ($data) {\n return isset($data->guarded) && $data->guarded;\n });\n }",
"public function isEnabled()\n {\n $attributeMetadata = $this->_getAttribute('dob');\n return $attributeMetadata ? (bool)$attributeMetadata->isVisible() : false;\n }",
"function hasAllAccess() {\n\t\treturn ($this->hasAccessBitLevel(1) && $this->hasAccessBitLevel(2) && $this->hasAccessBitLevel(4));\n\t}",
"public function getDisabled(): bool;",
"function getOptionalInputFields() {\n return $this->__inOptionalFields;\n }",
"public function getFillable()\n {\n return static::$model::getFillableValues();\n }",
"final public function setReadOnly($readOnly = true)\n {\n return $readOnly ? $this->setOption('readonly', '') : $this;\n }",
"public function getReadOnlyAttribute()\n {\n return $this->source === PirepFieldSource::ACARS;\n }",
"public function getWriteProtected() {\n\t\t$writeProtected = FALSE;\n\t\tif ($this->getUsersWithWriteAccess()->count() > 0) {\n\t\t\t$writeProtected = TRUE;\n\t\t}\n\t\tif ($this->getGroupsWithWriteAccess()->count() > 0) {\n\t\t\t$writeProtected = TRUE;\n\t\t}\n\n\t\treturn $writeProtected;\n\t}",
"public function getSubElementStates() {\r\n\t\t$data = array();\r\n\t\t\t$data[0] = 'Disabled';\r\n\t\t\t$data[1] = 'Enabled';\r\n\t\treturn $data; //array\r\n\t}",
"public function define_readonly($p_readonly)\r\n\t\t{\r\n\t\t\t$this->c_readonly = $p_readonly;\r\n\t\t}",
"function isReadOnly(){\n if (!isset($_SESSION['user'])) {\n return false;\n }else if (sqlSelectOne(\"SELECT * FROM users WHERE user_id='{$_SESSION['user']['user_id']}'\", 'user_isreadonly') == 1) {\n return true;\n }else{\n return false;\n }\n\n}",
"public function getMarkRequiredFields() {\n return $this->markRequiredFields;\n }",
"function mode($readOnly = FALSE, $datas=array()){\r\n\t\t$this->ro = $readOnly;\r\n\t\tif($readOnly){\r\n\t\t\t$this->cssLabel = 'formRo-label';\r\n\t\t\tif(sizeof($datas)>0){\t\t\r\n\t\t\t\tforeach ($datas as $key=>$val){\r\n\t\t\t\t\t$_POST[$key] = $val;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function getValidateOnly()\n {\n return $this->validate_only;\n }",
"public function getValidateOnly()\n {\n return $this->validate_only;\n }",
"public function getValidateOnly()\n {\n return $this->validate_only;\n }",
"function getIsMandatory() {\n\t\treturn $this->bIsMandatory;\n\t}",
"public function setReadonly($readonly)\n {\n if ($readonly) {\n foreach ($this->childNodes as $childNode) {\n $childNode->setAttribute('readonly', 'readonly');\n $childNode->setAttribute('onclick', 'return false;');\n }\n } else {\n foreach ($this->childNodes as $childNode) {\n $childNode->removeAttribute('readonly');\n $childNode->removeAttribute('onclick');\n }\n }\n\n return parent::setReadonly($readonly);\n }"
] | [
"0.69539946",
"0.6789906",
"0.67611384",
"0.6641115",
"0.66196114",
"0.6576605",
"0.65025556",
"0.6465499",
"0.6464149",
"0.6443993",
"0.64146924",
"0.6341962",
"0.63217187",
"0.63009435",
"0.615839",
"0.61463743",
"0.6106181",
"0.60906035",
"0.60796595",
"0.60535103",
"0.60361534",
"0.60214263",
"0.5980926",
"0.5941744",
"0.5924202",
"0.5914495",
"0.5911632",
"0.591059",
"0.5906622",
"0.5859797",
"0.5859456",
"0.57910144",
"0.5757416",
"0.5757416",
"0.5757211",
"0.57258976",
"0.57258976",
"0.57258976",
"0.5724276",
"0.5722131",
"0.5711709",
"0.5684328",
"0.5683028",
"0.56681305",
"0.56586915",
"0.56571496",
"0.5656853",
"0.56535304",
"0.5629307",
"0.5615451",
"0.56081903",
"0.55852884",
"0.55740964",
"0.55321443",
"0.55153984",
"0.5499959",
"0.54907507",
"0.5490693",
"0.5447421",
"0.54124326",
"0.5411303",
"0.54003775",
"0.53827775",
"0.5374348",
"0.5372037",
"0.53682405",
"0.53673613",
"0.5337122",
"0.533401",
"0.5331242",
"0.5330422",
"0.5295149",
"0.5293449",
"0.52826315",
"0.5279598",
"0.5273459",
"0.5269882",
"0.52679527",
"0.5260023",
"0.5256087",
"0.5250015",
"0.52408046",
"0.52316284",
"0.5230182",
"0.52249366",
"0.5223086",
"0.52071595",
"0.52038145",
"0.5201979",
"0.5199121",
"0.51969826",
"0.5188107",
"0.517853",
"0.51692003",
"0.5165929",
"0.51623785",
"0.5153366",
"0.5153366",
"0.5153366",
"0.51477",
"0.5145736"
] | 0.0 | -1 |
Get requiredbooleans set higher up in the form structure. | protected function isRequiredFromAncestor($key)
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isRequired($key);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBooleanFields()\n {\n return $this->booleanFields;\n }",
"protected function getBooleans(){\n return array_keys( array_filter( $this->getOperatorData(),\n function($item){\n return $item['type'] === self::TYPE_BOOLEAN;\n }));\n }",
"public function getBooleanFields()\n {\n return array(\n 'email_sent',\n 'send_email'\n );\n }",
"public static function getBooleans()\n {\n return array_keys((new self())->casts, 'boolean');\n }",
"public function getMarkRequiredFields() {\n return $this->markRequiredFields;\n }",
"public function getRequired(): bool;",
"public function getIsRequired()\n {\n return $this->_fields['IsRequired']['FieldValue'];\n }",
"public function getFields() {\n\t\treturn true;\n\t\t// not yet used\n\t\t// if activated\n\t\t// return false;\n\t}",
"public function getFrontEndRequiredFields();",
"protected function setRequiredFieldsConditional()\n {\n $requiredFieldsConditional = [\n 'billing_country' => [\n 'US' => ['billing_state'],\n 'CA' => ['billing_state']\n ]\n ];\n\n $this->requiredFieldsConditional = \\Genesis\\Utils\\Common::createArrayObject($requiredFieldsConditional);\n\n $requiredFieldValuesConditional = [\n 'currency' => [\n 'CNY' => [\n [\n 'bank_code' => ['CITIC', 'GDB', 'PSBC', 'BOC', 'ABC', 'CEB', 'CCB', 'ICBC', 'CMBC', 'QUICKPAY']\n ]\n ],\n 'THB' => [\n [\n 'bank_code' => ['SCB_THB', 'KTB_THB', 'BAY_THB', 'UOB_THB', 'KKB_THB', 'BBL_THB']\n ]\n ],\n 'MYR' => [\n [\n 'bank_code' => ['CIMB_MYR', 'PBE_MYR', 'RHB_MYR', 'HLE_MYR', 'MAY_MYR']\n ]\n ],\n 'IDR' => [\n [\n 'bank_code' => [\n 'MDR_IDR', 'BNI_IDR', 'BCA_IDR', 'BRI_IDR',\n 'PMB_IDR', 'CIMB_IDR', 'DMN_IDR', 'BTN_IDR', 'VA'\n ]\n ]\n ],\n 'INR' => [\n [\n 'bank_code' => ['NB', 'UI']\n ]\n ]\n ]\n ];\n\n $this->requiredFieldValuesConditional = \\Genesis\\Utils\\Common::createArrayObject(\n $requiredFieldValuesConditional\n );\n }",
"public function getIsRequired(): bool;",
"public static function getIsRequired()\n {\n return (bool) self::get('is_required', false);\n }",
"final public function getRequired()\n {\n return (bool)$this->getOption('data-required');\n }",
"function getEnableFieldsToBeIgnored() ;",
"public function getBoolField()\n {\n $value = $this->get(self::BOOL_FIELD);\n return $value === null ? (boolean)$value : $value;\n }",
"public function hasFields(){\n return $this->_has(1);\n }",
"function getMandatoryInputFields_() {\n return $this->__inMandatoryFields;\n }",
"public function isIsRequired()\n {\n return $this->_fields['IsRequired']['FieldValue'];\n }",
"public function getIsRequired()\n\t{\n\t\treturn $this->is_required;\n\t}",
"public static function booleans()\n {\n return self::elements(false, true);\n }",
"public function getMandatory();",
"public function getConditions($form = null) {\n\t\treturn 'messageTable.isDeleted = 0 AND messageTable.isDisabled = 0';\n\t}",
"public function getIsRequired()\n {\n if (array_key_exists(\"isRequired\", $this->_propDict)) {\n return $this->_propDict[\"isRequired\"];\n } else {\n return null;\n }\n }",
"public function getIsRequired()\n {\n if (array_key_exists(\"isRequired\", $this->_propDict)) {\n return $this->_propDict[\"isRequired\"];\n } else {\n return null;\n }\n }",
"function getIsMandatory() {\n\t\treturn $this->bIsMandatory;\n\t}",
"public function getRequired(): bool\n {\n\t\treturn $this->required;\n\t}",
"private function getCheckableFields()\n {\n return ['index', 'city', 'countryIso', 'text', 'region'];\n }",
"private function get_conditional_fields( $form_id ) {\n\t\tglobal $wpdb;\n\n\t\t$rules = $wpdb->get_results( $wpdb->prepare( \"SELECT field_id, field_rule FROM $this->field_table_name WHERE field_rule_setting = 1 AND field_rule != '' AND form_id = %d\", $form_id ) );\n\n\t\tif ( !$rules )\n\t\t\treturn false;\n\n\t\t$conditions = array();\n\n\t\tforeach ( $rules as $rule ) {\n\t\t\t$conditions[] = unserialize( $rule->field_rule );\n\t\t}\n\n\t\treturn json_encode( $conditions );\n\t}",
"private function convert_to_boolean_attributes() {\n foreach ($this->attributes() as $attr => $val) {\n if (preg_match('/^can_/', $attr) || preg_match('/^is_/', $attr)) {\n $this->$attr = ($val == '1');\n }\n }\n }",
"function forceFields(){\n foreach($this->xset->desc as $fn=>&$fd){\n if (in_array($fn, self::$bfields)){\n $fd->browsable = 1;\n } else {\n $fd->browsable = 0;\n }\n }\n }",
"public function provideBoolValues(): array\n {\n return [\n [true],\n [false],\n ];\n }",
"public function getCommonFormRequiredFields()\n {\n return $this->common_form_required_fields;\n }",
"public function rules()\n {\n $required = [];\n \n foreach ($this->survey->questions AS $question) {\n if ($question->is_required && $question->is_active) {\n $required['question-' . $question->id] = 'required';\n }\n }\n \n return $required;\n }",
"public function isFieldFlagSet($flag) {}",
"public function validBooleanTrueProvider() {\n\t\treturn [\n\t\t\t\"string TRUE\"\t=> [\"TRUE\"],\n\t\t\t\"string ON\"\t\t=> [\"ON\"],\n\t\t\t\"string YES\"\t=> [\"YES\"],\n\t\t\t\"string 1\"\t\t=> [\"1\"],\n\t\t\t\"integer 1\"\t\t=> [1]\n\t\t];\n\t}",
"abstract protected function getMandatoryModelsFields();",
"private function getCheckedVars()\n {\n return array(\n 'ratexdlsactive',\n 'topxdlsactive',\n 'lastxdlsactive',\n 'allowupload',\n 'securedownload',\n 'sizelimit',\n 'showscreenshot',\n 'limit_extension',\n 'allowscreenshotupload',\n 'frontpagesubcats',\n 'sessionlimit',\n 'inform_user',\n 'torrent',\n );\n }",
"public function isDbSet(): bool\n {\n return (bool)$this->db;\n }",
"public function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\t\t\n\t\t$conditions['select'] = '`bid` AS id, `cid`, `type`, `name`, `alias`, `imptotal`, `impmade`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`clicks`, `imageurl`, `clickurl`, `date`, `showBanner` AS state, `checked_out`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`checked_out_time`, `editor`, `custombannercode`, `catid`, `description`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`sticky`, `ordering`, `publish_up`, `publish_down`, `tags`, `params`'\t;\n\t\t\n\t\t$conditions['where'] = array();\n\t\t\n\t\treturn $conditions;\n\t}",
"public static function pgBooleanProvider(): iterable\n {\n return [\n // Database value, prepared statement value, boolean integer value, boolean value.\n ['t', 'true', 1, true],\n ['true', 'true', 1, true],\n ['y', 'true', 1, true],\n ['yes', 'true', 1, true],\n ['on', 'true', 1, true],\n ['1', 'true', 1, true],\n\n ['f', 'false', 0, false],\n ['false', 'false', 0, false],\n [ 'n', 'false', 0, false],\n ['no', 'false', 0, false],\n ['off', 'false', 0, false],\n ['0', 'false', 0, false],\n ];\n }",
"public function ajax_conditional_fields() {\n\t\tglobal $wpdb;\n\n\t\t$form_id = absint( $_REQUEST['form_id'] );\n\t\t$field_id = absint( $_REQUEST['field_id'] );\n\n\t\t// Get the field name and cache the query for the other variables\n\t\t$field_name = $wpdb->get_var( $wpdb->prepare( \"SELECT field_name, field_key, field_rule_setting, field_rule FROM $this->field_table_name WHERE field_id = %d AND form_id = %d ORDER BY field_sequence ASC\", $field_id, $form_id ) );\n\t\t$field_key\t \t\t= $wpdb->get_var( null, 1 );\n\t\t$field_rule_setting = $wpdb->get_var( null, 2 );\n\t\t$rules \t\t\t\t= unserialize( $wpdb->get_var( null, 3 ) );\n\n\t\t// Only get checkbox, select, and radio for list of options\n\t\t$fields = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->field_table_name WHERE field_type IN('checkbox', 'select', 'radio') AND form_id = %d ORDER BY field_sequence ASC\", $form_id ) );\n\t\t$field_options = $wpdb->get_var( null, 4 );\n\n\t\t// Display the conditional rules if setting is on\n\t\t$display = ( $field_rule_setting ) ? ' class=\"show-fields\"' : '';\n\n\t\t// Count the number of rules for our index\n\t\t$num_fields = count( $rules['rules'] );\n\n\t\tif ( !$fields ) :\n\t\t\techo sprintf( '<div class=\"warning error\"><p>%s</p></div>', __( 'A Checkbox, Select, or Radio field is needed in order to perform conditional logic.', 'visual-form-builder-pro' ) );\n\t\telse :\n\t?>\n<div id=\"vfb-conditional-fields\">\n\t<form id=\"vfb-add-conditional-fields\" class=\"media-upload-form type-form validate\">\n\t\t<h3 class=\"media-title\">Conditional Field Rules</h3>\n\t\t\t<label for=\"vfb-conditional-setting\">\n\t\t\t\t<input type=\"checkbox\" name=\"conditional_setting\" id=\"vfb-conditional-setting\" value=\"1\" <?php checked( $field_rule_setting, '1' ); ?> />\n\t\t\t\t<?php _e( 'Enable Conditional Rule for this field', 'visual-form-builder-pro' ); ?>\n\t\t\t</label>\n\n\t\t\t<div id=\"vfb-build-conditional-fields-container\"<?php echo $display; ?>>\n\t\t\t\t\t<?php if ( 1 == $field_rule_setting ) : ?>\n\t\t\t\t\t<p><select name=\"conditional_show\">\n\t\t\t\t\t\t<option value=\"show\" <?php selected( $rules['conditional_show'], 'show' ); ?>><?php _e( 'Show', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t<option value=\"hide\" <?php selected( $rules['conditional_show'], 'hide' ); ?>><?php _e( 'Hide', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t</select> the <strong><?php echo esc_html( stripslashes( $field_name ) ); ?></strong> field based on\n\t\t\t\t\t<select name=\"conditional_logic\">\n\t\t\t\t\t\t<option value=\"all\" <?php selected( $rules['conditional_logic'], 'all' ); ?>><?php _e( 'all', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t<option value=\"any\" <?php selected( $rules['conditional_logic'], 'any' ); ?>><?php _e( 'any', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t</select>\n\t\t\t\t\t of the following rules:\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<?php for ( $i = 0; $i < $num_fields; $i++ ) : ?>\n\n\t\t\t\t\t<div class=\"vfb-conditional-fields-data\">\n\t\t\t\t\t\tif <select name=\"rules[<?php echo $i; ?>][field]\" class=\"vfb-conditional-other-fields\">\n\t\t\t\t\t\t\t<?php foreach ( $fields as $field ) : ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $field->field_id; ?>\" <?php selected( $rules['rules'][ $i ]['field'], $field->field_id ); ?>><?php echo esc_html( stripslashes( $field->field_name ) ); ?></option>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t<select name=\"rules[<?php echo $i; ?>][condition]>\" class=\"vfb-conditional-condition\">\n\t\t\t\t\t\t\t<option value=\"is\" <?php selected( $rules['rules'][ $i ]['condition'], 'is' ); ?>><?php _e( 'is', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t\t<option value=\"isnot\" <?php selected( $rules['rules'][ $i ]['condition'], 'isnot' ); ?>><?php _e( 'is not', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$these_opts = $wpdb->get_var( $wpdb->prepare( \"SELECT field_options FROM $this->field_table_name WHERE field_id = %d ORDER BY field_sequence ASC\", $rules['rules'][ $i ]['field'] ) );\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<select name=\"rules[<?php echo $i; ?>][option]\" class=\"vfb-conditional-other-fields-options\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( !empty( $these_opts ) ) {\n\t\t\t\t\t\t\t\t$options = maybe_unserialize( $these_opts );\n\n\t\t\t\t\t\t\t\tforeach ( $options as $option ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<option value=\"<?php echo esc_attr( stripslashes( $option ) ); ?>\" <?php selected( esc_attr( stripslashes( $rules['rules'][ $i ]['option'] ) ), esc_html( stripslashes( $option ) ) ); ?>><?php echo esc_html( stripslashes( $option ) ); ?></option>\n\t\t\t\t\t\t\t\t<?php }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t<a href=\"#\" class=\"vfb-add-condition vfb-interface-icon vfb-interface-plus\" title=\"Add Condition\">\n\t\t\t\t\t\t\t<?php _e( 'Add', 'visual-form-builder-pro' ); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<a href=\"#\" class=\"vfb-delete-condition vfb-interface-icon vfb-interface-minus\" title=\"Delete Condition\">\n\t\t\t\t\t\t\t<?php _e( 'Delete', 'visual-form-builder-pro' ); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div> <!-- #vfb-conditional-fields-data -->\n\t\t\t\t\t<?php endfor; ?>\n\n\t\t\t\t\t<?php else: ?>\n\n\t\t\t\t\t<p><select name=\"conditional_show\">\n\t\t\t\t\t\t<option value=\"show\"><?php _e( 'Show', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t<option value=\"hide\"><?php _e( 'Hide', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t</select> the <strong><?php echo esc_html( stripslashes( $field_name ) ); ?></strong> field based on\n\t\t\t\t\t<select name=\"conditional_logic\">\n\t\t\t\t\t\t<option value=\"all\"><?php _e( 'all', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t<option value=\"any\"><?php _e( 'any', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t</select> of the following rules:\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<div class=\"vfb-conditional-fields-data\">\n\t\t\t\t\t\tif <select name=\"rules[0][field]\" class=\"vfb-conditional-other-fields\">\n\t\t\t\t\t\t\t<?php foreach ( $fields as $field ) : ?>\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $field->field_id; ?>\"><?php echo esc_html( stripslashes( $field->field_name ) ); ?></option>\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t<select name=\"rules[0][condition]>\" class=\"vfb-conditional-condition\">\n\t\t\t\t\t\t\t<option value=\"is\"><?php _e( 'is', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t\t<option value=\"isnot\"><?php _e( 'is not', 'visual-form-builder-pro' ); ?></option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t<select name=\"rules[0][option]\" class=\"vfb-conditional-other-fields-options\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( !empty( $field_options ) ) {\n\t\t\t\t\t\t\t\t$options = maybe_unserialize( $field_options );\n\n\t\t\t\t\t\t\t\tforeach ( $options as $option ) {\n\t\t\t\t\t\t\t\t\techo sprintf( '<option value=\"%1$s\">%2$s</option>', esc_attr( stripslashes( $option ) ), esc_html( stripslashes( $option ) ) );\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\t</select>\n\t\t\t\t\t\t<a href=\"#\" class=\"vfb-add-condition vfb-interface-icon vfb-interface-plus\" title=\"Add Condition\">\n\t\t\t\t\t\t\t<?php _e( 'Add', 'visual-form-builder-pro' ); ?></a>\n\t\t\t\t\t\t<a href=\"#\" class=\"vfb-delete-condition vfb-interface-icon vfb-interface-minus\" title=\"Delete Condition\">\n\t\t\t\t\t\t\t<?php _e( 'Delete', 'visual-form-builder-pro' ); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div> <!-- #vfb-conditional-fields-data -->\n\t\t\t\t\t<?php endif; ?>\n\t\t\t</div> <!-- #vfb-build-conditional-fields-container -->\n\t\t<input type=\"hidden\" name=\"field_id\" value=\"<?php echo $field_id; ?>\" />\n\t\t<p>\n\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"Save\" />\n\t\t\t<span id=\"vfb-saving-conditional\">\n\t\t\t\t<img alt=\"\" src=\"<?php echo admin_url( '/images/wpspin_light.gif' ); ?>\" class=\"waiting spinner\" />\n\t\t\t\t<div id=\"vfb-saving-conditonal-error\"></div>\n\t\t\t</span>\n\t\t</p>\n\t</form>\n</div> <!-- #vfb-conditional-fields -->\n\t<?php\n\t\tendif;\n\n\t\tdie(1);\n\t}",
"public function isRequired() {\n return $this->is_required;\n }",
"public function required()\n {\n return (true == @$this->data[\"required\"]);\n }",
"public function hasBoolValue(){\n return $this->_has(4);\n }",
"function getIsOn(){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT isOn FROM bot_on_off LIMIT 1');\n\t\t$statement->execute();\n\t\treturn $statement->fetch()['isOn'] == true;\n\t}",
"function getBooleanQuery(){\n return $this->_query;\n }",
"public function is_required(){\n\t\treturn $this->field->required;\n\t}",
"public function isRequired() : bool {\r\n return $this->config->get('field_required') ?? false;\r\n }",
"protected function required(): array\n {\n return $this->required;\n }",
"public static function get_available_fields() {\n\t\tif ( is_array( self::$available_fields ) ) {\n\t\t\treturn self::$available_fields ;\n\t\t}\n\n\t\tforeach ( self::get_fields() as $field_key => $value ) {\n\t\t\tif ( 'yes' === get_option( WC_CS_PREFIX . $field_key . '_enabled' ) ) {\n\t\t\t\tself::$available_fields[ $field_key ] = $value ;\n\t\t\t}\n\n\t\t\tif ( 'billing_address_2' === $field_key && array_key_exists( 'billing_address_1', self::$available_fields ) ) {\n\t\t\t\tself::$available_fields[ $field_key ] = $value ;\n\t\t\t\tself::$available_fields[ $field_key ][ 'required' ] = false ;\n\t\t\t}\n\t\t}\n\n\t\treturn self::$available_fields ;\n\t}",
"public function getValidFormChoiceTypeValues(): array\n {\n return [\n 'qualified' => [\n 'qualified', TRUE, FALSE, \n ], \n 'unqualified' => [\n 'unqualified', FALSE, TRUE, \n ], \n ];\n }",
"public function hasFields(){ return !empty($this->field_map); }",
"public function isEnabled()\n {\n\t\t$enable = true;\n\t\t$element = $this->getElement();\n\t\t$builderElement = $this->getBuilderElement();\n\t\tif ($builderElement) {\n\t if (isset($builderElement['requiredFields']) && is_array($builderElement['requiredFields'])) {\n\t foreach ($builderElement['requiredFields'] as $field => $status) {\n\t if ($status && !$element->getData($field)) {\n\t $enable = false;\n\t break;\n\t }\n\t }\n\t }\n\t } else {\n\t \t$enable = false;\n\t }\n return $enable;\n }",
"public function getRequiredFields()\n {\n return $this->_aRequiredFields;\n }",
"public function load_fields() {\n\n // Verify if fields exists\n if ( self::$the_fields ) {\n\n return self::$the_fields;\n\n } else {\n\n return false;\n\n }\n\n }",
"public function getCondition() { \n \t\treturn $this->condition . tx_newspaper::enableFields(tx_newspaper::getTable($this)); \n \t}",
"public function getBoolPackedFieldCount()\n {\n return $this->count(self::BOOL_PACKED_FIELD);\n }",
"public static function get_conditionals() {\n\t\treturn [\n\t\t\tAdmin_Conditional::class,\n\t\t];\n\t}",
"function isRequired()\n {\n return $this->required;\n }",
"public function getRequiredOptions();",
"public function getEnableFieldsToBeIgnored() {}",
"protected function getBareRequiredFieldList()\n {\n $requiredFields = array_keys(singleton('NewsletterSubscription')->stat('db'));\n\n $this->extend('updateBareRequiredFieldList', $requiredFields);\n\n return $requiredFields;\n }",
"public function rules()\n {\n return array(\n array(\n 'dummyConfigCheckbox',\n 'boolean'\n )\n );\n }",
"public function getOnlyOnYes()\n {\n return $this->onlyOnYes;\n }",
"function wpsl_bool_check( $atts ) {\n\n foreach ( $atts as $key => $val ) {\n if ( in_array( $val, array( 'true', '1', 'yes', 'on' ) ) ) {\n $atts[$key] = true;\n } else if ( in_array( $val, array( 'false', '0', 'no', 'off' ) ) ) {\n $atts[$key] = false;\n }\n }\n\n return $atts;\n}",
"function getIgnoreEnableFields() ;",
"function getOptionalInputFields() {\n return $this->__inOptionalFields;\n }",
"public function IsRequired()\n {\n return $this->IsRequired;\n }",
"public static function form_fields(){\n\n \treturn [\n [\n \t'id'=> 'description',\n \t'name'=> 'description', \n \t'desc'=> 'Description', \n \t'val'=>\tnull, \n \t'type'=> 'text',\n \t'maxlength'=> 255,\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'rate',\n \t'name'=> 'rate', \n \t'desc'=> 'Discount Rate', \n \t'val'=>\tnull, \n \t'type'=> 'number',\n \t'min'=> 0,\n \t'max'=> 100,\n \t'step'=> '0.01',\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'stat',\n \t'name'=> 'stat', \n \t'desc'=> 'isActive', \n \t'val'=>1, \n \t'type'=> 'checkbox',\n ],\n ];\n\n }",
"public function isRequired()\n\t{\n\t\treturn (bool)$this->_required;\n\t}",
"function _get_avail_fields() {\n\t\t$avail_fields = array();\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$avail_fields = $this->_get_fields_map_simple();\n\t\t} else {\n\t\t\t$avail_fields = $this->_get_fields_map_dynamic(true);\n\t\t}\n\t\treturn $avail_fields;\n\t}",
"public function getValues() {\n $values = parent::getValues();\n return array_merge($values, Array('0'=>__('general.bool_no'), '1'=>__('general.bool_yes')));\n }",
"public function getAreCasesRequired()\n {\n return $this->_fields['AreCasesRequired']['FieldValue'];\n }",
"public function hasBoolValue(){\n return $this->_has(3);\n }",
"public function getMandatory() {\n return $this->__isMandatory;\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}",
"private function firmRules()\n {\n return [\n 'country' => 'required_with_all:region,city|required_if:status,Enable',\n 'region' => 'required_with_all:country,city',\n 'city' => 'required_with_all:country,region',\n 'address' => 'nullable|string|between:0,255',\n 'status' => 'required|integer',\n ];\n }",
"public function checkRequiredParamsSet() : bool {\n }",
"public static function get_conditionals() {\n\t\treturn [ Front_End_Conditional::class ];\n\t}",
"public static function get_conditionals() {\n\t\treturn [ Front_End_Conditional::class ];\n\t}",
"public function hasField(){\n return $this->_has(2);\n }",
"public function getRequiredFields()\n {\n return $this->requiredFields;\n }",
"public function recipe_fields($recipe) {\n return false;\n }",
"public function recipe_fields($recipe) {\n return false;\n }",
"public function getCanShowDataFields()\n {\n return $this->_getWebsiteConfigFromHelper(\n Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_ADDRESSBOOK_PREF_CAN_SHOW_FIELDS,\n $this->getCustomer()->getStore()->getWebsite()\n );\n }",
"private function READ_FIELDS()\r\r {\r\r foreach($this->_fields as $key => $attributes)\r\r {\r\r foreach($attributes as $attrib_key => $attribute)\r\r {\r\r if(is_numeric($attrib_key))\r\r {\r\r $this->_ready_fields[$key][$attribute] = true;\r\r }\r\r else\r\r {\r\r $this->_ready_fields[$key][$attrib_key] = $attribute; \r\r } \r\r }\r\r } \r\r }",
"public function hasBoolPackedField()\n {\n return count($this->get(self::BOOL_PACKED_FIELD)) !== 0;\n }",
"public function hasRequiredFields()\n {\n // If any of our fields are empty, reject stuff\n $all_fields_found = true;\n $field_list = array(\n 'email',\n 'password',\n 'password2',\n 'first_name',\n 'last_name',\n 'speaker_info'\n );\n\n foreach ($field_list as $field) {\n if (!isset($this->_data[$field])) {\n $all_fields_found = false;\n break;\n }\n }\n\n return $all_fields_found;\n }",
"public function testBooleanField()\n {\n $field = $this->table->getField('trueorfalse'); // Boolean\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Boolean',\n $field);\n $this->assertEquals('trueorfalse', $field->getName());\n\n $this->assertTrue($field->getPHPValue(1));\n $this->assertFalse($field->getPHPValue(0));\n $this->assertNull($field->getPHPValue(null));\n\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('falsedef'); // Boolean, No Nulls, default False\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Boolean', $field);\n $this->assertEquals('falsedef', $field->getName());\n\n $this->assertFalse($field->getPHPValue(null));\n\n // Check for an exception when in strict\n $field->setStrictValues();\n $x = false;\n\n try\n {\n $field->getPHPValue(null);\n }\n catch ( RangeException )\n {\n $x = true;\n }\n\n $this->assertTrue($x);\n\n $field = $this->table->getField('truedef'); // Boolean, No Nulls, default true\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Boolean', $field);\n $this->assertEquals('truedef', $field->getName());\n\n $this->assertTrue($field->getPHPValue(null));\n $boundVal = $field->getSqlBoundValue(null);\n $valMarker = $boundVal->getValueMarker();\n\n $this->assertEquals('true', $boundVal->getBoundValues()[$valMarker]);\n }",
"public function getOptions()\r\r\r\n {\r\r\r\n $options = array(\r\r\r\n self::ENABLED_YES => self::ENABLED_YES_TEXT,\r\r\r\n self::ENABLED_NO => self::ENABLED_NO_TEXT\r\r\r\n );\r\r\r\n \r\r\r\n return $options;\r\r\r\n }",
"public function isRequired() : bool;",
"public function getRequiredExtraFields(): array\n {\n return [];\n }",
"abstract public function get_gateway_form_fields();",
"static public function fieldsGet()\n {\n return array_keys(static::$conditions);\n }",
"function isValid() {\n\t\t$value = $this->getFieldValue();\n\t\tif (empty($value) || $value == 'on') {\n\t\t\t// Make sure that the form will contain a real\n\t\t\t// boolean value after validation.\n\t\t\t$form =& $this->getForm();\n\t\t\t$value = ($value == 'on' ? true : false);\n\t\t\t$form->setData($this->getField(), $value);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getRequired() {\n return $this->_required;\n }",
"public function getBoolean($i);",
"protected function getRequired()\n {\n return $this->required;\n }",
"public function isRequired() {\n return $this->required;\n }",
"public function getRequiredFields(){\n if(empty($this->tableFields)){\n $this->getTableInfo();\n }\n return $this->requiredFields;\n }",
"public function isRequired()\n {\n return $this->required;\n }"
] | [
"0.66736203",
"0.61035544",
"0.60887706",
"0.5916627",
"0.5845182",
"0.5804804",
"0.5795088",
"0.57010406",
"0.56568414",
"0.56406957",
"0.5615966",
"0.56041163",
"0.5585803",
"0.55375504",
"0.5519897",
"0.5511537",
"0.549661",
"0.5473186",
"0.54716384",
"0.54529065",
"0.5449193",
"0.5434227",
"0.5428188",
"0.5428188",
"0.5419471",
"0.5400619",
"0.53929734",
"0.5389195",
"0.5387265",
"0.5368752",
"0.5368701",
"0.53683484",
"0.5348138",
"0.53458303",
"0.534282",
"0.5323907",
"0.53196806",
"0.52798134",
"0.5267735",
"0.525434",
"0.52484185",
"0.52395415",
"0.5236619",
"0.52328324",
"0.5228701",
"0.52252686",
"0.5212923",
"0.5211442",
"0.5204029",
"0.51993215",
"0.51979756",
"0.51936513",
"0.51925707",
"0.51912975",
"0.5172553",
"0.5166861",
"0.51605433",
"0.5155995",
"0.5155162",
"0.51509935",
"0.51499003",
"0.5149007",
"0.5148224",
"0.51418144",
"0.50996107",
"0.50948125",
"0.50930005",
"0.50686014",
"0.5067149",
"0.5063792",
"0.50637317",
"0.5050971",
"0.50478595",
"0.50405824",
"0.5039848",
"0.5038808",
"0.50334793",
"0.50324273",
"0.5031549",
"0.5031549",
"0.503088",
"0.5028951",
"0.5022025",
"0.5022025",
"0.50157547",
"0.50126225",
"0.50114024",
"0.4999342",
"0.49988517",
"0.4995312",
"0.4990439",
"0.49888143",
"0.49879405",
"0.49878803",
"0.49753153",
"0.4969647",
"0.49696022",
"0.49659112",
"0.4960937",
"0.49570072",
"0.49546868"
] | 0.0 | -1 |
Find out if this element is placed in a horizontally aligned context. | public function isAligned()
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isAligned();
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function hasAlign() {\n\t\treturn isset($this->options['align']);\n\t}",
"private function hasHeadAlign() {\n\t\treturn isset($this->options['head_align']);\n\t}",
"public function isHorizontal() {\n\t\t$this->direction=\"H\";\n\t}",
"public function getHorizontal() {\r\n return $this->horizontal;\r\n }",
"private function getHorizontalOrientation()\n {\n if ($this->axis_data[1]['a'] == 'y') {\n return true;\n }\n if ($this->axis_data[3]['a'] == 'y') {\n return true;\n }\n\n if ($this->axis_data[0]['a'] == 'x') {\n return true;\n }\n if ($this->axis_data[2]['a'] == 'x') {\n return true;\n }\n\n return false;\n }",
"public function isWide()\n {\n return $this->wide;\n }",
"private function hasNumAlign() {\n\t\treturn isset($this->options['num_align']);\n\t}",
"public function hasWidth()\n {\n return $this->width !== null;\n }",
"public function getIsWidthLgShowed(): bool;",
"public static function isHorizontal($image)\n {\n $width = imagesx($image);\n $height = imagesy($image);\n return $width > $height;\n }",
"public function isInsideHead()\r\n\t{\r\n\t\treturn Anowave_Ec_Model_System_Config_Position::GTM_LOCATION_HEAD == (int) Mage::getStoreConfig('ec/config/code_position');\r\n\t}",
"function hasLayout() ;",
"public function isOrPositionBefore()\n {\n return\n ($this->getIsOnCatalogProductPage() && !$this->getShowOrPosition())\n || ($this->getShowOrPosition()\n && $this->getShowOrPosition() == self::POSITION_BEFORE);\n }",
"public function hasLayout() {}",
"public function hasInlineVector()\n {\n return ($this->hasLinkImage() && $this->LinkImage()->getExtension() == 'svg' && $this->InlineVector);\n }",
"function is_x(){\n\t\tif( $this->axis == 1 ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function getAlign() {}",
"public function getWrapLeftSideBarInWell(): bool\n {\n return $this->wrapLeftSideBarInWell;\n }",
"private function isXAxisOffset()\n {\n foreach ($this->data as $series) {\n if ($series['type'] == 'bar' || $series['type'] == 'stackedbar') {\n return true;\n }\n }\n return false;\n }",
"public function isInline()\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->isInline();\n }\n\n return false;\n }",
"public function isWrapped()\n {\n return ($this->getWrapperInfo() !== false);\n }",
"public function isNavbarJustify()\r\n\t{\r\n\t\treturn $this->navbarJustify;\r\n\t}",
"public function checkWidthHeigth()\r\n\t{\r\n\t\t$referenceImageSize = getimagesize($this->referenceFile);\r\n\t\t$targetImageSize = getimagesize($this->targetFile);\r\n\t\treturn ((abs($targetImageSize[0] - $referenceImageSize[0])) < $this->pixelTol &&\r\n\t\t\tabs(($targetImageSize[1] - $referenceImageSize[1])) < $this->pixelTol);\r\n\t}",
"public function horizontalLayout() {\n }",
"function getAlign() { return $this->_align; }",
"public function isAllTableSameWidth()\n {\n return $this->sameWide;\n }",
"public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}",
"public function setHorizontalAlign($value)\n\t{\n\t\t$this->getStyle()->setHorizontalAlign($value);\n\t}",
"public function isRotated(): bool\n {\n return $this->width !== $this->product->width();\n }",
"public function getPositionXL()\n {\n // Scrutinizer thinks the following could return string. It is wrong.\n return array_search($this->position, self::POSITION_XLREF);\n }",
"public function hasPos(){\n return $this->_has(1);\n }",
"public function hasPos(){\n return $this->_has(1);\n }",
"function getX() {\n $pt = $this->getFirstPoint();\n if ( empty($pt) ) return FALSE;\n \n $poslist = $pt->getPosList();\n $cs = explode(' ',$poslist);\n return $cs[1];\n }",
"public function canDisplayGiftWrappingForItems()\n {\n foreach ($this->getOrder()->getAllItems() as $item) {\n if ($item->getGwId()) {\n return true;\n }\n }\n return false;\n }",
"public function isNestedSetLeftKey()\n {\n return $this->isNestedSetLeftKey;\n }",
"protected function isVisible()\n {\n $result = parent::isVisible()\n && static::getWidgetTarget() != \\XLite\\Core\\Request::getInstance()->target\n && 0 < $this->getData(new \\XLite\\Core\\CommonCell, true);\n\n if ($result) {\n\n if (!\\XLite\\Core\\CMSConnector::isCMSStarted()) {\n\n if (self::WIDGET_TYPE_SIDEBAR == $this->getParam(self::PARAM_WIDGET_TYPE)) {\n $result = in_array($this->viewListName, array('sidebar.second', 'sidebar.single'));\n\n } elseif (self::WIDGET_TYPE_CENTER == $this->getParam(self::PARAM_WIDGET_TYPE)) {\n $result = ('center.bottom' == $this->viewListName);\n }\n }\n }\n\n return $result;\n }",
"public function isSidebarIncludespacer()\r\n\t{\r\n\t\treturn $this->sidebarIncludespacer;\r\n\t}",
"public function checkHorizontalWin($userMove){\r\n $HorizontalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $row = $this->lastRowInsert;\r\n $current_player = \"[$this->currentPlayer]\";\r\n\r\n for($col = $userMove-1; $col > -1 ; $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break; \r\n }\r\n $HorizontalCounter++;\r\n }\r\n for($col= $userMove; $col < Board::COLUMNS ; $col++){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $HorizontalCounter++; \r\n }\r\n return $HorizontalCounter >= self::WIN ? true : false;\r\n \r\n }",
"public function isLeftAssociative()\n {\n return ($this->getAssociativity() === self::LEFT_ASSOCIATIVE);\n }",
"public function isRoot() {\n return $this->{$this->leftAttribute} == 1;\n }",
"public function is_layout ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Layout' );\n }",
"protected function getcolspan(){\r\n\t\t$x_points=$this->GTemp->struct->XPoints;\r\n\t\treturn array_search($this->x2, $x_points)-array_search($this->x1, $x_points);\r\n\t}",
"public function getIsNeedToDisplaySideBar()\n {\n return (bool) Mage::app()->getStore()->getConfig('checkout/sidebar/display');\n }",
"public function getAlign()\n {\n return $this->align;\n }",
"protected function _isLittleEndian(){\n return (self::LITTLE_ENDIAN == $this->machine_endianness);\n }",
"function is_above($line, $locx, $locy) {\n\t\treturn (($line[1]['x'] - $line[0]['x'])*($locy - $line[0]['y']) - ($line[1]['y'] - $line[0]['y'])*($locx - $line[0]['x'])) > 0;\n\t}",
"function pixelgrade_portfolio_items_title_alignment_nearby_control_show() {\n\t$position = pixelgrade_option( 'portfolio_items_title_position' );\n\t// We hide it when displaying as overlay\n\tif ( 'overlay' === $position ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function valid()\n\t{\n\t\treturn isset($this->_elementNames[$this->__position]);\n\t}",
"public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n $allowedValues = $this->getRelativeHorizontalPositionAllowableValues();\n if (!in_array($this->container['relative_horizontal_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getRelativeVerticalPositionAllowableValues();\n if (!in_array($this->container['relative_vertical_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getWrapTypeAllowableValues();\n if (!in_array($this->container['wrap_type'], $allowedValues)) {\n return false;\n }\n\n\n return true;\n }",
"public function hasImageWidth()\n {\n return $this->image_width !== null;\n }",
"private function hasFootAlign() {\n\t\treturn isset($this->options['foot_align']);\n\t}",
"public function getGridCentered() {\r\n return $this->getGrid()->centered;\r\n }",
"public function isContextual(): bool\n {\n return $this->definition->isContextual($this);\n }",
"public static function getTextHorizontalAlignmentArray()\n {\n $ret = [\n 'left' => 'Left',\n 'center' => 'Center',\n 'right' => 'Right',\n ];\n\n return $ret;\n }",
"public function isAttributeCheckbox()\n {\n return trim(Mage::getStoreConfig('training_layred/catalog/attribute_checkbox'));\n }",
"public function isInLeftCorner(int $i): bool {\n return ($i % (2 * $this->width - 1)) == 0;\n }",
"function lalita_is_side_padding_active() {\n\t\t$lalita_settings = wp_parse_args(\n\t\t\tget_option( 'lalita_spacing_settings', array() ),\n\t\t\tlalita_spacing_get_defaults()\n\t\t);\n\t\t\n\t\tif ( ( $lalita_settings[ 'side_top' ] == 0 ) && ( $lalita_settings[ 'side_right' ] == 0 ) && ( $lalita_settings[ 'side_bottom' ] == 0 ) && ( $lalita_settings[ 'side_left' ] == 0 ) ) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isPivot(): bool\n {\n return true;\n }",
"public function hasOffset(){\n return $this->_has(1);\n }",
"public function getRelativeHorizontalPositionAllowableValues()\n {\n return [\n self::RELATIVE_HORIZONTAL_POSITION_MARGIN,\n self::RELATIVE_HORIZONTAL_POSITION_PAGE,\n self::RELATIVE_HORIZONTAL_POSITION_COLUMN,\n self::RELATIVE_HORIZONTAL_POSITION_DEFAULT,\n self::RELATIVE_HORIZONTAL_POSITION_CHARACTER,\n self::RELATIVE_HORIZONTAL_POSITION_LEFT_MARGIN,\n self::RELATIVE_HORIZONTAL_POSITION_RIGHT_MARGIN,\n self::RELATIVE_HORIZONTAL_POSITION_INSIDE_MARGIN,\n self::RELATIVE_HORIZONTAL_POSITION_OUTSIDE_MARGIN\n ];\n }",
"public static function isLayoutBoxedEnabled()\n {\n return static::getConfig('layout_boxed') || View::getSection('layout_boxed');\n }",
"public function sysIsLittleEndian(){\n return (self::LITTLE_ENDIAN == $this->system_endianness);\n }",
"public function hasWrapper() {\n return NULL != $this->wrapper;\n }",
"protected function _getLastAbsoluteX()\n {\n for ($k=count($this->table)-1; $k>=0; $k--) {\n if ($this->table[$k]['x'] && $this->table[$k]['position']) return $this->table[$k]['x'];\n }\n return $this->_pdf->getlMargin();\n }",
"public function isRoot()\n\t{\n\t\treturn $this->getOwner()->{$this->leftAttribute}==1;\n\t}",
"protected function align($align)\n {\n switch ($align['horizontal']) {\n case 'left':\n $result = 'xMin';\n break;\n\n case 'right':\n $result = 'xMax';\n break;\n\n default:\n $result = 'xMid';\n }\n switch ($align['vertical']) {\n case 'top':\n $result .= 'YMin';\n break;\n\n case 'bottom':\n $result .= 'YMax';\n break;\n\n default:\n $result .= 'YMid';\n }\n $result .= $align['slice'] === true ? ' slice' : ' meet';\n\n return $result;\n }",
"public function hasSpans(){\n return $this->_has(2);\n }",
"public function isKspace() : bool {\n return ($this->typeId->id === 2);\n }",
"public function withinBounds($x,$y){\n return (0 <= $x && $x < $this->width) && (0 <= $y && $y < $this->height);\n }",
"public function hasPosition(){\r\n return $this->_has(2);\r\n }",
"public function isCatalogBackendMinQtyVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_MIN_QTY);\n }",
"public function overflow(): bool\n {\n return (bool) is_null($this->node);\n }",
"public function hasAsis()\n {\n return isset($this->asis);\n }",
"function mkd_burst_is_side_header() {\r\n global $mkd_burst_options;\r\n\r\n\t\t$side_header = false;\r\n\t\t\r\n if($mkd_burst_options['header_type'] == \"side\") {\r\n $side_header = true;\r\n }\r\n\r\n return $side_header;\r\n }",
"public function isNavbarIncludespacer()\r\n\t{\r\n\t\treturn $this->navbarIncludespacer;\r\n\t}",
"public function isCatalogBackendMinSaleQtyVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_MIN_SALE_QTY);\n }",
"public function hasW()\n {\n return isset($this->w);\n }",
"public function hasW()\n {\n return isset($this->w);\n }",
"public static function getButtonHorizontalPositions() {\r\n\t\t$options = array(\r\n\t\t\t'left' => 'Left',\r\n\t\t\t'center' => 'Center',\r\n\t\t\t'right' => 'Right'\r\n\t\t);\r\n\t\treturn $options;\r\n\t}",
"public function valid()\n {\n return $this->_position < ExcelCell::columnIndexFromString($this->_subject->getHighestColumn());\n }",
"public function hasBlockOffset()\n {\n return $this->block_offset !== null;\n }",
"public function isLowerTriangular(): bool\n {\n if (!$this->isSquare()) {\n return false;\n }\n if (!array_key_exists(__METHOD__, $this->cache)) {\n $this->cache[__METHOD__] = true;\n foreach ($this->table as $y => $row) {\n foreach ($row->slice($y + 1) as $cell) {\n if ($cell != 0) {\n $this->cache[__METHOD__] = false;\n break 2;\n }\n }\n }\n }\n return $this->cache[__METHOD__];\n }",
"function CalcWidths($width,$align)\r\n{\r\n $TableWidth=0;\r\n foreach($this->aCols as $i=>$col)\r\n {\r\n $w=$col['w'];\r\n if($w==-1)\r\n $w=$width/count($this->aCols);\r\n elseif(substr($w,-1)=='%')\r\n $w=$w/100*$width;\r\n $this->aCols[$i]['w']=$w;\r\n $TableWidth+=$w;\r\n }\r\n //Compute the abscissa of the table\r\n if($align=='C')\r\n $this->TableX=max(($this->w-$TableWidth)/2,0);\r\n elseif($align=='R')\r\n $this->TableX=max($this->w-$this->rMargin-$TableWidth,0);\r\n else\r\n $this->TableX=$this->lMargin;\r\n}",
"function valid()\n {\n return $this->_position == 0 || $this->_curPage->getSize() > 0;\n }",
"public function isAutoWidth() {\n\t\tif ($this->_width==0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function offsetExists($offset)\n\t{\n\t\t$layoutTemplate = $this->getLayoutTemplate();\n\t\treturn isset($layoutTemplate[$offset]);\n\t}",
"public function hasSpanId(){\n return $this->_has(2);\n }",
"function isLeft($a, $b, $c) {\n return area2($a, $b, $c) > 0;\n}",
"public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}",
"public function getMasterPos() {\n\t\t# Stub\n\t\treturn false;\n\t}",
"public function getLeft(): MarginInterface\n {\n return $this->left;\n }",
"function enable_align_wide() {\n add_theme_support( 'align-wide' );\n}",
"public function getHasCoordinates(){\n\t\treturn ($this->coordinates != '') ? 1:0;\n\t}",
"public function isAutofinishSpansEnabled()\n {\n return $this->boolValue('autofinish.spans', false);\n }",
"public function isVertical()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"function pixelgrade_portfolio_items_title_alignment_overlay_control_show() {\n\t$position = pixelgrade_option( 'portfolio_items_title_position' );\n\t// We hide it when not displaying as overlay\n\tif ( 'overlay' !== $position ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function isCurrentChild(): bool;",
"public function getWidth()\n\t{\n\t\tif (substr($this->getContainerStyle('width'), -2, 2) != 'px')\n\t\t\treturn false;\n\t\treturn intval(substr($this->getContainerStyle('width'), 0, -2));\n\t}",
"public function hasLatitude()\n {\n return $this->Latitude !== null;\n }",
"public function marginLeft() {\n\t}"
] | [
"0.6155844",
"0.6120114",
"0.5830942",
"0.57309824",
"0.57006973",
"0.5585999",
"0.5529587",
"0.5518652",
"0.5503483",
"0.5436162",
"0.5325055",
"0.5257028",
"0.52281725",
"0.5196685",
"0.51379114",
"0.5136088",
"0.51226896",
"0.5119517",
"0.5086906",
"0.50308925",
"0.49688643",
"0.49650297",
"0.49615216",
"0.49167153",
"0.49024665",
"0.48498482",
"0.4833202",
"0.4827062",
"0.48034024",
"0.47832724",
"0.47617292",
"0.47617292",
"0.47491035",
"0.47436523",
"0.47313657",
"0.472888",
"0.47199965",
"0.47159216",
"0.47128454",
"0.47071147",
"0.4706016",
"0.47010356",
"0.46977028",
"0.46907705",
"0.46577075",
"0.46523213",
"0.46158588",
"0.461146",
"0.46105537",
"0.4600591",
"0.4568105",
"0.4560616",
"0.45299587",
"0.45298392",
"0.45284906",
"0.45223692",
"0.4510337",
"0.4510311",
"0.45080313",
"0.4506734",
"0.44966656",
"0.4492068",
"0.4489078",
"0.44677466",
"0.44654155",
"0.4457692",
"0.44576207",
"0.44500735",
"0.44390115",
"0.44376603",
"0.4425904",
"0.44161758",
"0.44150573",
"0.4406058",
"0.44030464",
"0.43918258",
"0.4384203",
"0.4384203",
"0.43807057",
"0.4372534",
"0.43592995",
"0.4353271",
"0.43461835",
"0.4345034",
"0.43446118",
"0.43445635",
"0.43442288",
"0.43420398",
"0.43413594",
"0.43392307",
"0.4323957",
"0.4320379",
"0.4319762",
"0.43192172",
"0.43184835",
"0.4316427",
"0.4312668",
"0.43020445",
"0.430194",
"0.43011838"
] | 0.6797746 | 0 |
Find out if this element is placed in an inline context. | public function isInline()
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isInline();
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function is_inline()\r\n\t{\r\n\t\treturn $this->is_inline;\r\n\t}",
"function vcex_vc_is_inline() {\n\tif ( function_exists( 'vc_is_inline' ) ) {\n\t\treturn vc_is_inline();\n\t}\n\treturn false;\n}",
"public function hasInlineVector()\n {\n return ($this->hasLinkImage() && $this->LinkImage()->getExtension() == 'svg' && $this->InlineVector);\n }",
"public function isInline(): bool\n\t{\n\t\treturn $this->disposition === self::DISPOSITION_INLINE;\n\t}",
"public function isInline() : bool\n {\n return $this->getDisposition() == 'inline';\n }",
"public function isInlineImage(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_INLINE_IMAGE );\n\t}",
"public function getInline()\n\t{\n\t\treturn $this->isInlineQuery;\t\n\t}",
"public function inlineImageExists()\n {\n foreach ($this->attachment as $attachment) {\n if ($attachment[6] == 'inline') {\n return true;\n }\n }\n return false;\n }",
"public function InlineImageExists() {\n\t foreach($this->attachment as $attachment) {\n\t if ($attachment[6] == 'inline') {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}",
"public function isPaymentPageModeInline($scopeId = null)\n {\n return $this->getPaymentPageMode($scopeId) === Configuration::PAYMENT_TYPE_INLINE;\n }",
"private static function has_inline($handle)\n\t{\n\t\tglobal $wp_styles;\n\n\t\tif (isset($wp_styles->registered[$handle]->extra['after']))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"public function isContextual(): bool\n {\n return $this->definition->isContextual($this);\n }",
"protected function isPageSliderContext()\n\t{\n\t\treturn $this->request->get('IFRAME') === 'Y';\n\t}",
"protected function get_vc_inline_html() {\n\t\t\treturn false;\n\t\t}",
"public function isEmbargoed();",
"protected function canPerformInlineSearch()\n\t{\n\t\t/* If the data store entry is present, read it first */\n\t\tif( isset( \\IPS\\Data\\Store::i()->safeInlineSearch ) )\n\t\t{\n\t\t\t/* We are over the threshold, return FALSE now */\n\t\t\tif( \\IPS\\Data\\Store::i()->safeInlineSearch == false )\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* If we haven't checked in 24 hours we should do so again */\n\t\t\t\tif( \\IPS\\Data\\Store::i()->safeInlineSearch > ( time() - ( 60 * 60 * 24 ) ) )\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Get our member count */\n\t\t$totalMembers = \\IPS\\Db::i()->select( 'COUNT(*)', 'core_members' )->first();\n\n\t\t/* If we have more members than our cutoff, just set a flag as we don't need to recheck this periodically. The total will never materially dip to where we can start performing inline searches again, and worst case scenario the upgrader/support tool would clear the cache anyways. */\n\t\tif( $totalMembers > $this->inlineSearchCutoff )\n\t\t{\n\t\t\t\\IPS\\Data\\Store::i()->safeInlineSearch = false;\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Otherwise we store a timestamp so we can recheck periodically */\n\t\t\t\\IPS\\Data\\Store::i()->safeInlineSearch = time();\n\t\t\treturn TRUE;\n\t\t}\t\n\t}",
"public function hasInfluencedContent();",
"public function inlineImageExists()\n {\n }",
"public function isInlineContent($part)\r\n\t{\r\n\t\t$dis = $this->getPartContentDisposition($part);\r\n\t\tif ($dis)//ture\r\n\t\t{\r\n\t\t\tif ($dis == 'inline' || $dis == 'infile') // Add 'infile' as a hack for some stupid emails\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t\t//maybe need it in the future.\r\n\t\t\t\t// if (isset($part['disposition-filename']) && isset($part['content-name']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \t$filename = end(explode('.', $part['disposition-filename']));\r\n\t\t\t\t// \t$name = end(explode('.', isset($part['content-name']);\r\n\t\t\t\t// \tif ($filename == 'html' || $filename == 'htm' || $name == 'html' || $name == 'htm')))\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\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\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else if(isset($part['disposition-filename']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \techo $part['disposition-filename'];\r\n\t\t\t\t// \tif (end(explode('.', $part['disposition-filename'])) == 'htm' || end(explode('.', $part['disposition-filename'])) == 'html' )\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\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\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else if (isset($part['content-name']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \tif (end(explode('.', $part['content-name'])) == 'html')\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\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\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else\r\n\t\t\t\t// {\r\n\t\t\t\t// \treturn true;\r\n\t\t\t\t// }\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function hasSpanId(){\n return $this->_has(2);\n }",
"public function isCurrentChild(): bool;",
"public function hasAsis()\n {\n return isset($this->asis);\n }",
"public function isAligned()\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->isAligned();\n }\n\n return false;\n }",
"public function isShowing($in_tag)\n {\n $container = $this->show_area;\n $containee = $in_tag;\n $ret = false;\n $match = \"/^\" . $containee . \"/\";\n if (preg_match($match, $container)) {\n $ret = true;\n }\n\n $match = \"/qcol....form$/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n $match = \"/pghd....form$/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n $match = \"/pgft....form$/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n $match = \"/grph...._/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n return $ret;\n }",
"public function isWrapped()\n {\n return ($this->getWrapperInfo() !== false);\n }",
"public function hasContext(){\n return $this->_has(2);\n }",
"public function hasContextValue();",
"public function showIn(string $context): bool;",
"public function hasContext()\n\t\t{\n\t\t\treturn null !== $this->context;\n\t\t}",
"public function isRTE() {}",
"public function testIncludeWithInlineContext()\n {\n $output = $this->primer->getPatterns(array('components/test-group/include-with-inline-context'), false);\n\n $this->assertEquals($output, 'new context');\n }",
"public function isInvisible($in)\n {\n $elt = $this->getElement($in);\n\n return ($elt && ($elt['a'] & self::ELT_INVISIBLE));\n }",
"static function is_post_field_edited_inline($inline_edit_list, $field_type, $post_id) {\n foreach ($inline_edit_list as $edit) {\n if ($edit['type'] == $field_type && $edit['post_id'] == $post_id) {\n return true;\n }\n }\n\n return false;\n }",
"public function testInlineAnnotation() {\n $comment = \"/** @Inline */\";\n $annotations = new Annotations($comment);\n\n $this->assertTrue(isset($annotations['inline']));\n }",
"public function isToBeMarked();",
"public function hasSpans(){\n return $this->_has(2);\n }",
"public function hasEmbeddedField()\n {\n return $this->get(self::EMBEDDED_FIELD) !== null;\n }",
"public function getDetailFieldsInline()\n {\n if ($this->owner->config()->detail_fields_inline) {\n return true;\n }\n \n return Config::inst()->get(static::class, 'default_detail_fields_inline');\n }",
"public function isContainer($in)\n {\n $elt = $this->getElement($in);\n\n return ($elt &&\n (($elt['a'] & self::ELT_NOSELECT) ||\n (((!$this->_showunsub && !$this->isSubscribed($elt)) ||\n $this->isInvisible($elt)) &&\n $this->hasChildren($elt, true))));\n }",
"public function isAutofinishSpansEnabled()\n {\n return $this->boolValue('autofinish.spans', false);\n }",
"public function getIsSnippetEnabled()\n {\n return $this->helper->isSnippetEnabled();\n }",
"public function hasParent()\n {\n return $this->currentParent !== null;\n }",
"final public function hasParent() {\n\t\treturn ($this->_parentNode !== null);\n\t}",
"public function hasCurrent()\n {\n return $this->current !== null;\n }",
"public function hasCurElementId(){\n return $this->_has(1);\n }",
"public function hasContexts();",
"public function isFrontendArea(): bool;",
"public function isHtmlBlock()\n {\n return (! $this->isPhpBlock());\n }",
"protected function isEmbeddedSubclass()\n {\n $index = $this->getIndex();\n return $index != \"\";\n }",
"public function hasContentElement(): bool\n {\n return $this->isChildElementSet(1);\n }",
"public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}",
"public function isAdHocLineItem()\n {\n if ($this->parent_invoice_item_id && !$this->product_id && !$this->data_product_id &&\n !$this->bindery_option_id &&\n !$this->proof_id && !$this->shipping_option_id && $this->quantity\n ) {\n return true;\n } else {\n return false;\n }\n }",
"public function inContext(string $context): bool\n { return false;\n }",
"public function hasInfoWindow() {\n return (!empty($this->_text));\n }",
"function is_sp_widget_context() {\n\t\tif ( isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'],$this->id_base) !== false ) {\n\t\t\treturn true;\n\t\t} elseif ( isset($_REQUEST['_wp_http_referer']) && strpos($_REQUEST['_wp_http_referer'],$this->id_base) !== false ) {\n\t\t\treturn true;\n\t\t} elseif ( isset($_REQUEST['widget_id']) && strpos($_REQUEST['widget_id'],$this->id_base) !== false ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function hasParent() {\n return isset($this->_parent);\n }",
"public function isActive() {\n return (($page = Mage::registry('splash_page')) !== null) && $page->getId() === $this->getId();\n }",
"public function isActive() {\n return $this->site->page()->is($this);\n }",
"function testInline(){\n\n #mdx:Inline\n $form = new HtForm();\n $form->inline(true);\n $form->textin('fst_name')->label('First Name');\n $form->textin('lst_name')->label('Last Name');\n $form->button('Submit');\n #/mdx echo $form\n $this->assertGreaterThanOrEqual(2, substr_count(\"$form\",\"display:inline-block\"));\n\n }",
"public function in(BoxInterface $box): bool;",
"function hasParent() {\n\t\treturn (bool) ($this->parentID);\n\t}",
"public function getCaptionShown()\n {\n return ($this->Caption && !$this->HideCaption);\n }",
"public function hasMarkDown(): bool\n {\n return $this->markDown;\n }",
"public function isInteractive();",
"public function isInteractive();",
"public function isInteractive();",
"public function isEmphasized() {\n\t\treturn $this->emphasize;\n\t}",
"public function hasTag(){\n return $this->_has(1);\n }",
"public function hasParent() {\n\t\treturn $this->parent()->count() == 1;\n\t}",
"public function isInsideHead()\r\n\t{\r\n\t\treturn Anowave_Ec_Model_System_Config_Position::GTM_LOCATION_HEAD == (int) Mage::getStoreConfig('ec/config/code_position');\r\n\t}",
"public function is_embed()\n {\n }",
"public function isVisible()\n {\n if ($this->parent instanceof Zap_UIObject) {\n return ($this->parent->isVisible() && $this->visible);\n } else {\n return $this->visible;\n }\n }",
"function getPType() {\n return 'inline';\n }",
"public function isExpanded() {}",
"public function getIsPartOf()\n {\n return $this->isPartOf;\n }",
"function isVisible() {\n return $this->entry->flags & ThreadEntry::FLAG_EDITED;\n }",
"protected function isDceContentElement(DataHandler $pObj): bool\n {\n return (bool)$this->getDceUid($pObj);\n }",
"public function is_single()\r\n\t{\r\n\t\treturn $this->block == NULL;\r\n\t}",
"public static function isLocalContext()\r\n\t{\r\n\t\treturn self::$localContext;\r\n\t}",
"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}",
"public function isInteractive(): bool;",
"public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }",
"private function readContext(): bool\n {\n return ($data = $this->readIdentifier('msgctxt')) !== null\n && ($this->translation = $this->translation->withContext($data));\n }",
"abstract public function isCurrent();",
"public function isIsolated() {}",
"public function isUseInPreview() {\r\n\t\treturn $this->getUseInPreview();\r\n\t}",
"public function isParent() {\n\t\treturn $this->isParent;\n\t}",
"public function hasRenderingType()\n {\n return $this->RenderingType !== null;\n }",
"public function isSetASIN()\n {\n return !is_null($this->_fields['ASIN']['FieldValue']);\n }",
"public function is_block ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Block' );\n }",
"public function isCurrent() {\n\n return !empty($this->environment);\n }",
"public function isProcessTag()\r\n\t{\r\n\t\treturn $this->process_tag;\r\n\t}",
"public function hasContent(): bool\n {\n return !empty($this->getAssetId());\n }",
"public function hasWrapper() {\n return NULL != $this->wrapper;\n }",
"public static function use_inline_styles(){\n return false;\n }",
"public function isOpen() {\n if($this->isActive()) return true;\n return $this->site->page()->parents()->has($this);\n }",
"public static function hasAssociatedEntity()\n {\n return static::$associatedEntity !== null;\n }",
"public function isShowingFull($in_tag)\n {\n $match = \"/qcol....$/\";\n if (preg_match($match, $in_tag)) {\n return true;\n }\n\n $match = \"/qcol....form$/\";\n if (preg_match($match, $in_tag)) {\n return true;\n }\n\n $match = \"/pghd....form$/\";\n if (preg_match($match, $in_tag)) {\n return true;\n }\n\n $match = \"/pghd....$/\";\n if (preg_match($match, $in_tag)) {\n return true;\n }\n\n $match = \"/pgft....form$/\";\n if (preg_match($match, $in_tag)) {\n return true;\n }\n\n $match = \"/pgft....$/\";\n if (preg_match($match, $in_tag)) {\n return true;\n }\n\n $match = \"/grps...._/\";\n if (preg_match($match, $in_tag)) {\n return true;\n }\n\n if ($in_tag . \"detl\" == $this->show_area) {\n return true;\n }\n\n if ($in_tag == $this->show_area) {\n return true;\n }\n\n return false;\n }",
"public function has_PLAIN_not_HTML()\n\t{\n\t\treturn $this->PLAIN != '' && $this->HTML == '';\n\t}",
"private function hasAlign() {\n\t\treturn isset($this->options['align']);\n\t}"
] | [
"0.7384146",
"0.70733654",
"0.6968481",
"0.6914325",
"0.6851162",
"0.67480165",
"0.6497554",
"0.63016534",
"0.6232524",
"0.57936937",
"0.57405216",
"0.5622722",
"0.55322516",
"0.5500013",
"0.54707915",
"0.5444395",
"0.54324687",
"0.5407346",
"0.53898376",
"0.5381279",
"0.5376551",
"0.53643036",
"0.53631985",
"0.53499454",
"0.53328264",
"0.5327806",
"0.52628434",
"0.52487844",
"0.5246277",
"0.5239341",
"0.52357477",
"0.52168715",
"0.5211043",
"0.5199071",
"0.5191435",
"0.5186424",
"0.5155747",
"0.51185995",
"0.5117745",
"0.51176834",
"0.5073507",
"0.5054282",
"0.50516945",
"0.50387925",
"0.50274915",
"0.50102466",
"0.500354",
"0.4997962",
"0.49923947",
"0.4983748",
"0.49786514",
"0.49782518",
"0.49732205",
"0.49720764",
"0.49626473",
"0.494749",
"0.49328867",
"0.49264416",
"0.49262786",
"0.4916711",
"0.49051347",
"0.4902971",
"0.4897175",
"0.4895581",
"0.4895581",
"0.4895581",
"0.4895162",
"0.48945564",
"0.48894712",
"0.48826382",
"0.48793855",
"0.4867258",
"0.48659456",
"0.4863464",
"0.48558068",
"0.48551896",
"0.48504406",
"0.48475885",
"0.48460925",
"0.48449606",
"0.48360443",
"0.48337013",
"0.48242968",
"0.48228016",
"0.48158377",
"0.4815831",
"0.4812763",
"0.47994402",
"0.4796146",
"0.47906396",
"0.4787359",
"0.47843397",
"0.47837278",
"0.4782051",
"0.47813246",
"0.47761348",
"0.47751772",
"0.47730923",
"0.47710016",
"0.47686094"
] | 0.745781 | 0 |
Index Page for this controller. Maps to the following URL or or Since this controller is set as the default controller in config/routes.php, it's displayed at So any other public methods not prefixed with an underscore will map to /index.php/welcome/ | function __construct()
{
parent::__construct();
$this->load->library('session');
if($this->session->userdata('userID')=="")
redirect(base_url().'home', 'refresh');
$this->load->model('Analysis_Model');
$this->load->helper('form');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }",
"public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}",
"public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}",
"public function index()\n\t{\n\t\treturn view('welcome');\n\t}",
"public function index()\n\t{\n\t\treturn view('welcome');\n\t}",
"public function indexAction()\n\t{\n\t\t//echo 'Hello from the index action in the Home controller!';\n\t\t\n\t\t/*View::render('Home' . DS . 'index.php', [\n\t\t\t\"name\" => \"Laura\",\n\t\t\t\"colours\" => [\"red\", \"green\", \"blue\"]\n\t\t]);*/\n\t\t\n\t\t// View::renderTemplate('Home' . DS . 'index.html', [\n\t\t// \t\"name\" => \"Laura\",\n\t\t// \t\"colours\" => [\"red\", \"green\", \"blue\"]\n // ]);\n \n\t\t$this->showRouteParams();\n\t\t// echo \"Hello, World!\";\n }",
"public function index()\n\t{\n\t\t//Default view\n\t\t$this->load->view('index.html');\n\t}",
"function index() {\n\n // This page cannot be accessed without providing a page\n // the routes.php file will not allow the page to be accessed\n // $route['pages/(:any)'] = 'pages/view/$';\n redirect('/', 'refresh');\n\n }",
"public function Index()\n\t{\n\t\t$this->views->SetTitle('Index Controller');\n\t\t$this->views->AddView('index/index.tpl.php', array(),'primary');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('default/index');\n\t}",
"public function index() {\n\t\t$this->display('index');\n\t}",
"public function index()\n\t{\t\n\n\t\t$this->load->view('welcome_message');\n\t}",
"public function indexAction()\n {\n $arr = [\n 'title' => 'Welcome',\n 'data' => [\n 'name' => 'PHP FRAMEWORK',\n ]\n ];\n View::renderTemplate('Welcome/index.html', $arr);\n }",
"public function index()\n\t{\n\t\t$this->load->view('index');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('index');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('index');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('index');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('index');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('index');\n }",
"public function show_index()\n {\n return view('welcome');\n }",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}",
"public function Index()\n {\n $this->standardView('Index');\n }",
"public function index()\n {\n return view('main.welcome');\n }",
"public function index()\n {\n // return view('welcome');\n }",
"public function index()\n {\n $this->load->view('index');\n }",
"public function index()\n {\n // return view('welcome');\n \n }",
"public function index()\n\t{\n\t\t$this->load->view('home');\n\t}",
"public function index()\n\t{\n\t\techo \"Nothing !\";\n\t}",
"public function index() {\n \n return view('welcome');\n }",
"public function index()\n {\n return view('pages.welcome');\n }",
"public function Index()\n {\n \treturn view(\"index\");\n\t}",
"public function index()\n {\n $this->load->view('welcome_message');\n }",
"public function index()\n {\n $this->load->view('welcome_message');\n }",
"public function index()\n {\n\t\t/*$this->layout->setTitle('Welcome to our Blog');\n\t\t$this->layout->showView('welcome/about.php');*/\n\t\techo 'hello I\\'m using codeigniter';\n }",
"public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n\t{\n\t\treturn view('pages/home');\n\t}",
"public function index()\n {\n return \"INDEX PAGE\";\n }",
"public function index()\n\t{\n\t\treturn view('home');\n\t}",
"public function index()\n\t{\n\t\treturn view('home');\n\t}",
"function index() {\n \n parent::index();\n\n\t\t$data['user_id'] = $this->tank_auth->get_user_id();\n\t\t$data['username'] = $this->tank_auth->get_username();\n\t\t$data['main_content_view'] = $this->load->view('welcome', $data, true);\n $this->render_template($data);\n\t}",
"public function index()\n {\n SEOMeta::setTitle('Trusted Mortgage & Remortgage Solutions In UK - SmartMortgages UK');\n SEOMeta::setDescription('Home Page Description: For competitive mortgage and remortgage quotes around the UK at affordable rates, speak to one of our expert credit consultants and get a mortgage. For more visit us today.');\n\n return view('welcome');\n }",
"public function index()\n\t{\n\t\t$this->title = 'My Index Action';\n\n\t\treturn new View('basic/index');\n\t}",
"public function index()\n\t{\n\t\t$data['title'] = 'Home | Welcome to AEY';\n\t\t$data ['view_page'] = 'homepage';\n\n\t\t$this->load->view('site', $data);\n\t}",
"public function index()\n {\n\n return view('welcome');\n\n }",
"public function actionIndex(){ \n $this->view(\"index.php\");\n }",
"public function index() {\n $this->registry->template->module = 'welcome';\n \n /*** load the index template ***/\n $this->registry->template->show('index');\n }",
"public function actionIndex()\n\t{\n\t $this->pageTitle = 'Get Started';\n\t\t$this->render('index');\n\t}",
"public function index()\n {\n return view('front.welcome');\n }",
"public function index()\n\t{\n\t\treturn $this->traces();\n\t\treturn view('welcome');\n\t}",
"public function index()\n\t{\n\t\t$this->loadViews(\"index\");\n\t}",
"public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}",
"public function index()\n\t{\n\t\t$this->load->view('home/home');\n\t}",
"public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}",
"public function index()\r\n\t{\r\n\t\techo \"index\";\r\n\t}",
"public function index()\n\t{\n\t\t$this->twig->display('welcome/index.html', []);\n\t}",
"public function Index() {\n $this->Display();\n }",
"public function index()\r\n {\r\n View::render('home');\r\n }",
"public function index()\n {\n $title = 'Welcome Page';\n return view($this->view . '.home', compact('title'));\n }",
"public function index()\n\t{\n\t\t//\n\t\techo'index';\n\t}",
"public function index() {\n $this->getView('navigation', array('pagename' => 'Welcome'));\n $this->getView('welcome');\n $this->getView('footer');\n }",
"public function index()\n {\n return view(\"home\");\n }",
"public function home()\n\t{\n\t\t$this->load->view('index_view');\n\t}",
"function index() {\n $this->renderView(\"index\");\n }",
"function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}",
"public function index()\n\t{\n\t\treturn view('index');\n\t}",
"public function index()\n {\n return view('welcome');\n }",
"public function index()\n {\n\n\n\n return view('welcome');\n }",
"public function index() {\n\t\t$page = Page::getInstance();\n\t\t$session = Session::getInstance();\n\t\t$page->setPageTitle('Method index notfound');\n\t\t$session->setFlash('Chaque controller doit avoir une méthode index', 'error');\n\t}",
"public function index()\r\n\t{\r\n\t\t//\r\n\t}",
"public function index() {\n\t\t// render the view (/view/main/index.php)\n\t\t$this->view->render(\"main\", \"index\");\n\t}",
"public function index()\n {\n return View(\"pages.home\");\n }",
"public function index()\n {\n // Nothing to do\n }",
"public function index(){\n return view('welcome');\n }",
"public function index()\n\t{\n\t\t//\n\t}",
"public function index()\n\t{\n\t\t//\n\t}",
"public function index()\n\t{\n\t\t//\n\t}",
"public function index()\n\t{\n\t\t//\n\t}"
] | [
"0.7654226",
"0.74120015",
"0.73941106",
"0.731618",
"0.7225734",
"0.7225734",
"0.71892303",
"0.71651614",
"0.71515816",
"0.71449816",
"0.7107295",
"0.7076961",
"0.70735484",
"0.70390433",
"0.7028994",
"0.7028994",
"0.7028994",
"0.7028994",
"0.7028994",
"0.6972685",
"0.6966502",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.69458175",
"0.6931115",
"0.69237715",
"0.6909754",
"0.69002444",
"0.6892469",
"0.68740654",
"0.6856824",
"0.685447",
"0.68367773",
"0.6802268",
"0.68009436",
"0.68009436",
"0.67941576",
"0.67897063",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.6765238",
"0.67641693",
"0.6762739",
"0.675961",
"0.675961",
"0.6750375",
"0.67492497",
"0.6746904",
"0.6740853",
"0.67362094",
"0.67285895",
"0.6715751",
"0.67131466",
"0.67093956",
"0.6703179",
"0.669952",
"0.66913503",
"0.66737175",
"0.6661388",
"0.6659626",
"0.66492915",
"0.6629806",
"0.66201687",
"0.66113573",
"0.66033775",
"0.6597271",
"0.6592685",
"0.6592362",
"0.65850896",
"0.6575033",
"0.6574869",
"0.65715355",
"0.6552081",
"0.65469116",
"0.654429",
"0.6543424",
"0.65411824",
"0.65409356",
"0.6515197",
"0.6514655",
"0.6514655",
"0.6514655",
"0.6514655"
] | 0.0 | -1 |
auf blacklist: return false | function unlock($key)
{
if (in_array($key->getKeyId(), $this->config->blackList))
return false;
// auf whitelist: return true
if (in_array($key->getKeyId(), $this->config->whiteList))
return true;
// accesslist pruefen!
foreach ($this->config->accessList as $item) {
if ($item->keyId == $key->getKeyId()
&& $this->isNowInWindow($item->begin, $item->end)
) {
return true;
}
}
// Bei Active Key:
if ($key instanceof ActiveKey) {
foreach ($key->getConfigList() as $keyConfig) {
if ($keyConfig->lockId == $this->lockId
&& $this->isNowInWindow($keyConfig->begin, $keyConfig->end)
) {
return true;
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _hardFilter()\n\t {\n\t\t$check = true;\n\n\t\t$blackxml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/storage/blacklist.xml\"));\n\n\t\tforeach ($blackxml->patterns->pattern as $pattern)\n\t\t {\n\t\t\tif (isset($this->name) === true)\n\t\t\t {\n\t\t\t\tif (preg_match((string) $pattern, $this->name) > 0)\n\t\t\t\t {\n\t\t\t\t\t$check = false;\n\t\t\t\t\tbreak;\n\t\t\t\t } //end if\n\n\t\t\t } //end if\n\n\t\t\tif (preg_match((string) $pattern, $this->description) > 0)\n\t\t\t {\n\t\t\t\t$check = false;\n\t\t\t\tbreak;\n\t\t\t } //end if\n\n\t\t } //end foreach\n\n\t\tif ($check !== false)\n\t\t {\n\t\t\tforeach ($blackxml->words->word as $word)\n\t\t\t {\n\t\t\t\tif (isset($this->name) === true)\n\t\t\t\t {\n\t\t\t\t\tif (preg_match(\"/\" . (string) $word . \"/ui\", $this->name) > 0)\n\t\t\t\t\t {\n\t\t\t\t\t\t$check = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t } //end if\n\n\t\t\t\t } //end if\n\n\t\t\t } //end foreach\n\n\t\t } //end if\n\n\t\tif ($check === false)\n\t\t {\n\t\t\t$whitexml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/storage/whitelist.xml\"));\n\n\t\t\tforeach ($whitexml->patterns->pattern as $pattern)\n\t\t\t {\n\t\t\t\tif (preg_match((string) $pattern, $this->description) > 0)\n\t\t\t\t {\n\t\t\t\t\t$check = true;\n\t\t\t\t\tbreak;\n\t\t\t\t } //end if\n\n\t\t\t } //end foreach\n\n\t\t } //end if\n\n\t\treturn $check;\n\t }",
"function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent)\n {\n }",
"function cicleinscription_verify_username_blacklist($username){\n\tglobal $DB;\n\t\n\t$result = $DB->get_record('ci_blacklist', array('username'=>$username, 'statusblacklist' => 's'));\n\t\n\treturn $result ? $result : false;\n}",
"static public function isBlacklisted($data) {\n\t\tif (isset($data['path'])) {\n\t\t\t$path = $data['path'];\n\t\t} else if (isset($data['newpath'])) {\n\t\t\t$path = $data['newpath'];\n\t\t}\n\t\tif (isset($path)) {\n\t\t\tif (self::isFileBlacklisted($path)) {\n\t\t\t\t$data['run'] = false;\n\t\t\t}\n\t\t}\n\t}",
"public function getBlacklist()\n {\n return $this->blacklist;\n }",
"function check_excl_list($matches)\r\r\n {\r\r\n\r\r\n $check_allowed = $matches[2];\r\r\n\r\r\n $this->debug_info('Checking link \"' . $check_allowed . '\" VS exclusion list {' . var_export($this->options['exclude_links_'], 1) . '}');\r\r\n foreach ($this->options['exclude_links_'] as $val)\r\r\n if (stripos($check_allowed, $val) === 0) {\r\r\n $this->debug_info('In exclusion list (' . $val . '), not masking...');\r\r\n return $matches[0];\r\r\n }\r\r\n $this->debug_info('Not in exclusion list, masking...');\r\r\n return false;\r\r\n }",
"public function testRejectBlacklistedHostThoughNotTrue()\r\n {\r\n $this->config->set('URI.HostBlacklist', 'example.com');\r\n $this->assertFiltering('http://example.comcast.com', false);\r\n }",
"public function getBlacklist()\n {\n return $this->blacklist;\n }",
"public function getBlacklist()\n {\n return $this->blacklist;\n }",
"public function blacklist()\n {\n return $this['blacklist'];\n }",
"function ozh_yourls_gsb_is_blacklisted( $url ) {\n include_once dirname( __FILE__ ) . '/includes/class-gsb.php';\n \n $api_key = yourls_get_option( 'ozh_yourls_gsb' );\n if( !$api_key ) {\n ozh_yourls_gsb_please_configure();\n return false;\n }\n \n $gsb = new ozh_yourls_GSB( $api_key );\n \n return $gsb->is_blacklisted( $url );\n}",
"private function _inBlacklist()\n\t {\n\t\t$result = $this->_db->exec(\"SELECT COUNT(`phone`) as count FROM `blacklist` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\t$row = $result->getRow();\n\t\t$count = $row['count'];\n\n\t\tif($count > 0)\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 } //end if\n\n\t }",
"public function test_rejects_blacklisted_by_append()\n {\n \tConfig::set('validation.email.blacklist.source', null);\n \tConfig::set('validation.email.blacklist.append', \"reject.me\");\n\n\t\t$rules = ['email' => 'email|blacklist'];\n\n\t\t$input = ['email' => '[email protected]'];\n\n\t\t$passes = Validator::make($input, $rules)->passes();\n\n\t\t$this->assertFalse($passes);\n }",
"public function test_rejects_blacklisted_by_append_multi()\n {\n \tConfig::set('validation.email.blacklist.source', null);\n \tConfig::set('validation.email.blacklist.append', \"reject.me|rejecthisother.com\");\n\n\t\t$rules = ['email' => 'email|blacklist'];\n\n\t\t$input = ['email' => '[email protected]'];\n\n\t\t$passes = Validator::make($input, $rules)->passes();\n\n\t\t$this->assertFalse($passes);\n }",
"public function isBlacklistedUri($uri)\n\t{\n\t\t$returnValue = 1;\n\t\tsystem(\"grep -q -F '\".escapeshellarg($uri).\"' '\".escapeshellarg($this->getBlacklistFilename()).\"' \", $returnValue);\n\t\t\n\t\treturn $returnValue == 0;\n\t}",
"public function test_allows_not_blacklisted_by_append()\n {\n \tConfig::set('validation.email.blacklist.source', null);\n \tConfig::set('validation.email.blacklist.append', \"notinsource.com|otherappend.com\");\n\n\t\t$rules = ['email' => 'email|blacklist'];\n\n\t\t$input = ['email' => '[email protected]'];\n\n\t\t$passes = Validator::make($input, $rules)->passes();\n\n\t\t$this->assertTrue($passes);\n }",
"function phishtank_is_blacklisted( $url ) {\n\t$parsed = parse_url( $url );\n\t\n\tif( !isset( $parsed['host'] ) )\n\t\treturn yourls_apply_filter( 'phishtank_malformed', 'malformed' );\n\t\n\t// Remove www. from domain (but not from www.com)\n\t$parsed['host'] = preg_replace( '/^www\\.(.+\\.)/i', '$1', $parsed['host'] );\n\t\n\t// Phishtank API\n\t$phishtank_api_key = yourls_get_option( 'phishtank_api_key' );\n\n $API=\"http://checkurl.phishtank.com/checkurl/\";\n $url_64=base64_encode($url);\n\n $ch = curl_init();\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt ($ch, CURLOPT_POST, TRUE);\n curl_setopt ($ch, CURLOPT_USERAGENT, \"YOURLS\");\n curl_setopt ($ch, CURLOPT_POSTFIELDS, \"format=xml&app_key=$phishtank_api_key&url=$url_64\");\n curl_setopt ($ch, CURLOPT_URL, \"$API\");\n $result = curl_exec($ch);\n curl_close($ch);\n\n if (preg_match(\"/phish_detail_page/\",$result)) {\n\t\t\treturn yourls_apply_filter( 'phishtank_blacklisted', true );\n\t}\n\t\n\t// All clear, probably not spam\n\treturn yourls_apply_filter( 'phishtank_clean', false );\n}",
"function blacklistedDistinguishedname($distName, $refused=\"\"){\n $blacklisted = FALSE;\n foreach ($refused as $refusedOU) {\n $pattern = '/'.preg_quote($refusedOU, '/') . '/';\n if (preg_match($pattern, $distName)){\n $blacklisted = TRUE;\n }\n }\n return $blacklisted;\n}",
"public static function blacklisted(string $address): bool\n {\n return in_array($address, config('ark.wallets.blacklist'), true);\n }",
"function check_spam_blacklists($ip) {\n\t\t\n\t// reverse the ip address octets\n\t$reverse_ip = implode(\".\", array_reverse(explode(\".\", $ip)));\n\t\n\t$results = array();\n\t\n\tforeach ($GLOBALS['spam_blacklist_servers'] as $name => $url) {\n\t\t$access_url = $reverse_ip . \".\" . $url; \n\t\t$record = dns_get_record($access_url);\n\t\t\t\t\n\t\tif (count($record) > 0) {\n\t\t\t$results[$name] = TRUE;\n\t\t} else {\n\t\t\t$results[$name] = FALSE;\n\t\t}\n\t}\n\treturn $results;\n}",
"final public function blacklistDetect(int $user):bool{\n $b = $this->db->select('count(*)','jc_blacklist','bl_user_main='.intval($user).' and bl_user_black='.$this->user.'');\n return $b[0][0] > 0 ? true : false;\n }",
"public function test_rejects_blacklisted_by_append_lowercase()\n {\n \tConfig::set('validation.email.blacklist.source', null);\n \tConfig::set('validation.email.blacklist.append', \"rejectthisother.com\");\n\n\t\t$rules = ['email' => 'email|blacklist'];\n\n\t\t$input = ['email' => '[email protected]'];\n\n\t\t$passes = Validator::make($input, $rules)->passes();\n\n\t\t$this->assertFalse($passes);\n }",
"public function test_rejects_blacklisted_by_source()\n {\n \tConfig::set('validation.email.blacklist.auto-update', true);\n \tConfig::set('validation.email.blacklist.source', __DIR__.'/stubs/source.json');\n\n\t\t$rules = ['email' => 'email|blacklist'];\n\n\t\t$input = ['email' => '[email protected]'];\n\n\t\t$passes = Validator::make($input, $rules)->passes();\n\n\t\t$this->assertFalse($passes);\n }",
"public function clearBlacklist()\n {\n $this->blacklist = [];\n }",
"public function userInBlacklist(){\t\n\n\t\t//look first for a \"black cookie\". If is set, compare it with the actual datasets in the etchat_blacklist tab\n\t\tif(isset($_COOKIE['cookie_etchat_blacklist_ip']) && isset($_COOKIE['cookie_etchat_blacklist_until']))\n\t\t\t$blacklist_c=$this->dbObj->sqlGet(\"SELECT etchat_blacklist_time FROM {$this->_prefix}etchat_blacklist WHERE etchat_blacklist_ip = '\".addslashes($_COOKIE['cookie_etchat_blacklist_ip']).\"' and etchat_blacklist_time = \".(int)$_COOKIE['cookie_etchat_blacklist_until'].\" and etchat_blacklist_time > \".date('U'));\n\t\t\n\t\t// just compare by IP \n\t\t//echo \"SELECT etchat_blacklist_time FROM {$this->_prefix}etchat_blacklist WHERE etchat_blacklist_ip = '\".$this->user_param_all.\"' and etchat_blacklist_time > \".date('U');\n\t\t$blacklist=$this->dbObj->sqlGet(\"SELECT etchat_blacklist_time FROM {$this->_prefix}etchat_blacklist WHERE etchat_blacklist_ip = '\".$this->user_param_all.\"' and etchat_blacklist_time > \".date('U'));\n\t\t\n\t\tif (is_array($blacklist)) $this->user_bann_time = $blacklist[0][0];\n\t\tif (is_array($blacklist_c)) $this->user_bann_time = $blacklist_c[0][0];\n\t\t\n\t\t// if the user is banned, destroy the session and return true\n\t\tif (is_array($blacklist) || is_array($blacklist_c)) return true;\n\t\telse return false;\n\t}",
"public function getBlacklistFilter()\n {\n $blacklist = $this->getBlacklist();\n $base = '/^'\n . preg_quote($this->getBasePath() . DIRECTORY_SEPARATOR, '/')\n . '/';\n\n return function (SplFileInfo $file) use ($base, $blacklist) {\n $path = Path::canonical(\n preg_replace($base, '', $file->getPathname())\n );\n\n if (in_array($path, $blacklist)) {\n return false;\n }\n\n return null;\n };\n }",
"function spam_karma_blacklist_ban() {\r\n\t// blacklist those IPs who haven't spammed in 60 days.\r\n\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t$ip = apply_filters( 'spam_karma_blacklist_ban_get_ip', $ip );\r\n\tif( empty( $ip ) ) \r\n\t\treturn;\r\n\t\r\n\tglobal $wpdb;\r\n\trequire_wp_db(); // in the off case that the database isn't loaded yet.\r\n\r\n\t$blacklist_count = $wpdb->get_var( $wpdb->prepare( \"SELECT `used_count` FROM `sk2_blacklist` WHERE `type` = 'ip_black' AND `value` = '%s' LIMIT 1\", $ip ) );\r\n\tapply_filters( 'spam_karma_blacklist_ban_count', $blacklist_count );\r\n\tif ( $blacklist_count - SPAM_KARMA_BLACKLIST_COUNT_TO_BAN > 0 ) {\r\n\t\tdo_action( 'spam_karma_blacklist_ban_do_ban' );\r\n\t\theader(\"HTTP/1.0 403 Forbidden\", true, 403);\r\n\t\tdie();\r\n\t}\r\n}",
"public function getBlacklist()\n {\n if (isset($this->raw->blacklist)) {\n $blacklist = (array) $this->raw->blacklist;\n\n array_walk(\n $blacklist,\n function (&$file) {\n $file = Path::canonical($file);\n }\n );\n\n return $blacklist;\n }\n\n return array();\n }",
"function _update_blacklist()\n {\n global $_CONF, $_TABLES, $LANG_SX00, $_SPX_CONF;\n\n require_once $_CONF['path'] . 'plugins/spamx/magpierss/rss_fetch.inc';\n require_once $_CONF['path'] . 'plugins/spamx/magpierss/rss_utils.inc';\n\n if (!defined('MAGPIE_USER_AGENT')) {\n define('MAGPIE_USER_AGENT', 'Geeklog/' . VERSION);\n }\n $rss = fetch_rss($_SPX_CONF['rss_url']);\n if ($rss === false) {\n if (strpos($_SPX_CONF['rss_url'], 'jayallen.org') === false) {\n return '<p>An error occured when updating MT Blacklist</p>';\n } else {\n $url = COM_createLink('discontinued', 'http://www.geeklog.net/article.php/mt-blacklist-discontinued');\n return '<p>Please note that MT-Blacklist has been $url and will not be updated any more.</p>';\n }\n }\n\n // entries to add and delete, according to the blacklist changes feed\n $to_add = array();\n $to_delete = array();\n\n foreach ($rss->items as $item) {\n // time this entry was published (currently unused)\n // $published_time = parse_w3cdtf( $item['dc']['date'] );\n $entry = substr($item['description'], 0, -3); // blacklist entry\n $subject = $item['dc']['subject']; // indicates addition or deletion\n\n // is this an addition or a deletion?\n $dbentry = addslashes($entry);\n if (strpos($subject, 'addition') !== false) {\n // save it to database\n $result = DB_query(\"SELECT name FROM {$_TABLES['spamx']} WHERE name = 'MTBlacklist' AND value = '$dbentry'\");\n $nrows = DB_numRows($result);\n if ($nrows < 1) {\n DB_query(\"INSERT INTO {$_TABLES['spamx']} VALUES ('MTBlacklist', '$dbentry')\");\n $to_add[] = $entry;\n }\n } else if (strpos($subject, 'deletion') !== false) {\n // delete it from database\n $result = DB_query(\"SELECT name FROM {$_TABLES['spamx']} WHERE name = 'MTBlacklist' AND value = '$dbentry'\");\n $nrows = DB_numRows($result);\n if ($nrows >= 1) {\n DB_delete($_TABLES['spamx'], array('name', 'value'),\n array('MTBlacklist', $dbentry));\n $to_delete[] = $entry;\n }\n }\n }\n $display = '<hr' . XHTML . '><p><b>' . $LANG_SX00['entriesadded'] . '</b></p><ul>';\n foreach ($to_add as $e) {\n $display .= \"<li>$e</li>\";\n }\n $display .= '</ul><p><b>' . $LANG_SX00['entriesdeleted'] . '</b></p><ul>';\n foreach ($to_delete as $e) {\n $display .= \"<li>$e</li>\";\n }\n $display .= '</ul>';\n SPAMX_log($LANG_SX00['uMTlist'] . $LANG_SX00['uMTlist2'] . count($to_add) . $LANG_SX00['uMTlist3'] . count($to_delete) . $LANG_SX00['entries']);\n\n return $display;\n }",
"function getBlackList() {\n\t\treturn $this->_blackList;\n\t}",
"function lynt_blacklist_strings($comment)\n {\n $bl = ['[url=', 'pill', 'viagra', 'cailis', 'replica'];\n \n foreach($bl as $string) {\n if (stripos($comment, $string) !== FALSE) return true;\n }\n return false;\n }",
"function check_banlist($banlist, $email) {\n if (count($banlist)) {\n $allow = true;\n foreach($banlist as $banned) {\n $temp = explode(\"@\", $banned);\n if ($temp[0] == \"*\") {\n $temp2 = explode(\"@\", $email);\n if (trim(strtolower($temp2[1])) == trim(strtolower($temp[1])))\n $allow = false;\n } \n\t\telse {\n if (trim(strtolower($email)) == trim(strtolower($banned)))\n $allow = false;\n }\n }\n }\n if (!$allow) {\n print_error(\"You are using from a <b>banned email address.</b>\");\n }\n}",
"protected function calculateBlacklist() {\n $blacklist = $this->configuration['blacklist'];\n $modules = array_keys($this->configuration['module']);\n if ($modules) {\n $blacklist = array_merge($blacklist, array_keys($this->manager->findConfigEntityDependents('module', $modules)));\n }\n\n $themes = array_keys($this->configuration['theme']);\n if ($themes) {\n $blacklist = array_merge($blacklist, array_keys($this->manager->findConfigEntityDependents('theme', $themes)));\n }\n\n $extensions = array_merge([], $modules, $themes);\n $blacklist = array_filter($this->manager->getConfigFactory()->listAll(), function ($name) use ($extensions, $blacklist) {\n // Filter the list of config objects since they are not included in\n // findConfigEntityDependents.\n foreach ($extensions as $extension) {\n if (strpos($name, $extension . '.') === 0) {\n return TRUE;\n }\n }\n\n // Add the config name to the blacklist if it is in the wildcard list.\n return self::inFilterList($name, $blacklist);\n });\n sort($blacklist);\n // Finally merge all dependencies of the blacklisted config.\n $this->blacklist = array_unique(array_merge($blacklist, array_keys($this->manager->findConfigEntityDependents('config', $blacklist))));\n }",
"public function isBlacklisted($dir) {\n if (!is_array($blacklist = CloudFlare::config()->purge_dir_blacklist)) {\n return false;\n }\n\n if (in_array($dir, $blacklist)) {\n return true;\n }\n\n return false;\n }",
"function ozh_dlb_skip_if_bot() {\n return ozh_dlb_is_bot();\n // if anything but false is returned, functions using the two shunt_* filters will be short-circuited\n}",
"function isWhitelisted( $url ) {\n global $whitelistregex;\n foreach( $whitelistregex as $wregex ) if( preg_match($wregex, $url) ) return true;\n return false;\n}",
"public function isBlackListed($location) {\n\t\tif($block = $this->master->getBlock($location->block)){\n\t\t\treturn $this->blacklist->isInBlackList($block->modid,$block->blockid,$block->metadata);\n\t\t}\n\n\n\n\n\t\tvar_dump($location);\n\t\techo 'cant get block from master!'.\"\\n\";\n\t\treturn true;\n\t}",
"public function setBlackList(array $blackList);",
"function regexscan( $link ) {\n global $blacklistregex, $whitelistregex;\n foreach( $blacklistregex as $regex ) {\n if( preg_match($regex, $link) ) {\n foreach( $whitelistregex as $wregex ) if( preg_match($wregex, $link) ) return false;\n return true;\n }\n }\n return false;\n}",
"function blacklisted($type, $key, $blacklist) {\n \n $blacklist_wlan_chk_mh = $_SESSION[\"blacklist_wlan_chk_mh\"];\n $blacklist_fp_chk_mh = $_SESSION[\"blacklist_fp_chk_mh\"];\n $blacklist_mode_fp_mh = $_SESSION[\"blacklist_mode_fp_mh\"];\n $blacklist_bt_chk_mh = $_SESSION[\"blacklist_bt_chk_mh\"];\n\n $blacklist_exploded = explode(\",\", $blacklist);\n switch ($type) {\n case \"wifi_global\":\n if ($blacklist_wlan_chk_mh == \"1\") {\n foreach ($blacklist_exploded as $blacklist_key => $blacklist_value) {\n if ($key == $blacklist_value) {\n // found key in blacklist\n return 1;\n }\n }\n }\n break;\n \n case \"wifi_local\":\n if ($blacklist_fp_chk_mh == \"1\") {\n $essids = explode(\",\", $key);\n $essids_blacklisted = 0;\n foreach ($blacklist_exploded as $blacklist_key => $blacklist_value) {\n foreach ($essids as $essid_key => $essid_value) {\n if ($essid_value == $blacklist_value) {\n $essids_blacklisted++;\n }\n }\n }\n switch ($blacklist_mode_fp_mh) {\n case \"ALL\":\n // fingerprint is made of blacklisted essids only\n if ($essids_blacklisted == count($essids)) { return 1; }\n break;\n case \"ONE\":\n // fingerprint contains at least one blacklisted essid\n if ($essids_blacklisted > 0) { return 1; }\n break;\n default:\n die(\"function blacklisted ERROR: Unknown local MAC mode: \" . $blacklist_mode_fp_mh);\n }\n }\n break;\n\n case \"bt\":\n if ($blacklist_bt_chk_mh == \"1\") {\n foreach ($blacklist_exploded as $blacklist_key => $blacklist_value) {\n if ($key == $blacklist_value) {\n // found key in blacklist\n return 1;\n }\n }\n }\n break;\n\n default:\n die(\"function blacklisted ERROR: Unknown type: \" . $type);\n }\n return 0;\n}",
"static function getrules_5g_blacklist()\r\n {\r\n global $aio_wp_security;\r\n $rules = '';\r\n if ($aio_wp_security->configs->get_value('aiowps_enable_5g_firewall') == '1') {\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$five_g_blacklist_marker_start . PHP_EOL; //Add feature marker start\r\n\r\n $rules .= '# 5G BLACKLIST/FIREWALL (2013)\r\n # @ http://perishablepress.com/5g-blacklist-2013/\r\n\r\n # 5G:[QUERY STRINGS]\r\n <IfModule mod_rewrite.c>\r\n RewriteEngine On\r\n RewriteBase /\r\n RewriteCond %{QUERY_STRING} (\\\"|%22).*(<|>|%3) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (javascript:).*(\\;) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (\\\\\\|\\.\\./|`|=\\'$|=%27$) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (\\;|\\'|\\\"|%22).*(union|select|insert|drop|update|md5|benchmark|or|and|if) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (base64_encode|localhost|mosconfig) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (boot\\.ini|echo.*kae|etc/passwd) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (GLOBALS|REQUEST)(=|\\[|%) [NC]\r\n RewriteRule .* - [F]\r\n </IfModule>\r\n\r\n # 5G:[USER AGENTS]\r\n <IfModule mod_setenvif.c>\r\n # SetEnvIfNoCase User-Agent ^$ keep_out\r\n SetEnvIfNoCase User-Agent (binlar|casper|cmsworldmap|comodo|diavol|dotbot|feedfinder|flicky|ia_archiver|jakarta|kmccrew|nutch|planetwork|purebot|pycurl|skygrid|sucker|turnit|vikspider|zmeu) keep_out\r\n <limit GET POST PUT>\r\n Order Allow,Deny\r\n Allow from all\r\n Deny from env=keep_out\r\n </limit>\r\n </IfModule>\r\n\r\n # 5G:[REQUEST STRINGS]\r\n <IfModule mod_alias.c>\r\n RedirectMatch 403 (https?|ftp|php)\\://\r\n RedirectMatch 403 /(https?|ima|ucp)/\r\n RedirectMatch 403 /(Permanent|Better)$\r\n RedirectMatch 403 (\\=\\\\\\\\\\\\\\'|\\=\\\\\\%27|/\\\\\\\\\\\\\\'/?|\\)\\.css\\()$\r\n RedirectMatch 403 (\\,|\\)\\+|/\\,/|\\{0\\}|\\(/\\(|\\.\\.\\.|\\+\\+\\+|\\||\\\\\\\\\\\"\\\\\\\\\\\")\r\n RedirectMatch 403 \\.(cgi|asp|aspx|cfg|dll|exe|jsp|mdb|sql|ini|rar)$\r\n RedirectMatch 403 /(contac|fpw|install|pingserver|register)\\.php$\r\n RedirectMatch 403 (base64|crossdomain|localhost|wwwroot|e107\\_)\r\n RedirectMatch 403 (eval\\(|\\_vti\\_|\\(null\\)|echo.*kae|config\\.xml)\r\n RedirectMatch 403 \\.well\\-known/host\\-meta\r\n RedirectMatch 403 /function\\.array\\-rand\r\n RedirectMatch 403 \\)\\;\\$\\(this\\)\\.html\\(\r\n RedirectMatch 403 proc/self/environ\r\n RedirectMatch 403 msnbot\\.htm\\)\\.\\_\r\n RedirectMatch 403 /ref\\.outcontrol\r\n RedirectMatch 403 com\\_cropimage\r\n RedirectMatch 403 indonesia\\.htm\r\n RedirectMatch 403 \\{\\$itemURL\\}\r\n RedirectMatch 403 function\\(\\)\r\n RedirectMatch 403 labels\\.rdf\r\n RedirectMatch 403 /playing.php\r\n RedirectMatch 403 muieblackcat\r\n </IfModule>\r\n\r\n # 5G:[REQUEST METHOD]\r\n <ifModule mod_rewrite.c>\r\n RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)\r\n RewriteRule .* - [F]\r\n </IfModule>' . PHP_EOL;\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$five_g_blacklist_marker_end . PHP_EOL; //Add feature marker end\r\n }\r\n\r\n return $rules;\r\n }",
"function wpspamshield_whitelist_webhook( $bypass ) {\n\tif ( untrailingslashit( $_SERVER['REQUEST_URI'] ) === '/' . rest_get_url_prefix() . '/airstory/v1/webhook' ) {\n\t\t$bypass = true;\n\t}\n\n\treturn $bypass;\n}",
"function checkPasswordAgainstBlacklist($password) {\n return $this->checkAgainstBlacklist('password', $password);\n }",
"public static function blackList($value, $disallowedValues) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = true;\n\t\t\t\n\t\t\t// Check Disallowed Values\n\t\t\tif(in_array($value, $disallowedValues)) {\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}",
"public function beforeRunRules() {\n\t\t$whitelistedURLs = wfWAF::getInstance()->getStorageEngine()->getConfig('whitelistedURLs');\n\t\tif ($whitelistedURLs) {\n\t\t\t$whitelistPattern = \"\";\n\t\t\tforeach ($whitelistedURLs as $whitelistedURL) {\n\t\t\t\t$whitelistPattern .= preg_replace('/\\\\\\\\\\*/', '.*?', preg_quote($whitelistedURL, '/')) . '|';\n\t\t\t}\n\t\t\t$whitelistPattern = '/^(?:' . wfWAFUtils::substr($whitelistPattern, 0, -1) . ')$/i';\n\n\t\t\twfWAFRule::create(wfWAF::getInstance(), 0x8000000, 'rule', 'whitelist', 0, 'User Supplied Whitelisted URL', 'allow',\n\t\t\t\tnew wfWAFRuleComparisonGroup(\n\t\t\t\t\tnew wfWAFRuleComparison(wfWAF::getInstance(), 'match', $whitelistPattern, array(\n\t\t\t\t\t\t'request.uri',\n\t\t\t\t\t))\n\t\t\t\t)\n\t\t\t)->evaluate();\n\t\t}\n\n\t\t// Whitelisted IPs (Wordfence config)\n\t\t$whitelistedIPs = wfWAF::getInstance()->getStorageEngine()->getConfig('whitelistedIPs');\n\t\tif ($whitelistedIPs) {\n\t\t\tif (!is_array($whitelistedIPs)) {\n\t\t\t\t$whitelistedIPs = explode(',', $whitelistedIPs);\n\t\t\t}\n\t\t\tforeach ($whitelistedIPs as $whitelistedIP) {\n\t\t\t\t$ipRange = new wfWAFUserIPRange($whitelistedIP);\n\t\t\t\tif ($ipRange->isIPInRange(wfWAF::getInstance()->getRequest()->getIP())) {\n\t\t\t\t\tthrow new wfWAFAllowException('Wordfence whitelisted IP.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check plugin blocking\n\t\tif ($result = wfWAF::getInstance()->willPerformFinalAction(wfWAF::getInstance()->getRequest())) {\n\t\t\tif ($result === true) { $result = 'Not available'; } // Should not happen but can if the reason in the blocks table is empty\n\t\t\twfWAF::getInstance()->getRequest()->setMetadata(array_merge(wfWAF::getInstance()->getRequest()->getMetadata(), array('finalAction' => $result)));\n\t\t}\n\t}",
"function getBlacklist() {\n $entry_rs = $this->SHARED_DB->get_results(\n \"SELECT id AS blacklist_id, first_name, last_name, email, notes FROM hbo_blacklist\n ORDER BY blacklist_id, last_name, first_name, email\");\n\n if ( $this->SHARED_DB->last_error ) {\n throw new DatabaseException( $this->SHARED_DB->last_error );\n }\n\n $alias_rs = $this->SHARED_DB->get_results(\n \"SELECT id AS alias_id, blacklist_id, first_name, last_name, email\n FROM hbo_blacklist_alias WHERE deleted_date IS NULL\");\n\n if ( $this->SHARED_DB->last_error ) {\n throw new DatabaseException( $this->SHARED_DB->last_error );\n }\n\n $mugshot_rs = $this->SHARED_DB->get_results(\n \"SELECT id AS mugshot_id, blacklist_id, filename\n FROM hbo_blacklist_mugshot WHERE deleted_date IS NULL\");\n\n if ( $this->SHARED_DB->last_error ) {\n throw new DatabaseException($this->SHARED_DB->last_error);\n }\n\n $blacklist = array();\n foreach ( $entry_rs as $record ) {\n $entry = new BlacklistEntry( $record->blacklist_id, $record->first_name, $record->last_name, $record->email, $record->notes );\n foreach ( $alias_rs as $alias ) {\n if ( $alias->blacklist_id == $record->blacklist_id ) {\n $entry->add_alias( $alias );\n }\n }\n foreach ( $mugshot_rs as $mugshot ) {\n if ( $mugshot->blacklist_id == $record->blacklist_id ) {\n $entry->add_mugshot( $mugshot );\n }\n }\n $blacklist[] = $entry;\n }\n return $blacklist;\n }",
"public function removeUriFromFilter($uri)\n\t{\n\t\t$blacklistFilename = $this->getBlacklistFilename();\n\t\t$tmpfilename = tempnam('', 'gama-blacklist-');\n\t\t$returnValue = 1;\n\t\tsystem(\"grep -v -F '\".escapeshellarg($uri).\"' '\".escapeshellarg($blacklistFilename).\"' > '\".escapeshellarg($tmpfilename).\"'\", $returnValue);\n\t\t\n\t\tif($returnValue == 0)\n\t\t{\n\t\t\trename($tmpfilename, $blacklistFilename);\n\t\t\tchmod($blacklistFilename, 0664);\n\t\t}\n\t}",
"function nonBlacklistedDistunguishednameArray($array,$refused=\"\"){\n $cleanArray = array();\n foreach ($array as $dn) {\n if(blacklistedDistinguishedname($dn,$refused)==FALSE){\n array_push($cleanArray,$dn);\n }\n }\n return $cleanArray;\n}",
"function checkEmailAgainstBlacklist($email) {\n return $this->checkAgainstBlacklist('email', $email);\n }",
"public function setBlacklist(array $blacklist)\n {\n $this->blacklist = $blacklist;\n }",
"function setBlackList($blackList) {\n\t\t$this->_blackList = $blackList;\n\t}",
"public static function blacklist(array $blacklist)\n {\n config()->set('vue-translation.blacklist', $blacklist);\n }",
"function portblacklisted($port) {\n\t$blackports = array (\n\t\tarray(135, 139),\t// Winodws\n\t\tarray(445, 445),\t// Netbios\n\t\tarray(411, 413),\t// DC++\n\t\tarray(6881,6889),\t// Bittorrent\n\t\tarray(1214,1214),\t// Kazaa\n\t\tarray(6346,6347),\t// Gnutella\n\t\tarray(4662,4662),\t// eMule\n\t\tarray(6699,6699),\t// WinMX\n\t);\n\tforeach ($blackports as $b) {\n\t\tif ($port >= $b[0] && $port <= $b[1])\n\t\t\treturn true;\n\t}\n\treturn false;\n}",
"function ozh_yourls_gsb_check_add( $false, $url ) {\n \n list( $blacklisted, $desc ) = ozh_yourls_gsb_is_blacklisted( $url );\n \n // If blacklisted, halt here\n\tif ( $blacklisted ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:' . $desc,\n\t\t\t'message' => 'Ce domaine est sur liste noire par Google Safe Browsing à cause de suspicion de ' . $desc . '. <a href=\"http://code.google.com/apis/safebrowsing/safebrowsing_faq.html#whyAdvisory\">En savoir plus</a>.',\n\t\t\t'errorCode' => '403',\n\t\t);\n\t}\n \n // If not blacklisted but still unsure (error message), we should warn the user\n if( $desc ) {\n define( 'OZH_YOURLS_GSB_EXTRA_INFO', $desc );\n yourls_add_filter( 'add_new_link', 'ozh_yourls_gsb_extra_info' );\n }\n\t\n\t// All clear, don't interrupt the normal flow of events\n\treturn $false;\n}",
"static function getrules_block_spambots()\r\n {\r\n global $aio_wp_security;\r\n $rules = '';\r\n if ($aio_wp_security->configs->get_value('aiowps_enable_spambot_blocking') == '1') {\r\n $url_string = AIOWPSecurity_Utility_Htaccess::return_regularized_url(AIOWPSEC_WP_HOME_URL);\r\n if ($url_string == FALSE) {\r\n $url_string = AIOWPSEC_WP_HOME_URL;\r\n }\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$block_spambots_marker_start . PHP_EOL; //Add feature marker start\r\n $rules .= '<IfModule mod_rewrite.c>' . PHP_EOL;\r\n $rules .= 'RewriteEngine On' . PHP_EOL;\r\n $rules .= 'RewriteCond %{REQUEST_METHOD} POST' . PHP_EOL;\r\n $rules .= 'RewriteCond %{REQUEST_URI} ^(.*)?wp-comments-post\\.php(.*)$' . PHP_EOL;\r\n $rules .= 'RewriteCond %{HTTP_REFERER} !^' . $url_string . ' [NC,OR]' . PHP_EOL;\r\n $rules .= 'RewriteCond %{HTTP_USER_AGENT} ^$' . PHP_EOL;\r\n $rules .= 'RewriteRule .* http://127.0.0.1 [L]' . PHP_EOL;\r\n $rules .= '</IfModule>' . PHP_EOL;\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$block_spambots_marker_end . PHP_EOL; //Add feature marker end\r\n }\r\n\r\n return $rules;\r\n }",
"private function shouldProcess()\n {\n if (count($this->settings['whitelist']) > 0) {\n return in_array($this->templateName, $this->settings['whitelist'], true);\n }\n\n if (count($this->settings['blacklist']) > 0) {\n return !in_array($this->templateName, $this->settings['blacklist'], true);\n }\n\n return true;\n }",
"function checkIfDesacivable($memberOf, $refusedGroup=\"\"){\n $blacklisted = FALSE;\n foreach ($memberOf as $group) {\n if ($group == $refusedGroup){\n $blacklisted = TRUE;\n }\n }\n return $blacklisted;\n}",
"function checkAgainstBlacklist($type, $value) {\n // Get the black list rules\n $detailed = FALSE;\n if ($type == 'email') {\n $detailed = TRUE;\n }\n $rules = $this->getBlacklistRules($type, FALSE, $detailed);\n // If there are no rules yet, we can safely return TRUE\n if (empty($rules)) {\n return TRUE;\n }\n // Otherwise we need to check the handle against each rule\n foreach ($rules as $id => $likeRule) {\n if ($detailed) {\n if ($likeRule['blacklist_delay'] == 1) {\n continue;\n }\n $likeRule = $likeRule['blacklist_match'];\n }\n $rule = $this->convertFromSqlLikeValue($likeRule);\n // Strip whitespace\n $rule = trim($rule);\n // Convert current rule into valid regexp\n if ($rule[0] == '*') {\n $rule = ltrim($rule, '*');\n } else {\n $rule = '^'.$rule;\n }\n if ($rule[strlen($rule) - 1] == '*') {\n $rule = rtrim($rule, '*');\n } else {\n $rule = $rule.'$';\n }\n // Now do the check\n if (preg_match('~'.$rule.'~i', $value)) {\n // Return FALSE on first match\n return FALSE;\n }\n }\n // We didn't find any match, so the handle is valid\n return TRUE;\n }",
"function array_blacklist(array $array, array $blacklist = array()) {\n\treturn array_diff_key($array, array_flip($blacklist));\n}",
"public function users_register_check_blocked($h)\n {\n $this->ssType = $h->getSetting('stop_spam_type');\n \n // get user info:\n //$username = $h->currentUser->name;\n $username = ''; // dont check on username as it is too narrow a filter\n $email = $h->currentUser->email;\n $ip = $h->cage->server->testIp('REMOTE_ADDR');\n \n // If any variable is empty or the IP is \"localhost\", skip using this plugin.\n if (!$email || !$ip || ($ip == '127.0.0.1')) { return false; }\n\n // Include our StopSpam class:\n require_once(PLUGINS . 'stop_spam/libs/StopSpam.php');\n $spam = new StopSpamFunctions();\n \n $json = $spam->checkSpammers($username, $email, $ip); \n $flags = $spam->flagSpam($h, $json);\n \n if ($flags) { \n // store flags - used when type is \"go_pending\"\n $h->vars['reg_flags'] = $flags;\n \n // if type is \"block_reg\", provide a way to tell the Users plugin:\n if ($this->ssType == 'block_reg') {\n $h->vars['block'] = true;\n }\n } \n else \n {\n // safe user, do nothing...\n }\n\n }",
"function wp_check_comment_disallowed_list($author, $email, $url, $comment, $user_ip, $user_agent)\n {\n }",
"public static function setBlacklist($array)\n\t{\n\t\tself::$blacklist = $array;\n\t}",
"public function getStatusBlacklist()\n {\n return $this->status_blacklist;\n }",
"function check_IP_ban_list(){\r\n\r\n\t\t#OPEN BAN IP LIST\r\n\t\t//$fp = fopen(DIR_SERVER_ROOT.'ilcfg/ban_list.inc.php', 'r');\r\n\t\t//$_deny_ip = explode(\"\\n\", fread($fp, filesize(DIR_SERVER_ROOT.'ban_list.inc.php')));\r\n\r\n\t\t$_ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t$_allowed = false;\r\n\t\tforeach($this->_allow_ip as $_a_ip){\r\n\t\t\t$_a_ip = str_replace('.','\\.',$_a_ip);\r\n\t\t\t$_a_ip = str_replace('*','[0-9]{1,3}',$_a_ip);\r\n\t\t\t$_a_ip = str_replace('?','[0-9]{1}',$_a_ip);\r\n\t\t\tif(ereg(\"^{$_a_ip}$\", $_ip)) $_allowed = true;\r\n\t\t}\r\n\t\tif(!$_allowed) die($_error_message);\r\n\t\t$_allowed = true;\r\n\t\tforeach($this->_deny_ip as $_d_ip){\r\n\t\t\t$_d_ip = str_replace('.','\\.',$_d_ip);\r\n\t\t\t$_d_ip = str_replace('*','[0-9]{1,3}',$_d_ip);\r\n\t\t\t$_d_ip = str_replace('?','[0-9]{1}',$_d_ip);\r\n\t\t\tif(ereg(\"^{$_d_ip}$\", $_ip)) $_allowed = false;\r\n\t\t}\r\n\t\tif(!$_allowed)\r\n\t\t{\r\n\t\t\t$this->ip_detect_mail();\r\n\t\t\tinclude(DIR_SERVER_ROOT.BAN_IP_PAGE);\r\n\t\t\texit();\r\n\t\t}\r\n\t}",
"public function missingImportantPatterns(): bool\n {\n $defaultParts = explode('|', self::DEFAULT_FILE_DENY_PATTERN);\n $givenParts = explode('|', $this->fileDenyPattern);\n $missingParts = array_diff($defaultParts, $givenParts);\n return !empty($missingParts);\n }",
"protected function checkDisableFunctions() {}",
"function is_baned($ip)\r\n{\r\n\tglobal $db_url;\r\n\t$all_baned_ips=array();\r\n\t$db=YDB::factory($db_url);\r\n\t$result=$db->queryAll(sprintf(parse_tbprefix(\"SELECT * FROM <badip> WHERE ip='%s'\"),$db->escape_string($ip)));\r\n\tif($result)\r\n\t\treturn true;\r\n\treturn false;\r\n}",
"static function getrules_6g_blacklist()\r\n {\r\n global $aio_wp_security;\r\n $rules = '';\r\n if ($aio_wp_security->configs->get_value('aiowps_enable_6g_firewall') == '1') {\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$six_g_blacklist_marker_start . PHP_EOL; //Add feature marker start\r\n\r\n $rules .= '# 6G BLACKLIST/FIREWALL (2016)\r\n # @ https://perishablepress.com/6g/\r\n\r\n # 6G:[QUERY STRINGS]\r\n <IfModule mod_rewrite.c>\r\n RewriteEngine On\r\n RewriteCond %{QUERY_STRING} (eval\\() [NC,OR]\r\n RewriteCond %{QUERY_STRING} (127\\.0\\.0\\.1) [NC,OR]\r\n RewriteCond %{QUERY_STRING} ([a-z0-9]{2000}) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (javascript:)(.*)(;) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (base64_encode)(.*)(\\() [NC,OR]\r\n RewriteCond %{QUERY_STRING} (GLOBALS|REQUEST)(=|\\[|%) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (<|%3C)(.*)script(.*)(>|%3) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (\\\\|\\.\\.\\.|\\.\\./|~|`|<|>|\\|) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (boot\\.ini|etc/passwd|self/environ) [NC,OR]\r\n RewriteCond %{QUERY_STRING} (thumbs?(_editor|open)?|tim(thumb)?)\\.php [NC,OR]\r\n RewriteCond %{QUERY_STRING} (\\'|\\\")(.*)(drop|insert|md5|select|union) [NC]\r\n RewriteRule .* - [F]\r\n </IfModule>\r\n\r\n # 6G:[REQUEST METHOD]\r\n <ifModule mod_rewrite.c>\r\n RewriteCond %{REQUEST_METHOD} ^(connect|debug|delete|move|put|trace|track) [NC]\r\n RewriteRule .* - [F]\r\n </IfModule>\r\n\r\n # 6G:[REFERRERS]\r\n <IfModule mod_rewrite.c>\r\n RewriteCond %{HTTP_REFERER} ([a-z0-9]{2000}) [NC,OR]\r\n RewriteCond %{HTTP_REFERER} (semalt.com|todaperfeita) [NC]\r\n RewriteRule .* - [F]\r\n </IfModule>\r\n\r\n # 6G:[REQUEST STRINGS]\r\n <IfModule mod_alias.c>\r\n RedirectMatch 403 (?i)([a-z0-9]{2000})\r\n RedirectMatch 403 (?i)(https?|ftp|php):/\r\n RedirectMatch 403 (?i)(base64_encode)(.*)(\\()\r\n RedirectMatch 403 (?i)(=\\\\\\'|=\\\\%27|/\\\\\\'/?)\\.\r\n RedirectMatch 403 (?i)/(\\$(\\&)?|\\*|\\\"|\\.|,|&|&?)/?$\r\n RedirectMatch 403 (?i)(\\{0\\}|\\(/\\(|\\.\\.\\.|\\+\\+\\+|\\\\\\\"\\\\\\\")\r\n RedirectMatch 403 (?i)(~|`|<|>|:|;|,|%|\\\\|\\s|\\{|\\}|\\[|\\]|\\|)\r\n RedirectMatch 403 (?i)/(=|\\$&|_mm|cgi-|etc/passwd|muieblack)\r\n RedirectMatch 403 (?i)(&pws=0|_vti_|\\(null\\)|\\{\\$itemURL\\}|echo(.*)kae|etc/passwd|eval\\(|self/environ)\r\n RedirectMatch 403 (?i)\\.(aspx?|bash|bak?|cfg|cgi|dll|exe|git|hg|ini|jsp|log|mdb|out|sql|svn|swp|tar|rar|rdf)$\r\n RedirectMatch 403 (?i)/(^$|(wp-)?config|mobiquo|phpinfo|shell|sqlpatch|thumb|thumb_editor|thumbopen|timthumb|webshell)\\.php\r\n </IfModule>\r\n\r\n # 6G:[USER AGENTS]\r\n <IfModule mod_setenvif.c>\r\n SetEnvIfNoCase User-Agent ([a-z0-9]{2000}) bad_bot\r\n SetEnvIfNoCase User-Agent (archive.org|binlar|casper|checkpriv|choppy|clshttp|cmsworld|diavol|dotbot|extract|feedfinder|flicky|g00g1e|harvest|heritrix|httrack|kmccrew|loader|miner|nikto|nutch|planetwork|postrank|purebot|pycurl|python|seekerspider|siclab|skygrid|sqlmap|sucker|turnit|vikspider|winhttp|xxxyy|youda|zmeu|zune) bad_bot\r\n\r\n # Apache < 2.3\r\n <IfModule !mod_authz_core.c>\r\n Order allow,deny\r\n Allow from all\r\n Deny from env=bad_bot\r\n </IfModule>\r\n\r\n # Apache >= 2.3\r\n <IfModule mod_authz_core.c>\r\n <RequireAll>\r\n Require all granted\r\n Require not env bad_bot\r\n </RequireAll>\r\n </IfModule>\r\n </IfModule>' . PHP_EOL;\r\n $rules .= AIOWPSecurity_Utility_Htaccess::$six_g_blacklist_marker_end . PHP_EOL; //Add feature marker end\r\n }\r\n\r\n return $rules;\r\n }",
"public static function getFieldBlacklist()\n {\n $fieldBlacklist = array();\n if ( eZINI::instance( 'ocopendata.ini' )->hasVariable( 'ContentSettings', 'IdentifierBlackListForExternal' ) )\n {\n $fieldBlacklist = array_fill_keys(\n eZINI::instance( 'ocopendata.ini' )->variable( 'ContentSettings', 'IdentifierBlackListForExternal' ),\n true\n );\n }\n return $fieldBlacklist;\n }",
"public function appendBlackList($value)\n {\n return $this->append(self::_BLACK_LIST, $value);\n }",
"function isWhiteListed($tld) {\r\n\t$wpbar_options = get_option(\"wpbar_options\");\r\n\t$whitelist=explode(\"\\n\",$wpbar_options[\"whitelist\"]);\r\n\t$white=false;\r\n\tfor($i=0;$i<sizeof($whitelist);$i++){\r\n\t\tif(trim($tld)==trim(get_domain($whitelist[$i])))\r\n\t\t\t$white=true;\r\n\t}\r\n\treturn $white;\r\n}",
"function is_user_agent_banned($user_agent, $banned_user_agents)\n {\n foreach($banned_user_agents as $banned_user_agent)\n {\n #if(strpos(strtolower($user_agent),strtolower($banned_user_agent))!==false) // case insensitive\n #if($banned_user_agent!='' && (preg_match(\"/\".$banned_user_agent.\"/i\",$user_agent))) // case insensitive\n if(strpos($user_agent,$banned_user_agent)!==false) // case sensitive, faster\n {\n return true;\n }\n }\n return false;\n }",
"public function test_filters_automatic_updater_disabled()\n {\n }",
"public function generateBlacklist($disable = false)\n {\n $blacklist = $this->_params['storage']\n ->retrieve(Ingo_Storage::ACTION_BLACKLIST);\n $bl_addr = $blacklist->getBlacklist();\n $bl_folder = $blacklist->getBlacklistFolder();\n\n $bl_type = empty($bl_folder)\n ? Ingo_Storage::ACTION_DISCARD\n : Ingo_Storage::ACTION_MOVE;\n\n if (!empty($bl_addr)) {\n $this->_addItem(Ingo::RULE_BLACKLIST, new Ingo_Script_Procmail_Comment(_(\"Blacklisted Addresses\"), $disable, true));\n $params = array('action-value' => $bl_folder,\n 'action' => $bl_type,\n 'disable' => $disable);\n\n foreach ($bl_addr as $address) {\n if (!empty($address)) {\n $recipe = new Ingo_Script_Procmail_Recipe($params, $this->_params);\n $recipe->addCondition(array('field' => 'From', 'value' => $address, 'match' => 'address'));\n $this->_addItem(Ingo::RULE_BLACKLIST, $recipe);\n }\n }\n }\n }",
"function __block_caps( $caps, $cap )\n\t{\n\t if ( $cap === 'install_themes' )\n\t $caps[] = 'do_not_allow';\n\t return $caps;\n\t}",
"protected function matchHideForNonAdminsCondition() {}",
"public function isNotUsing();",
"function findRule( $link ) {\n global $blacklistregexarray, $globalblacklistregexarray;\n $regexStart = '/(?:https?:)?\\/\\/+[a-z0-9_\\-.]*(';\n $regexEnd = ')'.getRegexEnd( 0 );\n $lines = stripLines( $blacklistregexarray );\n foreach( $lines as $id=>$line ) {\n if( preg_match( $regexStart . str_replace( '/', '\\/', preg_replace('|\\\\\\*/|u', '/', $line) ) . $regexEnd, $link ) ) return array( 'blacklist'=>'local', 'rule'=>str_replace( '|', '|', $line ) );\n }\n $lines = stripLines( $globalblacklistregexarray );\n foreach( $lines as $id=>$line ) {\n if( preg_match( $regexStart . str_replace( '/', '\\/', preg_replace('|\\\\\\*/|u', '/', $line) ) . $regexEnd, $link ) ) return array( 'blacklist'=>'global', 'rule'=>str_replace( '|', '|', $line ) );\n }\n return false;\n}",
"function is_banned()\n\t{\n\t\treturn $this->_banned;\n\t}",
"function phishtank_check_add( $false, $url ) {\n $url = yourls_sanitize_url( $url );\n\n // only check for 'http(s)'\n if( !in_array( yourls_get_protocol( $url ), array( 'http://', 'https://' ) ) )\n return $false;\n \n // is the url malformed?\n if ( phishtank_is_blacklisted( $url ) === yourls_apply_filter( 'phishtank_malformed', 'malformed' ) ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:nourl',\n\t\t\t'message' => yourls__( 'Missing or malformed URL' ),\n\t\t\t'errorCode' => '400',\n\t\t);\n }\n\t\n // is the url blacklisted?\n if ( phishtank_is_blacklisted( $url ) != false ) {\n\t\treturn array(\n\t\t\t'status' => 'fail',\n\t\t\t'code' => 'error:spam',\n\t\t\t'message' => 'Ce domaine est sur liste noire',\n\t\t\t'errorCode' => '403',\n\t\t);\n }\n\t\n\t// All clear, not interrupting the normal flow of events\n\treturn $false;\n}",
"private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }",
"function isUploadBannedItem($file_name) {\n // 파일 업로드 금지\n $ban_list = array('php', 'html', 'css', 'js'); // 금지 파일 확장자 수정 필요!!\n $exp_file_name = explode('.', $file_name);\n\n // 확장자 소문자로 가져오기\n $ext = strtolower($exp_file_name[sizeof($exp_file_name) - 1]);\n if (in_array($ext, $ban_list)) {\n return false;\n }\n return true;\n}",
"function is_disallowed_status($parameters)\n\t{\n\t\trequire_once(SQL_LIB_DIR . \"fetch_status_map.func.php\");\n\t\t\n\t\t$application_id = $parameters->application_id;\n\t\t\n\t\t$status_map = Fetch_Status_Map();\n\t\t$disallowed_statuses = array();\n\t\n\t\t$disallowed_statuses[] = Search_Status_Map('sent::external_collections::*root',$status_map);\n\t\t$disallowed_statuses[] = Search_Status_Map('pending::external_collections::*root',$status_map);\n\t\t$disallowed_statuses[] = Search_Status_Map('chargeoff::collections::customer::*root',$status_map);\n\t\n\t\t$db = ECash_Config::getMasterDbConnection();\n\t\n\t\t$query = \"\n\t\t\tSELECT application_status_id, is_watched\n\t\t\tFROM application\n\t\t\tWHERE application_id = {$db->quote($application_id)} \";\n\t\n\t\t$st = $db->query($query);\n\t\t$row = $st->fetch(PDO::FETCH_OBJ);\n\t\n\t\tif ((in_array($row->application_status_id, $disallowed_statuses)) || $row->is_watched == 'yes') \n\t\t{\n\t\t\t$this->Log(\"This application is in a disallowed status, no returns processing will happen\");\n\t\t\treturn true;\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function plugin_statssummary_bad_behavior2 ()\n{\n global $LANG_BAD_BEHAVIOR;\n\n if (SEC_inGroup ('Bad Behavior2 Admin') && function_exists('bb2_insert_head')) {\n $blocked_ips = BB_countBlockedIPs ();\n\n return array ($LANG_BAD_BEHAVIOR['blocked_ips'],\n COM_numberFormat ($blocked_ips));\n } else {\n return false;\n }\n}",
"public function ban();",
"function addEmailRuleToBlacklist($rule) {\n // Check if the rule is valid\n if (!preg_match('~^\\*?([^@]+@?[^@]*|[^@]*@?[^@]+)\\*?$~i', $rule)) {\n return FALSE;\n }\n return $this->addRuleToBlacklist('email', $rule);\n }",
"final protected function policy__skip_if_denied($arg, & $conf)\n\t{\n\t\tforeach ((array) $arg as $id) {\n\t\t\t$m = @ $conf['block:'.$id]['.block'];\t// FIXME\n\t\t\tif ($m !== null && !$this->authIsBlockAllowed($m)) {\n\t\t\t\tdebug_msg('Skipping block \"%s\" (%s).', $id, $m);\n\t\t\t\tunset($conf['block:'.$id]);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"function candelbl($uid,$bid)\n{\n $minfo = mysql_fetch_array(mysql_query(\"SELECT bowner FROM ibwf_blogs WHERE id='\".$bid.\"'\"));\n if(ismod($uid))\n {\n return true;\n }\n if($minfo[0]==$uid)\n {\n return true;\n }\n \n return false;\n}",
"final protected function policy__dummy_if_denied($arg, & $conf)\n\t{\n\t\tforeach ((array) $arg as $id) {\n\t\t\t$m = @ $conf['block:'.$id]['.block'];\t// FIXME\n\t\t\tif ($m !== null && !$this->authIsBlockAllowed($m)) {\n\t\t\t\tdebug_msg('Replacing block \"%s\" (%s) with dummy.', $id, $m);\n\t\t\t\t$conf['block:'.$id]['.block'] = 'core/dummy';\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function weixinblacklistAction()\n\t{\n\t\t//检查当日没来的,进入黑名单\n\t\t$model=M(\"AppointHistory\");\n\t\t$yesterday=date('Y-m-d H:i:s',strtotime(\"-2 hour\"));\n\t\t$values = $model->field(\"a.*,b.start as starttime\")->table(array(\"yoga_appoint_history\"=>\"a\",\"yoga_club_schedule\"=>\"b\"))->where(\"a.is_check=0 and a.come=0 and a.schedule_id=b.id and b.start<='{$yesterday}'\")->select();\n\t\t$month = date('Y-m'); \n\t\tforeach ($values as $key => $value) { \n\t\t\t\t$model->where(\"id=\".$value['id'])->setField(\"is_check\",1); \n\t\t\t$starttime = $value['starttime'];\n\t\t\t$starttime = substr($starttime,0,10);\n\t\t\t$ct=M(\"CheckHistory\")->where(array(\"member_id\"=>$value['member_id'],\"create_time\"=>array(\"like\",$starttime.\"%\")))->count();\n\t\t\tif($ct>0)\n\t\t\t{\n\t\t\t\tM(\"AppointHistory\")->where(\"id=\".$value['id'])->setField(\"come\",1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//本月爽约历史记录次数次数\n\t\t\t//$history=M(\"AppointBlackList\")->where(array(\"member_id\"=>$value['member_id'],\"create_time\"=>array(\"gt\",$month)))->count();\n\t\t\t$count = $model-> where(array(\"create_time\"=>array(\"gt\",$month),\"come\"=>0,\"member_id\"=>$value['member_id']))->count(); \n\t\t if($count==0){ continue; } \n//爽约原因\n $schedule_id = $value['schedule_id'];\n $schedule = D(\"ClubSchedule\")->find($schedule_id);\n if(!empty($schedule)){\n $class = M(\"PtClassPublic\")->find($schedule['class_id']);\n $reason = \"缺席\".$schedule['start'].\"的\".$class['name'];}\n else\n $reason=\"缺席\";\n\t\t\tif($count==1)\n\t\t\t{\n\t\t\t\t$end_time = date('Y-m-d H:i:s',strtotime(\"+4 day\"));\n\t\t\t\t//4天\n\t\t\t\tM(\"AppointBlackList\")->data(array(\"reason\"=>$reason,\"member_id\"=>$value['member_id'],\"history_id\"=>$value['id'],\"create_time\"=>getDbTime(),\"start_time\"=>getDbTime(),\"end_time\"=>$end_time ))->add();\n\t\t\t}\n\t\t\telse if($count==2)\n\t\t\t{\n\t\t\t\t//2周\n\n\t\t\t\t$end_time = date('Y-m-d H:i:s',strtotime(\"+2 week\"));\n\t\t\t\t//4天\n\t\t\t\tM(\"AppointBlackList\")->data(array(\"reason\"=>$reason,\"member_id\"=>$value['member_id'],\"history_id\"=>$value['id'],\"create_time\"=>getDbTime(),\"start_time\"=>getDbTime(),\"end_time\"=>$end_time ))->add();\n\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//本月\n\t\t\t\t$end_time =date('Y-m-d H:i:s', strtotime(date('Y-m-01') . ' +1 month -1 day'));\n\t\t\t\t//4天\n\t\t\t\tM(\"AppointBlackList\")->data(array(\"reason\"=>$reason,\"member_id\"=>$value['member_id'],\"history_id\"=>$value['id'],\"create_time\"=>getDbTime(),\"start_time\"=>getDbTime(),\"end_time\"=>$end_time ))->add();\n\t\n\t\t\t}\n\t\t\t \n\t\t}\n\t}",
"function is_validwhitelistname($name) {\n\tif (!is_string($name))\n\t\treturn false;\n\n\tif (!preg_match(\"/[^a-zA-Z0-9\\_\\.\\/]/\", $name))\n\t\treturn true;\n\n\treturn false;\n}",
"private function isPasswordBlacklisted($password)\n {\n $handle = fopen(\"./Resources/password-blacklist.txt\", \"r\");\n\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n\n if (trim($line) == trim($password)) {\n return true;\n }\n }\n\n fclose($handle);\n } else {\n // error opening the file.\n }\n return false;\n }",
"public function clientIsBlacklisted($ip)\n {\n foreach ($this->ipBlacklist as $pattern)\n if (preg_match($pattern, $ip) === 1)\n return true;\n return false;\n }",
"public function isIgnored(): bool;",
"function checkCIDRBlacklist($ip)\n{\n $us_backlist = array(\n //'23','24','50','63','64','65','66','67','68','69','70','71','72','73','74','75','76','96','97',\n //'98','99','100','104','107','108','142','162','163','172','173','174','184','192','198','199','204','205','206','207','208','209','216'\n );\n $cidr = substr($ip, 0, strpos($ip, '.')); // xxx\n if(!empty($us_backlist) && in_array($cidr, $us_backlist))\n return true;\n\n $blacklist = array(\n //'27.67',\n //'27.74',\n //'171.253',\n //'171.249',\n //'59.153',\n //'113.185',\n //'113.161',\n //'115.84',\n //'115.73',\n //'117.0',\n //'117.1',\n //'117.2',\n //'117.3',\n //'117.4',\n //'117.5',\n //'125.212',\n //'123.31',\n //'123.24',\n //'101.99',\n //'58.187', // FPT\n //'183.80', // FPT\n //'183.81', // FPT\n //'42.112', // FPT\n //'42.117', // FPT\n //'1.52', // FPT\n //'1.53', // FPT\n );\n //$cidr = substr($ip, 0, strrpos($ip, '.')); // xxx.xxx.xxx\n $cidr = substr($ip, 0, strpos($ip, '.', strpos($ip, '.') + 1)); // xxx.xxx\n if(!empty($blacklist) && in_array($cidr, $blacklist))\n return true;\n else\n return false;\n}",
"function readBlacklist(){\n\t\t$dirs=array();\n\t\t// Blacklist laden und abarbeiten\n\t\t$blacklist_file\t=\t$this->config[\"blacklist\"];\n\t\t\n\t\t$blacklist_fh\t=\tfopen($blacklist_file, \"r\");\n\t\tif (! $blacklist_fh) {\n\t \tthrow new Exception(\"Could not open the file!\".$blacklist_file);\n\t }\n\t\t\n\t\twhile ($zeile = fgets($blacklist_fh, 4096))\n\t\t\t{\n\t\t\t\t$dirs[]=trim($zeile);\n\t\t\t}\n\t\tfclose ($blacklist_fh);\n\t\treturn $dirs;\n\t}",
"function block_web_extension($str)\n\t{\n\t\treturn ( ! preg_match(\"/(https?:\\/\\/)([\\w*-]+)\\.([\\w*.-]*)([\\w*]{2,3})(.+)(\\.(as[ap]?x?|php|[ps]?html?|cgi|jsp|cfm|pl|pm)\\b|\\/\\B)/\", $str)) ? FALSE : TRUE;\n\t}",
"public function getDisabledTags()\n\t{\n\t\t$disabled = array();\n\t\t$coreTags = array( \"font\", \"size\", \"img\", \"url\", \"code\", \"quote\", \"color\" );\n\t\t$bbcodeCache = $this->cache->getCache('bbcode');\n\n\t\tforeach( $coreTags as $tag )\n\t\t{\n\t\t\tif ( !in_array( $tag, array_keys( $bbcodeCache ) ) )\n\t\t\t{\n\t\t\t\t$disabled[] = $tag;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach( $bbcodeCache as $bbcode )\n\t\t{\n\t\t\t/* Allowed this BBCode? */\n\t\t\tif ( $bbcode['bbcode_sections'] != 'all' || $bbcode['bbcode_groups'] != 'all' )\n\t\t\t{\n\t\t\t\t$sections\t= explode( ',', $bbcode['bbcode_sections'] );\n\t\t\t\t$groups = array_diff( explode( ',', $bbcode['bbcode_groups'] ), array( '' ) );\n\t\t\t\t$mygroups = array( self::$Perms['memberData']['member_group_id'] );\n\t\t\t\t$group_pass = false;\n\t\t\t\t$section_pass = false;\n\t\t\t\t\n\t\t\t\tif ( self::$Perms['memberData']['mgroup_others'] )\n\t\t\t\t{\n\t\t\t\t\t$mygroups = array_diff( array_merge( $mygroups, explode( ',', IPSText::cleanPermString( self::$Perms['memberData']['mgroup_others'] ) ) ), array( '' ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Perms */\n\t\t\t\tif ( $bbcode['bbcode_groups'] != 'all' )\n\t\t\t\t{\n\t\t\t\t\tforeach( $groups as $g_id )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( in_array( $g_id, $mygroups ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$group_pass = true;\n\t\t\t\t\t\t}\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$group_pass = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Sections */\n\t\t\t\tif ( $bbcode['bbcode_sections'] != 'all' )\n\t\t\t\t{\n\t\t\t\t\tforeach( $sections as $section )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $section == self::$Perms['parseArea'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$section_pass = true;\n\t\t\t\t\t\t}\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$section_pass = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $section_pass == false || $group_pass == false )\n\t\t\t\t{\n\t\t\t\t\t$disabled[] = $bbcode['bbcode_tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $disabled;\n\t}",
"function wac_allowed_bids(){\n\t$allowed = wac_setting_field('allowed_bids');\n\treturn (empty($allowed) || $allowed <= 0)? 0 : $allowed;\n}",
"public function hasIgnoredefense(){\r\n return $this->_has(31);\r\n }",
"function addPasswordRuleToBlacklist($rule) {\n // Check if the rule is valid\n if (!preg_match('~^\\*?.+\\*?$~i', $rule)) {\n return FALSE;\n }\n return $this->addRuleToBlacklist('password', $rule);\n }"
] | [
"0.7139865",
"0.6805139",
"0.6573389",
"0.65502185",
"0.6545179",
"0.6500885",
"0.6425092",
"0.63882595",
"0.63882595",
"0.6360267",
"0.6332957",
"0.6316103",
"0.62741876",
"0.62554574",
"0.6253907",
"0.6222276",
"0.61966157",
"0.61934495",
"0.61579347",
"0.6139677",
"0.60964626",
"0.60837084",
"0.6079761",
"0.6064478",
"0.6056543",
"0.60222876",
"0.5987893",
"0.5922114",
"0.5919266",
"0.5900159",
"0.5863562",
"0.5860602",
"0.5859763",
"0.5848022",
"0.584532",
"0.5826018",
"0.58091414",
"0.57904375",
"0.5773344",
"0.5770239",
"0.5770232",
"0.57396805",
"0.57000947",
"0.569054",
"0.5686121",
"0.5675663",
"0.5647604",
"0.5644621",
"0.56410146",
"0.5599948",
"0.55926675",
"0.5590011",
"0.55767816",
"0.5572329",
"0.5564622",
"0.55593044",
"0.554934",
"0.55400574",
"0.5523802",
"0.5521183",
"0.5518089",
"0.5496094",
"0.5492976",
"0.5491446",
"0.5467218",
"0.5449967",
"0.5430713",
"0.5421858",
"0.5420497",
"0.54183453",
"0.5403694",
"0.5386378",
"0.5370295",
"0.53594494",
"0.5355068",
"0.53457195",
"0.5334515",
"0.5327687",
"0.5326932",
"0.5325906",
"0.53233075",
"0.5307708",
"0.5305769",
"0.5301366",
"0.52979875",
"0.52927655",
"0.5280784",
"0.5271794",
"0.52672905",
"0.5257927",
"0.5255369",
"0.52405775",
"0.5236465",
"0.5232248",
"0.52315",
"0.52250004",
"0.5220527",
"0.52181464",
"0.521423",
"0.52111447",
"0.51760054"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$pages = Page::with(['parent', 'children', 'tags', 'images'])
->paginate(25);
return view($this->view . 'index', compact('pages'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.6830523",
"0.6802689",
"0.6797",
"0.67957735",
"0.67871135",
"0.6760129",
"0.67427456",
"0.6730486",
"0.67272323",
"0.67255723",
"0.67255723",
"0.67255723",
"0.67177945",
"0.6707866",
"0.6706713",
"0.6704375",
"0.6664782",
"0.6662871",
"0.6660302",
"0.6659404",
"0.6656656",
"0.6653517",
"0.6647965",
"0.6620322",
"0.66185474",
"0.6618499",
"0.6606105",
"0.6600617",
"0.65996987",
"0.6594775",
"0.6587389",
"0.6585109",
"0.6581641",
"0.6581017",
"0.6577157",
"0.65747666",
"0.6572513",
"0.65721947",
"0.6570553",
"0.65646994",
"0.6563556",
"0.6554194",
"0.65529937",
"0.65460825",
"0.65368485",
"0.653429",
"0.65328294",
"0.6526759",
"0.6526695",
"0.6526284",
"0.65191334",
"0.65183175",
"0.65174305",
"0.651703",
"0.65141153",
"0.6507088",
"0.65061647",
"0.6504046",
"0.64942145",
"0.6491893",
"0.64883405",
"0.6486392",
"0.6485077",
"0.64846045",
"0.6478858",
"0.64756656",
"0.64726377",
"0.6471126",
"0.64701074",
"0.6467418",
"0.6462195",
"0.64618355",
"0.6459199",
"0.6457831",
"0.6454631",
"0.64533997",
"0.6451915",
"0.6450861",
"0.6449301",
"0.64492667",
"0.64469045"
] | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
$pages = Page::with('children')
->where('status', 1)
->orderBy('id')->pluck('name', 'id');
return view($this->view . 'create', compact('pages'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view('resource.create');\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }",
"public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create()\n {\n return view ('forms.create');\n }",
"public function create ()\n {\n return view('forms.create');\n }",
"public function create()\n\t{\n\t\treturn view('faith.form');\n\t}",
"public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }",
"public function create()\n {\n return view(\"request_form.form\");\n }",
"public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }",
"public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle école'\n\t\t) ) );\n\t}",
"public function create()\n {\n return view($this->forms . '.create');\n }",
"public function create()\n {\n return view('restful.add');\n }",
"public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }",
"public function create()\n {\n return view('admin.createform');\n }",
"public function create()\n {\n return view('admin.forms.create');\n }",
"public function create()\n {\n return view('backend.student.form');\n }",
"public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function create()\n {\n return view('client.form');\n }",
"public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }",
"public function create()\n {\n return view('Form');\n }",
"public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }",
"public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }",
"public function create()\n {\n return view('backend.schoolboard.addform');\n }",
"public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}",
"public function create()\n {\n //\n return view('form');\n }",
"public function create()\n {\n return view('rests.create');\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return view(\"Add\");\n }",
"public function create(){\n return view('form.create');\n }",
"public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create()\n {\n\n return view('control panel.student.add');\n\n }",
"public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }",
"public function create()\n {\n return $this->cView(\"form\");\n }",
"public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }",
"public function create()\n {\n return view(\"dresses.form\");\n }",
"public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }",
"public function create()\n {\n return view('fish.form');\n }",
"public function create()\n {\n return view('users.forms.create');\n }",
"public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}",
"public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }",
"public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }",
"public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }",
"public function create()\n {\n return view('essentials::create');\n }",
"public function create()\n {\n return view('student.add');\n }",
"public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}",
"public function create()\n {\n return view('url.form');\n }",
"public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }",
"public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}",
"public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view('crud/add'); }",
"public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}",
"public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view(\"List.form\");\n }",
"public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}",
"public function create()\n {\n //load create form\n return view('products.create');\n }",
"public function create()\n {\n return view('article.addform');\n }",
"public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }",
"public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}",
"public function create()\n {\n return view('saldo.form');\n }",
"public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}",
"public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }",
"public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }",
"public function create()\n {\n return view('admin.inverty.add');\n }",
"public function create()\n {\n return view('Libro.create');\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n return view(\"familiasPrograma.create\");\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}",
"public function create()\n {\n return view(\"create\");\n }",
"public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}",
"public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view('forming');\n }",
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }",
"public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }",
"public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }",
"public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }",
"public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"public function create()\n {\n return view('student::students.student.create');\n }",
"public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}"
] | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.7174283",
"0.7150356",
"0.71444064",
"0.71442676",
"0.713498",
"0.71283126",
"0.7123691",
"0.71158516",
"0.71158516",
"0.71158516",
"0.7112176",
"0.7094388",
"0.7085711",
"0.708025",
"0.70800644",
"0.70571953",
"0.70571953",
"0.70556754",
"0.70396435",
"0.7039549",
"0.7036275",
"0.703468",
"0.70305896",
"0.7027638",
"0.70265305",
"0.70199823",
"0.7018007",
"0.7004984",
"0.7003889",
"0.7000935",
"0.69973785",
"0.6994679",
"0.6993764",
"0.6989918",
"0.6986989",
"0.6966502",
"0.69656384",
"0.69564354",
"0.69518244",
"0.6951109",
"0.6947306",
"0.69444615",
"0.69423944",
"0.6941156",
"0.6937871",
"0.6937871",
"0.6936686",
"0.69345254",
"0.69318026",
"0.692827",
"0.69263744",
"0.69242257",
"0.6918349",
"0.6915889",
"0.6912884",
"0.691146",
"0.69103104",
"0.69085974",
"0.69040126",
"0.69014287",
"0.69012105",
"0.6900397",
"0.68951064",
"0.6893521",
"0.68932164",
"0.6891899",
"0.6891616",
"0.6891616",
"0.6889246",
"0.68880934",
"0.6887128",
"0.6884732",
"0.68822503",
"0.68809193",
"0.6875949",
"0.68739206",
"0.68739134",
"0.6870358",
"0.6869779",
"0.68696856",
"0.686877"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
try {
DB::beginTransaction();
$data = $request->all();
$validator = Validator::make($data, Page::rules(), Page::messages());
if ($validator->fails()) {
return back()->withInput()->withErrors($validator);
}
if (!empty($request->slug)) {
$data['slug'] = str_slug($request->name);
}
if ($request->has('parent_id')) {
$data['parent_id'] = $request->parent_id;
$page = Page::with('parent')->create($data);
} else {
$data['parent_id'] = null;
$page = Page::with('children')->create($data);
}
if ($page) {
if ($request->hasFile('file')) {
$this->uploadImage($request, 'uploads/page/', $page, 'file');
}
if ($request->has('tags')) {
$this->attachTag($page, 'App\Model\Page', $request->tags);
}
}
DB::commit();
return redirect()->route($this->route . 'index')->with('success', 'Page added successfully.');
} catch (ModelNotFoundException $exception) {
DB::rollback();
return back()->with('error', 'Your page can not add to our system right now. Plz try again later.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
] | 0.0 | -1 |
Display the specified resource. | public function show(Page $page)
{
return view($this->view . 'show', compact('page'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
] | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245",
"0.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
] | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit(Page $page)
{
if ($page === null) {
return redirect()->route($this->route . 'index')->with('error', 'We can not find page with that id, please try the other');
}
$pages = Page::with('children')
->where('status', 1)
->orderBy('id')->pluck('name', 'id');
return view($this->view . 'edit', compact('page', 'pages'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }"
] | [
"0.78557473",
"0.76946205",
"0.72731614",
"0.7241571",
"0.71700776",
"0.70650244",
"0.7052897",
"0.698311",
"0.69465625",
"0.6944826",
"0.69399333",
"0.69286525",
"0.69031185",
"0.68969506",
"0.68969506",
"0.6878258",
"0.6862812",
"0.6859171",
"0.68560475",
"0.68436426",
"0.6834711",
"0.6810601",
"0.680613",
"0.6804975",
"0.68015367",
"0.6795471",
"0.6791821",
"0.6791821",
"0.6787303",
"0.6783644",
"0.67790574",
"0.67766285",
"0.6767741",
"0.67610145",
"0.67455536",
"0.67455536",
"0.6744367",
"0.6743159",
"0.6739656",
"0.67351145",
"0.67246765",
"0.67128825",
"0.6692859",
"0.66916454",
"0.6687554",
"0.66875297",
"0.6687494",
"0.6684443",
"0.668203",
"0.66689324",
"0.66680384",
"0.6664605",
"0.6664605",
"0.66621166",
"0.66604865",
"0.66589504",
"0.6655767",
"0.66542184",
"0.665213",
"0.66422516",
"0.6631665",
"0.663077",
"0.6627607",
"0.6627607",
"0.66193914",
"0.6618503",
"0.66160196",
"0.66146857",
"0.6609641",
"0.6608315",
"0.6605284",
"0.6595882",
"0.65947276",
"0.6594626",
"0.65895563",
"0.6589339",
"0.6587281",
"0.65805006",
"0.6579201",
"0.6579166",
"0.657641",
"0.6576111",
"0.65740323",
"0.65692765",
"0.6568046",
"0.6567221",
"0.6565346",
"0.6560687",
"0.6560687",
"0.6560384",
"0.65577257",
"0.65569293",
"0.65558636",
"0.6555392",
"0.65553015",
"0.65542984",
"0.655418",
"0.6554106",
"0.6547678",
"0.65473104",
"0.6543329"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, Page $page)
{
try {
DB::beginTransaction();
$data = $request->all();
if ($page === null) {
return redirect()->route($this->route . 'index')->with('error', 'We can not find page with that id, please try the other');
}
$validator = Validator::make($data, Page::rules($page->id), Page::messages());
if ($validator->fails()) {
return back()->withInput()->withErrors($validator);
}
if ($request->has('tags')) {
Taggable::where('taggable_id', $page->id)
->where('taggable_type', 'App\Model\Page')
->delete();
$this->attachTag($page, 'App\Model\Page', $request->tags);
}
if ($request->hasFile('file')) {
$this->uploadImage($request, 'uploads/page/', $page, 'file');
}
$update = $page->update($data);
if (!$update) {
DB::rollBack();
return back()->with('error', 'Your page can not add to your system right now. Plz try again later.');
}
DB::commit();
return redirect()->route($this->route . 'index')->with('success', 'Page added successfully.');
} catch (ModelNotFoundException $exception) {
return back()->with('error', 'Your page can not add to your system right now. Plz try again later.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
] | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Page $page)
{
$delete = $page->delete();
if (!$delete) {
return back()->with('error', 'Your page can not delete from your system right now. Plz try again later.');
}
return redirect()->route($this->route . 'index')->with('success', 'Page deleted successfully');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }"
] | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
] | 0.0 | -1 |
Configures the options for cleaning | function setOptions($options = array())
{
$default = array(
"RemoveStyles" => true,
"IsWord" => true,
"UseTidy" => true,
"TidyBefore" => false,
"CleaningMethod" => array(
"tags" => "whitelist",
"attributes" => "blacklist"
),
"OutputXHTML" => true,
"FillEmptyTableCells" => true,
"DropEmptyParas" => true,
"Optimize" => true,
"Compress" => false,
"Encoding" => "UTF8"
);
$new = array_merge_recursive($default, (array)$options);
$this->_options = $new;
$this->__setTidyConfig();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _prepareOptions()\n {\n // apply options\n if (isset($this->_deploy['set_time_limit'])) {\n // script needs time to proces huge amount of data (important)\n set_time_limit($this->_deploy['set_time_limit']);\n }\n if (isset($this->_deploy['memory_limit'])) {\n // adjust memory_limit if needed (not very important)\n ini_set('memory_limit', $this->_deploy['memory_limit']);\n }\n }",
"public function remove_options()\n {\n }",
"public static function additionalCleaning() {\n \n }",
"public function cleanup() {\n\t\tforeach ( array(\n\t\t\t'leadin_portal_domain',\n\t\t\t'leadin_portalId',\n\t\t\t'leadin_pluginVersion',\n\t\t\t'hubspot_affiliate_code',\n\t\t\t'hubspot_acquisition_attribution',\n\t\t) as $option_name\n\t\t) {\n\t\t\tif ( get_option( $option_name ) ) {\n\t\t\t\tdelete_option( $option_name );\n\t\t\t}\n\t\t}\n\t}",
"function sanitize_options(array $options)\n {\n }",
"public function set_options_filter() {\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @since 10.0.0\n\t\t *\n\t\t * @return array\n\t\t */\n\t\t$config = apply_filters( 'gu_set_options', [] );\n\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @return null|array\n\t\t */\n\t\t$config = empty( $config ) ? apply_filters_deprecated( 'github_updater_set_options', [ [] ], '6.1.0', 'gu_set_options' ) : $config;\n\n\t\tforeach ( array_keys( self::$git_servers ) as $git ) {\n\t\t\tunset( $config[ \"{$git}_access_token\" ], $config[ \"{$git}_enterprise_token\" ] );\n\t\t}\n\n\t\tif ( ! empty( $config ) ) {\n\t\t\t$config = $this->sanitize( $config );\n\t\t\tself::$options = array_merge( get_site_option( 'git_updater' ), $config );\n\t\t\tupdate_site_option( 'git_updater', self::$options );\n\t\t}\n\t}",
"function driver_clean($option = array());",
"function options_sanitize($options){\r\n // do checks here \r\n //debugbreak(); \r\n if($options['reset'] == 'reset'){\r\n add_settings_error('reset_settings','reset_settings',__('Settings have been reset back to default values',$this->plugin_domain),'updated');\r\n return $this->get_options(true);\r\n }\r\n $options['clickable'] = $options['clickable'] == 'yes' ? 'yes' : 'no'; \r\n $options['dofollow'] = isset($options['dofollow']) ? 'on' : 'off'; \r\n $options['newwindow'] = isset($options['newwindow']) ? 'on' : 'off'; \r\n $options['del_options'] = isset($options['del_options']) ? 'on' : 'off';\r\n $options['del_table'] = isset($options['del_table']) ? 'on' : 'off';\r\n return $options;\r\n }",
"function remove_option_whitelist($del_options, $options = '')\n {\n }",
"protected function configureOptions(): void\n {\n }",
"function clean($options = array()) {\n\t\t$options = array_merge(array(\"prefixes\"=> \"\", \"source\"=>\"\", \"suffixes\"=>\"\", \"modifiers\"=>\"gm\",\"replaceLimit\"=>\"1\"), $options);\n\t\t$this->prefixes = $options['prefixes'];\n\t\t$this->source = $options['source'];\n\t\t$this->suffixes = $options['suffixes'];\n\t\t$this->modifiers = $options['modifiers']; // default to global multiline matching\n\t\t$this->replaceLimit = $options['replaceLimit']; // default to global multiline matching\n\n\t\treturn $this;\n\t}",
"public function clearOptions()\n {\n $this->_options = array();\n }",
"public function resetOptions()\n {\n $this->options = [];\n $this->configure();\n }",
"function sanitize_settings($options)\n\t\t{\n\t\t\t// Setup array of valid options for return\n\t\t\t$valid_options = array();\n\t\t\t\n\t\t\t// Establish defaults\n\t\t\t$option_defaults = array(\n\t\t\t\t'analytics' => '',\n\t\t\t\t'google' => '',\n\t\t\t\t'pinterest' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$option_types = array(\n\t\t\t\t'analytics' => 'html',\n\t\t\t\t'google' => 'text',\n\t\t\t\t'pinterest' => 'text'\n\t\t\t);\n\t\t\t\n\t\t\t// Merge pass options and the defaults\n\t\t\t$options = (array) wp_parse_args($options, $option_defaults);\n\t\t\t\n\t\t\t// Sanitize each value\n\t\t\tforeach ($option_types as $key => $type) {\n\t\t\t\t$valid_options[$key] = $this->sanitize_an_option($options[$key], $type);\n\t\t\t}\n\n\t\t\treturn $valid_options;\n\t\t}",
"protected function initOptions()\n {\n }",
"public function configureOptions();",
"function remove_allowed_options($del_options, $options = '')\n {\n }",
"public function resetOptions()\n {\n $this->options = array();\n }",
"protected function _clean()\n {\n if ($this->_defaultOptions['clean'] === FALSE) {\n return;\n }\n\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'remove unused markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $this->_cleanMarkers('loop');\n $this->_cleanMarkers('optional');\n\n $this->DISPLAY = preg_replace(\n $this->_contentMarkers,\n '',\n $this->DISPLAY\n );\n }",
"protected function removeConfigOptions() {\r\n\t\t$definition = $this->getDefinition();\r\n\r\n\t\t$definition->setOptions(array_diff_key($definition->getOptions(), array('db-configuration' => '', 'configuration' => '')));\r\n\t}",
"public function __construct()\n {\n $this->optionsFile = null;\n }",
"protected function prepareOptions()\n {\n $options = $this->getOptions();\n $input = [];\n\n foreach($options as $option)\n {\n $input[] = $this->option($option[0]);\n }\n\n $larapath = $this->laravel['path'];\n $lastnsdelim = strrpos($input[1], '\\\\');\n\n $this->options[$options[0][0]] = $input[0] ?: substr($input[1], 0, $lastnsdelim);\n $this->options[$options[1][0]] = substr($input[1], $lastnsdelim);\n $this->options[$options[2][0]] = $input[2] ?: ExtStr::tableize($input[1]);\n $this->options[$options[3][0]] = $input[3] ?: $this->options[$options[1][0]].'Closure';\n $this->options[$options[4][0]] = $input[4] ?: ExtStr::tableize($input[1].'Closure');\n $this->options[$options[5][0]] = $input[5] ? $input[5] : $larapath . '/models';\n $this->options[$options[6][0]] = $input[6] ? $input[6] : $larapath . '/database/migrations';\n }",
"public function clean() {}",
"private function delete_all_plugin_options() {\n\t\t// Deletes all options from the options table.\n\t\t$this->options->delete( Activation::OPTION_SHOW_ACTIVATION_NOTICE );\n\t\t$this->options->delete( Activation::OPTION_NEW_SITE_POSTS );\n\t\t$this->options->delete( Credentials::OPTION );\n\t\t$this->options->delete( 'googlesitekit-active-modules' );\n\t\t$this->options->delete( Search_Console::PROPERTY_OPTION );\n\t\t$this->options->delete( AdSense::OPTION );\n\t\t$this->options->delete( Analytics::OPTION );\n\t\t$this->options->delete( 'googlesitekit_analytics_adsense_linked' );\n\t\t$this->options->delete( PageSpeed_Insights::OPTION );\n\t\t$this->options->delete( Optimize::OPTION );\n\t\t$this->options->delete( Tag_Manager::OPTION );\n\t\t$this->options->delete( First_Admin::OPTION );\n\t\t$this->options->delete( OAuth_Client::OPTION_PROXY_NONCE );\n\t\t$this->options->delete( Beta_Migration::OPTION_IS_PRE_PROXY_INSTALL );\n\n\t\t// Clean up old site verification data, moved to user options.\n\t\t// Also clean up other old unused options.\n\t\t// @todo remove after RC.\n\t\t$this->options->delete( Verification::OPTION );\n\t\t$this->options->delete( Verification_Tag::OPTION );\n\t\t$this->options->delete( 'googlesitekit_api_key' );\n\t\t$this->options->delete( 'googlesitekit_available_modules' );\n\t\t$this->options->delete( 'googlesitekit_secret_token' );\n\t\t$this->options->delete( 'googlesitekit_project_id' );\n\t\t$this->options->delete( 'googlesitekit_gcp_project' );\n\t}",
"function cleanup($html, $options = null) \n { \n if(isset($options) && is_array($options)){ \n $this->setOptions($options); \n } \n $this->_html = \"{$html}\"; \n\n if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n\n // Remove escape slashes \n $this->_html = stripslashes($this -> _html); \n\n if($this->_options['CleaningMethod']['tags'] == \"whitelist\"){ \n // Trim everything before body tag, leaving possible body attributes \n if(preg_match(\"/<body/i\", \"{$this -> _html}\")){ \n $this -> html = stristr($this -> _html, \"<body\"); \n } \n\n // strip tags, still leaving attributes, second variable is allowed tags \n $this->_html = strip_tags($this->_html, $this->_tag_whitelist); \n } \n\n if($this->_options['RemoveStyles']){ \n // Remove class and style attributes \n $this->removeBlacklistedAttributes(\"class|style\"); \n } \n\n if($this->_options['IsWord']){ \n $this->removeBlacklistedAttributes(\"lang|[ovwxp]:\\w+\"); \n } \n\n if($this->_options['CleaningMethod']['attributes'] == \"blacklist\"){ \n if(!empty ($this->_attrib_blacklist)){ \n $this->removeBlacklistedAttributes($this->_attrib_blacklist); \n } \n } \n\n if($this->_options['Optimize']){ \n $repl = 1; \n while($repl){ \n $repl = 0; \n foreach($this->_cleanup_tags as $tag){ \n // Strip empty inline tags \n $this -> _html = preg_replace(\"/<($tag)[^>]*>[\\s]*([( )]*)[\\s]*<\\/($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n\n // Merge inline tags \n $this -> _html = preg_replace(\"/<\\/($tag)[^>]*>[\\s]*([( )]*)[\\s]*<($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n } \n } \n\n // Drop empty paragraph tags \n if($this->_options['DropEmptyParas']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[( )]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n // Trim extra spaces only if tidy is not set to indent \n if(!$this->_tidy_config['indent']){ \n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/i',\"\\\\1 \\\\2\", $this -> _html); \n\n // Trim extra spaces before tags \n $this -> _html = preg_replace('/[\\n|\\r|\\r\\n|][\\n|\\r|\\r\\n|]+</i',\"<\", $this -> _html); \n } \n } \n\n if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[( )]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n if($this->_options['FillEmptyTableCells']) { \n $this -> _html = preg_replace(\"/<td([^>]*)>[\\s]*<\\/td>/i\", \"<td\\\\1> </td>\", $this -> _html); \n } \n\n if($this->_options['Compress']){ \n // Trim spaces after tags \n $this -> _html = preg_replace('/>[\\s]+/',\">\", $this -> _html); \n\n // Trim spaces before end tags \n $this -> _html = preg_replace('/[\\s]+<\\//',\"</\", $this -> _html); \n\n // Trim spaces before tags \n $this -> _html = preg_replace('/[\\s]+</',\"<\", $this -> _html); \n\n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/',\"\\\\1 \\\\2\", $this -> _html); \n } \n\n if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n return $this->output(\"{$this->_html}\"); \n }",
"public function options() {}",
"private function set_start_options(): void {\n $files = has_filter(static::FILES_FILTER)\n ? apply_filters(static::FILES_FILTER, $this->files)\n : $this->resolve_additional_files($this->files);\n $urls = has_filter(static::URLS_FILTER)\n ? apply_filters(static::URLS_FILTER, $this->urls)\n : $this->enrich_additional_urls($this->urls);\n\n Simply_Static\\Options::instance()\n ->set('archive_status_messages', [])\n ->set('additional_files', Utils::array_to_option_string($files))\n ->set('additional_urls', Utils::array_to_option_string($urls))\n ->set('archive_start_time', Simply_Static\\Util::formatted_datetime())\n ->set('archive_end_time', '')\n ->save();\n }",
"function resetOptions()\n {\n $this->options = $this->_defaultOptions;\n }",
"protected function setOptions() {\n\t\t$this->_options->setHelpText(\"This tool provides a mechanism to run recurring workflow tasks.\");\n\n\t\t$text = \"This option triggers the execution of all known workflows.\\n\";\n\t\t$text.= \"You may filter the execution using option '--workflow'.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_RUN, array('--run', '-r'), Option::TYPE_NO_VALUE, $text, 'value'));\n\n\t\t$text = \"This options provides a way to filter a specific workflow.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_WORKFLOW, array('--workflow', '-w'), Option::TYPE_VALUE, $text, 'value'));\n\t}",
"public function clean();",
"public function clean();",
"public function clean();",
"public function clean();",
"public function clean();",
"public function __construct()\n {\n $this->options = [];\n }",
"public function tear_down() {\n\t\tforeach ( static::$original_options as $option => $original_value ) {\n\t\t\tupdate_option( $option, $original_value );\n\t\t}\n\n\t\tparent::tear_down();\n\t}",
"private function set_options()\n\t{\n\t\t$this->dompdf->set_paper(array(0, 0, 325.98, 646.299), 'landscape');\n\t\t$this->dompdf->set_option('isHtml5ParserEnabled', true);\n\t\t$this->dompdf->set_option('isRemoteEnabled', true);\n\t\t$this->dompdf->set_option('chroot', __DIR__ . '/templates');\n\t}",
"function clean_option_values( $config ){\r\n\t\t$core_inputs = array( 'select', 'multiselect' );\r\n\t\tif( ! isset( $config['options'] ) || ! is_array( $config['options'] ) || ! in_array( $config['type'], $core_inputs ) ) return $config;\r\n\r\n\t\t$tmp_options = array();\r\n\r\n\t\tforeach( $config['options'] as $value => $label ){\r\n\t\t\t$value = str_replace( '*', '', $value, $replace_default );\r\n\t\t\t$value = str_replace( '~', '', $value, $replace_disabled );\r\n\r\n\t\t\t$tmp_options[ $value ] = $label;\r\n\t\t}\r\n\r\n\t\t$config['options'] = $tmp_options;\r\n\r\n\t\treturn $config;\r\n\t}",
"protected abstract function prepareConstructOption($options);",
"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}",
"private function initOptions()\n {\n $this->optionsResolver->setDefaults([\n 'collection' => [],\n ]);\n\n $this->optionsResolver->setAllowedTypes('collection', 'array');\n }",
"public function clean() {\n\t\t\n\t}",
"protected function configure() {\n $this\n ->setName('mesd:jasper:delete-broken-records')\n ->setDescription('Removes any history record that points to a report that is no longer in the report store')\n ->addOption('dry-run', 'd', InputOption::VALUE_NONE, 'Dont make any database changes, just display the records that will be deleted')\n ;\n }",
"function init() {\r\n $options = get_option('e_tools');\r\n if ($options['enforce_length']) {\r\n add_filter('wp_trim_excerpt', __NAMESPACE__.'\\filter_trim_excerpt', 11, 2);\r\n add_filter('option_relevanssi_excerpt_length', __NAMESPACE__.'\\option_relevanssi_excerpt_length', 99);\r\n }\r\n}",
"public function __destruct()\n {\n unset($this->options);\n }",
"function wpex_customizer_options_sanitize( $options ) {\n\t\tif ( $options ) {\n\t\t\t// Delete options if import set to -1\n\t\t\tif ( '-1' == $options['reset'] ) {\n\t\t\t\t// Get menu locations\n\t\t\t\t$locations = get_theme_mod( 'nav_menu_locations' );\n\t\t\t\t$save_menus = array();\n\t\t\t\tforeach( $locations as $key => $val ) {\n\t\t\t\t\t$save_menus[$key] = $val;\n\t\t\t\t}\n\t\t\t\t// Remove all mods\n\t\t\t\tremove_theme_mods();\n\t\t\t\t// Re-add the menus\n\t\t\t\tset_theme_mod( 'nav_menu_locations', array_map( 'absint', $save_menus ) );\n\t\t\t\t// Error messages\n\t\t\t\t$error_msg = __( 'All theme customizer settings have been reset.', 'wpex-zero' );\n\t\t\t\t$error_type = 'updated';\n\t\t\t}\n\t\t\t// Set theme mods based on json data\n\t\t\telseif( ! empty( $options['import'] ) ) {\n\t\t\t\t// Decode input data\n\t\t\t\t$theme_mods = json_decode( $options['import'], true );\n\t\t\t\t// Validate json file then set new theme options\n\t\t\t\tif ( '0' == json_last_error() ) {\n\t\t\t\t\tforeach ( $theme_mods as $theme_mod => $value ) {\n\t\t\t\t\t\tset_theme_mod( $theme_mod, $value );\n\t\t\t\t\t}\n\t\t\t\t\t$error_msg = __( 'Theme customizer settings imported successfully.', 'wpex-zero' );\n\t\t\t\t\t$error_type = 'updated';\n\t\t\t\t}\n\t\t\t\t// Display invalid json data error\n\t\t\t\telse {\n\t\t\t\t\t$error_msg = __( 'Invalid Import Data.', 'wpex-zero' );\n\t\t\t\t\t$error_type = 'error';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// No json data entered\n\t\t\telse {\n\t\t\t\t$error_msg = __( 'No import data found.', 'wpex-zero' );\n\t\t\t\t$error_type = 'error';\n\t\t\t}\n\t\t\t// Make sure the settings data is reset! \n\t\t\t$options = array(\n\t\t\t\t'import'\t=> '',\n\t\t\t\t'reset'\t\t=> '',\n\t\t\t);\n\t\t}\n\t\t// Display message\n\t\tadd_settings_error(\n\t\t\t'wpex-customizer-notices',\n\t\t\tesc_attr( 'settings_updated' ),\n\t\t\t$error_msg,\n\t\t\t$error_type\n\t\t);\n\n\t\t// Return options\n\t\treturn $options;\n\t}",
"function realanswers_uninstall_options() {\r\n delete_option('real_apikey');\r\n delete_option('real_max_results');\r\n delete_option('real_custom_css');\r\n delete_option('real_captcha_public');\r\n delete_option('real_captcha_private');\r\n delete_option('real_location_count');\r\n delete_option('real_location_value');\r\n}",
"protected function applyCommandOptions()\n {\n if ($filter = $this->option('filter')) {\n $this->import->setLdapRawFilter($filter);\n }\n\n if ($attributes = $this->option('attributes')) {\n $this->import->setLdapRequestAttributes(explode(',', $attributes));\n }\n\n if ($this->isRestoring()) {\n $this->import->restoreEnabledUsers();\n }\n\n if ($this->isDeleting()) {\n $this->import->trashDisabledUsers();\n }\n\n if ($this->isDeletingMissing()) {\n $this->import->enableSoftDeletes();\n }\n }",
"public static function clean()\n\t{\n\t}",
"protected function setDefaultOptions()\n {\n $this->unsigned = false;\n }",
"protected function configure()\n {\n $this->internalInliner->setCleanup($this->options['cleanup']);\n\n $this->internalInliner->setUseInlineStylesBlock(\n $this->options['use_inline_styles_block']\n );\n $this->internalInliner->setStripOriginalStyleTags(\n $this->options['strip_original_tags']\n );\n $this->internalInliner->setExcludeMediaQueries(\n $this->options['exclude_media_queries']\n );\n }",
"private function set_end_options(): void {\n Simply_Static\\Options::instance()\n ->set('additional_files', Utils::array_to_option_string($this->files))\n ->set('additional_urls', Utils::array_to_option_string($this->urls))\n ->set('archive_end_time', Simply_Static\\Util::formatted_datetime())\n ->save();\n }",
"public function clean()\n {\n // Set to default values\n $this->sSql = '';\n $this->aValues = [];\n }",
"protected function adjustOptionsValues()\n {\n $this->init();\n $this->create();\n }",
"protected function defineCommandOptions(){}",
"private function configureDaemonDefinition(): void\n {\n $this->addOption('run-once', null, InputOption::VALUE_NONE, 'Run the command just once.');\n $this->addOption('run-max', null, InputOption::VALUE_OPTIONAL, 'Run the command x time.');\n $this->addOption('memory-max', null, InputOption::VALUE_OPTIONAL, 'Gracefully stop running command when given memory volume, in bytes, is reached.', 0);\n $this->addOption('shutdown-on-exception', null, InputOption::VALUE_NONE, 'Ask for shutdown if an exception is thrown.');\n $this->addOption('show-exceptions', null, InputOption::VALUE_NONE, 'Display exception on command output.');\n }",
"protected function createCommandLineOptions() {\n\t\ttry {\n\t\t\t$this->commandLineOptions = t3lib_div::makeInstance('tx_mnogosearch_clioptions');\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\techo $e->getMessage() . chr(10);\n\t\t\t$this->showUsageAndExit();\n\t\t}\n\t}",
"protected function get_options()\n\t{}",
"protected function setUp()\n {\n// $this->validOptions = array(\n// 'checksum' => true,\n// 'delete'\n// );\n }",
"public static function sanitize_options( $options ) {\r\n\t\t\r\n\t\t// start fresh\r\n\t\t$clean_options = array();\r\n $error = false;\r\n\r\n foreach($options as $k => $option){\r\n if(!empty($option)){\r\n $clean_options[$k] = sanitize_text_field(trim($option));\r\n }else{\r\n $error = true;\r\n add_settings_error( $k, $k.'-error', __( 'Fields can not be empty', 'inf-member' ) );\r\n }\r\n }\r\n\r\n if(!$error)\r\n\t\t return $clean_options;\r\n else\r\n return array();\r\n\t}",
"function convertizer_remove() {\ndelete_option('convertizer_data');\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 }",
"public function clean()\n\t{\n\t}",
"public function setMinifierOptions(array $options);",
"protected static function _cleanUp(): void {\n\t\tCoreLog::drop('custom');\n\n\t\tCoreLog::setConfig('debug', static::$_debugConfig);\n\t}",
"protected function _setOptions()\r\n {\r\n $this->addValidator('Extension',false, array('jpeg', 'jpg', 'png', 'case' => FALSE));\r\n \r\n $this->addValidator('MimeType', false, \r\n array('application/octet-stream', \r\n 'image/jpeg', 'image/png', 'headerCheck'=>TRUE));\r\n \r\n }",
"protected function configure()\n {\n $this\n ->addOption('site', null, InputOption::VALUE_REQUIRED, 'Site ID')\n ->addOption('process', null, InputOption::VALUE_REQUIRED, 'Process ID', uniqid())\n ;\n }",
"function wcnc2015_options_check() {\n\tif ( ! get_option( 'my-options-data' ) ) {\n\t\t$options_defaults['extra_tagline'] \t= '';\n\t\t$options_defaults['footer_text']\t= '';\n\n\t\tupdate_option( 'my-options-data', $options_defaults );\n\t}\n}",
"function initialize_options()\n\t\t{\n\t\t\tglobal $config;\n\n\t\t\t$defaults = array(\n\t\t\t\t'minimum_age' => 4,\n\t\t\t\t'maximum_age' => 0,\n\t\t\t);\n\t\t\tforeach ($defaults as $option => $default)\n\t\t\t{\n\t\t\t\tif (!isset($config[$option]))\n\t\t\t\t{\n\t\t\t\t\tset_config($option, $default);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"abstract function clean ();",
"public static function generate_options ()\n\t{\n\t\t// Location options\n\t\tadd_option(\"wustache_base_folder\", 'templates');\n\t}",
"public function clean()\n {\n $this->file = '';\n $this->vars = array();\n $this->headers = array();\n $this->metas = array();\n $this->jses = array();\n $this->javascript = array();\n $this->attachments = array();\n $this->csses = array();\n }",
"function cmh_delete_plugin_options() {\r\n\tdelete_option('cmh_options');\r\n}",
"protected function configure($options = array(), $attributes = array())\n {\n parent::configure($options, $attributes);\n\n $this->addOption('date_format', null);\n $this->addOption('php_date_format', null);\n $this->addOption('with_time', 'false');\n }",
"protected function _revertOptions(): void\n {\n $this->_search->setOption(Search::OPTION_SCROLL, $this->_options[0]);\n $this->_search->setOption(Search::OPTION_SCROLL_ID, $this->_options[1]);\n if (null !== $this->_options[2]) {\n $this->_search->setOption(Search::OPTION_SEARCH_IGNORE_UNAVAILABLE, $this->_options[2]);\n }\n }",
"function __setTidyConfig() \n { \n if($this->_options[\"IsWord\"]){ \n $this->_tidy_config['word-2000'] = true; \n $this->_tidy_config['drop-proprietary-attributes'] = true; \n } \n else { \n $this->_tidy_config['word-2000'] = false; \n } \n if($this->_options[\"OutputXHTML\"]) { \n $this->_options[\"UseTidy\"] = true; \n $this->_tidy_config['output-xhtml'] = true; \n } \n else { \n $this->_tidy_config['output-xhtml'] = false; \n } \n }",
"public function options_init() {\n\t\t\tglobal $allowedtags;\n\t\t\t$allowedtags['p'] = array();\n\t\t\t$this->allowedtags = $allowedtags;\n\n\t\t // set options equal to defaults\n\t\t $this->_options = get_option( $this->options_group[0]['options_name'] );\n\t\t if ( false === $this->_options ) {\n\t\t\t\t$this->_options = $this->get_defaults();\n\t\t }\n\t\t if ( isset( $_GET['undo'] ) && !isset( $_GET['settings-updated'] ) && is_array( $this->get_option('previous') ) ) {\n\t\t \t$this->_options = $this->get_option('previous');\n\t\t }\n\t\t update_option( $this->options_group[0]['options_name'], $this->_options );\t\t\n\t\t \n\t\t}",
"abstract public function clean();",
"public function hookConfig($args)\n {\n $post = $args['post'];\n\n // Sanitize first.\n $post['clean_url_identifier_prefix'] = trim($post['clean_url_identifier_prefix']);\n foreach (array(\n 'clean_url_main_path',\n 'clean_url_collection_generic',\n 'clean_url_item_generic',\n 'clean_url_file_generic',\n ) as $posted) {\n $value = trim($post[$posted], ' /');\n $post[$posted] = empty($value) ? '' : trim($value) . '/';\n }\n\n // The default url should be allowed for items and files.\n $post['clean_url_item_alloweds'][] = $post['clean_url_item_default'];\n $post['clean_url_item_alloweds'] = array_values(array_unique($post['clean_url_item_alloweds']));\n $post['clean_url_file_alloweds'][] = $post['clean_url_file_default'];\n $post['clean_url_file_alloweds'] = array_values(array_unique($post['clean_url_file_alloweds']));\n\n foreach ($this->_options as $optionKey => $optionValue) {\n if (in_array($optionKey, array(\n 'clean_url_item_alloweds',\n 'clean_url_file_alloweds',\n 'clean_url_route_plugins',\n ))) {\n $post[$optionKey] = empty($post[$optionKey]) ? serialize(array()) : serialize($post[$optionKey]);\n }\n if (isset($post[$optionKey])) {\n set_option($optionKey, $post[$optionKey]);\n }\n }\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}",
"public function run()\n {\n DB::table('options')->truncate();\n\t\tOption::create(array(\n\t\t\t'name' => 'Lĩnh vực',\n\t\t));\n\t\t\n\t\tOption::create(array(\n\t\t\t'name' => 'Package',\n\t\t));\n\n\t\tOption::create(array(\n\t\t\t'name' => 'Card level',\n\t\t));\n\n\t\tOption::create(array(\n\t\t\t'name' => 'Card chops chops',\n\t\t));\n\t\t\n\t\tOption::create(array(\n\t\t\t'name' => 'Month',\n\t\t));\n }",
"public function options();",
"public function options();",
"public function options();",
"public function options();",
"public function options();",
"public function settings_validate_options()\n {\n $settings_options = get_option($this->option_name);\n\n // did the CSS save option change?\n if ($settings_options['css_save_to'] !== $_POST[$this->option_name]['css_save_to']\n || $settings_options['css_format'] !== $_POST[$this->option_name]['css_format']) {\n // the save option has changed so we better resave the current stack\n $stack_id = apply_filters('oxy-stack-current-id', '');\n if (!empty($stack_id)) {\n $this->save_post_css($stack_id, $_POST[$this->option_name]);\n }\n }\n }",
"protected function loadDefaultOptions()\r\n {\r\n $this->options = [\r\n 'offsettop' => 0,\r\n 'offsetleft' => 0,\r\n 'merge' => false,\r\n 'backcolor' => 0xffffff,\r\n ];\r\n }",
"function buildClean() {\n $this->clean();\n\n foreach ($this->config->getAllowedBuilds() as [$type, $canonizedGlobExpressions]) {\n // TODO use $type to select Asset class, see addAsset\n $asset = new ScssAsset($canonizedGlobExpressions, $this->dir);\n $asset->build();\n }\n }",
"public function __construct() {\n\t\t$this->createCommandLineOptions();\n\t\t$this->dryRun = $this->commandLineOptions->hasOption(tx_mnogosearch_clioptions::DRYRUN);\n\t}",
"abstract function options();",
"public function initOptions()\n {\n $this->setOption('className', '%CLASS%' . $this->getRelationName());\n }",
"function wpdc_sanitize_wpdc_validate_options($input) {\r\n\t\t// do stuff with $options to check they are ok\r\n if(isset($_POST['reset'])){\r\n\t\t\tdelete_option('wpdc_settings_license_option');\r\n\t\t}\t\r\n\t\treturn $input;\r\n\t}",
"public function set_options()\n {\n // Attempt to retrieve our feature default settings so that we can compare against our post types query\n $defaults = get_option(self::FEATURE_DEFAULTS);\n\n // Retrieve all post types for the given instance and filter down to only publicly accessible types\n $types = get_post_types([\n 'public' => true,\n 'show_in_menu' => true,\n 'exclude_from_search' => false\n ]);\n\n // Remove all post types that we don't want to support duplication for\n $post_types = array_keys(\n array_filter(\n $types,\n function ($key) {\n return !in_array($key, ['attachment']);\n },\n ARRAY_FILTER_USE_KEY\n )\n );\n\n $this->defaults = [\n 'post_types' => $post_types\n ];\n\n // We don't want to ALWAYS update our feature defaults option unless\n // we know that new post types have been added/deleted\n if (isset($defaults) && $post_types === $defaults['post_types']) {\n return;\n }\n\n update_option(self::FEATURE_DEFAULTS, $this->defaults);\n }",
"function Clean()\r\n\t{\r\n\t\t$this->_strWhere = '';\r\n\t\t$this->_arrWhere = Array();\r\n\t}",
"function bf_flush_options() {\r\n\tglobal $bf_options;\r\n\t\r\n\t$bf_options = new BF_Options();\r\n\t$bf_options->get_options();\r\n\t\r\n\tif ( !get_option(THEME_ID . '_options') ) $bf_options->default_options();\r\n}",
"public abstract function clean();",
"protected function configure()\n {\n parent::configure();\n $this->options->mustHave('class');\n }",
"function ajb_options_init(){\n\tregister_setting( 'ajb_option_group', 'ajb_options', 'ajb_options_validate' );\n}",
"public function clean()\n {\n\n $this->tokens = [];\n $this->rawMatches = [];\n\n }"
] | [
"0.67059034",
"0.66845423",
"0.655205",
"0.65279716",
"0.63488376",
"0.6328982",
"0.6316985",
"0.62789446",
"0.6235864",
"0.6214473",
"0.6181154",
"0.6123411",
"0.61230326",
"0.6007186",
"0.59838057",
"0.5976565",
"0.59759104",
"0.59643817",
"0.5919952",
"0.59061944",
"0.58681196",
"0.5858044",
"0.58466923",
"0.5823565",
"0.57604194",
"0.5758218",
"0.5738981",
"0.572256",
"0.57166404",
"0.5710306",
"0.5710306",
"0.5710306",
"0.5710306",
"0.5710306",
"0.5705849",
"0.5683925",
"0.567936",
"0.5672182",
"0.5670816",
"0.56610894",
"0.565135",
"0.5646205",
"0.5642189",
"0.5642109",
"0.56350577",
"0.5622574",
"0.56084275",
"0.55970865",
"0.55809397",
"0.5577752",
"0.5570511",
"0.55518365",
"0.5551554",
"0.5537097",
"0.5502851",
"0.55001676",
"0.54977286",
"0.549171",
"0.54813105",
"0.5453367",
"0.5452466",
"0.5424125",
"0.5415474",
"0.54116464",
"0.54115087",
"0.54110706",
"0.54094404",
"0.540874",
"0.5396205",
"0.53937495",
"0.53935075",
"0.5391014",
"0.53876317",
"0.53849983",
"0.53844106",
"0.5371694",
"0.5364547",
"0.5358101",
"0.5353566",
"0.53435963",
"0.5311026",
"0.5298069",
"0.5298069",
"0.5298069",
"0.5298069",
"0.5298069",
"0.52979124",
"0.5294484",
"0.52885556",
"0.52881294",
"0.5279351",
"0.52734154",
"0.52692974",
"0.5269035",
"0.52662116",
"0.52624106",
"0.52562284",
"0.52508867",
"0.5248982",
"0.52450216"
] | 0.61087954 | 13 |
Sets the Tidy options based on the configuration of Options. | function __setTidyConfig()
{
if($this->_options["IsWord"]){
$this->_tidy_config['word-2000'] = true;
$this->_tidy_config['drop-proprietary-attributes'] = true;
}
else {
$this->_tidy_config['word-2000'] = false;
}
if($this->_options["OutputXHTML"]) {
$this->_options["UseTidy"] = true;
$this->_tidy_config['output-xhtml'] = true;
}
else {
$this->_tidy_config['output-xhtml'] = false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setOptions($options = array()) \n { \n $default = array( \n \"RemoveStyles\" => true, \n \"IsWord\" => true, \n \"UseTidy\" => true, \n \"TidyBefore\" => false, \n \"CleaningMethod\" => array( \n \"tags\" => \"whitelist\", \n \"attributes\" => \"blacklist\" \n ), \n \"OutputXHTML\" => true, \n \"FillEmptyTableCells\" => true, \n \"DropEmptyParas\" => true, \n \"Optimize\" => true, \n \"Compress\" => false, \n \"Encoding\" => \"UTF8\" \n ); \n $new = array_merge_recursive($default, (array)$options); \n\n $this->_options = $new; \n $this->__setTidyConfig(); \n }",
"protected function configureOptions(): void\n {\n }",
"private function set_options()\n\t{\n\t\t$this->dompdf->set_paper(array(0, 0, 325.98, 646.299), 'landscape');\n\t\t$this->dompdf->set_option('isHtml5ParserEnabled', true);\n\t\t$this->dompdf->set_option('isRemoteEnabled', true);\n\t\t$this->dompdf->set_option('chroot', __DIR__ . '/templates');\n\t}",
"abstract public function setOptions($options = array());",
"protected function setOptions() {\n\t\t$this->_options->setHelpText(\"This tool provides a mechanism to run recurring workflow tasks.\");\n\n\t\t$text = \"This option triggers the execution of all known workflows.\\n\";\n\t\t$text.= \"You may filter the execution using option '--workflow'.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_RUN, array('--run', '-r'), Option::TYPE_NO_VALUE, $text, 'value'));\n\n\t\t$text = \"This options provides a way to filter a specific workflow.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_WORKFLOW, array('--workflow', '-w'), Option::TYPE_VALUE, $text, 'value'));\n\t}",
"public function configureOptions();",
"abstract public function setOptions($options);",
"public function setOptions($options)\n {\n //if some arguments are not set grab defaults and merge\n $options = array_merge($this->defaults, $options);\n\n $this->maxTweets = $options['maxTweets'];\n $this->retweets= $options['include_retweets'];\n $this->style = $options['style'];\n $this->replies = $options['include_replies'];\n $this->cacheTime = $options['caching_intervals'];\n $this->displayImages = $options['display_images'];\n }",
"public function setOptions($options){\n\n\t}",
"function setOptions (array $options);",
"public function setOptions($options) {\n\n $this->options = $options;\n }",
"public function setOptions(array $options = array());",
"public function setConfig($options);",
"public function set_options(Array $options) {\n\t\tif (isset($options['tags'])) {\n\t\t $this->tags = array_merge($options['tags'], $this->tags);\n\t }\n\t}",
"public function setOptions($options = []);",
"public function configureOptions(array $options = []) : void;",
"public function setOptions($optionVars);",
"protected function configure(array $options)\n {\n }",
"public function setOptions(array $options): void;",
"public function setOptions(array $options): void;",
"public function configure($options);",
"public function setOptions($options)\n {\n $this->options = apply_filters(\n \"jankx_post_layout_{$this::get_name()}_set_options\",\n wp_parse_args(\n $options,\n $this->options\n ),\n $this\n );\n }",
"public function setOptions($options)\n {\n $this->options = $options;\n }",
"public static function configure(array $options): void\n {\n static::$options = $options;\n }",
"public static function set_options() {\r\n\t\tself::add_option(\"my_option\", \"foo\");\r\n\t}",
"public function setOptions(array $options = [])\n {\n $this->options = [];\n $this->shortcuts = [];\n $this->negations = [];\n $this->addOptions($options);\n }",
"public function setOptions()\n\t{\n\t\tupdate_option($this->optionVar, serialize($this->options));\n\t}",
"private function setOptions($options)\n {\n $this->options = $options;\n }",
"public function configure(array $options)\n {\n }",
"public function withTidy(array $config = [], string $encoding = 'utf8'): self\n\t{\n\t\t$this->tidyConfig = array_merge([\n\t\t\t'clean' => 'yes',\n\t\t\t'output-html' => 'yes',\n\t\t\t'wrap' => 0,\n\t\t], $config);\n\n\t\t$this->tidyEncoding = $encoding;\n\n\t\treturn $this;\n\t}",
"protected function assignOptions($options)\n {\n $this->parseTemplate=$options['template'];\n $this->extraOptions=$options['extraOptions'];\n }",
"public function setOptions($options)\n {\n $this->options = $options;\n }",
"public function setOptions($options)\n {\n $this->options = $options;\n }",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"protected function loadConfigurationOptions()\n {\n if ( ! empty($this->options)) return;\n\n $this->options = $this->app->make('config')->get('html');\n\n $this->options['theme_values'] = Arr::get($this->options['themes'], $this->options['theme']);\n\n unset ($this->options['themes']);\n }",
"public function setOptions($options = array())\r\n { \r\n $this->options = $options;\r\n }",
"private function setOptions()\n {\n $this->clientId = $this->config['stravaSettings']['clientId'];\n $this->clientSecret = $this->config['stravaSettings']['clientSecret'];\n $this->redirectUri = $this->config['stravaSettings']['redirectUri'];\n $this->aprovalPrompt = $this->config['stravaSettings']['approval_prompt'];\n $this->scopes = $this->config['stravaSettings']['scopes'];\n }",
"public function set_options(Array $options);",
"public function set_options() {\n\t\tif ( Kiwi_Social_Share_Helper::get_setting_value( 'click_to_tweet_posttypes', 'all' ) === 'all' ) {\n\t\t\t$this->post_types = 'all';\n\t\t} else {\n\t\t\t$post_types = Kiwi_Social_Share_Helper::get_setting_value( 'click_to_tweet_posttypes_list', array() );\n\t\t\t$this->post_types = array_merge( $this->post_types, $post_types );\n\t\t};\n\t}",
"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 }",
"protected function configure($options = array(), $attributes = array())\n {\n parent::configure($options, $attributes);\n\n $this->addOption('date_format', null);\n $this->addOption('php_date_format', null);\n $this->addOption('with_time', 'false');\n }",
"abstract protected function setup(Options $options): void;",
"protected function configure()\n {\n parent::configure();\n $this->options->mustHave('class');\n }",
"public function setOptions( /*array*/$Options )// : void\n\t{\n\t\t$this -> options = $Options;\n\t}",
"protected function initOptions()\n {\n }",
"public function options() {}",
"public function setOptions($opts) {\n /* Vars that can be set via this function */\n $allowed = array(\n \"quit_on_error\",\n \"error_handler\",\n \"redirect_on_failure\",\n \"redirect_on_failure_url\",\n \"fail_text\",\n \"redirect_on_logout\",\n \"redirect_on_logout_url\",\n \"logout_text\",\n \"wait_time\",\n \"redirect_on_ip_fail\",\n \"redirect_on_ip_fail_url\",\n \"ip_fail_text\"\n );\n\n foreach ($opts as $k => $o) {\n if (in_array($k, $allowed))\n $this->$k = $o;\n }\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 }",
"protected function configure($options = array(), $attributes = array())\n {\n \n }",
"static public function setOptions($opts = array()) {\n if (isset($opts['gzip'])) {\n self::$optGzip = $opts['gzip'] ? true : false;\n }\n if (isset($opts['minimal'])) {\n self::$optMinimal = $opts['minimal'] ? true : false;\n }\n // global option for http proxy \n if (isset($opts['pmp_http_proxy'])) {\n self::$optHttpProxy = $opts['pmp_http_proxy'] ? $opts['pmp_http_proxy'] : '';\n } \n }",
"public function setOptions($options = array()) {\n $this->options = $options;\n }",
"function options($options){\n\t\t$defaults = array(\n\t\t\t'class_header' => 'cg_header',\n\t\t\t'class_colGroup' => 'cg_colGroup',\n\t\t\t'class_row' => 'cg_row',\n\t\t\t'class_table' => 'cg_table',\n\t\t\t'empty_message' => __('No Results'),\n\t\t\t'separator' => ' ',\n\t\t\t'type' => 'table'\n\t\t);\n\t\t\n\t\t$options = array_merge($defaults, $options);\n\t\t\n\t\t$this->__settings = $options;\n\t\t\n\t\t//-- Set the directory we'll be looking for elements\n\t\t$this->elemDir = $this->__settings['type'];\n\t}",
"function tidy_getopt(tidy $object, $option) {}",
"public static function setup(array $options) {}",
"protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('date_order', 'Y-m-d');\n $this->addOption('date', array());\n $this->addOption('time', array());\n $this->addOption('with_time', true);\n $this->addOption('format', '%date% %time%');\n }",
"public function setOptions( array $options )\n\t{\n\t\t$this->_options = $options;\n\t}",
"public static function generate_options ()\n\t{\n\t\t// Location options\n\t\tadd_option(\"wustache_base_folder\", 'templates');\n\t}",
"protected function configure()\n {\n $this->internalInliner->setCleanup($this->options['cleanup']);\n\n $this->internalInliner->setUseInlineStylesBlock(\n $this->options['use_inline_styles_block']\n );\n $this->internalInliner->setStripOriginalStyleTags(\n $this->options['strip_original_tags']\n );\n $this->internalInliner->setExcludeMediaQueries(\n $this->options['exclude_media_queries']\n );\n }",
"public\n function setOptions(array $options)\n {\n $this->options = $options;\n }",
"public\n function setOptions(array $options)\n {\n $this->options = $options;\n }",
"abstract function options();",
"public function setOptions(array $options): void\n {\n $this->options = $options;\n }",
"public function setArguments($options)\n {\n $this->setOption('filename', $options, null);\n $this->setOption('output', $options, 'output');\n $this->setOption('format', $options, $this->pandocBroken ? 'markdown_github' : 'gfm+raw_html');\n $this->setOption('flatten', $options);\n $this->setOption('addmeta', $options);\n $this->setOption('luafilter', $options);\n $this->setOption('template', $options);\n $this->output = rtrim($this->output, '/') . '/';\n }",
"protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('image', false);\n $this->addOption('config', '{}');\n $this->addOption('culture', '');\n\n parent::configure($options, $attributes);\n\n if ('en' == $this->getOption('culture'))\n {\n $this->setOption('culture', 'en');\n }\n }",
"public function setOptions( array $options ) {\n if( null === $this->_classMethods ) {\n $this->_classMethods = get_class_methods( $this );\n }\n foreach( $options as $key => $value ) {\n $method = 'set' . ucfirst( $key );\n if( in_array( $method, $this->_classMethods )) {\n $this->$method($value);\n }\n }\n return $this;\n }",
"function setOptions($options)\n {\n $this->options = array_merge($this->options, $options);\n }",
"private function setOptions(array $options)\n {\n $this->opts = array_merge(array(\n \"build-models.request.queue\" => \"ichnaea.build-models.request\",\n \"build-models.request.exchange\" => \"ichnaea.build-models.request\",\n \"build-models.response.queue\"\t => \"ichnaea.build-models.response\",\n \"predict-models.request.queue\" => \"ichnaea.predict-models.request\",\n \"predict-models.request.exchange\" => \"ichnaea.predict-models.request\",\n \"predict-models.response.queue\" => \"ichnaea.predict-models.response\",\n \"fake.request.queue\" => \"ichnaea.fake.request\",\n \"fake.request.exchange\" => \"ichnaea.fake.request\",\n \"fake.response.queue\" => \"ichnaea.fake.response\",\n ), $this->opts, $options);\n }",
"protected function configure()\n {\n $this->addOption(\n 'v|version', '-s',\n 'The version of the template that is to be installed; optional if '\n .'project is installed with PEAR'\n );\n }",
"protected function configure($options = array(), $attributes = array())\n {\n parent::configure($options, $attributes);\n\n $this->setOption('type', 'hidden');\n $this->addOption('edit_mode', true);\n $this->addOption('no_file_label', '<span>No file selected.</span>');\n $this->addOption('set_label', 'Choose a file');\n $this->addOption('with_replace', true);\n $this->addOption('replace_label', 'Choose a different file');\n $this->addOption('with_delete', true);\n $this->addOption('delete_label', 'Remove file');\n $this->addOption('template', '%file%<br />%input% %replace% %delete%<br /><br />');\n }",
"public function setHtmlOptions($options)\n\t{\n\t\tif (is_scalar($options))\n\t\t\treturn;\n\t\t$this->_htmlOptions = array_merge($this->_htmlOptions, $options);\n\t}",
"protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('format', '%isd% %mobile%');\n }",
"public function setOptions($options)\n {\n $this->options = [\n 'config_dir' => null,\n 'cache_dir' => null,\n 'debug' => false,\n 'cache_class' => 'WebspaceCollectionCache',\n 'base_class' => 'WebspaceCollection',\n ];\n\n // overwrite the default values with the given options\n $this->options = \\array_merge($this->options, $options);\n }",
"public function options($config);",
"public function options();",
"public function options();",
"public function options();",
"public function options();",
"public function options();",
"public function options($opts)\n {\n parent::options($opts);\n }",
"public function setFontOptions($options = [])\n {\n $this->fontOptions = [\n 'file' => isset($options['file']) ? $options['file'] : public_path($this->fontOptions['file']),\n 'color' => isset($options['color']) ? $options['color'] : $this->fontOptions['color'],\n 'size' => isset($options['size']) ? $options['size'] : $this->fontOptions['size'],\n 'align' => isset($options['align']) ? $options['align'] : $this->fontOptions['align'],\n 'valign' => isset($options['valign']) ? $options['valign'] : $this->fontOptions['valign']\n ];\n }",
"public function setOptions(array $options)\r\n\t{\r\n\t\t$this->options = $options;\r\n\t}",
"public function setOptions(array $options): void\n {\n foreach ($options as $key => $value) {\n $this->setOption($key, $value);\n }\n }",
"public function setOptions(array $options) { \n if (!is_array($options)) throw new App_Loader_Autoloader_Exception('Invalid options passed to Fooup Autoloader',500); \n if (isset($options['includeFile']) && mb_strlen($options['includeFile'])>0) $this->_options['includeFile'] = $options['includeFile']; \n if (isset($options['namespaces']) && is_array($options['namespaces'])>0) $this->_options['namespaces'] = $options['namespaces']; \n }",
"public function setOptions(array $_options)\n {\n $this->options = $_options;\n }",
"public function setMainConfiguration(array $options);",
"public function setOptions( array $options = array() ) {\n\n // Mix-in defaults.\n $options = \\RWC\\Utility::get_options( $options, [\n 'apiKey' => null\n ] );\n\n $this->setApiKey( $options[ 'apiKey' ] );\n }",
"public function set_options_filter() {\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @since 10.0.0\n\t\t *\n\t\t * @return array\n\t\t */\n\t\t$config = apply_filters( 'gu_set_options', [] );\n\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @return null|array\n\t\t */\n\t\t$config = empty( $config ) ? apply_filters_deprecated( 'github_updater_set_options', [ [] ], '6.1.0', 'gu_set_options' ) : $config;\n\n\t\tforeach ( array_keys( self::$git_servers ) as $git ) {\n\t\t\tunset( $config[ \"{$git}_access_token\" ], $config[ \"{$git}_enterprise_token\" ] );\n\t\t}\n\n\t\tif ( ! empty( $config ) ) {\n\t\t\t$config = $this->sanitize( $config );\n\t\t\tself::$options = array_merge( get_site_option( 'git_updater' ), $config );\n\t\t\tupdate_site_option( 'git_updater', self::$options );\n\t\t}\n\t}",
"public function setupOptions()\n {\n $this->addTaskAction(new Action('test', 't', 'Test action'));\n }",
"protected function configure($options = array(), $attributes = array())\r\n\t{\r\n\t\t$this->addOption('value');\r\n\t}",
"public function setOptions(array $options)\n {\n // set topic and gridId if namespace is defined\n if (isset($options['namespace'])) {\n $this->setTopic($options['namespace'] . '.form');\n $this->setAttrib('gridId', $options['namespace'] . '.instance');\n unset($options['namespace']);\n }\n\n parent::setOptions($options);\n }",
"public function options(array $options);",
"protected function set_options( array $options ) {\n\n $this->options = array_merge(\n $this->options,\n $options\n );\n\n }",
"protected function setUp(Config\\Options $options): void\n {\n // can be used in child classes to extract and validate config settings\n }"
] | [
"0.7753073",
"0.65544134",
"0.64637095",
"0.62480843",
"0.6239767",
"0.6185608",
"0.61761826",
"0.604455",
"0.6002066",
"0.59947944",
"0.59359074",
"0.5933925",
"0.59324235",
"0.5923187",
"0.59125334",
"0.5909761",
"0.59046334",
"0.58950865",
"0.58893365",
"0.58893365",
"0.5885772",
"0.588415",
"0.58443046",
"0.58401805",
"0.58237815",
"0.5814185",
"0.5811025",
"0.5786824",
"0.57670474",
"0.5763395",
"0.5739699",
"0.5732316",
"0.5732316",
"0.56887877",
"0.56887877",
"0.56887877",
"0.56887877",
"0.56887877",
"0.56887877",
"0.56887877",
"0.56887877",
"0.5669067",
"0.56667584",
"0.56601495",
"0.56530654",
"0.56349856",
"0.5582526",
"0.5574723",
"0.55660707",
"0.5564303",
"0.5558731",
"0.55473834",
"0.55440646",
"0.55352783",
"0.5533803",
"0.55274063",
"0.5501192",
"0.5487785",
"0.5485232",
"0.54734963",
"0.54721415",
"0.545819",
"0.54553896",
"0.5451786",
"0.5439384",
"0.54359764",
"0.54359764",
"0.54189324",
"0.540185",
"0.5400826",
"0.5391842",
"0.5390378",
"0.5389884",
"0.5389623",
"0.53713804",
"0.53637767",
"0.5363272",
"0.53598654",
"0.53433204",
"0.53424984",
"0.5339178",
"0.5339178",
"0.5339178",
"0.5339178",
"0.5339178",
"0.5338993",
"0.53345895",
"0.53319746",
"0.5331901",
"0.53228325",
"0.531067",
"0.53034645",
"0.530159",
"0.5299963",
"0.5295483",
"0.5293521",
"0.52909863",
"0.5286545",
"0.52774876",
"0.5275666"
] | 0.75497925 | 1 |
Removes attributes from html tags that match the provided pattern Example of pattern: "id|on[\w]+" | function removeBlacklistedAttributes($attribs)
{
$this->_html = preg_replace('/[\s]+('.$attribs.')=[\s]*("[^"]*"|\'[^\']*\')/i',"",$this->_html);
$this->_html = preg_replace('/[\s]+('.$attribs.')=[\s]*[^ |^>]*/i',"",$this->_html);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was found.\n // Once the HTML is normalized, we will parse it again.\n $html = $tidy->repairString($html, [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n\n try {\n libxml_use_internal_errors(true);\n // Needs a XML encoding declaration to ensure is treated as UTF-8\n $dom->loadHTML('<?xml encoding=\"utf-8\" ?>'.$html);\n } catch (Exception $e) {\n return '';\n }\n\n $attributes = static::getAttributesNodes($dom);\n\n collect($attributes)\n ->filter(fn ($attribute) => static::isAttributeAllowedForTag($attribute))\n ->each(fn ($node) => $node->parentNode->removeAttribute($node->nodeName));\n\n return $tidy->repairString($dom->saveHTML(), [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n }",
"function strip_htmltag($str, $all = TRUE)\n{\n\tglobal $_symbol_noexists;\n\tstatic $noexists_pattern;\n\n\tif (! isset($noexists_pattern))\n\t\t$noexists_pattern = '#<span class=\"noexists\">([^<]*)<a[^>]+>' .\n\t\t\tpreg_quote($_symbol_noexists, '#') . '</a></span>#';\n\n\t// Strip Dagnling-Link decoration (Tags and \"$_symbol_noexists\")\n\t$str = preg_replace($noexists_pattern, '$1', $str);\n\n\tif ($all) {\n\t\t// All other HTML tags\n\t\treturn preg_replace('#<[^>]+>#', '', $str);\n\t} else {\n\t\t// All other anchor-tags only\n\t\treturn preg_replace('#<a[^>]+>|</a>#i', '', $str);\n\t}\n}",
"public static function cleanTagsWithoutAttributes(array $tags, string $html): string {\n\t\t$empty_tags = implode('|', ArrayTools::preg_quote($tags, '|'));\n\t\treturn preg_replace('|<(' . $empty_tags . ')>([^<>]*)</\\1>|i', '$2', $html);\n\t}",
"function oh_remove_type_attr($tag, $handle) {\n return preg_replace( \"/ type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}",
"private function _filter_attributes($str) {\n\t\t$out = '';\n\n\t\tif (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches)) {\n\t\t\tforeach ($matches [0] as $match) {\n\t\t\t\t$out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}",
"public static function purifyHtmlEventAttributes($value)\n\t{\n\t\tif (preg_match('#<([^><]+?)([^a-z_\\\\-]on\\\\w*|xmlns)(\\\\s*=\\\\s*[^><]*)([>]*)#i', $value) || preg_match('/\\\\b(' . static::$htmlEventAttributes . ')\\\\s*=/i', $value) || preg_match('/javascript:[\\w\\.]+\\(/i', $value)) {\n\t\t\t\\App\\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');\n\t\t\tthrow new Exceptions\\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $value, 406);\n\t\t}\n\t}",
"function DOM_delete_empty_attributes() {\r\n\t\t$query = '//' . ReTidy::get_html_namespace() . '*[@*=\"\"]';\r\n\t\t$tags_with_empty_attribute = $this->xpath->query($query);\r\n\t\tforeach($tags_with_empty_attribute as $tag) {\r\n\t\t\t$tagName = $tag->nodeName;\r\n\t\t\t$array_attributes = DTD::getAttributesForElementByType($tagName, \"#IMPLIED\");\r\n\t\t\tforeach($tag->attributes as $attribute) {\r\n\t\t\t\tif(strlen($attribute->nodeValue) === 0) {\r\n\t\t\t\t\tforeach($array_attributes as $attribute2){\r\n\t\t\t\t\t\tif($attribute->nodeName === $attribute2) {\r\n\t\t\t\t\t\t\t$attribute->nodeValue = \"XXX9o9stripme9o9XXX\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}",
"function filterAttr($attrSet) {\t\n\t\t$newSet = array();\n\t\t// process attributes\n\t\tfor ($i = 0; $i <count($attrSet); $i++) {\n\t\t\t// skip blank spaces in tag\n\t\t\tif (!$attrSet[$i]) continue;\n\t\t\t// split into attr name and value\n\t\t\t$attrSubSet = explode('=', trim($attrSet[$i]));\n\t\t\tlist($attrSubSet[0]) = explode(' ', $attrSubSet[0]);\n\t\t\t// removes all \"non-regular\" attr names AND also attr blacklisted\n\t\t\t//////\n\t\t\t///// NEEDS FIX!!! eregi zu preg_match umgeschrieben... stimmt das noch??? ////\n\t\t\t/////\n\t\t\tif ((!preg_match(\"^[a-z]*$\",$attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) \n\t\t\t\tcontinue;\n\t\t\t// xss attr value filtering\n\t\t\tif ($attrSubSet[1]) {\n\t\t\t\t// strips unicode, hex, etc\n\t\t\t\t$attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]);\n\t\t\t\t// strip normal newline within attr value\n\t\t\t\t$attrSubSet[1] = preg_replace('/\\s+/', '', $attrSubSet[1]);\n\t\t\t\t// strip double quotes\n\t\t\t\t$attrSubSet[1] = str_replace('\"', '', $attrSubSet[1]);\n\t\t\t\t// [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)\n\t\t\t\tif ((substr($attrSubSet[1], 0, 1) == \"'\") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == \"'\"))\n\t\t\t\t\t$attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));\n\t\t\t\t// strip slashes\n\t\t\t\t$attrSubSet[1] = stripslashes($attrSubSet[1]);\n\t\t\t}\n\t\t\t// auto strip attr's with \"javascript:\n\t\t\tif (\t((strpos(strtolower($attrSubSet[1]), 'expression') !== false) &&\t(strtolower($attrSubSet[0]) == 'style')) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'livescript:') !== false) \n\t\t\t) continue;\n\n\t\t\t// if matches user defined array\n\t\t\t$attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);\n\t\t\t// keep this attr on condition\n\t\t\tif ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {\n\t\t\t\t// attr has value\n\t\t\t\tif ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[1] . '\"';\n\t\t\t\t// attr has decimal zero as value\n\t\t\t\telse if ($attrSubSet[1] == \"0\") $newSet[] = $attrSubSet[0] . '=\"0\"';\n\t\t\t\t// reformat single attributes to XHTML\n\t\t\t\telse $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[0] . '\"';\n\t\t\t}\t\n\t\t}\n\t\treturn $newSet;\n\t}",
"function remove_html_tag_news($data){\n\treturn preg_replace('/ style=\".*?\"/i', '$1', strip_tags($data, '<i><a><b><u><div><hr>'));\n}",
"function removeAttributesFromTag($tag, $attributes)\n {\n $filter = '(//' . $tag . ')';\n $elements = $this->xpath->query($filter);\n foreach ($elements as $index => $element) {\n $tag = $element->tagName;\n foreach ($attributes as $attr) {\n if ($element->hasAttribute($attr)) {\n $element->removeAttribute($attr);\n }\n }\n }\n }",
"function lessie_process_html_tag(&$vars) {\r\n $el = &$vars['element'];\r\n\r\n // Remove type=\"...\" and CDATA prefix/suffix.\r\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\r\n\r\n // Remove media=\"all\" but leave others unaffected.\r\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\r\n unset($el['#attributes']['media']);\r\n }\r\n}",
"private function _filter_attributes($str)\n {\n $out = '';\n\n if (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches))\n {\n foreach ($matches[0] as $match)\n {\n $out .= preg_replace(\"#/\\*.*?\\*/#s\", '', $match);\n }\n }\n\n return $out;\n }",
"private function _remove_evil_attributes($str, $is_image)\n {\n // All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns\n //$evil_attributes = array('on\\w*', 'style', 'xmlns', 'formaction');\n $evil_attributes = array('on\\w*', 'xmlns', 'formaction');\n\n if ($is_image === true)\n {\n /*\n * Adobe Photoshop puts XML metadata into JFIF images,\n * including namespacing, so we have to allow this for images.\n */\n unset($evil_attributes[array_search('xmlns', $evil_attributes)]);\n }\n\n do {\n $count = 0;\n $attribs = array();\n\n // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes)\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*(\\042|\\047)([^\\\\2]*?)(\\\\2)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // find occurrences of illegal attribute strings without quotes\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*([^\\s>]*)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // replace illegal attribute strings that are inside an html tag\n if (count($attribs) > 0)\n {\n $str = preg_replace('/(<?)(\\/?[^><]+?)([^A-Za-z<>\\-])(.*?)('.implode('|', $attribs).')(.*?)([\\s><]?)([><]*)/i', '$1$2 $4$6$7$8', $str, -1, $count);\n }\n\n } while ($count);\n\n return $str;\n }",
"protected function _filter_attributes($str)\n\t{\n\t\t$out = '';\n\t\tif (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches))\n\t\t{\n\t\t\tforeach ($matches[0] as $match)\n\t\t\t{\n\t\t\t\t$out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}",
"function <%= functionPrefix %>_remove_type_attr($tag, $handle) {\n return preg_replace( \"/type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}",
"protected function filter_attributes()\n\t{\n\t\t$filter = array_flip(array('type', 'split', 'align'));\n\t\t\n\t\t$attrs = $this->manager->attrs();\n\t\t\n\t\t$this->btn_attrs = array_diff_key($attrs, $filter);\n\t\t$this->manager->attrs(array_intersect_key($attrs, $filter));\n\t}",
"function strip_only($str, $tags) {\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n return $str;\n}",
"function strip_att_htmlN($string) \r\n {\r\n\t$desenho = array( '@');\r\n\t#Será retornado o seguinte no lugar delas, caso ache alguma palavra bloqueada\r\n\t$substituir_pore = array('');\r\n\t#Rodando a string e procurando pelas palavras proibidas\r\n\tfor($e=0;$e < sizeof($desenho); $e++) {\r\n\t\t\t$string = str_replace($desenho[$e], $substituir_pore[$e], $string);\r\n\t\t\t \r\n\t\t\t\r\n\t}\r\n\r\n\treturn $string; \r\n }",
"function strip_selected_tags($str, $tags = \"\", $stripContent = false)\n {\n preg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n foreach ($allTags[1] as $tag){\n if ($stripContent) {\n $str = preg_replace(\"/<\".$tag.\"[^>]*>.*<\\/\".$tag.\">/iU\",\"\",$str);\n }\n $str = preg_replace(\"/<\\/?\".$tag.\"[^>]*>/iU\",\"\",$str);\n }\n return $str;\n }",
"function remove_img_attr ($html)\n{\n return preg_replace('/(width|height)=\"\\d+\"\\s/', \"\", $html);\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}",
"function fett_process_html_tag(&$vars) {\n if (theme_get_setting('fett_html_tags')) {\n $el = &$vars['element'];\n\n // Remove type=\"...\" and CDATA prefix/suffix.\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\n unset($el['#attributes']['media']);\n }\n }\n}",
"function wpmantis_strip_only($str, $tags, $stripContent = false)\n{\n $content = '';\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) {\n if ($stripContent)\n $content = '(.+</'.$tag.'[^>]*>|)';\n $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);\n }\n return $str;\n}",
"function clean_inside_tags($txt,$tags){\n\t\t\t$txt =removeemptytags($txt);\n\t\t\tpreg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n\t\t\n\t\t\tforeach ($allTags[1] as $tag){\n\t\t\t\t$txt = preg_replace(\"/<\".$tag.\"[^>]*>/i\",\"<\".$tag.\">\",$txt);\n\t\t\t}\n\t\t\treturn $txt;\n\t\t}",
"function wp_list_categories_remove_title_attributes($output) {\n $output = preg_replace('` title=\"(.+)\"`', '', $output);\n return $output;\n}",
"public function removeAttribute($name, $content)\r\n\t{\r\n\t\t$pattern = '/@' . $name . ' ([^\"\\[\\]\\n\\r]*[^*\\[\\]\\s])/';\r\n\t\t$content = preg_replace($pattern, \"\", $content);\r\n\r\n\t\t$pattern = '/@' . $name . ':\"([^@]*)\"/';\r\n\t\t$content = preg_replace($pattern, \"\", $content);\r\n\r\n\t\t$pattern = '/@' . $name . ':([^\"\\s][^\"\\s]*)/';\r\n\t\t$content = preg_replace($pattern, \"\", $content);\r\n\r\n\t\treturn $content;\r\n\t}",
"protected static function removeEvilAttributes($str, $is_image)\n {\n $evil_attributes = ['on\\w*', 'style', 'xmlns', 'formaction', 'form', 'xlink:href', 'FSCommand', 'seekSegmentTime'];\n\n if ($is_image === true) {\n unset($evil_attributes[array_search('xmlns', $evil_attributes)]);\n }\n\n do {\n $count = $temp_count = 0;\n\n $str = preg_replace('/(<[^>]+)(?<!\\w)('.implode('|', $evil_attributes).')\\s*=\\s*(\\042|\\047)([^\\\\2]*?)(\\\\2)/is', '$1[removed]', $str, -1, $temp_count);\n $count += $temp_count;\n\n $str = preg_replace('/(<[^>]+)(?<!\\w)('.implode('|', $evil_attributes).')\\s*=\\s*([^\\s>]*)/is', '$1[removed]', $str, -1, $temp_count);\n $count += $temp_count;\n } while ($count);\n\n return $str;\n }",
"function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}",
"protected function _filterAttributes($str) {\n $out = '';\n \n if(preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches)) {\n foreach($matches[0] as $match) {\n $out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n }\n }\n \n return $out;\n }",
"function filter_tags($string)\n{\n return preg_replace('/<[^>]*>/', ' ', $string);\n}",
"function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}",
"protected static function filterAttributes($str)\n {\n $out = '';\n if (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches))\n {\n foreach ($matches[0] as $match)\n {\n $out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n }\n }\n\n return $out;\n }",
"function remove_width_attribute($html) {\n $html = preg_replace('/(width|height)=\"\\d*\"\\s/', \"\", $html);\n return $html;\n}",
"function remove_width_attribute( $html ) {\n $html = preg_replace( '/(width|height)=\"\\d*\"\\s/', \"\", $html );\n return $html;\n}",
"public function removeTagAttributes($tag)\n\t{\n\t\t$args = $this->argsArray(func_get_args());\n\t\tarray_shift($args);\n\t\t\n\t\tforeach ($args as $a) {\n\t\t\t$this->removed_tag_attrs[$tag][] = $a;\n\t\t}\n\t}",
"function tag_attributes($attributes)\n{\n if (is_string($attributes)) {\n $toProcess['name'] = $attributes;\n $toProcess['id'] = $attributes;\n } else {\n //don't allow 'value' to be set specifically as an attribute (why = consistency)\n unset($attributes['value']);\n $toProcess = $attributes;\n }\n\n $attr = array();\n foreach ($toProcess as $key => $attribute) {\n // Reject weird attribute names (a little more restrictively than necessary)\n if (preg_match('/[^A-Za-z0-9_:.-]/', $key)) {\n continue;\n }\n if (is_string($attribute)) {\n $attr[$key] = $key . '=\"' . html_escape($attribute) . '\"';\n } elseif ($attribute === true) {\n $attr[$key] = $key;\n }\n }\n return join(' ', $attr);\n}",
"function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}",
"function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}",
"function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}",
"function non_inline_attributes() {\r\n\t\t$this->code = preg_replace('/<span([^>]*) align=\"[^\"]*\"([^>]*)>/is', '<span$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<span([^>]*) style=\"([^\"]*)text-align\\s*:\\s*[^;]*;([^\"]*)\"([^>]*)>/is', '<span$1 style=\"$2$3\"$4>', $this->code);\r\n\t}",
"function html5_style_remove($tag)\n{\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n}",
"function _js_link_removal($match) {\n\t\t$attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match [1]));\n\n\t\treturn str_replace($match [1], preg_replace('#href=.*?(alert\\(|alert&\\#40;|javascript\\:|charset\\=|window\\.|document\\.|\\.cookie|<script|<xss|base64\\s*,)#si', '', $attributes), $match [0]);\n\t}",
"function untag($string, $tag) {\n\t$tmpval = array();\n\t$preg = \"|<$tag>(.*?)</$tag>|s\";\n\n\tpreg_match_all($preg, $string, $tags);\n\tforeach ($tags[1] as $tmpcont){\n\t\t$tmpval[] = $tmpcont;\n\t}\n\treturn $tmpval;\n}",
"function _filter_xss_attributes($attr) {\n $attrarr = array();\n $mode = 0;\n $attrname = '';\n\n while (strlen($attr) != 0) {\n // Was the last operation successful?\n $working = 0;\n\n switch ($mode) {\n case 0:\n // Attribute name, href for instance.\n if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) {\n $attrname = strtolower($match[1]);\n $skip = ($attrname == 'style' || substr($attrname, 0, 2) == 'on');\n $working = $mode = 1;\n $attr = preg_replace('/^[-a-zA-Z]+/', '', $attr);\n }\n break;\n\n case 1:\n // Equals sign or valueless (\"selected\").\n if (preg_match('/^\\s*=\\s*/', $attr)) {\n $working = 1;\n $mode = 2;\n $attr = preg_replace('/^\\s*=\\s*/', '', $attr);\n break;\n }\n\n if (preg_match('/^\\s+/', $attr)) {\n $working = 1;\n $mode = 0;\n if (!$skip) {\n $attrarr[] = $attrname;\n }\n $attr = preg_replace('/^\\s+/', '', $attr);\n }\n break;\n\n case 2:\n // Attribute value, a URL after href= for instance.\n if (preg_match('/^\"([^\"]*)\"(\\s+|$)/', $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname=\\\"$thisval\\\"\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace('/^\"[^\"]*\"(\\s+|$)/', '', $attr);\n break;\n }\n\n if (preg_match(\"/^'([^']*)'(\\s+|$)/\", $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname='$thisval'\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace(\"/^'[^']*'(\\s+|$)/\", '', $attr);\n break;\n }\n\n if (preg_match(\"%^([^\\s\\\"']+)(\\s+|$)%\", $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname=\\\"$thisval\\\"\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace(\"%^[^\\s\\\"']+(\\s+|$)%\", '', $attr);\n }\n break;\n }\n\n if ($working == 0) {\n // Not well formed; remove and try again.\n $attr = preg_replace('/\n ^\n (\n \"[^\"]*(\"|$) # - a string that starts with a double quote, up until the next double quote or the end of the string\n | # or\n \\'[^\\']*(\\'|$)| # - a string that starts with a quote, up until the next quote or the end of the string\n | # or\n \\S # - a non-whitespace character\n )* # any number of the above three\n \\s* # any number of whitespaces\n /x', '', $attr);\n $mode = 0;\n }\n }\n\n // The attribute list ends with a valueless attribute like \"selected\".\n if ($mode == 1 && !$skip) {\n $attrarr[] = $attrname;\n }\n return $attrarr;\n}",
"function clean_html($html)\r\n{\r\n\t$html = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', \"\", $html);\r\n\t$html = preg_replace('/<style\\b[^>]*>(.*?)<\\/style>/is', \"\", $html);\r\n\t$html = preg_replace('/<link \\b[^>]*>(.*?)/is', \"\", $html);\r\n\r\n\treturn $html;\r\n}",
"function html5_style_remove( $tag ) {\n return preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}",
"public function setHtmlAttributeWildcards() {}",
"public static function cleanTagsAttributes(string $string, array $include = null, array $exclude = []): string {\n\t\t$matches = self::matchTags($string);\n\t\tif (!$matches) {\n\t\t\treturn $string;\n\t\t}\n\n\t\t$search = [];\n\t\t$replace = [];\n\t\tforeach ($matches as $match) {\n\t\t\tif ($include === null) {\n\t\t\t\t$attr = [];\n\t\t\t} else {\n\t\t\t\t$attr = self::parseAttributes($match[2]);\n\t\t\t\t$attr = ArrayTools::filterKeys($attr, $include, $exclude);\n\t\t\t}\n\t\t\t$ss = $match[0];\n\t\t\t$single = str_ends_with($match[0], '/>') ? '/' : '';\n\t\t\t$rr = '<' . strtolower($match[1]) . self::attributes($attr) . $single . '>';\n\t\t\tif ($ss !== $rr) {\n\t\t\t\t$search[] = $ss;\n\t\t\t\t$replace[] = $rr;\n\t\t\t}\n\t\t}\n\t\tif (preg_match_all('#<\\\\\\s*([A-Za-z][A-Za-z0-9]*)\\s*>#i', $string, $matches)) {\n\t\t\tforeach ($matches as $match) {\n\t\t\t\t$ss = $match[0];\n\t\t\t\t$rr = '<\\\\' . strtolower($match[1]) . '>';\n\t\t\t\tif ($ss !== $rr) {\n\t\t\t\t\t$search[] = $ss;\n\t\t\t\t\t$replace[] = $rr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (count($search) === 0) {\n\t\t\treturn $string;\n\t\t}\n\t\treturn str_replace($search, $replace, $string);\n\t}",
"function strip_only(&$str, $tags)\n{\n\tif(isset($str) && is_array($str))\n\t\treturn $str;\n if(!is_array($tags))\n\t{\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n\n\t$size = sizeof($tags);\n\t$keys = array_keys($tags);\n\tfor ($i=0; $i<$size; $i++)\n\t{\n\t\t$tag = $tags[$keys[$i]];\n\t\tif(isset($tag) && is_array($tag))\n\t\t\t$str = strip_only($str, $tag);\n\t\telse\n\t\t{\n\t\t\tif(stripos($str, $tag) !== false)\n\t\t\t\t$str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n\t\t}\n\t}\n\treturn $str;\n}",
"function gwt_drupal_process_html_tag(&$variables) {\n $tag = &$variables['element'];\n\n if ($tag['#tag'] == 'style' || $tag['#tag'] == 'script') {\n // Remove redundant type attribute and CDATA comments.\n unset($tag['#attributes']['type'], $tag['#value_prefix'], $tag['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($tag['#attributes']['media']) && $tag['#attributes']['media'] === 'all') {\n unset($tag['#attributes']['media']);\n }\n }\n}",
"function strip_html_tags($str){\n $str = preg_replace('/(<|>)\\1{2}/is', '', $str);\n $str = preg_replace(\n array(// Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n ),\n \"\", //replace above with nothing\n $str );\n $str = replaceWhitespace($str);\n $str = strip_tags($str);\n return $str;\n}",
"public function clean( $tag ) {\n\n\t\t// I was seeing an issue with & being encoded to & which would then make it so MPD couldn't find it\n\t\t$tag = html_entity_decode( $tag );\n\n\t\t// Replace /, <, >, | and : with nothing\n\t\t//$tag = preg_replace(\"/[\\/|\\>|\\<|\\||\\:]/\", \"\", $tag);\n\n\t\t// Replace ampersands with \"and\"\n\t\t//$tag = preg_replace(\"/[&]/\", \"and\", $tag);\n\n\t\treturn $tag;\n\t}",
"function remove_non_rss(string $html): string\n{\n $html = preg_replace('%<script.*?>.*?</script>%is', '', $html);\n $html = preg_replace('%<a href=\"#.*?>(.*?)</a>%is', '$1', $html);\n $html = preg_replace('%<a href=\"javascript.*?>(.*?)</a>%is', '$1', $html);\n return $html;\n}",
"private function removeTagsWithMultiplication() {\n\t\t$special = array(\n\t\t\t// TagText-TagAttribut => Multiplikate\n\t\t\t'img-alt' => 3,\n\t\t\t'img-title' => 4,\n\t\t\t'a-title' => 5,\n\t\t\t'a' => 5,\n\t\t\t'h1' => 20,\n\t\t\t'h2' => 9,\n\t\t\t'h3' => 8,\n\t\t\t'h4' => 7,\n\t\t\t'h5' => 6,\n\t\t\t'h6' => 5,\n\t\t\t'b' => 4,\n\t\t\t'u' => 3,\n\t\t\t'i' => 2,\n\t\t\t'em' => 3,\n\t\t\t'strong' => 4,\n\t\t\t'cite' => 2,\n\t\t\t'blockquote' => 2\n\t\t);\n\t\tforeach ($special as $tag => $multis) {\n\t\t\tif (strpos($tag, '-') !== false) {\n\t\t\t\t$split = explode('-', $tag);\n\t\t\t\t$tag = $split[0];\n\t\t\t\t$attr = $split[1];\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'[^>]*'.$attr.'=\"([^\"]*)\"[^>]*>#i', str_repeat(' $1 ', $multis), $this->html);\n\t\t\t} else {\n\t\t\t\t$this->html = preg_replace('#<'.$tag.'(>|\\s.*?>)(.*?)</'.$tag.'>#is', str_repeat(' $2 ', $multis), $this->html);\n\t\t\t}\n\t\t}\n\t\t$this->html = strip_tags($this->html);\n\t}",
"function extract_attrs($line) {\n if (preg_match(self::REGEX_ATTR, $line)) {\n return preg_replace(self::REGEX_ATTR, ' \\1', $line);\n }\n }",
"function html_strip_unsafe($strData)\n\t\t{\n\t\t // Unsafe HTML tags/attributes that members may abuse\n\t\t $arrData=array(\n\t\t //'/<iframe(.*?)<\\/iframe>/is',\n\t\t '/<title(.*?)<\\/title>/is',\n\t\t '/<pre(.*?)<\\/pre>/is',\n\t\t '/<frame(.*?)<\\/frame>/is',\n\t\t '/<frameset(.*?)<\\/frameset>/is',\n\t\t //'/<object(.*?)<\\/object>/is',\n\t\t '/<script(.*?)<\\/script>/is',\n\t\t //'/<embed(.*?)<\\/embed>/is',\n\t\t '/<applet(.*?)<\\/applet>/is',\n\t\t '/<meta(.*?)>/is',\n\t\t '/<!doctype(.*?)>/is',\n\t\t '/<link(.*?)>/is',\n\t\t '/<body(.*?)>/is',\n\t\t '/<\\/body>/is',\n\t\t '/<head(.*?)>/is',\n\t\t '/<\\/head>/is',\n\t\t '/onload=\"(.*?)\"/is',\n\t\t '/onunload=\"(.*?)\"/is',\n\t\t '/onerror=\"(.*?)\"/is',\n\t\t '/onclick=\"(.*?)\"/is',\n\t\t '/onchange=\"(.*?)\"/is',\n\t\t '/onmouseover=\"(.*?)\"/is',\n\t\t '/autofocus=\"(.*?)\"/is',\n\t\t '/onfocus=\"(.*?)\"/is',\n\t\t '/<html(.*?)>/is',\n\t\t '/<\\/html>/is',\n\t\t );\n\t\t $strData = preg_replace($arrData, \"\", $strData);\n\t\t\t$strData = filter_var($strData, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\t\t return $strData;\n\t\t}",
"function kp_remove_image_size_attributes( $html ) {\n return preg_replace( '/(width|height)=\"\\d*\"/', '', $html );\n}",
"function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}",
"protected function filterAtts( $atts = array() ) {\n\t\t\t\n\t\t\tforeach($atts as $key => &$att) {\n \t\t\n \t\t$param = $this->params[$key];\n \t\t\n \t\tswitch( $param['type'] ) {\n \t\t\n \t\tcase 'vc_link' :\n \t\t\n \t\t $att = vc_build_link($att);\n \t\t \n break;\n \t\t\n \t\t}\n \t\t\n \t\t}\n \t\t\n \t\treturn $atts;\n \t\t\n\t\t}",
"function get_shortcode_atts_regex()\n {\n }",
"function strip_autolink($str)\n{\n\treturn preg_replace('#<!--autolink--><a [^>]+>|</a><!--/autolink-->#', '', $str);\n}",
"protected function setRegexAttributes()\n {\n $find = '#{([a-z][a-zA-Z0-9_]*)}#';\n $attributes = $this->route->attributes;\n $newAttributes = [];\n preg_match_all($find, $this->regex, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $name = $match[1];\n $subpattern = $this->getSubpattern($name);\n $this->regex = str_replace(\"{{$name}}\", $subpattern, $this->regex);\n if (! isset($attributes[$name])) {\n $newAttributes[$name] = null;\n }\n }\n $this->route->attributes($newAttributes);\n }",
"function ks_style_remove( $tag ) {\n\treturn preg_replace( '~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag );\n}",
"function remove_tags( $html, $tags, $strip_content = FALSE )\n\t{\n\t\t$content = '';\n\t\tif ( ! is_array( $tags ) )\n\t\t{\n\t\t\t$tags = ( strpos( $html, '>' ) !== FALSE ? explode( '>', str_replace( '<', '', $tags ) ) : [ $tags ] );\n\t\t\tif ( end( $tags ) == '' )\n\t\t\t{\n\t\t\t\tarray_pop( $tags );\n\t\t\t}\n\t\t}\n\t\tforeach ( $tags as $tag )\n\t\t{\n\t\t\tif ( $strip_content )\n\t\t\t{\n\t\t\t\t$content = '(.+</' . $tag . '[^>]*>|)';\n\t\t\t}\n\n\t\t\t$html = preg_replace( '#</?' . $tag . '[^>]*>' . $content . '#is', '', $html );\n\t\t}\n\n\t\treturn $html;\n\t}",
"function tags_attr($selector, $attr, $text = '', $source = false)\r\n{\r\n\r\n\r\n $result = array();\r\n $text = trim($text);\r\n foreach (get_noko($source)->get($selector)->toArray() as $tag)\r\n if (!$text or @in_array($text,$tag['#text']))\r\n if (!empty($tag[$attr])) $result[] = trim($tag[$attr]);\r\n $r = $result;\r\n\r\n if (DEV)\r\n xlogc('tags_attr', $r, $selector, $attr, $source, $text);\r\n\r\n return $r;\r\n}",
"protected function _sanitize_naughty_html($matches)\n\t{\n\t\tstatic $naughty_tags = array(\n\t\t\t'alert', 'area', 'prompt', 'confirm', 'applet', 'audio', 'basefont', 'base', 'behavior', 'bgsound',\n\t\t\t'blink', 'body', 'embed', 'expression', 'form', 'frameset', 'frame', 'head', 'html', 'ilayer',\n\t\t\t'iframe', 'input', 'button', 'select', 'isindex', 'layer', 'link', 'meta', 'keygen', 'object',\n\t\t\t'plaintext', 'style', 'script', 'textarea', 'title', 'math', 'video', 'svg', 'xml', 'xss'\n\t\t);\n\n\t\tstatic $evil_attributes = array(\n\t\t\t'on\\w+', 'style', 'xmlns', 'formaction', 'form', 'xlink:href', 'FSCommand', 'seekSegmentTime'\n\t\t);\n\n\t\t// First, escape unclosed tags\n\t\tif (empty($matches['closeTag']))\n\t\t{\n\t\t\treturn '<'.$matches[1];\n\t\t}\n\t\t// Is the element that we caught naughty? If so, escape it\n\t\telseif (in_array(strtolower($matches['tagName']), $naughty_tags, TRUE))\n\t\t{\n\t\t\treturn '<'.$matches[1].'>';\n\t\t}\n\t\t// For other tags, see if their attributes are \"evil\" and strip those\n\t\telseif (isset($matches['attributes']))\n\t\t{\n\t\t\t// We'll store the already fitlered attributes here\n\t\t\t$attributes = array();\n\n\t\t\t// Attribute-catching pattern\n\t\t\t$attributes_pattern = '#'\n\t\t\t\t.'(?<name>[^\\s\\042\\047>/=]+)' // attribute characters\n\t\t\t\t// optional attribute-value\n\t\t\t\t.'(?:\\s*=(?<value>[^\\s\\042\\047=><`]+|\\s*\\042[^\\042]*\\042|\\s*\\047[^\\047]*\\047|\\s*(?U:[^\\s\\042\\047=><`]*)))' // attribute-value separator\n\t\t\t\t.'#i';\n\n\t\t\t// Blacklist pattern for evil attribute names\n\t\t\t$is_evil_pattern = '#^('.implode('|', $evil_attributes).')$#i';\n\n\t\t\t// Each iteration filters a single attribute\n\t\t\tdo\n\t\t\t{\n\t\t\t\t// Strip any non-alpha characters that may preceed an attribute.\n\t\t\t\t// Browsers often parse these incorrectly and that has been a\n\t\t\t\t// of numerous XSS issues we've had.\n\t\t\t\t$matches['attributes'] = preg_replace('#^[^a-z]+#i', '', $matches['attributes']);\n\n\t\t\t\tif ( ! preg_match($attributes_pattern, $matches['attributes'], $attribute, PREG_OFFSET_CAPTURE))\n\t\t\t\t{\n\t\t\t\t\t// No (valid) attribute found? Discard everything else inside the tag\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t// Is it indeed an \"evil\" attribute?\n\t\t\t\t\tpreg_match($is_evil_pattern, $attribute['name'][0])\n\t\t\t\t\t// Or does it have an equals sign, but no value and not quoted? Strip that too!\n\t\t\t\t\tOR (trim($attribute['value'][0]) === '')\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$attributes[] = 'xss=removed';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$attributes[] = $attribute[0][0];\n\t\t\t\t}\n\n\t\t\t\t$matches['attributes'] = substr($matches['attributes'], $attribute[0][1] + strlen($attribute[0][0]));\n\t\t\t}\n\t\t\twhile ($matches['attributes'] !== '');\n\n\t\t\t$attributes = empty($attributes)\n\t\t\t\t? ''\n\t\t\t\t: ' '.implode(' ', $attributes);\n\t\t\treturn '<'.$matches['slash'].$matches['tagName'].$attributes.'>';\n\t\t}\n\n\t\treturn $matches[0];\n\t}",
"static function tagWithAttributeRegex ($tag, $attr, $value, $closing = true) {\n\t\treturn \":(\n\t\t(<($tag)\\s+[^>]*)\n\t\t($attr)=\n\t\t)\n\t\t(\n\t\t\t\\s*(\\\"|')\n\t\t\t((((?!\\\\6).)*\\s)*($value)(\\s((?!\\\\6).)*)*)\n\t\t\t\\\\6([^>]*>)\n\t\t|\n\t\t\t\\s*((?!/>)($value))\n\t\t\t([^>]*>)\n\t\t)\".($closing ? \"\n\t\t(((?!</($tag)>).)*)\n\t\t(</($tag)>)\n\t\t\" : \"\").\"\n\t\t:ix\";\n\t}",
"protected function cleanHtml($html) {\n $chain = new Zend_Filter();\n\n if($this->isFilterTags){\n $chain->addFilter(new Zend_Filter_StripTags(self::$tags));\n }\n $chain->addFilter(new Zend_Filter_StringTrim());\n\n $html = $chain->filter($html);\n\n $tmp = $html;\n while (1) {\n // Try and replace an occurrence of javascript:\n $html = preg_replace('/(<[^>]*)javascript:([^>]*>)/i', '$1$2', $html);\n \n\n // If nothing changed this iteration then break the loop\n if ($html == $tmp)\n break;\n\n $tmp = $html;\n }\n\n return $html;\n }",
"function protectAttr($str,$name=false)\n\t{\n\t\tif ($name && !preg_match('/^[A-Za-z][A-Za-z0-9_:.-]*$/',$str)) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\treturn str_replace(array(\"'\",'\"'),array(''','"'),$str);\n\t}",
"private function removeNotAllowedAttributes(\\DOMDocument $domDocument)\n {\n $xpath = new \\DOMXPath($domDocument);\n $nodes = $xpath->query(\n '//@*[name() != \\'' . implode('\\' and name() != \\'', $this->allowedAttributes) . '\\']'\n );\n foreach ($nodes as $node) {\n $node->parentNode->removeAttribute($node->nodeName);\n }\n }",
"function _convert_attribute($match) {\n\t\treturn str_replace(array('>', '<', '\\\\'), array('>', '<', '\\\\\\\\'), $match [0]);\n\t}",
"public function removeAllAttributes()\n {\n $this->attr = [];\n }",
"public function style_remove($tag) {\n return preg_replace('~\\s+type=[\"\\'][^\"\\']++[\"\\']~', '', $tag);\n }",
"function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"javascript\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"alert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"about:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"onmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"onclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"onload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"onsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"<body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"<html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"document.\" , $t);\r\n\t\treturn $t;\r\n\t}",
"function util_getAttribute($in_haystack, $in_tag, $in_attr)\r\n{\r\n\t$attrs = util_innerString($in_haystack, \"<{$in_tag} \", '>', FALSE);\r\n\tif ($attrs) {\r\n\t\tif (substr($attrs, -1) == '/') {\r\n\t\t\t$attrs = substr($attrs, 0, -1);\r\n\t\t}\r\n\t}else {\r\n\t\treturn NULL;\r\n\t}\r\n\tforeach (explode(' ', util_whitespace($attrs)) as $candidate) {\r\n\t\t$attr = explode('=', $candidate, 2);\r\n\t\tif (count($attr) != 2) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif ($attr[0] == $in_attr) {\r\n\t\t\treturn substr($attr[1], 1, strlen($attr[1]) - 2);\r\n\t\t}\r\n\t}\r\n\treturn NULL;\r\n}",
"private function processAttrs(){\n\n\t\t$start = strlen($this->tag)+1;\n\t\t$temp = substr($this->raw,$start);\n\n\t\t//echo $temp . \"\\n\";\n\n\t\t$i=0;\n\t\tfor(; $i < strlen($temp); ){\n\t\t\tif($temp[$i] == '>') break;\n\t\t\t\t\n\t\t\t$pos = $this->skipWs($temp, $i);\n\t\t\t\t\n\t\t\t//echo \"should be r-{$temp[$pos]}\\n\";\n\t\t\t\t\n\t\t\t$pos2 = $this->skipToEqualOrWs($temp, $pos);\n\t\t\t\t\n\t\t\t//echo \"should be =-{$temp[$pos2]}\\n\";\n\t\t\t\t\n\t\t\t$attr = trim(substr($temp, $pos, $pos2 - $pos));\n\t\t\t\t\n\t\t\t//echo \"Got attribute-$attr\\n\";\n\t\t\t\t\n\t\t\tif(!empty($attr) && $pos2 < strlen($temp) && $temp[$pos2] == '='){\n\n\t\t\t\t//skip =\n\t\t\t\t$pos2++;\n\n\t\t\t\t$pos = $this->skipWs($temp, $pos2); //should be ' or \"\n\n\t\t\t\tif($temp[$pos] != '\"' && $temp[$pos] != \"'\"){\n\t\t\t\t\t//echo \"FAILED-{$temp[$pos]}\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$pos++; //skip the ' or \"\n\n\t\t\t\t$pos2 = $this->skipToQuote($temp, $pos, $temp[$pos-1]);\n\n\t\t\t\t$val = trim(substr($temp, $pos, $pos2-$pos),'\\'\"');\n\n\t\t\t\t$pos2++; //get past ' or \"\n\n\t\t\t\t$this->attributes[$attr] = $val;\n\n\t\t\t\t//echo \"$attr:$val\\n\";\n\t\t\t}\n\t\t\t$i = $pos2;\n\t\t}\n\t\t$this->textStart = $i+$start+1;\n\t}",
"public function attributeFilter($atts, $item, $args)\n\t{\n\t\tif ( $this->nav_menu_repo->getMenuID() == null ) return $atts;\n\t\tif ( !isset($args->menu->term_id) ) return $atts;\n\t\tif ( $args->menu->term_id !== $this->nav_menu_repo->getMenuID() ) return $atts;\n\n\t\t// Remove the rel= attribute created from saving the menu object for syncing\n\t\tforeach($atts as $attribute => $value){\n\t\t\tif ( strtolower($attribute) != 'rel' ) continue;\n\t\t\tif ( $value == $item->object ) unset($atts[$attribute]);\n\t\t\tif ( is_numeric($value) ) unset($atts[$attribute]);\n\t\t}\n\t\t\n\t\treturn $atts;\n\t}",
"static function strip_html_tags($string){\n return preg_replace(array('/\\<(script)(.+)>/i', '/\\<(.+)(script)>/i', '/\\<(style)(.+)>/i', '/\\<(.+)(style)>/i'), '', $string);\n }",
"function wp_strip_all_tags($text, $remove_breaks = \\false)\n {\n }",
"private static function cleanHtml(string $html, array $allowedTags): string\n {\n $html = static::removeUnallowedHTMLTags($html, array_keys(static::$validUserTagsAndAttributes));\n\n $html = static::removeUnallowedHTMLAttributes($html);\n\n $html = static::removeUnallowedHTMLTags($html, $allowedTags);\n\n return $html;\n }",
"function remove_rewrite_tag($tag)\n {\n }",
"function real_strip_tags($str, $allowable_tags = \"\")\n{\n return strip_tags($str, $allowable_tags);\n}",
"function htmlButTags($str) {\n\t$caracteres = get_html_translation_table(HTML_ENTITIES);\n\t// Find out the \"tags\" entities\n\t$remover = get_html_translation_table(HTML_SPECIALCHARS);\n\t// Spit out the tags entities from the original table\n\t$caracteres = array_diff($caracteres, $remover);\n\t// Translate the string....\n\t$str = strtr($str, $caracteres);\n\t\n\t// now amps\n\t$str = preg_replace(\"/&(?![A-Za-z]{0,4}\\w{2,3};|#[0-9]{2,3};)/\",\"&\" , $str);\n\t\n\treturn $str;\n}",
"function removePartialTags($string) {\r\n\t\t$pos_close = strpos($string, \">\");\r\n\t\tif($pos_close != false) {\r\n\t\t\t$string = substr($string, $pos_close + 1);\r\n\t\t}\r\n\t\t$pos_open = strpos($string, \"<\");\r\n\t\tif($pos_open != false) {\r\n\t\t\t$string = substr($string, 0, $pos_open);\r\n\t\t}\r\n\t\t//print('removePartialTags cleaned string: ' . $string);\r\n\t\treturn $string;\r\n\t}",
"private static function remove_between_tags($y_html) {\n\t//--\n\treturn @preg_replace(\"'\".self::tag_remove_start().\".*?\".self::tag_remove_end().\"'si\", ' ', (string)$y_html); // insensitive\n\t//--\n}",
"function txt_alphanumerical_clean( $t, $additional_tags=\"\" )\n\t{\n\t\tif ( $additional_tags )\n\t\t{\n\t\t\t$additional_tags = preg_quote( $additional_tags, \"/\" );\n\t\t}\n\t\t\n\t\treturn preg_replace( \"/[^a-zA-Z0-9\\-\\_\".$additional_tags.\"]/\", \"\" , $t );\n }",
"function remove_utm($url) {\r\n\treturn preg_replace(\"/&?utm_(.*?)\\=[^&]+/\",\"\", $url);\r\n}",
"function cleanInput ($input) {\n\t \n\t\t$search = array(\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n\t\t);\n\n\t\treturn preg_replace($search, '', $input);\n\t}",
"private function _convert_attribute($match)\n {\n return str_replace(array('>', '<', '\\\\'), array('>', '<', '\\\\\\\\'), $match[0]);\n }",
"function acf_allow_unfiltered_html()\n{\n}",
"function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"javascript\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"alert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"about:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"onmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"onclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"onload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"onsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"<body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"<html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"document.\" , $t );\n\t\t\n\t\treturn $t;\n }",
"public function normalizeTags($attribute,$params)\n {\n $this->tags=VideoTag::array2string(array_unique(VideoTag::string2array($this->tags)));\n }",
"private static function removeUnallowedHTMLTags(string $html, array $allowedTags): string\n {\n $allowedTagsStr = '<'.implode('><', $allowedTags).'>';\n\n return strip_tags($html, $allowedTagsStr);\n }",
"function get_tag_regex($tag)\n {\n }",
"function mc_strip_tags() {\n\n\treturn apply_filters( 'mc_strip_tags', '<strong><em><i><b><span><br><a>' );\n}",
"function remove_attachment_title_attr( $attr ) {\n\tunset($attr['title']);\n\treturn $attr;\n}",
"function noTag($temp){\n\t$data\t= strip_tags($temp, \"<img \");\n\t$data\t= strip_tags($temp, \"<table \");\n\t$data\t= strip_tags($temp, \"<font \");\n\t$data\t= strip_tags($temp, \"<span \");\t\n\t$data\t= strip_tags($temp, \"<p \");\t\t\n\treturn $data;\n}",
"function qa_sanitize_html_hook_tag($element, $attributes = null)\n{\n\tglobal $qa_sanitize_html_newwindow;\n\n\tif (!isset($attributes)) // it's a closing tag\n\t\treturn '</' . $element . '>';\n\n\tif ($element == 'param' && trim(strtolower(@$attributes['name'])) == 'allowscriptaccess')\n\t\t$attributes['name'] = 'allowscriptaccess_denied';\n\n\tif ($element == 'embed')\n\t\tunset($attributes['allowscriptaccess']);\n\n\tif ($element == 'a' && isset($attributes['href']) && $qa_sanitize_html_newwindow)\n\t\t$attributes['target'] = '_blank';\n\n\t$html = '<' . $element;\n\tforeach ($attributes as $key => $value)\n\t\t$html .= ' ' . $key . '=\"' . $value . '\"';\n\n\treturn $html . '>';\n}",
"public static function cleanInsideHtmlTags($str,$tags)\n\t{\n\t\tpreg_match_all('/<([^>]+)>/i',$tags,$allTags,PREG_PATTERN_ORDER);\n\t\tforeach($allTags[1] as $tag)\n\t\t{\n\t\t\t$str=preg_replace('/<'.$tag.' [^>]*>/i','<'.$tag.'>',$str);\n\t\t}\n\n\t\treturn $str;\n\t}"
] | [
"0.5939265",
"0.5924926",
"0.57694834",
"0.5744616",
"0.5660727",
"0.56411314",
"0.5618329",
"0.5615616",
"0.5602336",
"0.5594623",
"0.5572615",
"0.55611455",
"0.5544675",
"0.55132604",
"0.55105466",
"0.5482235",
"0.54742277",
"0.54584867",
"0.54467577",
"0.5440193",
"0.53907895",
"0.53891325",
"0.5377687",
"0.53731066",
"0.53646487",
"0.53580004",
"0.5324073",
"0.5323511",
"0.5317911",
"0.53101397",
"0.53033847",
"0.52785164",
"0.52493674",
"0.5247284",
"0.5222909",
"0.521457",
"0.5189771",
"0.51881224",
"0.51881224",
"0.51881224",
"0.51582277",
"0.5146901",
"0.51372963",
"0.5135311",
"0.50933397",
"0.50748587",
"0.50594056",
"0.5054944",
"0.5050737",
"0.5043978",
"0.5041839",
"0.50136167",
"0.49783206",
"0.49664778",
"0.49588895",
"0.4932943",
"0.4928963",
"0.49208617",
"0.48861074",
"0.48788184",
"0.48745123",
"0.48739168",
"0.48531976",
"0.48523635",
"0.4851359",
"0.4825221",
"0.48162532",
"0.48086315",
"0.48061702",
"0.47950563",
"0.478866",
"0.47854728",
"0.4780837",
"0.47803116",
"0.47726724",
"0.47660697",
"0.4755966",
"0.47522292",
"0.47501323",
"0.47343692",
"0.47126773",
"0.46872717",
"0.46848667",
"0.46691597",
"0.4667268",
"0.46643373",
"0.46621025",
"0.46563333",
"0.46558183",
"0.4648779",
"0.46338168",
"0.46327063",
"0.46294618",
"0.462652",
"0.46189657",
"0.46076667",
"0.46074775",
"0.4607117",
"0.46036598",
"0.46032917"
] | 0.6185785 | 0 |
Uses the Tidy Configuration to run Tidy's cleanRepair method, if available. | function tidyClean()
{
if(!class_exists('tidy')){
if(function_exists('tidy_parse_string')){
tidy_set_encoding("{$this->_options["Encoding"]}");
foreach($this->_tidy_config as $k => $v) {
tidy_setopt($k, $v);
}
tidy_parse_string($this->_html);
tidy_clean_repair();
$this->_html = tidy_get_output();
}
else {
error_log("Tidy is not supported on this platform. Basic Cleaning is applied.");
}
}
else {
$tidy = new tidy;
$tidy -> parseString($this->_html, $this->_tidy_config, "{$this->_options["Encoding"]}");
$tidy -> cleanRepair();
$this -> html = $tidy;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cleanRepair() {}",
"function tidy_clean_repair(tidy $object) {}",
"function __setTidyConfig() \n { \n if($this->_options[\"IsWord\"]){ \n $this->_tidy_config['word-2000'] = true; \n $this->_tidy_config['drop-proprietary-attributes'] = true; \n } \n else { \n $this->_tidy_config['word-2000'] = false; \n } \n if($this->_options[\"OutputXHTML\"]) { \n $this->_options[\"UseTidy\"] = true; \n $this->_tidy_config['output-xhtml'] = true; \n } \n else { \n $this->_tidy_config['output-xhtml'] = false; \n } \n }",
"function tidy_repair_file($filename, $config = null, $encoding = null, $use_include_path = false) {}",
"public function _tidy_cleanup_callback($text = '')\n {\n if ( ! class_exists('tidy') || ! extension_loaded('tidy')) {\n return $text;\n }\n $tidy_default_config = [\n 'alt-text' => '',\n 'output-xhtml' => true,\n ];\n $tidy = new tidy();\n $tidy->parseString($text, $this->_TIDY_CONFIG ?: $tidy_default_config, conf('charset'));\n $tidy->cleanRepair();\n return $tidy;\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}",
"function cleanup($html, $options = null) \n { \n if(isset($options) && is_array($options)){ \n $this->setOptions($options); \n } \n $this->_html = \"{$html}\"; \n\n if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n\n // Remove escape slashes \n $this->_html = stripslashes($this -> _html); \n\n if($this->_options['CleaningMethod']['tags'] == \"whitelist\"){ \n // Trim everything before body tag, leaving possible body attributes \n if(preg_match(\"/<body/i\", \"{$this -> _html}\")){ \n $this -> html = stristr($this -> _html, \"<body\"); \n } \n\n // strip tags, still leaving attributes, second variable is allowed tags \n $this->_html = strip_tags($this->_html, $this->_tag_whitelist); \n } \n\n if($this->_options['RemoveStyles']){ \n // Remove class and style attributes \n $this->removeBlacklistedAttributes(\"class|style\"); \n } \n\n if($this->_options['IsWord']){ \n $this->removeBlacklistedAttributes(\"lang|[ovwxp]:\\w+\"); \n } \n\n if($this->_options['CleaningMethod']['attributes'] == \"blacklist\"){ \n if(!empty ($this->_attrib_blacklist)){ \n $this->removeBlacklistedAttributes($this->_attrib_blacklist); \n } \n } \n\n if($this->_options['Optimize']){ \n $repl = 1; \n while($repl){ \n $repl = 0; \n foreach($this->_cleanup_tags as $tag){ \n // Strip empty inline tags \n $this -> _html = preg_replace(\"/<($tag)[^>]*>[\\s]*([( )]*)[\\s]*<\\/($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n\n // Merge inline tags \n $this -> _html = preg_replace(\"/<\\/($tag)[^>]*>[\\s]*([( )]*)[\\s]*<($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n } \n } \n\n // Drop empty paragraph tags \n if($this->_options['DropEmptyParas']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[( )]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n // Trim extra spaces only if tidy is not set to indent \n if(!$this->_tidy_config['indent']){ \n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/i',\"\\\\1 \\\\2\", $this -> _html); \n\n // Trim extra spaces before tags \n $this -> _html = preg_replace('/[\\n|\\r|\\r\\n|][\\n|\\r|\\r\\n|]+</i',\"<\", $this -> _html); \n } \n } \n\n if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[( )]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n if($this->_options['FillEmptyTableCells']) { \n $this -> _html = preg_replace(\"/<td([^>]*)>[\\s]*<\\/td>/i\", \"<td\\\\1> </td>\", $this -> _html); \n } \n\n if($this->_options['Compress']){ \n // Trim spaces after tags \n $this -> _html = preg_replace('/>[\\s]+/',\">\", $this -> _html); \n\n // Trim spaces before end tags \n $this -> _html = preg_replace('/[\\s]+<\\//',\"</\", $this -> _html); \n\n // Trim spaces before tags \n $this -> _html = preg_replace('/[\\s]+</',\"<\", $this -> _html); \n\n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/',\"\\\\1 \\\\2\", $this -> _html); \n } \n\n if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n return $this->output(\"{$this->_html}\"); \n }",
"public static function additionalCleaning() {\n \n }",
"private function executeTidy($page){\n\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_tidier_error','error_pid = '.intval($page['uid']));\n\t\t\n\t\t// build the command\n\t\t$search =array(\n\t\t\t'###TEMP_RESULT###',\n\t\t\t'###TEMP_FILE###', \n\t\t\t'###TIDY_ACCESS###',\n\t\t);\n\t\t$replace = array(\n\t\t\t$this->tempFilename($page['uid'], 'result'),\n\t\t\t$this->tempFilename($page['uid'], 'file'),\n\t\t\t(intval($this->conf['tidyAccess']) > 0 ? intval($this->conf['tidyAccess']) : 2),\n\t\t);\n\t\t$cmd = str_replace($search, $replace, $this->conf['tidyCommand']);\n\t\t\n\t\t// this has to be cleaned up, some error handling!\n\t\t// get content\n\t\t$content = t3lib_div::getURL($this->getDomain() . '/?id='.intval($page['uid']));\n\t\tfile_put_contents($this->tempFilename($page['uid'], 'file'), $content);\n\t\t\n\t\t// exec tidy\n\t\texec($cmd);\n\t\t\n\t\t// parse tidy \n\t\t$this->parseTidy($page);\n\t\t// remove html file\n\t\t@unlink($this->tempFilename($page['uid'], 'file'));\n\t\t\n\t\t\n\t}",
"public function process($html, $url, $smart_tidy=true) {\r\n\t\t$this->reset();\r\n\t\t\r\n\t\t// extract host name\r\n\t\t$host = @parse_url($url, PHP_URL_HOST);\r\n\t\tif (!($this->config = SiteConfig::build($host))) {\r\n\t\t\t// no match, so use defaults\r\n\t\t\t$this->config = new SiteConfig();\r\n\t\t}\r\n\t\t// store copy of config in our static cache array in case we need to process another URL\r\n\t\tSiteConfig::add_to_cache($host, $this->config);\r\n\t\t\r\n\t\t// use tidy (if it exists)?\r\n\t\t// This fixes problems with some sites which would otherwise\r\n\t\t// trouble DOMDocument's HTML parsing. (Although sometimes it\r\n\t\t// makes matters worse, which is why you can override it in site config files.)\r\n\t\t$tidied = false;\r\n\t\tif ($this->config->tidy && function_exists('tidy_parse_string') && $smart_tidy) {\r\n\t\t\t$this->debug('Using Tidy');\r\n\t\t\t$tidy = tidy_parse_string($html, self::$tidy_config, 'UTF8');\r\n\t\t\tif (tidy_clean_repair($tidy)) {\r\n\t\t\t\t$original_html = $html;\r\n\t\t\t\t$tidied = true;\r\n\t\t\t\t$html = $tidy->value;\r\n\t\t\t}\r\n\t\t\tunset($tidy);\r\n\t\t}\r\n\t\t\r\n\t\t// load and parse html\r\n\t\t$this->readability = new Readability($html, $url);\t\t\r\n\t\t\r\n\t\t// we use xpath to find elements in the given HTML document\r\n\t\t// see http://en.wikipedia.org/wiki/XPath_1.0\r\n\t\t$xpath = new DOMXPath($this->readability->dom);\r\n\r\n\t\t// strip elements (using xpath expressions)\r\n\t\tforeach ($this->config->strip as $pattern) {\r\n\t\t\t$elems = @$xpath->query($pattern, $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Stripping '.$elems->length.' elements (strip)');\r\n\t\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// strip elements (using id and class attribute values)\r\n\t\tforeach ($this->config->strip_id_or_class as $string) {\r\n\t\t\t$string = strtr($string, array(\"'\"=>'', '\"'=>''));\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(@class, '$string') or contains(@id, '$string')]\", $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Stripping '.$elems->length.' elements (strip_id_or_class)');\r\n\t\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// strip images (using src attribute values)\r\n\t\tforeach ($this->config->strip_image_src as $string) {\r\n\t\t\t$string = strtr($string, array(\"'\"=>'', '\"'=>''));\r\n\t\t\t$elems = @$xpath->query(\"//img[contains(@src, '$string')]\", $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Stripping '.$elems->length.' image elements');\r\n\t\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// strip elements using Readability.com and Instapaper.com ignore class names\r\n\t\t// .entry-unrelated and .instapaper_ignore\r\n\t\t// See https://www.readability.com/publishers/guidelines/#view-plainGuidelines\r\n\t\t// and http://blog.instapaper.com/post/730281947\r\n\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' entry-unrelated ') or contains(concat(' ',normalize-space(@class),' '),' instapaper_ignore ')]\", $this->readability->dom);\r\n\t\t// check for matches\r\n\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t$this->debug('Stripping '.$elems->length.' .entry-unrelated,.instapaper_ignore elements');\r\n\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// strip elements that contain style=\"display: none;\"\r\n\t\t$elems = @$xpath->query(\"//*[contains(@style,'display:none')]\", $this->readability->dom);\r\n\t\t// check for matches\r\n\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t$this->debug('Stripping '.$elems->length.' elements with inline display:none style');\r\n\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// try to get title\r\n\t\tforeach ($this->config->title as $pattern) {\r\n\t\t\t$elems = @$xpath->evaluate($pattern, $this->readability->dom);\r\n\t\t\tif (is_string($elems)) {\r\n\t\t\t\t$this->debug('Title expression evaluated as string');\r\n\t\t\t\t$this->title = trim($elems);\r\n\t\t\t\tbreak;\r\n\t\t\t} elseif ($elems instanceof DOMNodeList && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Title matched');\r\n\t\t\t\t$this->title = $elems->item(0)->textContent;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// try to get body\r\n\t\tforeach ($this->config->body as $pattern) {\r\n\t\t\t$elems = @$xpath->query($pattern, $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Body matched');\r\n\t\t\t\tif ($elems->length == 1) {\t\t\t\t\r\n\t\t\t\t\t$this->body = $elems->item(0);\r\n\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->body = $this->readability->dom->createElement('div');\r\n\t\t\t\t\t$this->debug($elems->length.' body elems found');\r\n\t\t\t\t\tforeach ($elems as $elem) {\r\n\t\t\t\t\t\t$isDescendant = false;\r\n\t\t\t\t\t\tforeach ($this->body->childNodes as $parent) {\r\n\t\t\t\t\t\t\tif ($this->isDescendant($parent, $elem)) {\r\n\t\t\t\t\t\t\t\t$isDescendant = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($isDescendant) {\r\n\t\t\t\t\t\t\t$this->debug('Element is child of another body element, skipping.');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t\t\t$this->readability->prepArticle($elem);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->debug('Element added to body');\r\n\t\t\t\t\t\t\t$this->body->appendChild($elem);\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\t\r\n\t\t\r\n\t\t// auto detect?\r\n\t\t$detect_title = $detect_body = false;\r\n\t\t// detect title?\r\n\t\tif (!isset($this->title)) {\r\n\t\t\tif (empty($this->config->title) || (!empty($this->config->title) && $this->config->autodetect_on_failure)) {\r\n\t\t\t\t$detect_title = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// detect body?\r\n\t\tif (!isset($this->body)) {\r\n\t\t\tif (empty($this->config->body) || (!empty($this->config->body) && $this->config->autodetect_on_failure)) {\r\n\t\t\t\t$detect_body = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// check for hNews\r\n\t\tif ($detect_title || $detect_body) {\r\n\t\t\t// check for hentry\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' hentry ')]\", $this->readability->dom);\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('hNews: found hentry');\r\n\t\t\t\t$hentry = $elems->item(0);\r\n\t\t\t\t\r\n\t\t\t\tif ($detect_title) {\r\n\t\t\t\t\t// check for entry-title\r\n\t\t\t\t\t$elems = @$xpath->query(\".//*[contains(concat(' ',normalize-space(@class),' '),' entry-title ')]\", $hentry);\r\n\t\t\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t\t\t$this->debug('hNews: found entry-title');\r\n\t\t\t\t\t\t$this->title = $elems->item(0)->textContent;\r\n\t\t\t\t\t\t$detect_title = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// check for entry-content.\r\n\t\t\t\t// according to hAtom spec, if there are multiple elements marked entry-content,\r\n\t\t\t\t// we include all of these in the order they appear - see http://microformats.org/wiki/hatom#Entry_Content\r\n\t\t\t\tif ($detect_body) {\r\n\t\t\t\t\t$elems = @$xpath->query(\".//*[contains(concat(' ',normalize-space(@class),' '),' entry-content ')]\", $hentry);\r\n\t\t\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t\t\t$this->debug('hNews: found entry-content');\r\n\t\t\t\t\t\tif ($elems->length == 1) {\r\n\t\t\t\t\t\t\t// what if it's empty? (some sites misuse hNews - place their content outside an empty entry-content element)\r\n\t\t\t\t\t\t\t$e = $elems->item(0);\r\n\t\t\t\t\t\t\tif (($e->tagName == 'img') || (trim($e->textContent) != '')) {\r\n\t\t\t\t\t\t\t\t$this->body = $elems->item(0);\r\n\t\t\t\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$detect_body = false;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$this->debug('hNews: skipping entry-content - appears not to contain content');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($e);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->body = $this->readability->dom->createElement('div');\r\n\t\t\t\t\t\t\t$this->debug($elems->length.' entry-content elems found');\r\n\t\t\t\t\t\t\tforeach ($elems as $elem) {\r\n\t\t\t\t\t\t\t\t$isDescendant = false;\r\n\t\t\t\t\t\t\t\tforeach ($this->body->childNodes as $parent) {\r\n\t\t\t\t\t\t\t\t\tif ($this->isDescendant($parent, $elem)) {\r\n\t\t\t\t\t\t\t\t\t\t$isDescendant = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif ($isDescendant) {\r\n\t\t\t\t\t\t\t\t\t$this->debug('Element is child of another body element, skipping.');\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t\t\t\t\t$this->readability->prepArticle($elem);\r\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->debug('Element added to body');\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->body->appendChild($elem);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$detect_body = false;\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}\r\n\r\n\t\t// check for elements marked with instapaper_title\r\n\t\tif ($detect_title) {\r\n\t\t\t// check for instapaper_title\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' instapaper_title ')]\", $this->readability->dom);\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('title found (.instapaper_title)');\r\n\t\t\t\t$this->title = $elems->item(0)->textContent;\r\n\t\t\t\t$detect_title = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check for elements marked with instapaper_body\r\n\t\tif ($detect_body) {\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' instapaper_body ')]\", $this->readability->dom);\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('body found (.instapaper_body)');\r\n\t\t\t\t$this->body = $elems->item(0);\r\n\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t\t}\r\n\t\t\t\t$detect_body = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// still missing title or body, so we detect using Readability\r\n\t\tif ($detect_title || $detect_body) {\r\n\t\t\t$this->debug('Using Readability');\r\n\t\t\t// clone body if we're only using Readability for title (otherwise it may interfere with body element)\r\n\t\t\tif (isset($this->body)) $this->body = $this->body->cloneNode(true);\r\n\t\t\t$success = $this->readability->init();\r\n\t\t}\r\n\t\tif ($detect_title) {\r\n\t\t\t$this->debug('Detecting title');\r\n\t\t\t$this->title = $this->readability->getTitle()->textContent;\r\n\t\t}\r\n\t\tif ($detect_body && $success) {\r\n\t\t\t$this->debug('Detecting body');\r\n\t\t\t$this->body = $this->readability->getContent();\r\n\t\t\tif ($this->body->childNodes->length == 1 && $this->body->firstChild->nodeType === XML_ELEMENT_NODE) {\r\n\t\t\t\t$this->body = $this->body->firstChild;\r\n\t\t\t}\r\n\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\tif ($this->config->prune) {\r\n\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($this->body)) {\r\n\t\t\t// remove scripts\r\n\t\t\t$this->readability->removeScripts($this->body);\r\n\t\t\t$this->success = true;\r\n\t\t}\r\n\t\t\r\n\t\t// if we've had no success and we've used tidy, there's a chance\r\n\t\t// that tidy has messed up. So let's try again without tidy...\r\n\t\tif (!$this->success && $tidied && $smart_tidy) {\r\n\t\t\t$this->debug('Trying again without tidy');\r\n\t\t\t$this->process($original_html, $url, false);\r\n\t\t}\r\n\r\n\t\treturn $this->success;\r\n\t}",
"public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('admincp.component_controller_maintain_reparser_clean')) ? eval($sPlugin) : false);\n\t}",
"public function markClean();",
"function MaintainCleanCache()\n{\n\tglobal $context, $txt;\n\n\t// Just wipe the whole cache directory!\n\tclean_cache();\n\tclean_cache('js');\n\tclean_cache('css');\n\n\t$context['maintenance_finished'] = $txt['maintain_cache'];\n}",
"public function isClean();",
"public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('mobiletemplate.component_controller_admincp_managestyles_clean')) ? eval($sPlugin) : false);\n\t}",
"public function clean() {\n\t\tglobal $warnings;\n\n\t\t// it's not at CBW\n\t\tif ($this->location != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as being at HQ\";\n\t\t\t$this->location = 1;\n\t\t}\n\t\t// it had beer in it\n\t\tif ($this->beer != 0) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as empty\";\n\t\t\t$this->beer = 0;\n\t\t}\n\t\t// it's not dirty\n\t\tif ($this->status != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as dirty\";\n\t\t}\n\n\t\t$this->status = 2;\n\t\t$this->update();\n\t}",
"protected function _clean()\n {\n if ($this->_defaultOptions['clean'] === FALSE) {\n return;\n }\n\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'remove unused markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $this->_cleanMarkers('loop');\n $this->_cleanMarkers('optional');\n\n $this->DISPLAY = preg_replace(\n $this->_contentMarkers,\n '',\n $this->DISPLAY\n );\n }",
"abstract function clean ();",
"public static function clean()\n\t{\n\t}",
"public function clean() {}",
"public function doXHTML_cleaning() {}",
"public function cleanup()\n {\n if ($this->catalogRule != '-') {\n $this->deleteAllCatalogRule->run();\n }\n }",
"public function clean()\n {\n (($sPlugin = Phpfox_Plugin::get('donation.component_controller_index_clean')) ? eval($sPlugin) : false);\n }",
"public function withTidy(array $config = [], string $encoding = 'utf8'): self\n\t{\n\t\t$this->tidyConfig = array_merge([\n\t\t\t'clean' => 'yes',\n\t\t\t'output-html' => 'yes',\n\t\t\t'wrap' => 0,\n\t\t], $config);\n\n\t\t$this->tidyEncoding = $encoding;\n\n\t\treturn $this;\n\t}",
"protected function parentCleanup() {\n }",
"public function cleanup() {\n\t\t$this->status = new WPSEO_Import_Status( 'cleanup', false );\n\n\t\tif ( ! $this->detect_helper() ) {\n\t\t\treturn $this->status;\n\t\t}\n\n\t\t$this->wpdb->query( \"DELETE FROM {$this->wpdb->postmeta} WHERE meta_key LIKE '_aioseop_%'\" );\n\n\t\treturn $this->status->set_status( true );\n\t}",
"function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }",
"public function cleanup() {\n\n\t\t$fs = new \\Symfony\\Component\\Filesystem\\Filesystem();\n\n\t\t$challange_dir = EE_ROOT_DIR . '/services/nginx-proxy/html/.well-known';\n\t\t$challange_rule_file = EE_ROOT_DIR . '/services/nginx-proxy/vhost.d/default';\n\t\tif ( $fs->exists( $challange_rule_file ) ) {\n\t\t\t$fs->remove( $challange_rule_file );\n\t\t}\n\t\tif ( $fs->exists( $challange_dir ) ) {\n\t\t\t$fs->remove( $challange_dir );\n\t\t}\n\t}",
"abstract public function clean();",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"function tidy_repair_string($data, $config = null, $encoding = null) {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function cleanUp() {}",
"public function fix() {}",
"public function fix() {}",
"public function clean() {\n\t\t\n\t}",
"public static function inst() {\n\t\tif (class_exists('HTMLPurifier')) return new PurifierHTMLCleaner();\n\t\telseif (class_exists('tidy')) return new TidyHTMLCleaner();\n\t}",
"public function clean();",
"public function clean();",
"public function clean();",
"public function clean();",
"public function clean();",
"public function clean(){\n\n\t\t(($sPlugin = Phpfox_Plugin::get('cars.component_controller_admincp_index_clean')) ? eval($sPlugin) : false);\n\n\t}",
"protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}",
"public function cleanUp();",
"public function cleanUp();",
"public function cleanUp();",
"private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }",
"public static function doMaintenance() {\n\t\t\n\t\t// Do tasks here\n\t\tthrow new Exception(\"Unimplemented\");\n\t}",
"private function clean() {\n\t\t$types = ['.aux', '.fdb_latexmk', '.fls', '.log', '.out', '.tex', '.toc'];\n\t\t$s = '';\n\t\tforeach (scandir($this -> directory) as $file) {\n\t\t\tif ($file === '.' || $file === '..') continue;\n\t\t\tforeach ($types as $t) {\n\t\t\t\t$extension = substr($file, 0-strlen($t));\n\t\t\t\tif (in_array($extension, $types) && file_exists($this -> directory . '/' . $file)) {\n\t\t\t\t\tunlink($this -> directory . '/' . basename($file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function cleanup()\n {\n $db = eZDB::instance();\n $db->begin();\n $db->query( \"DELETE FROM ezsphinx\" );\n $db->query( \"DELETE FROM ezsphinx_pathnodes\" );\n $db->commit();\n }",
"function cleanup_tags() {\n $sql = '\n DELETE FROM\n tags\n WHERE NOT EXISTS (\n SELECT NULL FROM tips_tags\n WHERE\n tags.id = tips_tags.tag_id\n )';\n \n return $this->prep_and_exec($sql);\n }",
"public function apply($str)\n\t{\n\t\tif (extension_loaded('tidy') && class_exists('tidy'))\n\t\t{\n\t\t\t$config = array(\n\t\t\t\t'doctype' => 'strict',\n\t\t\t\t'drop-proprietary-attributes' => true,\n\t\t\t\t'drop-font-tags' => true,\n\t\t\t\t'escape-cdata' => true,\n\t\t\t\t'indent' => false,\n\t\t\t\t'join-classes' => false,\n\t\t\t\t'join-styles' => true,\n\t\t\t\t'lower-literals' => true,\n\t\t\t\t'output-xhtml' => true,\n\t\t\t\t'show-body-only' => true,\n\t\t\t\t'wrap' => 80\n\t\t\t);\n\t\t\t\n\t\t\t$str = '<p>tt</p>'.$str; // Fixes a big issue\n\t\t\t\n\t\t\t$tidy = new tidy;\n\t\t\t$tidy->parseString($str, $config, 'utf8');\n\t\t\t$tidy->cleanRepair();\n\t\t\t\n\t\t\t$str = (string) $tidy;\n\t\t\t\n\t\t\t$str = preg_replace('#^<p>tt</p>\\s?#','',$str);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$str = $this->miniTidy($str);\n\t\t}\n\t\t\n\t\t# Removing open comments, open CDATA and processing instructions\n\t\t$str = preg_replace('%<!--.*?-->%msu','',$str);\n\t\t$str = str_replace('<!--','',$str);\n\t\t$str = preg_replace('%<!\\[CDATA\\[.*?\\]\\]>%msu','',$str);\n\t\t$str = str_replace('<![CDATA[','',$str);\n\t\t\n\t\t# Transform processing instructions\n\t\t$str = str_replace('<?','>?',$str);\n\t\t$str = str_replace('?>','?<',$str);\n\t\t\n\t\t$str = html::decodeEntities($str,true);\n\t\t\n\t\t$this->content = '';\n\t\txml_parse($this->parser,'<all>'.$str.'</all>');\n\t\treturn $this->content;\n\t}",
"function tidy_str($str)\n\t{\n\t\tglobal $_CONFIG;\n\t\tif ($_CONFIG->tidy_html__or(true)) {\n\t\t\t$tidy = new tidy();\n\t\t\t$tidy->parseString($str, $_CONFIG->tidy_config__or(array()));\n\t\t\tif ($tidy->cleanRepair()) {\n\t\t\t\tfb(tidy_get_error_buffer($tidy), 'Tidy Errors');\n\t\t\t\treturn (string)$tidy;\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}",
"public function cleanup(bool $forceClean=FALSE){\n\t\tif(!$forceClean && rand(0,10) > 5) return;\n\t\tif ($handle = opendir($this->chunkPath)) {\n\t\t\twhile (FALSE !== ($file = readdir($handle))) {\n\t\t\t\t// relative dirs\n\t\t\t\tif ('.' === $file) continue;\n\t\t\t\tif ('..' === $file) continue;\n\t\t\t\t// directories/non-files\n\t\t\t\tif(!is_file($file)) continue;\n\t\t\t\t// non-chunks\n\t\t\t\tif(substr($file, strlen($this->partFileExt) * -1) !== $this->partFileExt) continue;\n\t\t\t\t// check modified time, to prevent current chunks from being removed\n\t\t\t\t$time = filemtime($this->chunkPath.'/'.$file);\n\t\t\t\tif($time && time() - $time > $this->chunkMaxAge){ // 4hr\n\t\t\t\t\tunlink($this->chunkPath.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t}",
"function tidy_diagnose(tidy $object) {}",
"public function cleanup() {\n\t\t//TODO\n\t}"
] | [
"0.69163716",
"0.6459631",
"0.5992639",
"0.5587093",
"0.5527182",
"0.5481099",
"0.54701006",
"0.54606694",
"0.54170126",
"0.5328901",
"0.51956946",
"0.51528555",
"0.50111246",
"0.50066435",
"0.48950356",
"0.48489368",
"0.48452532",
"0.48368126",
"0.48112518",
"0.47943094",
"0.47892353",
"0.47765455",
"0.47687688",
"0.47499746",
"0.47267494",
"0.47146657",
"0.4708404",
"0.47060272",
"0.4701051",
"0.46971104",
"0.46971104",
"0.46971104",
"0.46971104",
"0.46971104",
"0.46971104",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.4697087",
"0.46955892",
"0.4695536",
"0.4695536",
"0.4695536",
"0.4695536",
"0.4695536",
"0.4695536",
"0.4695536",
"0.46942997",
"0.46941808",
"0.4692592",
"0.46620336",
"0.46592128",
"0.46592128",
"0.46592128",
"0.46592128",
"0.46592128",
"0.46508873",
"0.46506763",
"0.46493906",
"0.46493906",
"0.46493906",
"0.4621881",
"0.46207413",
"0.46092746",
"0.45966047",
"0.45919508",
"0.45905918",
"0.45889118",
"0.45868987",
"0.45828402",
"0.45802101"
] | 0.7230275 | 0 |
Cleans the provided html snippet based on the configuation options | function cleanup($html, $options = null)
{
if(isset($options) && is_array($options)){
$this->setOptions($options);
}
$this->_html = "{$html}";
if($this->_options['UseTidy'] && $this->_options['TidyBefore']){
$this->tidyClean();
}
// Remove escape slashes
$this->_html = stripslashes($this -> _html);
if($this->_options['CleaningMethod']['tags'] == "whitelist"){
// Trim everything before body tag, leaving possible body attributes
if(preg_match("/<body/i", "{$this -> _html}")){
$this -> html = stristr($this -> _html, "<body");
}
// strip tags, still leaving attributes, second variable is allowed tags
$this->_html = strip_tags($this->_html, $this->_tag_whitelist);
}
if($this->_options['RemoveStyles']){
// Remove class and style attributes
$this->removeBlacklistedAttributes("class|style");
}
if($this->_options['IsWord']){
$this->removeBlacklistedAttributes("lang|[ovwxp]:\w+");
}
if($this->_options['CleaningMethod']['attributes'] == "blacklist"){
if(!empty ($this->_attrib_blacklist)){
$this->removeBlacklistedAttributes($this->_attrib_blacklist);
}
}
if($this->_options['Optimize']){
$repl = 1;
while($repl){
$repl = 0;
foreach($this->_cleanup_tags as $tag){
// Strip empty inline tags
$this -> _html = preg_replace("/<($tag)[^>]*>[\s]*([( )]*)[\s]*<\/($tag)>/i","\\2", $this -> _html,-1,$count);
$repl += $count;
// Merge inline tags
$this -> _html = preg_replace("/<\/($tag)[^>]*>[\s]*([( )]*)[\s]*<($tag)>/i","\\2", $this -> _html,-1,$count);
$repl += $count;
}
}
// Drop empty paragraph tags
if($this->_options['DropEmptyParas']){
$this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\s]*[( )]*[\s]*<\/(p|h[1-6]{1})>/i',"\r\n", $this -> _html);
}
// Trim extra spaces only if tidy is not set to indent
if(!$this->_tidy_config['indent']){
// Trim extra spaces between words
$this -> _html = preg_replace('/([^<>])[\s]+([^<>])/i',"\\1 \\2", $this -> _html);
// Trim extra spaces before tags
$this -> _html = preg_replace('/[\n|\r|\r\n|][\n|\r|\r\n|]+</i',"<", $this -> _html);
}
}
if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){
$this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\s]*[( )]*[\s]*<\/(p|h[1-6]{1})>/i',"\r\n", $this -> _html);
}
if($this->_options['FillEmptyTableCells']) {
$this -> _html = preg_replace("/<td([^>]*)>[\s]*<\/td>/i", "<td\\1> </td>", $this -> _html);
}
if($this->_options['Compress']){
// Trim spaces after tags
$this -> _html = preg_replace('/>[\s]+/',">", $this -> _html);
// Trim spaces before end tags
$this -> _html = preg_replace('/[\s]+<\//',"</", $this -> _html);
// Trim spaces before tags
$this -> _html = preg_replace('/[\s]+</',"<", $this -> _html);
// Trim extra spaces between words
$this -> _html = preg_replace('/([^<>])[\s]+([^<>])/',"\\1 \\2", $this -> _html);
}
if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){
$this->tidyClean();
}
return $this->output("{$this->_html}");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function cleanHTML($content);",
"protected function parseHtml() {\r\n\t\tif (is_array($this->cfg->html))\r\n\t\t\t$this->cfg->html = utils::render($this->cfg->html);\r\n\t}",
"function tidyClean() \n { \n if(!class_exists('tidy')){ \n if(function_exists('tidy_parse_string')){ \n tidy_set_encoding(\"{$this->_options[\"Encoding\"]}\"); \n foreach($this->_tidy_config as $k => $v) { \n tidy_setopt($k, $v); \n } \n tidy_parse_string($this->_html); \n tidy_clean_repair(); \n $this->_html = tidy_get_output(); \n } \n else { \n error_log(\"Tidy is not supported on this platform. Basic Cleaning is applied.\"); \n } \n } \n else { \n $tidy = new tidy; \n $tidy -> parseString($this->_html, $this->_tidy_config, \"{$this->_options[\"Encoding\"]}\"); \n $tidy -> cleanRepair(); \n $this -> html = $tidy; \n } \n }",
"function wpstart_sanitize_html($input)\n {\n return wp_kses_post(force_balance_tags($input));\n }",
"function emarking_clean_question_html($html)\n{\n $question = get_string('question', 'mod_quiz');\n $html = preg_replace('/[\\n\\r]/', '', $html);\n $html = preg_replace('/<div class=\"state\">(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<div class=\"grade\">(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<div class=\"questionflag\">(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<h4 class=\"accesshide\">(.*?)<\\/h4>/', '', $html);\n $html = preg_replace('/<input type=\"hidden\"(.*?)>/', '', $html);\n $html = preg_replace('/<input type=\"radio\"(.*?)>/', '<input type=\"radio\">', $html);\n $html = preg_replace('/checked=\"checked\"/', '', $html);\n $html = preg_replace('/alt=\"[^\"]*\"/', '', $html);\n $html = preg_replace('/title=\"[^\"]*\"/', '', $html);\n $html = preg_replace('/class=\"texrender\"/', '', $html);\n $html = preg_replace('/<script type=\"math\\/tex\">(.*?)<\\/script>/', '', $html);\n $html = preg_replace('/class\\s*=\\s*\"(.*?)\"/', '', $html);\n $html = preg_replace('/style\\s*=\\s*\"(.*?)\"/', '', $html);\n $html = preg_replace('/<span\\s*>/', '', $html);\n $html = preg_replace('/<\\/span>/', '', $html);\n $html = preg_replace('/<label(.*?)>/', '', $html);\n $html = preg_replace('/<\\/label>/', '', $html);\n $html = preg_replace('/<a\\s+href\\s*=\\s*\"(.*?)\">(.*?)<\\/a>/', '$2', $html);\n $html = preg_replace('/id\\s*=\\s*\"(.*?)\"/', '', $html);\n $html = preg_replace('/<br>/', '', $html);\n $html = preg_replace('/<p(\\s*?)>/', '', $html);\n $html = preg_replace('/(<div\\s*>)+/', '<div>', $html);\n $html = preg_replace('/(<\\/div>)+/', '</div>', $html);\n $html = preg_replace('/<div>Sele(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<div(.*?)><h3(.*?)>'.$question.'\\s+(.*?)<\\/h3><\\/div>/', '<br/><p><b>$3</b></p>', $html);\n $html = preg_replace('/<tbody\\s*>/', '', $html);\n $html = preg_replace('/<\\/tbody>/', '', $html);\n $html = preg_replace('/<td(.*?)>(.*?)<\\/p><\\/td>/', '<td style=\"text-align:center;\" align=\"center\">$2</td>', $html);\n $html = preg_replace('/frame=\"border\"/', '', $html);\n $html = preg_replace('/border=\"\\d+\"/', 'border=\"1\"', $html);\n $html = preg_replace('/<table(.*?)>/', '<br/><table$1>', $html);\n $html = preg_replace('/<table(.*?)>/', '<br/><table$1>', $html);\n $html = preg_replace('/<div>(<input.*?)<\\/div>/', '<br/>$1', $html);\n return $html;\n}",
"function cmh_validate_options($input) {\r\n\t // strip html from textboxes\r\n\t$input['textarea_one'] = wp_filter_nohtml_kses($input['textarea_one']); // Sanitize textarea input (strip html tags, and escape characters)\r\n\t$input['txt_one'] = wp_filter_nohtml_kses($input['txt_one']); // Sanitize textbox input (strip html tags, and escape characters)\r\n\treturn $input;\r\n}",
"function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }",
"protected function allow_html() {\n\t\tremove_filter( 'pre_term_description', 'wp_filter_kses' );\n\t\tremove_filter( 'term_description', 'wp_kses_data' );\n\n\t\tadd_filter( 'pre_term_description', 'wp_filter_post_kses' );\n\t}",
"public function doXHTML_cleaning() {}",
"public static function sanitizeHtml($raw_html)\n {\n try {\n $cache_dir = fn_get_cache_path(false) . 'html_purifier/';\n if (!is_dir($cache_dir)) {\n fn_mkdir($cache_dir);\n }\n\n $config_instance = \\HTMLPurifier_Config::createDefault();\n $config_instance->set('HTML.DefinitionID', PRODUCT_NAME . '_' . PRODUCT_VERSION);\n $config_instance->set('HTML.DefinitionRev', 1);\n $config_instance->set('Cache.SerializerPath', $cache_dir);\n $config_instance->set('Cache.SerializerPermissions', DEFAULT_DIR_PERMISSIONS);\n $config_instance->set('HTML.AllowedAttributes', [\n // general tags\n '*.class' => true,\n '*.id' => true,\n '*.href' => true,\n '*.target' => true,\n '*.style' => true,\n '*.title' => true,\n // img tags\n 'img.src' => true,\n 'img.width' => true,\n 'img.height' => true,\n 'img.alt' => true,\n // block placeholders in WYSIWYG\n 'hr.data-ca-object-key' => true,\n 'hr.data-ca-block-name' => true,\n ]);\n\n $config_instance->autoFinalize = false;\n\n /**\n * Allows to configure HTMLPurifier before it purifies given HTML.\n *\n * @param \\HTMLPurifier_Config $config_instance Instance of HTMLPurifier_Config\n * @param string $raw_html HTML to be purified\n */\n fn_set_hook('sanitize_html', $config_instance, $raw_html);\n\n /** @var \\HTMLPurifier_HTMLDefinition $html_definition */\n if ($html_definition = $config_instance->maybeGetRawHTMLDefinition()) {\n $html_definition->addAttribute('a',\n 'target',\n new \\HTMLPurifier_AttrDef_Enum(\n array('_blank', '_self', '_target', '_top')\n ));\n\n $html_definition->addAttribute('hr',\n 'data-ca-object-key',\n new \\HTMLPurifier_AttrDef_Text()\n );\n\n $html_definition->addAttribute('hr',\n 'data-ca-block-name',\n new \\HTMLPurifier_AttrDef_Text()\n );\n }\n\n $purifier_instance = \\HTMLPurifier::instance($config_instance);\n\n $html_purify = $purifier_instance->purify($raw_html);\n\n return html_entity_decode($html_purify, ENT_QUOTES, 'UTF-8');\n\n } catch (\\Exception $e) {\n throw new DeveloperException($e->getMessage());\n }\n }",
"function clean_html($html)\r\n{\r\n\t$html = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', \"\", $html);\r\n\t$html = preg_replace('/<style\\b[^>]*>(.*?)<\\/style>/is', \"\", $html);\r\n\t$html = preg_replace('/<link \\b[^>]*>(.*?)/is', \"\", $html);\r\n\r\n\treturn $html;\r\n}",
"protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }",
"protected function cleanHTML(string $html) : string\n {\n // $html = str_replace(\"\\n\", '', $html);\n for($i = 0; $i < 3; $i++) {\n $html = str_replace($this->prefixHTML, '', $html);\n $html = str_replace($this->postfixHTML, '', $html);\n $html = str_replace('<?xml version=\"1.0\" standalone=\"yes\"?>', '', $html);\n //remove white space\n $html = preg_replace('/\\s+/', ' ', $html);\n // $html = str_replace('> <', '><', $html);\n }\n\n return $html;\n }",
"function acf_allow_unfiltered_html()\n{\n}",
"protected function cleanHTML($html)\n\t{\n\t\t$html = trim($html);\n\t\t// remove multiple tabs\n\t\t$html = preg_replace('/\\t/',\"\",$html);\n\t\t// remove multiple line breaks\n\t\t$html = preg_replace('/(\\n|\\r){2,}/',\"\\n\",$html);\n\t\t// set all paths to absolute\n\t\t$html = preg_replace_callback('/((?:src|href|action)=[\\'\\\"])([^\\'\\\"]*)([\\'\\\"])/',function($matches){\n\t\t\tif ( (preg_match('/^\\/[^\\/]/',$matches[2])) && (!preg_match('/^https?/',$matches[2])) )\n\t\t\t{\n\t\t\t\t$matches[2] = Director::absoluteURL($matches[2]);\n\t\t\t}\n\t\t\treturn $matches[1].$matches[2].$matches[3];\n\t\t},$html);\n\t\treturn $html;\n\t}",
"function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }",
"public static function cleanHTMLStr($html)\n {\n require_once __DIR__ . '/../../Libs/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php';\n $config = HTMLPurifier_Config::createDefault();\n $config->loadArray([\n 'Cache.DefinitionImpl' => null,\n 'Core.Encoding' => 'UTF-8',\n 'HTML.Allowed' => 'strong,em,a[href|title|target|rel|class|style],ul[style],ol[style],li[style],br,span[class|style]',\n 'Attr.AllowedFrameTargets' => array('_blank', '_self'),\n 'CSS.AllowTricky' => true,\n 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding,padding-left,padding-right,color,background-color,text-align,display',\n 'AutoFormat.RemoveEmpty' => true\n ]);\n $purifier = new HTMLPurifier($config);\n return $purifier->purify($html);\n }",
"private static function clearHTML($html)\n {\n return preg_replace(array(\n '/\\s+/',\n '/[\\t\\n\\r]+/',\n '/<!--.*?-->/s',\n '/>\\s*</',\n '/;\\s*(\\\"|\\')/',\n '/<\\/\\s+/',\n '/\\s+\\/>/',\n '/<\\s+/',\n '/\\s+>/'\n ), array(\n ' ',\n ' ',\n '',\n '><',\n '${1}',\n '</',\n '/>',\n '<',\n '>'\n ), $html);\n }",
"function wpec_validate_options($input) {\n\n\t// Check our textbox option field contains no HTML tags - if so strip them out\n\t//$input['text_string'] = wp_filter_nohtml_kses($input['text_string']);\n\n return $input;\n}",
"function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}",
"function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}",
"function theme_options_validate( $input ) {\n\n\t// Say our text option must be safe text with no HTML tags\n\t$input['sometext'] = wp_filter_nohtml_kses( $input['sometext'] );\n\n\n\n\treturn $input;\n}",
"function cleanHtml($name) {\n\t\tif (isset($this->getvars[$name])){\n\t\t\treturn (string)strip_tags(urldecode($this->getvars[$name]));\n\t\t} else {\n\t\t\treturn (string)@strip_tags(urldecode($this->postvars[$name]));\n\t\t}\n\t}",
"public function sanitize()\n {\n parent::sanitize();\n\n foreach ($this->_cleanData as $key => $value) {\n $this->_cleanData[$key] = strip_tags($value);\n }\n }",
"public function cropHtmlWorksWithLinebreaks() {}",
"function qa_sanitize_html($html, $linksnewwindow = false, $storage = false)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\trequire_once 'vendor/htmLawed.php';\n\n\tglobal $qa_sanitize_html_newwindow;\n\n\t$qa_sanitize_html_newwindow = $linksnewwindow;\n\n\t$safe = htmLawed($html, array(\n\t\t'safe' => 1,\n\t\t'elements' => '*+embed+object-form',\n\t\t'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; style: !; classid:clsid',\n\t\t'keep_bad' => 0,\n\t\t'anti_link_spam' => array('/.*/', ''),\n\t\t'hook_tag' => 'qa_sanitize_html_hook_tag',\n\t));\n\n\treturn $safe;\n}",
"function wp_filter_nohtml_kses($data)\n {\n }",
"function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}",
"public function tidyHtml(string $html): string\n {\n // some point.\n return $html;\n }",
"public function cropHtmlWorksWithComplexContent() {}",
"public function testHtml() {\n $this->assertEquals('String with b & i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.'));\n $this->assertEquals('String <b>with</b> b & i <i>tags</i>.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('strip' => false)));\n $this->assertEquals('String <b>with</b> b & i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('whitelist' => '<b>')));\n $this->assertEquals('String with b &amp; i tags.', Sanitize::html('String <b>with</b> b & i <i>tags</i>.', array('double' => true)));\n }",
"function purify($html, $level=0, $groupId=0) {\n $clean = '';\n switch($level) { \n case CODENDI_PURIFIER_FORUMML:\n require_once($GLOBALS['htmlpurifier_dir'].'/HTMLPurifier.auto.php');\n $hp = HTMLPurifier::getInstance();\n $config = $this->getHPConfig($level);\n $clean = util_make_links($hp->purify($html, $config), $groupId); \t\n break;\n default:\n $clean = parent::purify($html,$level,$groupId);\n }\n return $clean;\n }",
"function remove_autop_template_content( $init, $editor_id ) {\r\n $init['apply_source_formatting'] = true;\r\n $init['wpautop'] = false;\r\n $init['remove_linebreaks'] = false;\r\n return $init;\r\n }",
"function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}",
"protected function setHtmlContent() {}",
"public static function get_allowed_wp_kses_html()\n {\n }",
"function filter_html($as_admin,$source_member,$pos,&$len,&$comcode,$in_html,$in_semihtml)\n{\n\tif ((!$as_admin) && (!has_specific_permission($source_member,'use_very_dangerous_comcode')))\n\t{\n\t\tglobal $POTENTIAL_JS_NAUGHTY_ARRAY;\n\n\t\t$comcode=preg_replace('#(\\\\\\\\)+(\\[/(html|semihtml)\\])#','\\2',$comcode); // Stops sneaky trying to trick the end of the HTML tag to hack this function\n\n\t\tif (($in_html) && ($in_semihtml)) $ahead_end=max(strpos(strtolower($comcode),'[/html]',$pos),strpos(strtolower($comcode),'[/semihtml]',$pos));\n\t\telseif ($in_html) $ahead_end=strpos(strtolower($comcode),'[/html]',$pos);\n\t\telseif ($in_semihtml) $ahead_end=strpos(strtolower($comcode),'[/semihtml]',$pos);\n\t\telse $ahead_end=false;\n\t\tif ($ahead_end===false) $ahead_end=strlen($comcode);\n\t\t$ahead=substr($comcode,$pos,$ahead_end-$pos);\n\n\t\trequire_code('input_filter');\n\t\thard_filter_input_data__html($ahead);\n\n\t\t// Tidy up\n\t\t$comcode=substr($comcode,0,$pos).$ahead.substr($comcode,$ahead_end);\n\t\t$len=strlen($comcode);\n\t}\n}",
"protected function _clean()\n {\n if ($this->_defaultOptions['clean'] === FALSE) {\n return;\n }\n\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'remove unused markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $this->_cleanMarkers('loop');\n $this->_cleanMarkers('optional');\n\n $this->DISPLAY = preg_replace(\n $this->_contentMarkers,\n '',\n $this->DISPLAY\n );\n }",
"protected function cleanHtml($html) {\n $chain = new Zend_Filter();\n\n if($this->isFilterTags){\n $chain->addFilter(new Zend_Filter_StripTags(self::$tags));\n }\n $chain->addFilter(new Zend_Filter_StringTrim());\n\n $html = $chain->filter($html);\n\n $tmp = $html;\n while (1) {\n // Try and replace an occurrence of javascript:\n $html = preg_replace('/(<[^>]*)javascript:([^>]*>)/i', '$1$2', $html);\n \n\n // If nothing changed this iteration then break the loop\n if ($html == $tmp)\n break;\n\n $tmp = $html;\n }\n\n return $html;\n }",
"function string_restore_valid_html_tags( $p_string, $p_multiline = true ) \r\n{\r\n\t$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );\r\n\r\n\tif ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {\r\n\t\treturn $p_string;\r\n\t}\r\n\r\n\t$tags = explode( ',', $t_html_valid_tags );\r\n\tforeach ($tags as $key => $value) \r\n\t{ \r\n \tif ( !is_blank( $value ) ) {\r\n \t$tags[$key] = trim($value); \r\n }\r\n }\r\n $tags = implode( '|', $tags);\r\n\r\n\t$p_string = preg_replace( '/<(' . $tags . ')\\s*>/ui', '<\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/<\\/(' . $tags . ')\\s*>/ui', '</\\\\1>', $p_string );\r\n\t$p_string = preg_replace( '/<(' . $tags . ')\\s*\\/>/ui', '<\\\\1 />', $p_string );\r\n\r\n\r\n\treturn $p_string;\r\n}",
"private function clean_content( $content ){\n\t\t\t$content = strip_shortcodes( $content );\n\n\t\t\t// clean html away from content\n\t\t\t$content = wp_filter_nohtml_kses( $content );\n\n\t\t\t// all clean and ready to shine\n\t\t\treturn $content;\n\t\t}",
"private function clean_youtube() {\n\n\t\tadd_filter('embed_oembed_html', function($html, $src, $args){\n\n\t\t\tif ( strpos( $src, 'www.youtube.com') != false ) {\n\t\t\t\t$html = preg_replace( '/(src=(\\S+))(?=\")/', '$1&showinfo=0&rel=0', $html);\n\t\t\t}\n\n\t\t\t$html = '<div class=\"embed-responsive embed-responsive-16by9\">' . $html . '</div>';\n\t\t\treturn $html;\n\t\t}, 10, 3);\n\t}",
"public static function removeHtml($s)\n {\n $newLinesAfter = 'h1|h2|h3|h4|h5|h6|h7|h8';\n $newLineAfter = 'caption|div|li|p|tr';\n $removeContent = 'script|style|noframes|select|option|link';\n $spaceAfter = 'td|th';\n\n /**///prep the string\n $s = ' ' . preg_replace(\"/[\\\\r\\\\n]+/\", '', $s);\n\n //begin removal\n /**///remove comment blocks\n while(stripos($s,'<!--') > 0){\n $pos[1] = stripos($s,'<!--');\n $pos[2] = stripos($s,'-->', $pos[1]);\n $len[1] = $pos[2] - $pos[1] + 3;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n\n /**///remove tags with content between them\n if(strlen($removeContent) > 0){\n $e = explode('|', $removeContent);\n for($i=0;$i<count($e);$i++){\n while(stripos($s,'<' . $e[$i]) > 0){\n $len[1] = strlen('<' . $e[$i]);\n $pos[1] = stripos($s,'<' . $e[$i]);\n $pos[2] = stripos($s,$e[$i] . '>', $pos[1] + $len[1]);\n $len[2] = $pos[2] - $pos[1] + $len[1];\n $x = substr($s,$pos[1],$len[2]);\n $s = str_replace($x,'',$s);\n }\n }\n }\n\n foreach (explode('|', $newLinesAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\\n\", $s);\n }\n foreach (explode('|', $newLineAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \"\\n\", $s);\n }\n foreach (explode('|', $spaceAfter) as $endTag) {\n $s = str_replace(\"</$endTag>\", \" \", $s);\n }\n\n /**///remove remaining tags\n $start = 0;\n while(stripos($s,'<', $start) > 0){\n $pos[1] = stripos($s,'<', $start);\n $pos[2] = stripos($s,'>', $pos[1]);\n if (!$pos[2]) {\n //No closing tag! Skip this one\n $start = $pos[1]+1;\n } else {\n $len[1] = $pos[2] - $pos[1] + 1;\n $x = substr($s,$pos[1],$len[1]);\n $s = str_replace($x,'',$s);\n }\n }\n\n if (PHP_EOL != \"\\n\") {\n $s = str_replace(\"\\n\", PHP_EOL, $s);\n }\n return html_entity_decode(trim($s), ENT_QUOTES, 'cp1252');\n }",
"private static function cleanHtml(string $html, array $allowedTags): string\n {\n $html = static::removeUnallowedHTMLTags($html, array_keys(static::$validUserTagsAndAttributes));\n\n $html = static::removeUnallowedHTMLAttributes($html);\n\n $html = static::removeUnallowedHTMLTags($html, $allowedTags);\n\n return $html;\n }",
"function remove_html($content) {\r\n\t$content = strip_tags($content);\r\n return $content;\r\n}",
"function mdwpfp_init_markup_cleanup() {\n add_action('init', 'mdwpfp_head_cleanup');\n\n // Remove WP version from the RSS feed.\n add_filter('the_generator', 'mdwpfp_rss_version');\n\n // Clean the WP generated code around images.\n add_filter('the_content', 'mdwpfp_filter_ptags_on_images');\n\n // Remove pesky injected css for recent comments widget.\n add_filter('wp_head', 'mdwpfp_remove_wp_widget_recent_comments_style', 1);\n // Clean up injected comment styles in the <head>.\n add_action('wp_head', 'mdwpfp_remove_recent_comments_style', 1);\n\n // Clean the default WP photo gallery output.\n add_filter('gallery_style', 'mdwpfp_gallery_style');\n\n}",
"function wp_kses_allowed_html($context = '')\n {\n }",
"public function html_remove_shortcodes($html)\n {\n return preg_replace_callback('/\\[[^\\]]*\\]/', function ($match) {\n if (preg_match('/^\\[(image|sitetree\\_link,id|file\\_link,id)\\b/', $match[0])) {\n return $match[0];\n }\n return '';\n }, $html);\n }",
"function xss_html_clean( $html )\n\t{\n\t\t//-----------------------------------------\n\t\t// Opening script tags...\n\t\t// Check for spaces and new lines...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"#<(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\" , \"<script\" , $html );\n\t\t$html = preg_replace( \"#<(\\s+?)?/(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\", \"</script\", $html );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Basics...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"/javascript/i\" , \"javascript\", $html );\n\t\t$html = preg_replace( \"/alert/i\" , \"alert\" , $html );\n\t\t$html = preg_replace( \"/about:/i\" , \"about:\" , $html );\n\t\t$html = preg_replace( \"/onmouseover/i\", \"onmouseover\" , $html );\n\t\t$html = preg_replace( \"/onclick/i\" , \"onclick\" , $html );\n\t\t$html = preg_replace( \"/onload/i\" , \"onload\" , $html );\n\t\t$html = preg_replace( \"/onsubmit/i\" , \"onsubmit\" , $html );\n\t\t$html = preg_replace( \"/<body/i\" , \"<body\" , $html );\n\t\t$html = preg_replace( \"/<html/i\" , \"<html\" , $html );\n\t\t$html = preg_replace( \"/document\\./i\" , \"document.\" , $html );\n\t\t\n\t\treturn $html;\n\t}",
"static function html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }",
"public function custom_category_descriptions_allow_html() {\n\t\t$filters = array(\n\t\t\t'pre_term_description',\n\t\t\t'pre_link_description',\n\t\t\t'pre_link_notes',\n\t\t\t'pre_user_description',\n\t\t);\n\n\t\tforeach ( $filters as $filter ) {\n\t\t\tremove_filter( $filter, 'wp_filter_kses' );\n\t\t}\n\t\tremove_filter( 'term_description', 'wp_kses_data' );\n\t}",
"function correctHTMLValidationErrors($txt) {\r\n\tif (Settings::get ( \"disable_html_validation\" )) {\r\n\t\treturn $txt;\r\n\t}\r\n\t\r\n\t// Ersetze & durch &\r\n\t$txt = preg_replace ( '/[&](?![A-Za-z]+[;])/', \"&\", $txt );\r\n\t\r\n\t// replaced deprecated HTML-Tags\r\n\t$txt = str_ireplace ( \"<center>\", \"<div style=\\\"text-align:center\\\">\", $txt );\r\n\t$txt = str_ireplace ( \"</center>\", \"</div>\", $txt );\r\n\t$txt = str_ireplace ( \"<strike>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</strike>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<s>\", \"<del>\", $txt );\r\n\t$txt = str_ireplace ( \"</s>\", \"</del>\", $txt );\r\n\t$txt = str_ireplace ( \"<tt>\", \"<code>\", $txt );\r\n\t$txt = str_ireplace ( \"</tt>\", \"</code>\", $txt );\r\n\t$txt = str_ireplace ( \"<dir>\", \"<ul>\", $txt );\r\n\t$txt = str_ireplace ( \"</dir>\", \"</ul>\", $txt );\r\n\t$txt = str_ireplace ( \"<acronym>\", \"<abbr>\", $txt );\r\n\t$txt = str_ireplace ( \"</acronym>\", \"</abbr>\", $txt );\r\n\t\r\n\treturn $txt;\r\n}",
"public function cleanup()\n\t{\n\t\tif ($this->isHtml())\n\t\t{\n\t\t\t$responseBody = preg_replace('/<link rel=[\"\\' ](pingback|alternate|EditURI|wlwmanifest|index|profile|prev)[\"\\' ](.*?)>/si', '', $this->getResponseBody());\n\t\t\t$responseBody = preg_replace('/<meta name=[\"\\' ]generator[\"\\' ](.*?)>/si', '', $responseBody);\n\t\t\t$this->setResponseBody($responseBody);\n\t\t}\n\t}",
"private static function minify($html) {\n\t\tif(!modules::get_config('tpl_minifier')) {\n\t\t\treturn $html;\n\t\t}\n\t\t// TODO: Match <code> and <pre> too - in separate arrays\n\t\tpreg_match_all('/(<script[^>]*?>.*?<\\/script>)/si', $html, $pre);\n\t\tpreg_match_all('/(<textarea[^>]*?>.*?<\\/textarea>)/si', $html, $textarea);\n\t\t$i=0;\n\t\twhile(preg_match('/(<script[^>]*?>.*?<\\/script>)/si', $html)) {\n\t\t\t$html = preg_replace('/(<script[^>]*?>.*?<\\/script>)/si', '#pre'.$i.'#', $html, 1);\n\t\t\t$i++;\n\t\t}\n\t\t$i=0;\n\t\twhile(preg_match('/(<textarea[^>]*?>.*?<\\/textarea>)/si', $html)) {\n\t\t\t$html = preg_replace('/(<textarea[^>]*?>.*?<\\/textarea>)/si', '#textarea'.$i.'#', $html, 1);\n\t\t\t$i++;\n\t\t}\n\t\t$html = preg_replace('#<!-[^\\[].+?->#', '', $html);//ToDo: WTF?!\n\t\t$html = preg_replace('/[\\r\\n\\t]+/', ' ', $html);\n\t\t$html = preg_replace('/>[\\s]*</', '><', $html); // Strip spacechars between tags\n\t\t$html = preg_replace('/[\\s]+/', ' ', $html); // Replace several spacechars with one space\n\t\tif(!empty($pre[0])) {\n\t\t\t$i=0;\n\t\t\tforeach($pre[0] as $tag) {\n\t\t\t\t$tag = preg_replace('/^\\ *\\/\\/[^\\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside\n\t\t\t\t$tag = preg_replace('/[\\ \\t]{2,}/', ' ', $tag); // Replace several spaces by one\n\t\t\t\t$tag = preg_replace('/\\s{2,}/', \"\\r\\n\", $tag); // Replace several linefeeds by one\n\t\t\t\t$html = preg_replace('/#pre'.$i.'#/', $tag, $html, 1);\n\t\t\t\tunset($pre[0][$i]);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tif(!empty($textarea[0])) {\n\t\t\t$i=0;\n\t\t\tforeach($textarea[0] as $tags) {\n\t\t\t\t$tags = preg_replace('/^\\ *\\/\\/[^\\<]*?$/m', ' ', $tags);\n\t\t\t\t$tags = preg_replace('/[\\ \\t]{3,}/', ' ', $tags);\n\t\t\t\t$html = preg_replace('/#textarea'.$i.'#/', $tags, $html, 1);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\treturn $html;\n\t}",
"function HTMLPurifier($html, $config = null) {\r\r\n static $purifier = false;\r\r\n if (!$purifier) {\r\r\n require_once 'HTMLPurifier.php';\r\r\n $purifier = new HTMLPurifier();\r\r\n }\r\r\n return $purifier->purify($html, $config);\r\r\n}",
"function clean_content($string) {\n $patterns = array(\n '#^\\s*</p>#',\n '#<p>\\s*$#',\n '#<p>(\\s| )*+(<br\\s*/*>)?(\\s| )*</p>#'\n );\n // $patterns = '#<p>(\\s| )*+(<br\\s*/*>)?(\\s| )*</p>#i';\n\n return preg_replace($patterns, '', $string);\n}",
"public function cropHTML($content, $options)\n {\n $options = explode('|', $options);\n $chars = (int)$options[0];\n $absChars = abs($chars);\n $replacementForEllipsis = trim($options[1]);\n $crop2space = trim($options[2]) === '1';\n // Split $content into an array(even items in the array are outside the tags, odd numbers are tag-blocks).\n $tags = 'a|abbr|address|area|article|aside|audio|b|bdi|bdo|blockquote|body|br|button|caption|cite|code|col|colgroup|data|datalist|dd|del|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|h1|h2|h3|h4|h5|h6|header|hr|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|main|map|mark|meter|nav|object|ol|optgroup|option|output|p|param|pre|progress|q|rb|rp|rt|rtc|ruby|s|samp|section|select|small|source|span|strong|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|tr|track|u|ul|ut|var|video|wbr';\n $tagsRegEx = '\n\t\t\t(\n\t\t\t\t(?:\n\t\t\t\t\t<!--.*?-->\t\t\t\t\t# a comment\n\t\t\t\t\t|\n\t\t\t\t\t<canvas[^>]*>.*?</canvas> # a canvas tag\n\t\t\t\t\t|\n\t\t\t\t\t<script[^>]*>.*?</script> # a script tag\n\t\t\t\t\t|\n\t\t\t\t\t<noscript[^>]*>.*?</noscript> # a noscript tag\n\t\t\t\t\t|\n\t\t\t\t\t<template[^>]*>.*?</template> # a template tag\n\t\t\t\t)\n\t\t\t\t|\n\t\t\t\t</?(?:' . $tags . ')+\t\t\t# opening tag (\\'<tag\\') or closing tag (\\'</tag\\')\n\t\t\t\t(?:\n\t\t\t\t\t(?:\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\\\\s+\\\\w[\\\\w-]*\t\t# EITHER spaces, followed by attribute names\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\\\\s*=?\\\\s*\t\t# equals\n\t\t\t\t\t\t\t\t(?>\n\t\t\t\t\t\t\t\t\t\".*?\"\t\t# attribute values in double-quotes\n\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t\t\\'.*?\\'\t\t# attribute values in single-quotes\n\t\t\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t\t\t[^\\'\">\\\\s]+\t# plain attribute values\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\t|\t\t\t\t\t\t# OR a single dash (for TYPO3 link tag)\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\\\\s+-\n\t\t\t\t\t\t)\n\t\t\t\t\t)+\\\\s*\n\t\t\t\t\t|\t\t\t\t\t\t\t# OR only spaces\n\t\t\t\t\t\\\\s*\n\t\t\t\t)\n\t\t\t\t/?>\t\t\t\t\t\t\t\t# closing the tag with \\'>\\' or \\'/>\\'\n\t\t\t)';\n $splittedContent = preg_split('%' . $tagsRegEx . '%xs', $content, -1, PREG_SPLIT_DELIM_CAPTURE);\n // Reverse array if we are cropping from right.\n if ($chars < 0) {\n $splittedContent = array_reverse($splittedContent);\n }\n // Crop the text (chars of tag-blocks are not counted).\n $strLen = 0;\n // This is the offset of the content item which was cropped.\n $croppedOffset = null;\n $countSplittedContent = count($splittedContent);\n for ($offset = 0; $offset < $countSplittedContent; $offset++) {\n if ($offset % 2 === 0) {\n $tempContent = $splittedContent[$offset];\n $thisStrLen = mb_strlen(html_entity_decode($tempContent, ENT_COMPAT, 'UTF-8'), 'utf-8');\n if ($strLen + $thisStrLen > $absChars) {\n $croppedOffset = $offset;\n $cropPosition = $absChars - $strLen;\n // The snippet \"&[^&\\s;]{2,8};\" in the RegEx below represents entities.\n $patternMatchEntityAsSingleChar = '(&[^&\\\\s;]{2,8};|.)';\n $cropRegEx = $chars < 0 ? '#' . $patternMatchEntityAsSingleChar . '{0,' . ($cropPosition + 1) . '}$#uis' : '#^' . $patternMatchEntityAsSingleChar . '{0,' . ($cropPosition + 1) . '}#uis';\n if (preg_match($cropRegEx, $tempContent, $croppedMatch)) {\n $tempContentPlusOneCharacter = $croppedMatch[0];\n } else {\n $tempContentPlusOneCharacter = false;\n }\n $cropRegEx = $chars < 0 ? '#' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}$#uis' : '#^' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}#uis';\n if (preg_match($cropRegEx, $tempContent, $croppedMatch)) {\n $tempContent = $croppedMatch[0];\n if ($crop2space && $tempContentPlusOneCharacter !== false) {\n $cropRegEx = $chars < 0 ? '#(?<=\\\\s)' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}$#uis' : '#^' . $patternMatchEntityAsSingleChar . '{0,' . $cropPosition . '}(?=\\\\s)#uis';\n if (preg_match($cropRegEx, $tempContentPlusOneCharacter, $croppedMatch)) {\n $tempContent = $croppedMatch[0];\n }\n }\n }\n $splittedContent[$offset] = $tempContent;\n break;\n }\n $strLen += $thisStrLen;\n }\n }\n // Close cropped tags.\n $closingTags = [];\n if ($croppedOffset !== null) {\n $openingTagRegEx = '#^<(\\\\w+)(?:\\\\s|>)#';\n $closingTagRegEx = '#^</(\\\\w+)(?:\\\\s|>)#';\n for ($offset = $croppedOffset - 1; $offset >= 0; $offset = $offset - 2) {\n if (substr($splittedContent[$offset], -2) === '/>') {\n // Ignore empty element tags (e.g. <br />).\n continue;\n }\n preg_match($chars < 0 ? $closingTagRegEx : $openingTagRegEx, $splittedContent[$offset], $matches);\n $tagName = isset($matches[1]) ? $matches[1] : null;\n if ($tagName !== null) {\n // Seek for the closing (or opening) tag.\n $countSplittedContent = count($splittedContent);\n for ($seekingOffset = $offset + 2; $seekingOffset < $countSplittedContent; $seekingOffset = $seekingOffset + 2) {\n preg_match($chars < 0 ? $openingTagRegEx : $closingTagRegEx, $splittedContent[$seekingOffset], $matches);\n $seekingTagName = isset($matches[1]) ? $matches[1] : null;\n if ($tagName === $seekingTagName) {\n // We found a matching tag.\n // Add closing tag only if it occurs after the cropped content item.\n if ($seekingOffset > $croppedOffset) {\n $closingTags[] = $splittedContent[$seekingOffset];\n }\n break;\n }\n }\n }\n }\n // Drop the cropped items of the content array. The $closingTags will be added later on again.\n array_splice($splittedContent, $croppedOffset + 1);\n }\n $splittedContent = array_merge($splittedContent, [\n $croppedOffset !== null ? $replacementForEllipsis : ''\n ], $closingTags);\n // Reverse array once again if we are cropping from the end.\n if ($chars < 0) {\n $splittedContent = array_reverse($splittedContent);\n }\n return implode('', $splittedContent);\n }",
"public function clear_html( $val ) {\n//\t\treturn $val;\n\t\treturn str_replace( array( ',', '"', '[', ']', ''' ), array( ',', '\"', '[', ']', \"'\" ), $val);\n\t}",
"protected function _beforeToHtml()\n {\n if (!$this->isReviewsEnabled()) {\n $this->setTemplate('');\n return parent::_beforeToHtml();\n }\n\n if (!$this->_setReviews()) {\n $this->setTemplate('');\n return parent::_beforeToHtml();\n }\n\n return parent::_beforeToHtml();\n }",
"function html_strip_unsafe($strData)\n\t\t{\n\t\t // Unsafe HTML tags/attributes that members may abuse\n\t\t $arrData=array(\n\t\t //'/<iframe(.*?)<\\/iframe>/is',\n\t\t '/<title(.*?)<\\/title>/is',\n\t\t '/<pre(.*?)<\\/pre>/is',\n\t\t '/<frame(.*?)<\\/frame>/is',\n\t\t '/<frameset(.*?)<\\/frameset>/is',\n\t\t //'/<object(.*?)<\\/object>/is',\n\t\t '/<script(.*?)<\\/script>/is',\n\t\t //'/<embed(.*?)<\\/embed>/is',\n\t\t '/<applet(.*?)<\\/applet>/is',\n\t\t '/<meta(.*?)>/is',\n\t\t '/<!doctype(.*?)>/is',\n\t\t '/<link(.*?)>/is',\n\t\t '/<body(.*?)>/is',\n\t\t '/<\\/body>/is',\n\t\t '/<head(.*?)>/is',\n\t\t '/<\\/head>/is',\n\t\t '/onload=\"(.*?)\"/is',\n\t\t '/onunload=\"(.*?)\"/is',\n\t\t '/onerror=\"(.*?)\"/is',\n\t\t '/onclick=\"(.*?)\"/is',\n\t\t '/onchange=\"(.*?)\"/is',\n\t\t '/onmouseover=\"(.*?)\"/is',\n\t\t '/autofocus=\"(.*?)\"/is',\n\t\t '/onfocus=\"(.*?)\"/is',\n\t\t '/<html(.*?)>/is',\n\t\t '/<\\/html>/is',\n\t\t );\n\t\t $strData = preg_replace($arrData, \"\", $strData);\n\t\t\t$strData = filter_var($strData, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n\t\t return $strData;\n\t\t}",
"function FixHtml($html_text) {\n\t\t$text_filter = new TextFilter ( );\n\t\t$text_nojs = $text_filter->filterJavaScript ( $html_text );\n\t\t$text_noif = preg_replace ( '/<iframe.*?<\\/iframe>/ims', \"\", $text_nojs );\n\t\t$text_noif = preg_replace ( '/<IFRAME.*?<\\/IFRAME>/ims', \"\", $text_noif );\n\t\t//$text_bal = $text_filter->balanceTags($text_noif);\n\t\t\n\n\t\treturn $text_noif;\n\t}",
"function tags_tinymce_fix( $init )\n{\n // html elements being stripped\n $init['extended_valid_elements'] = 'i[*],span[*]';\n // don't remove line breaks\n $init['remove_linebreaks'] = false;\n // convert newline characters to BR\n $init['convert_newlines_to_brs'] = true;\n // don't remove redundant BR\n $init['remove_redundant_brs'] = false;\n // pass back to wordpress\n return $init;\n}",
"function tags_tinymce_fix( $init )\n{\n // html elements being stripped\n $init['extended_valid_elements'] = 'div[*],article[*]';\n // don't remove line breaks\n $init['remove_linebreaks'] = false;\n // convert newline characters to BR\n $init['convert_newlines_to_brs'] = true;\n // don't remove redundant BR\n $init['remove_redundant_brs'] = false;\n // pass back to wordpress\n return $init;\n}",
"public static function commentFormUnfilteredHtml() {\n if (\n function_exists(\n self::WP_NONCE_COMMENT_FORM_UNFILTERED_HTML_FUNCTION_NAME\n ) === FALSE\n ) {\n return FALSE;\n } else {\n call_user_func(\n self::WP_NONCE_COMMENT_FORM_UNFILTERED_HTML_FUNCTION_NAME\n );\n }\n }",
"function clear($sanitize)\n\t{\n\t\t$sanitize = strip_tags($sanitize);\n\t\treturn $sanitize;\n\t}",
"public function minify_html($html)\n {\n $html = str_replace([\"\\t\", \"\\r\", \"\\n\"], '', $html);\n\n // This is over twice the speed of a RegExp\n // (removes > 2 spaces and concatentate strings if there are 2 spaces between them)\n while (strpos($html, ' ') !== false)\n {\n $html = str_replace(' ', '', $html);\n }\n\n // while (strpos($html, ' ') !== false)\n // {\n // $html = str_replace(' ', '', $html);\n // }\n //\n // $text = preg_replace('|[\\s]+|s', ' ', $text1);\n\n\n $search = array(\n '#(?://)?<!\\[CDATA\\[(.*?)(?://)?\\]\\]>#s', //leave CDATA alone\n '/<!--(?!\\s*(?:\\[if [^\\]]+]|<!|>))(?:(?!-->).)*-->/s' // Remove html comments\n );\n\n $replace = array(\n \"//<![CDATA[\\n\" . '\\1' . \"\\n//]]>\",\n ''\n );\n\n return preg_replace($search, $replace, $html);\n }",
"protected static function cleanCode($html)\n {\n $html = str_replace(Parser::REMOVE_HTML, '', $html);\n $html = preg_replace('!\\s+!', ' ', $html);\n $html = iconv(\"UTF-8\", \"UTF-8//IGNORE\", utf8_decode($html));\n $html = trim(preg_replace('/.*<\\/head>/', '', $html));\n return $html;\n }",
"function _xss_sanitization_sanitize_stored_html( $html ) {\n \n // URL protocols\n $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn');\n\n return kses($html, _xss_sanitization_allowed_tags(), $protocols);\n}",
"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 }",
"public function htmlpurify($text) {\r\n require_once(__DIR__ . '/php-htmlpurifier/HTMLPurifier.standalone.php');\r\n $config = HTMLPurifier_Config::createDefault();\r\n $config->set('Cache.DefinitionImpl', null);\r\n $purifier = new HTMLPurifier($config);\r\n return $purifier->purify($text);\r\n }",
"function _wpcom_vip_allow_more_html_in_comments() {\n remove_filter( 'pre_comment_content', 'wp_filter_kses' );\n add_filter( 'pre_comment_content', 'wp_filter_post_kses' );\n}",
"static private function optimizeOutput(&$output) {\n\t\tif (!isset($_GET['no_opti'])) {\n\t\t\t$preserved_tags = array('textarea', 'pre', 'script', 'style', 'code');\n\t\t\t$preserved_blocks = array();\n\t\t\t$preserved_boundry = '@@PRESERVEDTAG@@';\n\t\t\t$cdata_blocks = array();\n\t\t\t$cdata_boundry = '@@CDATA@@';\n\t\t\t$conditional_boundries = array('@@IECOND-OPEN@@', '@@IECOND-CLOSE@@');\n\n\t\t\t$output = str_replace(array('<!--[if', '<!--<![endif]-->'), $conditional_boundries, $output);\n\t\t\t$output = preg_replace('/<!--(.|\\s)*?-->/', '', $output);\n\t\t\t$output = str_replace($conditional_boundries, array('<!--[if', '<!--<![endif]-->'), $output);\n\n\t\t\t$tag_string = implode('|', $preserved_tags);\n\t\t\tpreg_match_all('!<(' . $tag_string . ')[^>]*>.*?</(' . $tag_string . ')>!is', $output, $preserved_blocks);\n\t\t\t$preserved_blocks = $preserved_blocks[0];\n\t\t\t$output = preg_replace('!<(' . $tag_string . ')[^>]*>.*?</(' . $tag_string . ')>!is', $preserved_boundry, $output);\n\n\t\t\tpreg_match_all('/<!\\[CDATA\\[.*?\\]\\]>/is', $output, $cdata_blocks);\n\t\t\t$cdata_blocks = $cdata_blocks[0];\n\t\t\t$output = preg_replace('/<!\\[CDATA\\[.*?\\]\\]>/is', $cdata_boundry, $output);\n\n\t\t\t$output = preg_replace('/[\\t\\s\\n\\r]+/m', ' ', $output);\n\t\t\t$output = str_replace('> <', '><', $output);\n\n\t\t\tforeach($preserved_blocks as $curr_block) {\n\t\t\t\t$output = preg_replace('!' . $preserved_boundry . '!', $curr_block, $output, 1);\n\t\t\t}\n\n\t\t\tforeach($cdata_blocks as $curr_block) {\n\t\t\t\t$output = preg_replace('!' . $cdata_boundry . '!', $curr_block, $output, 1);\n\t\t\t}\n\n\t\t\t$output = trim($output);\n\t\t}\n\t}",
"static function login_html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }",
"function my_minify_html() {\n ob_start('sanitize_output');\n}",
"function strip_html_tags( $text )\r\n{\r\n $text = preg_replace(\r\n array(\r\n // Remove invisible content\r\n '@<head[^>]*?>.*?</head>@siu',\r\n '@<style[^>]*?>.*?</style>@siu',\r\n '@<script[^>]*?.*?</script>@siu',\r\n '@<object[^>]*?.*?</object>@siu',\r\n '@<embed[^>]*?.*?</embed>@siu',\r\n '@<applet[^>]*?.*?</applet>@siu',\r\n '@<noframes[^>]*?.*?</noframes>@siu',\r\n '@<noscript[^>]*?.*?</noscript>@siu',\r\n '@<noembed[^>]*?.*?</noembed>@siu',\r\n // Add line breaks before and after blocks\r\n '@</?((address)|(blockquote)|(center)|(del))@iu',\r\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\r\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\r\n '@</?((table)|(th)|(td)|(caption))@iu',\r\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\r\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\r\n '@</?((frameset)|(frame)|(iframe))@iu',\r\n ),\r\n array(\r\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\r\n $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\",\r\n $nl.\"\\$0\", $nl.\"\\$0\",\r\n ),\r\n $text );\r\n return strip_tags( $text );\r\n}",
"public function testSimpleHTML() : void\n {\n $string = $this->sanitizer->sanitize('<script>alert(\"hello\");</script><div id=\"fake\"><h5 class=\"foo\">Lorem ipsum</h5></div>');\n $this->assertEquals(\"Lorem ipsum\", $string);\n }",
"protected function setHtmlFromDomDocument()\n {\n // retain the modified html\n $this->html = trim($this->doc->saveHtml($this->doc->documentElement));\n\n // strip the html and body tags added by DomDocument\n $this->html = substr(\n $this->html,\n strlen('<html><body>'),\n -1 * strlen('</body></html>')\n );\n\n // still may be whitespace all about\n $this->html = trim($this->html) . PHP_EOL;\n }",
"function clean_redundant_sufficient_inline() {\r\n\t\t// dirty generator (word). the point is it cannot be done on <span>s since they are not inherently sufficient for a sort of styling (and perhaps that is why this was overlooked).\r\n\t\t// notice also that this only treats simple cases (tags without attributes) of which there may be a fair number.\r\n\t\t// this array is ordered so that tag names that are substrings of other tag names are done last (b)\r\n\t\t$sufficient_inlines = array('big', 'small', 'em', 'strong', 'sub', 'sup', 'strike', 'blink', 'i', 'b', 'u');\r\n\t\tforeach($sufficient_inlines as $sufficient_inline) {\r\n\t\t\t$opening_part = '<' . $sufficient_inline;\r\n\t\t\t$closing_part = '</' . $sufficient_inline . '>';\r\n\t\t\t$strlen_opening_part = strlen($opening_part);\r\n\t\t\t$strlen_closing_part = strlen($closing_part);\r\n\t\t\t$OStrings = OM::getAllOstrings($this->code, $opening_part, $closing_part);\r\n\t\t\t$index = sizeof($OStrings) - 1;\r\n\t\t\twhile($index > -1) {\r\n\t\t\t\t$OString = $OStrings[$index][0];\r\n\t\t\t\t//print('$OString: ');var_dump($OString);\r\n\t\t\t\tif($OString[strlen($opening_part)] !== ' ' && $OString[strlen($opening_part)] !== '>') { // then we are catching the wrong tag\r\n\t\t\t\t\t//print('wrong $OString: ');var_dump($OString);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$offset = $OStrings[$index][1];\r\n\t\t\t\t\t$initial_substr = $substr = substr($OString, $strlen_opening_part, strlen($OString) - $strlen_opening_part - $strlen_closing_part);\r\n\t\t\t\t\t$substr = str_replace('<' . $sufficient_inline . '>', '', $substr, $count1);\r\n\t\t\t\t\t$substr = str_replace($closing_part, '', $substr, $count2);\r\n\t\t\t\t\tif($count1 > 0 || $count2 > 0 && $count1 === $count2) {\r\n\t\t\t\t\t\t$cleaned_OString = $opening_part . $substr . $closing_part;\r\n\t\t\t\t\t\t//$this->code = substr($this->code, 0, $offset) . $cleaned_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t\t$this->code = str_replace($OString, $cleaned_OString, $this->code);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$index--;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function sloodle_clean_for_output($str)\n {\n return sloodle_strip_new_lines(strip_tags(stripcslashes(@html_entity_decode($str, ENT_QUOTES, 'UTF-8'))));\n }",
"function somehtml($nohtml) {\n\t\t$nohtml = str_replace(\"|\", \"|\", $nohtml);\n\t\treturn stripslashes(strip_tags($nohtml, '<p><a><font><ul><li><h1><h2><h3><h4><h5><h6><hr><b><u><i><strong><em><table><tr><td><tbody><tfoot><span><div><br><br /><blockquote><img><embed><object><form><input>'));\n\t}",
"function gboutique_validate_options($input) {\r\n\t // strip html from textboxes\r\n\t$input['email'] = wp_filter_nohtml_kses($input['email']); // Sanitize textarea input (strip html tags, and escape characters)\r\n\t$input['pass'] = wp_filter_nohtml_kses($input['pass']); // Sanitize textbox input (strip html tags, and escape characters)\r\n\t$input['spreadsheetKey'] = wp_filter_nohtml_kses($input['spreadsheetKey']);\r\n\t$input['apiKey'] = wp_filter_nohtml_kses($input['apiKey']);\r\n\t$input['emailapiKey'] = wp_filter_nohtml_kses($input['emailapiKey']);\r\n\treturn $input;\r\n}",
"private static function minify_html( string $content = '' ): string {\n $pattern = array(\n '/<!--\\s.*?-->/',\n // Remove all HTML comments\n '/[\\n\\r\\t\\v\\e\\f]/',\n // Remove all new lines, carriage returns, tabs, vertical whitespaces, esc & form feeds characters\n '/\\s{2,}/',\n // Remove all spaces (when there are 2 or more)\n );\n\n $replacement = array(\n '',\n '',\n ' ',\n );\n\n return preg_replace( $pattern, $replacement, $content );\n }",
"public function setHtml();",
"function sacar_html($str) {\r\n$allowed = \"<br>,<b>,<i>,<u>\";\r\nreturn strip_tags($str,$allowed);\r\n}",
"function wp_strip_all_tags($text, $remove_breaks = \\false)\n {\n }",
"function qa_sanitize_html_hook_tag($element, $attributes = null)\n{\n\tglobal $qa_sanitize_html_newwindow;\n\n\tif (!isset($attributes)) // it's a closing tag\n\t\treturn '</' . $element . '>';\n\n\tif ($element == 'param' && trim(strtolower(@$attributes['name'])) == 'allowscriptaccess')\n\t\t$attributes['name'] = 'allowscriptaccess_denied';\n\n\tif ($element == 'embed')\n\t\tunset($attributes['allowscriptaccess']);\n\n\tif ($element == 'a' && isset($attributes['href']) && $qa_sanitize_html_newwindow)\n\t\t$attributes['target'] = '_blank';\n\n\t$html = '<' . $element;\n\tforeach ($attributes as $key => $value)\n\t\t$html .= ' ' . $key . '=\"' . $value . '\"';\n\n\treturn $html . '>';\n}",
"protected function filterHtml($input) {\n switch (gettype($input)) {\n case \"string\":\n return $this->htmlPurifier($input);\n\n case \"array\":\n case \"object\":\n foreach ($input as &$value) {\n $value = $this->filterHtml($value);\n }\n return $input;\n\n default:\n // Leave integers, floats or boolean unchanged.\n return $input;\n }\n }",
"public static function sanitize_option_arguments( $option = array() ) {\n\t\t$option = wp_parse_args( $option, array(\n\t\t\t// common arguments\n\t\t\t'type' => '',\n\t\t\t'id' => '',\n\t\t\t'title' => '',\n\t\t\t'class' => '',\n\t\t\t'css' => '',\n\t\t\t'default' => '',\n\t\t\t'desc' => '',\n\t\t) );\n\n\t\t// Sanitize fields\n\t\t$allowed_tags = array(\n\t\t\t'abbr' => array( 'title' => true ),\n\t\t\t'acronym' => array( 'title' => true ),\n\t\t\t'code' => true,\n\t\t\t'em' => true,\n\t\t\t'strong' => true,\n\t\t\t'a' => array(\n\t\t\t\t'href' => true,\n\t\t\t\t'title' => true,\n\t\t\t),\n\t\t);\n\n\t\t$option['desc'] = wp_kses( $option['desc'], $allowed_tags );\n\n\t\treturn $option;\n\t}",
"public function get_html_filtered()\n\t{\n\t\t$html = (isset($this->HTML_rewritten))?$this->HTML_rewritten:$this->HTML;\n\t\treturn $html;\n\t}",
"function cleanupMediaobjectUsage()\n\t{\n\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t$completecontent = \"\";\n\t\tforeach ($this->getAllRTEContent() as $content)\n\t\t{\n\t\t\t$completecontent .= $content;\n\t\t}\n\t\tilRTE::_cleanupMediaObjectUsage($completecontent, $this->getType() . \":html\",\n\t\t\t$this->getId());\n\t}",
"function regexcleanhtml($text){\n\t//get rid of unneeded spaces\n\t$text=regexspacecleaner($text);\n\t\n\t//lets get rid of weird spacing first so we can make simpler quearies later\n\t$regex_pattern=\"/<\\s/\"; //makes < followed by a space just < (e.g. slkj < slkj = slkj <slkj)\n\t$text = preg_replace($regex_pattern, \"<\", $text);\n\t$regex_pattern=\"/\\s>/\"; //makes > preceded by a space just > (e.g. slkj > slkj = slkj> slkj)\n\t$text = preg_replace($regex_pattern, \">\", $text);\n\t$regex_pattern=\"/<\\/\\s/\";\n\t$text = preg_replace($regex_pattern, \"</\", $text); //makes </ followed by a space just </ (e.g. slkj </ slkj = slkj </slkj)\n\t\n\treturn $text;\n}",
"public function get_settings_html() {\n\t\treturn '';\n\t}",
"function sanitize_settings($options)\n\t\t{\n\t\t\t// Setup array of valid options for return\n\t\t\t$valid_options = array();\n\t\t\t\n\t\t\t// Establish defaults\n\t\t\t$option_defaults = array(\n\t\t\t\t'analytics' => '',\n\t\t\t\t'google' => '',\n\t\t\t\t'pinterest' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$option_types = array(\n\t\t\t\t'analytics' => 'html',\n\t\t\t\t'google' => 'text',\n\t\t\t\t'pinterest' => 'text'\n\t\t\t);\n\t\t\t\n\t\t\t// Merge pass options and the defaults\n\t\t\t$options = (array) wp_parse_args($options, $option_defaults);\n\t\t\t\n\t\t\t// Sanitize each value\n\t\t\tforeach ($option_types as $key => $type) {\n\t\t\t\t$valid_options[$key] = $this->sanitize_an_option($options[$key], $type);\n\t\t\t}\n\n\t\t\treturn $valid_options;\n\t\t}",
"public function setCachedHTML($options);",
"function apostrapheFix($html)\r\n\t{\r\n\t\t$iStart = stripos($html,\"[apostraphe]\");\r\n\t\twhile((string)$iStart != null)\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//get entire apostraphe tag\r\n\t\t\t$iEnd = $iStart+12;\r\n\t\t\t\r\n\t\t\t//replace HTML\r\n\t\t\t$replacementHTML = \"'\";\r\n\t\t\t$html = substr_replace($html,$replacementHTML,$iStart,($iEnd-$iStart));\r\n\t\t\t\r\n\t\t\t//prep next loop\r\n\t\t\t$iStart = stripos($html,\"[apostraphe]\");\r\n\t\t}\r\n\t\t\r\n\t\treturn $html;\r\n\t}",
"function fix_html($string) {\n // ready our stats\n $this->stats = new tp_parserstats();\n // handler for possible json (buddypress)\n if ($this->might_json) {\n if ($string[0] == '{') {\n $jsoner = json_decode($string);\n if ($jsoner != null) {\n tp_logger(\"json detected (buddypress?)\", 4);\n // currently we only handle contents (which buddypress heavily use)\n if ($jsoner->contents) {\n $jsoner->contents = $this->fix_html($jsoner->contents);\n }\n if ($jsoner->fragments->{'div.widget_shopping_cart_content'}) {\n $jsoner->fragments->{'div.widget_shopping_cart_content'} = $this->fix_html($jsoner->fragments->{'div.widget_shopping_cart_content'});\n }\n if ($jsoner->fragments->{'div.kt-header-mini-cart-refreash'}) {\n $jsoner->fragments->{'div.kt-header-mini-cart-refreash'} = $this->fix_html($jsoner->fragments->{'div.kt-header-mini-cart-refreash'});\n }\n if ($jsoner->fragments->{'a.cart-contents'}) {\n $jsoner->fragments->{'a.cart-contents'} = $this->fix_html($jsoner->fragments->{'a.cart-contents'});\n }\n if ($jsoner->fragments->{'.woocommerce-checkout-review-order-table'}) {\n $jsoner->fragments->{'.woocommerce-checkout-review-order-table'} = $this->fix_html($jsoner->fragments->{'.woocommerce-checkout-review-order-table'});\n }\n if ($jsoner->fragments->{'.woocommerce-checkout-payment'}) {\n $jsoner->fragments->{'.woocommerce-checkout-payment'} = $this->fix_html($jsoner->fragments->{'.woocommerce-checkout-payment'});\n }\n return json_encode($jsoner); // now any attempted json will actually return a json \n }\n }\n }\n\n // create our dom\n $string = str_replace(chr(0xC2) . chr(0xA0), ' ', $string); // annoying NBSPs?\n $this->html = str_get_html($string, false); // false for RSS?\n //$this->stats->do_timing();\n //Log::info(\"Stats Build dom:\" . $this->stats->time);\n // mark translateable elements\n if ($this->html->find('html', 0))\n $this->html->find('html', 0)->lang = ''; // Document defined lang may be preset to correct lang, but should be ignored TODO: Better?\n $this->translate_tagging($this->html->root);\n //$this->stats->do_timing();\n //Log::info(\"Stats Done tagging:\" . $this->stats->time);\n // first fix the html tag itself - we might need to to the same for all such attributes with flipping\n if ($this->html->find('html', 0)) {\n if ($this->dir_rtl)\n $this->html->find('html', 0)->dir = 'rtl';\n else\n $this->html->find('html', 0)->dir = 'ltr';\n }\n\n if ($this->lang) {\n if ($this->html->find('html', 0))\n $this->html->find('html', 0)->lang = $this->lang;\n // add support for <meta name=\"language\" content=\"<lang>\">\n if ($this->html->find('meta[name=language]')) {\n @$this->html->find('meta[name=language]')->content = $this->lang;\n }\n }\n\n // not much point in further processing if we don't have a function that does it\n if ($this->fetch_translate_func == null) {\n return $this->html;\n }\n\n // fix feed\n if ($this->feed_fix) {\n // fix urls on feed\n tp_logger('fixing rss feed', 3);\n foreach (array('link', 'wfw:commentrss', 'comments') as $tag) {\n foreach ($this->html->find($tag) as $e) {\n $e->innertext = htmlspecialchars(call_user_func_array($this->url_rewrite_func, array($e->innertext)));\n // no need to translate anything here\n unset($e->nodes);\n }\n }\n // guid is not really a url -- in some future, we can check if permalink is true and probably falsify it\n foreach ($this->html->find('guid') as $e) {\n $e->innertext = $e->innertext . '-' . $this->lang;\n unset($e->nodes);\n }\n // fix feed language\n @$this->html->find('language', 0)->innertext = $this->lang;\n unset($this->html->find('language', 0)->nodes);\n } else {\n // since this is not a feed, we might have references to such in the <link rel=\"alternate\">\n foreach ($this->html->find('link') as $e) {\n if (strcasecmp($e->rel, 'alternate') == 0 || strcasecmp($e->rel, 'canonical') == 0) {\n if (!$e->hreflang) \n $e->href = call_user_func_array($this->url_rewrite_func, array($e->href));\n }\n }\n }\n\n // try some prefetching... (//todo - maybe move directly to the phrase create)\n// $originals = array();\n if ($this->prefetch_translate_func != null) {\n /* foreach ($this->html->find('text') as $e) {\n foreach ($e->nodes as $ep) {\n if ($ep->phrase) $originals[$ep->phrase] = true;\n }\n }\n foreach (array('title', 'value', 'placeholder', 'alt') as $title) {\n foreach ($this->html->find('[' . $title . ']') as $e) {\n if (isset($e->nodes))\n foreach ($e->nodes as $ep) {\n if ($ep->phrase) $originals[$ep->phrase] = true;\n }\n }\n }\n foreach ($this->html->find('[content]') as $e) {\n foreach ($e->nodes as $ep) {\n if ($ep->phrase) $originals[$ep->phrase] = true;\n }\n } */\n // if we should split, we will split some urls for translation prefetching\n if ($this->split_url_func != null) {\n foreach ($this->atags as $e) {\n foreach (call_user_func_array($this->split_url_func, array($e->href)) as $part) {\n $this->prefetch_phrases[$part] = true;\n }\n }\n foreach ($this->otags as $e) {\n foreach (call_user_func_array($this->split_url_func, array($e->value)) as $part) {\n $this->prefetch_phrases[$part] = true;\n }\n }\n }\n call_user_func_array($this->prefetch_translate_func, array($this->prefetch_phrases, $this->lang));\n }\n\n //fix urls more\n // WORK IN PROGRESS\n /* foreach ($this->atags as $e) {\n $hrefspans = '';\n foreach (call_user_func_array($this->split_url_func, array($e->href)) as $part) {\n // fix - not for dashes\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($part, $this->lang));\n $hrefspans .= $this->create_edit_span($part, $translated_text, $source, true);\n }\n $e->href = call_user_func_array($this->url_rewrite_func, array($e->href));\n $e->outertext .= $hrefspans;\n } */\n\n // fix src for items\n if ($this->fix_src_tag_func !== null) {\n foreach ($this->html->find('[src]') as $e) {\n $e->src = call_user_func_array($this->fix_src_tag_func, array($e->src));\n }\n\n foreach ($this->html->find('link') as $e) {\n $e->href = call_user_func_array($this->fix_src_tag_func, array($e->href));\n }\n }\n\n // fix urls...\n foreach ($this->atags as $e) {\n if ($e->href)\n $e->href = call_user_func_array($this->url_rewrite_func, array($e->href));\n }\n foreach ($this->otags as $e) {\n if ($e->value)\n $e->value = call_user_func_array($this->url_rewrite_func, array($e->value));\n }\n\n // this is used to reserve spans we cannot add directly (out of body, metas, etc)\n $hiddenspans = '';\n $savedspan = '';\n\n // actually translate tags\n // texts are first\n foreach ($this->html->find('text') as $e) {\n $replace = array();\n foreach ($e->nodes as $ep) {\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($ep->phrase, $this->lang));\n //stats\n $this->stats->total_phrases++;\n if ($translated_text) {\n $this->stats->translated_phrases++;\n if ($source == 0)\n $this->stats->human_translated_phrases++;\n }\n if (($this->is_edit_mode || ($this->is_auto_translate && $translated_text == null))/* && $ep->inbody */) {\n if ($ep->inselect) {\n $savedspan .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n } elseif (!$ep->inbody) {\n $hiddenspans .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n } else {\n $translated_text = $this->create_edit_span($ep->phrase, $translated_text, $source, false, $ep->srclang);\n }\n }\n // store replacements\n if ($translated_text) {\n $replace[] = array($translated_text, $ep);\n }\n }\n // do replacements in reverse\n foreach (array_reverse($replace) as $epag) {\n list($replacetext, $epg) = $epag;\n $e->outertext = substr_replace($e->outertext, $replacetext, $epg->start, $epg->len);\n }\n\n // this adds saved spans to the first not in select element which is in the body\n if ($e->nodes && !$ep->inselect && $savedspan && $ep->inbody) { // (TODO: might not be...?)\n $e->outertext = $savedspan . $e->outertext;\n $savedspan = '';\n }\n }\n\n // now we handle the title attributes (and the value of submit buttons)\n $hidden_phrases = array();\n foreach (array('title', 'value', 'placeholder', 'alt') as $title) {\n foreach ($this->html->find('[' . $title . ']') as $e) {\n $replace = array();\n $span = '';\n // when we already have a parent outertext we'll have to update it directly\n if (isset($e->parent->_[HDOM_INFO_OUTER])) {\n $saved_outertext = $e->outertext;\n }\n tp_logger(\"$title-original: $e->$title}\", 4);\n if (isset($e->nodes))\n foreach ($e->nodes as $ep) {\n if ($ep->tag == 'phrase') {\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($ep->phrase, $this->lang));\n // more stats\n $this->stats->total_phrases++;\n if ($ep->inbody)\n $this->stats->hidden_phrases++;\n else\n $this->stats->meta_phrases++;\n if ($translated_text) {\n $this->stats->translated_phrases++;\n if ($ep->inbody)\n $this->stats->hidden_translated_phrases++;\n else\n $this->stats->meta_translated_phrases++;\n if ($source == 0)\n $this->stats->human_translated_phrases++;\n }\n if (($this->is_edit_mode || ($this->is_auto_translate && $translated_text == null)) && $ep->inbody) {\n // prevent duplicate translation (title = text)\n if (strpos($e->innertext, $ep->phrase /* Transposh_utils::base64_url_encode($ep->phrase) */) === false) {\n// if (strpos($e->innertext, transposh_utils::base64_url_encode($ep->phrase)) === false) {\n //no need to translate span the same hidden phrase more than once\n if (!in_array($ep->phrase, $hidden_phrases)) {\n $this->stats->hidden_translateable_phrases++;\n $span .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n // logger ($span);\n $hidden_phrases[] = $ep->phrase;\n }\n }\n }\n // if we need to replace, we store this\n if ($translated_text) {\n $replace[$translated_text] = $ep;\n }\n }\n }\n // and later replace\n foreach (array_reverse($replace, true) as $replace => $epg) {\n $e->$title = substr_replace($e->$title, $replace, $epg->start, $epg->len);\n }\n\n $e->outertext .= $span;\n // this is where we update in the outercase issue\n if (isset($e->parent->_[HDOM_INFO_OUTER])) {\n $e->parent->outertext = implode($e->outertext, explode($saved_outertext, $e->parent->outertext, 2));\n }\n }\n }\n\n // now we handle the meta content - which is simpler because they can't be edited or auto-translated in place\n // we also don't expect any father modifications here\n // so we now add all those spans right before the <body> tag end\n foreach ($this->html->find('[content]') as $e) {\n $right = '';\n $newtext = '';\n\n foreach ($e->nodes as $ep) {\n if ($ep->tag == 'phrase') {\n // even more stats\n $this->stats->total_phrases++;\n $this->stats->meta_phrases++;\n list ($source, $translated_text) = call_user_func_array($this->fetch_translate_func, array($ep->phrase, $this->lang));\n if ($translated_text) {\n $this->stats->translated_phrases++;\n $this->stats->meta_translated_phrases++;\n if ($source == 0)\n $this->stats->human_translated_phrases++;\n list ($left, $right) = explode($ep->phrase, $e->content, 2);\n $newtext .= $left . $translated_text;\n $e->content = $right;\n }\n if ($this->is_edit_mode) {\n $hiddenspans .= $this->create_edit_span($ep->phrase, $translated_text, $source, true, $ep->srclang);\n }\n if (!$translated_text && $this->is_auto_translate && !$this->is_edit_mode) {\n tp_logger('untranslated meta for ' . $ep->phrase . ' ' . $this->lang);\n if ($this->is_edit_mode || $this->is_auto_translate) { // FIX\n }\n }\n }\n }\n if ($newtext) {\n $e->content = $newtext . $right;\n tp_logger(\"content-phrase: $newtext\", 4);\n }\n }\n\n if ($hiddenspans) {\n $body = $this->html->find('body', 0);\n if ($body != null)\n $body->lastChild()->outertext .= $hiddenspans;\n }\n \n // we might show an ad for transposh in some cases\n if (($this->allow_ad && !$this->default_lang && mt_rand(1, 100) > 95) || // 5 of 100 for translated non default language pages\n ($this->allow_ad && $this->default_lang && mt_rand(1, 100) > 99) || // 1 of 100 for translated default languages pages\n (!$this->allow_ad && mt_rand(1, 1000) > 999)) { // 1 of 1000 otherwise\n $this->do_ad_switch();\n }\n \n // This adds a meta tag with our statistics json-encoded inside...\n// $this->stats->do_timing();\n// Log::info(\"Stats Done:\" . $this->stats->time);\n\n $head = $this->html->find('head', 0);\n if ($this->edit_span_created) {\n if ($head != null) {\n $head->lastChild()->outertext .= $this->added_header;\n }\n }\n //exit;\n if ($head != null)\n $head->lastChild()->outertext .= \"\\n<meta name=\\\"translation-stats\\\" content='\" . json_encode($this->stats) . \"'/>\";\n\n // we make sure that the result is clear from our shananigans\n return str_replace(array(TP_GTXT_BRK, TP_GTXT_IBRK, TP_GTXT_BRK_CLOSER, TP_GTXT_IBRK_CLOSER), '', $this->html->outertext);\n // Changed because of places where tostring failed\n //return $this->html;\n //return $this->html->outertext;\n }",
"public static function get_CSS_extended_content_HTML(): string\n {\n $html = '<option value=\"-1\"></option>\n<option value=\"563533\"> /[global]/PUBLICATIONS/EGU/ACP/ACP Bootstrap CSS File</option>\n<option value=\"782\"> /[global]/PUBLICATIONS/EGU/ACP/ACP CSS File</option>\n<option value=\"2754\"> /[global]/PUBLICATIONS/EGU/EGU CSS</option>\n<option value=\"18550\"> /[global]/PUBLICATIONS/EGU/ACP/Font Awesome v3.2 Min Css</option>\n<option value=\"18551\"> /[global]/PUBLICATIONS/EGU/ACP/Font Awesome v3.2 Min ie7 Css</option>\n<option value=\"163924\"> /[global]/PUBLICATIONS/Template base css 2018</option>\n<option value=\"240357\"> /[global]/PUBLICATIONS/Template base css 2018 mobile opt</option>\n<option value=\"262955\"> /[global]/PUBLICATIONS/Template base css 2018 mobile opt media</option>\n<option value=\"553405\"> /[global]/PUBLICATIONS/Template base css 2019 mobile opt</option>\n<option value=\"553406\"> /[global]/PUBLICATIONS/Template base css 2019 mobile opt media</option>\n<option value=\"553407\"> /[global]/PUBLICATIONS/Template Bootstrap bridge css</option>\n<option value=\"1283\"> /[global]/PUBLICATIONS/Template css addon extendend content</option>\n<option value=\"120\"> /[global]/PUBLICATIONS/Template css base</option>\n<option value=\"19074\"> /[global]/PUBLICATIONS/Template css base 2015</option>\n<option value=\"24190\"> /[global]/Template css base candidate</option>\n<option value=\"24294\"> /[global]/PUBLICATIONS/Template css display-mathml</option>\n<option value=\"24295\"> /[global]/PUBLICATIONS/Template css editor</option>\n<option value=\"19796\"> /[global]/PUBLICATIONS/Template css editor bridge</option>\n<option value=\"17695\"> /[global]/Template css Font Awesome</option>\n<option value=\"75462\"> /[global]/Template CSS Font Awesome 4.7.0.min</option>\n<option value=\"23035\"> /[global]/Template css Font Open Sans</option>\n<option value=\"237997\"> /[global]/Template css Font Open Sans v.15</option>\n<option value=\"19803\"> /[global]/PUBLICATIONS/Template css font style</option>\n<option value=\"24302\"> /[global]/PUBLICATIONS/Template css grid-system unsemantic</option>\n<option value=\"20666\" selected=\"selected\"> /[global]/PUBLICATIONS/Template css journals addon extended content</option>\n<option value=\"16236\"> /[global]/PUBLICATIONS/Template css JQuery Toggle - deprecated</option>\n<option value=\"24297\"> /[global]/PUBLICATIONS/Template css jquery-ui slider pips</option>\n<option value=\"392\"> /[global]/PUBLICATIONS/Template css print base</option>\n<option value=\"19818\"> /[global]/PUBLICATIONS/Template css print base 2015</option>\n<option value=\"1026718\"> /[global]/PUBLICATIONS/Template Editor bridge hide blocks css 2021</option>\n<option value=\"774031\"> /[global]/PUBLICATIONS/Template EGUSphere Base special CSS</option>\n<option value=\"774024\"> /[global]/Template One-column base css 2020</option>\n<option value=\"774025\"> /[global]/Template One-column base print css 2020</option>\n<option value=\"778693\"> /[global]/Template One-column base special css 2020</option>\n<option value=\"19817\"> /[global]/Template style social icon CSS</option> ';\n\n return $html;\n }",
"private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was found.\n // Once the HTML is normalized, we will parse it again.\n $html = $tidy->repairString($html, [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n\n try {\n libxml_use_internal_errors(true);\n // Needs a XML encoding declaration to ensure is treated as UTF-8\n $dom->loadHTML('<?xml encoding=\"utf-8\" ?>'.$html);\n } catch (Exception $e) {\n return '';\n }\n\n $attributes = static::getAttributesNodes($dom);\n\n collect($attributes)\n ->filter(fn ($attribute) => static::isAttributeAllowedForTag($attribute))\n ->each(fn ($node) => $node->parentNode->removeAttribute($node->nodeName));\n\n return $tidy->repairString($dom->saveHTML(), [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n }",
"function remove_h1_from_editor( $settings ) {\n $settings['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;';\n return $settings;\n}",
"private function wpus_strip_tags($string, $remove_breaks = FALSE) {\n\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\n\t\t\t$string = preg_replace('@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $string);\n\n\t\t\t$string = preg_replace('@ *</?\\s*(P|UL|OL|DL|BLOCKQUOTE)\\b[^>]*?> *@si', \"\\n\\n\", $string);\n\t\t\t$string = preg_replace('@ *<(BR|DIV|LI|DT|DD|TR|TD|H\\d)\\b[^>]*?> *@si', \"\\n\", $string);\n\t\t\t$string = preg_replace(\"@\\n\\n\\n+@si\", \"\\n\\n\", $string);\n\n\t\t\t$string = strip_tags($string);\n\n\t\t\tif($remove_breaks) {\n\t\t\t\t$string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n\t\t\t}\n\n\t\t\t// ...since we're pulling excerpts from the DB, some of the excerpts contain truncated HTML tags\n\t\t\t// that won't be picked up by strip_tags(). This removes any trailing HTML from the beginning\n\t\t\t// and end of the excerpt:\n\t\t\t$string = preg_replace('/.*>|<.*/', ' ', $string);\n\n\t\t\treturn trim($string);\n\t\t}"
] | [
"0.65628284",
"0.63438624",
"0.61977494",
"0.61653143",
"0.6090394",
"0.6088692",
"0.6066914",
"0.6052629",
"0.6049276",
"0.6041285",
"0.6014014",
"0.6011197",
"0.59926075",
"0.59078074",
"0.5880054",
"0.58725715",
"0.58725107",
"0.5853894",
"0.5809442",
"0.57934916",
"0.5785562",
"0.57794607",
"0.5760954",
"0.5758369",
"0.57369876",
"0.5732307",
"0.56953645",
"0.56539714",
"0.5652284",
"0.5639041",
"0.5633059",
"0.5625011",
"0.56198484",
"0.56123245",
"0.5612081",
"0.560547",
"0.55937475",
"0.5593734",
"0.5581829",
"0.5573045",
"0.5568454",
"0.5558681",
"0.5546506",
"0.5539338",
"0.5526499",
"0.5522147",
"0.5520783",
"0.55179834",
"0.5515009",
"0.55136055",
"0.54976565",
"0.5493866",
"0.54740167",
"0.54720986",
"0.544729",
"0.54414237",
"0.54393286",
"0.543613",
"0.5417095",
"0.54170495",
"0.541671",
"0.5400546",
"0.5399728",
"0.5399437",
"0.53850484",
"0.5359762",
"0.5359103",
"0.5354352",
"0.53466725",
"0.53322893",
"0.533202",
"0.5330576",
"0.53165513",
"0.5316039",
"0.5313285",
"0.531204",
"0.53010744",
"0.5295099",
"0.528677",
"0.5277486",
"0.5271995",
"0.5264506",
"0.52637225",
"0.526095",
"0.5258251",
"0.52573013",
"0.5254042",
"0.5253806",
"0.52531326",
"0.5252495",
"0.5244943",
"0.52446645",
"0.5241688",
"0.5239093",
"0.52363384",
"0.52360356",
"0.5223166",
"0.5218522",
"0.520943",
"0.520862"
] | 0.7351366 | 0 |
Returns the fully qualified name of the class that this mapper maps. | public function mapFor()
{
return Forecast::class;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFullQualifiedClassname() : string\n {\n return $this->fqcn;\n \n }",
"public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }",
"protected function fullyQualifiedClassName(): string\n {\n return $this->fullNamespace() . '\\\\' . $this->name();\n }",
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}",
"public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}",
"public function getClassName()\n {\n return $this->class;\n }",
"public function getClassName()\n {\n return $this->class;\n }",
"public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }",
"public function getClassName()\n {\n return $this->class_name;\n }",
"public function getClassName()\n {\n return $this->_sClass;\n }",
"public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}",
"public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}",
"public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }",
"public function toClassName(): string\n {\n return ClassName::full($this->name);\n }",
"public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }",
"public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }",
"public function getFullClassName()\n {\n $name = $this->getName();\n $namespace = $this->getNamespace();\n if (!$namespace && $this->getDatabase()) {\n $namespace = $this->getDatabase()->getNamespace();\n }\n\n if ($namespace) {\n return trim($namespace, '\\\\') . '\\\\' . $name;\n } else {\n return $name;\n }\n }",
"public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }",
"public function getName()\n {\n return __CLASS__;\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }",
"public function getClassName() : string\n {\n return $this->className;\n }",
"public function getMapClass()\n\t{\n\t\treturn $this->_class;\n\t}",
"public function getClassName() : string\n {\n\n return $this->className;\n }",
"public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() ;",
"protected function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return __CLASS__;;\n }",
"public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}",
"public function getClassName() { return __CLASS__; }",
"public static function className() : string {\n return get_called_class();\n }",
"public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public static function getClassName() {\n\t\treturn get_called_class();\n\t}",
"private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClass()\n {\n return $this->_className;\n }",
"public static function getClassName()\n {\n return get_called_class();\n }",
"public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }",
"public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }",
"public function getClassName();",
"public function getClassName();",
"public static function getClassName() {\n return get_called_class();\n }",
"public function get_usable_full_class_path() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn strtolower( str_replace( '\\\\', '_', str_replace( '\\\\\\\\', '_', $full_path ) ) );\n\n\t}",
"public function getClassname(){\n\t\treturn $this->classname;\n\t}",
"public function getClass(): string\n {\n return $this->class;\n }",
"public function getModelNameBasedOnClassName(): string\n {\n $fqn = explode(\"\\\\\", get_class($this));\n\n return strtolower(end($fqn));\n }",
"public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}",
"public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}",
"public static function getClassName() {\n return self::$className;\n }",
"public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}",
"public function getNamespacedName()\n {\n return get_class();\n }",
"public function getClassName() {\n\t\treturn $this->className;\n\t}",
"public function getName(): string\n {\n return __CLASS__;\n }",
"public function getClassName() {\n\t\treturn $this->_className;\n\t}",
"public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }",
"public function getName() {\n return get_class($this);\n }",
"public function getName() {\n return get_class($this);\n }",
"public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }",
"public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}",
"protected function _getClassName()\n {\n $this->_checkAdapter();\n return static::$_classMap[$this->_adapter->getDialect()];\n }",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getName(){\n\t\treturn get_class($this);\n\t}",
"public function getClassName() : string;",
"public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}",
"function getName()\n {\n return get_class($this);\n }",
"public function qualifiedName()\n {\n return sprintf('%s::%s', $this->className(), $this->name());\n }",
"public function name($class) {\n return $this->classRegistry->getMap($class)->getCurrentName();\n }",
"public function getClassName(): string;",
"public function getName()\n {\n return static::CLASS;\n }",
"public function className(): string\n {\n return $this->taskClass->name();\n }",
"public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }",
"private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }",
"public function getAliasName()\n {\n return $this->namingStrategy->classToAlias($this->name);\n }",
"public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}",
"function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}",
"public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }",
"public function getBeanClassName(): string\n {\n return $this->namingStrategy->getBeanClassName($this->foreignKey->getLocalTableName());\n }",
"public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}",
"public function getter_qualified_name()\n\t{\n\t\treturn $this->qualified_name = (new \\ReflectionClass($this))->getShortName();\n\t}",
"public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }",
"protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }",
"public static function getClass()\n {\n $type = explode('\\\\', get_called_class());\n\n return $type[count($type) - 1];\n }",
"protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}",
"public function get_class()\n {\n return $this->class;\n }"
] | [
"0.7675617",
"0.7660593",
"0.75880456",
"0.7583924",
"0.75432956",
"0.7539442",
"0.75309086",
"0.75309086",
"0.7520951",
"0.7412456",
"0.73640776",
"0.73499453",
"0.7336656",
"0.73182315",
"0.7286464",
"0.72670597",
"0.7256326",
"0.72518706",
"0.722197",
"0.7216787",
"0.7207702",
"0.7207702",
"0.7204041",
"0.71760756",
"0.7173657",
"0.7167246",
"0.7142769",
"0.7134868",
"0.71293616",
"0.7119114",
"0.71191037",
"0.71191037",
"0.71191037",
"0.71191037",
"0.71191037",
"0.71191037",
"0.71191037",
"0.71191037",
"0.7117208",
"0.7106454",
"0.7103105",
"0.7099744",
"0.70924175",
"0.70896983",
"0.70896983",
"0.70896983",
"0.70896983",
"0.70859265",
"0.7085248",
"0.707742",
"0.707742",
"0.7071576",
"0.7070079",
"0.7064805",
"0.70643836",
"0.70633346",
"0.70633346",
"0.7063269",
"0.7061483",
"0.7056651",
"0.7049213",
"0.7046521",
"0.70451593",
"0.7039092",
"0.70240873",
"0.7018229",
"0.70000464",
"0.6998393",
"0.6996865",
"0.69722927",
"0.6971923",
"0.6946267",
"0.6946267",
"0.69431317",
"0.69302344",
"0.69212",
"0.6910667",
"0.6910667",
"0.6899402",
"0.6895907",
"0.6887956",
"0.68830836",
"0.68589485",
"0.68279207",
"0.68261343",
"0.6802399",
"0.6787807",
"0.6783886",
"0.6765097",
"0.67562985",
"0.6748525",
"0.6733376",
"0.67223203",
"0.6719713",
"0.67194176",
"0.6711346",
"0.6709865",
"0.67041796",
"0.67029923",
"0.6698854",
"0.66760653"
] | 0.0 | -1 |
Load the object's metadata through the Metadata Builder object. | public function map(Fluent $builder)
{
$builder->integer('id')->autoIncrement()->primary();
$builder->text('city');
$builder->oneToMany(HourlyPrediction::class, 'predictions')->mappedBy('forecast')->cascadeAll();
$builder->string( 'scale');
$builder->string( 'partner');
$builder->date('date');
$builder->dateTime('createdAt');
$builder->dateTime( 'updatedAt')->nullable();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadMetadata() {\n\t\t$this->pMeta = $this->em->getClassMetadata('OcProduct');\n\t\t$this->pdMeta = $this->em->getClassMetadata('OcProductDescription');\n\t}",
"protected function loadMetaData() {}",
"function loadClassMetadata(Mapping\\ClassMetadataInterface $metadata);",
"protected function setup_metadata() {\n\t\tif ( $this->get_meta_type() ) {\n\t\t\t$this->fill( $this->get_metadata() );\n\t\t}\n\t}",
"public function getMetadata();",
"public function getMetadata();",
"public function getMetadata();",
"public function getMetadata() {}",
"public function getMetadata() {}",
"protected function loadMetadata(): void\n {\n $config = new Storage;\n\n foreach ($this->metadataDirs as $dir) {\n $configs = glob($dir . '/*' . $config->getReader()->getFileExt());\n\n foreach ($configs as $file) {\n $config->load($file);\n\n if ($config['class']) {\n $this->metadata[$config['class']] = $config->getObj();\n } else {\n throw new RuntimeException(sprintf('ActiveRecord `class` definition missed in %s metadata file', $file));\n }\n }\n }\n }",
"private function metaLoad()\n {\n $this->meta ??= $this?->relations['meta'] ?? $this->meta()->get();\n }",
"public function read_meta( &$object );",
"public function setMetadata($metadata) {}",
"public function setMetadata($metadata) {}",
"protected function _getMetadataModel()\n\t{\n\t\treturn $this->getModelFromCache('Brivium_MetadataEssential_Model_Metadata');\n\t}",
"public function read_meta( &$object ) {\n\t\t}",
"public function setMetaFrom($object);",
"protected function loadMetaInformation()\n {\n try {\n $logger = new Logger('exiftool');\n $reader = BookReader::create($logger);\n $metadataBag = $reader->files($this->file->getRealPath())->first();\n foreach ($metadataBag as $meta) {\n $tagName = $meta->getTag()->getName();\n if (0 === strcasecmp($tagName, 'MIMEType')) {\n $this->mime = $meta->getValue()->asString();\n }\n if (0 === strcasecmp($tagName, 'FileType')) {\n $this->ext = strtolower($meta->getValue()->asString());\n }\n if ($this->ext && $this->mime) {\n break;\n }\n }\n } catch (\\Exception $e) {\n $logger->addNotice($e->getMessage());\n }\n finally {\n $this->mime = empty($this->mime) ? $this->file->getMimeType() : $this->mime;\n $this->ext = empty($this->ext) ? $this->file->guessExtension(): $this->ext;\n }\n }",
"public function __construct() {\n\t $this->metadata = new \\OpenCloud\\Metadata();\n\t}",
"public static function loadApiMetadata(ApiMetadataDriver $metadata)\n {\n $metadata->setGroupPrefix('leadField')\n ->addListProperties(\n array(\n 'id',\n 'label',\n 'alias',\n 'type',\n 'group',\n 'order',\n 'object'\n )\n )\n ->addProperties(\n array(\n 'defaultValue',\n 'isRequired',\n 'isPubliclyUpdatable',\n 'isUniqueIdentifier',\n 'properties'\n )\n )\n ->build();\n }",
"protected function initMetadata($data, $metadata) {}",
"public function testLoadMetadata()\n {\n $metadata = $this->driver->loadMetadataForClass(new \\ReflectionClass(Example::class));\n $this->assertInstanceOf(ClassMetadata::class, $metadata);\n $properties = $metadata->getPropertyMetadata();\n $this->assertArrayHasKey('fieldOne', $properties);\n $propertyOne = $properties['fieldOne'];\n\n $this->assertEquals('markdown', $propertyOne->getType());\n $this->assertEquals('title', $propertyOne->getRole());\n $this->assertEquals('group_one', $propertyOne->getGroup());\n $this->assertEquals([\n 'option_one' => 'Foobar',\n 'option_two' => 'Barfoo',\n 'option_three' => [\n 'sub_one' => 'One',\n 'sub_two' => 'Two',\n ],\n ], $propertyOne->getOptions()->getSharedOptions());\n\n $this->assertEquals([\n 'a' => 'A',\n 'b' => 'B',\n ], $propertyOne->getOptions()->getFormOptions());\n\n $this->assertEquals([\n 'c' => 'C',\n ], $propertyOne->getOptions()->getViewOptions());\n\n $this->assertEquals([\n 'd' => 'D',\n ], $propertyOne->getOptions()->getStorageOptions());\n\n $this->assertArrayHasKey('fieldTwo', $properties);\n }",
"public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)\n {\n $classMetadata = $eventArgs->getClassMetadata();\n if ($this->isEntitySupported($classMetadata)) {\n foreach ($this->mapping[$classMetadata->getName()] as $type=>$mappings){\n $this->addMapping($classMetadata, $mappings, $type);\n }\n }\n }",
"function metaInit () {\n $this->imageMeta = new ImageMeta($this->getImagePath());\n $this->imageMeta->getMeta();\n }",
"function wp_metadata_lazyloader()\n {\n }",
"public function init()\n {\n $this->loadMeta();\n }",
"public function syncMetadata() {}",
"function fetchMeta($metadata)\n {\n $languages = $this->getLanguages();\n $attribname = $this->fieldName().(!$this->isMlNode()?'_'.$languages[0]:'');\n $this->m_size = min($metadata[$attribname]['len'], $this->maxInputSize());\n $this->m_searchsize = min($metadata[$attribname]['len'], 20);\n $this->m_maxsize = $metadata[$attribname]['len'];\n }",
"public function load( &$object ) {\n\t\t// TODO: Implement load() method.\n\t}",
"protected function loadObjects() {\n if (!isset($this->objects)) {\n $this->obj_builder->toggleAutoload('on');\n $this->objects = $this->obj_builder->buildObjects();\n $this->obj_builder->toggleAutoload('off');\n }\n }",
"public function load( &$object );",
"public static function loadApiMetadata(ApiMetadataDriver $metadata)\n {\n $metadata->setGroupPrefix(self::TABLE)\n ->addListProperties(\n [\n 'id',\n 'dateAdded',\n ]\n )\n ->build();\n }",
"public function metadataShouldBeCreatableAndFetchableWithTheApi(): void\n {\n $metadata = new Metadata();\n $this->assertNull($metadata->getShopType());\n $this->assertNull($metadata->getShopVersion());\n $this->assertNull($metadata->getMetadata('MyCustomData'));\n\n $metadata->setShopType('my awesome shop');\n $metadata->setShopVersion('v2.0.0');\n $metadata->addMetadata('MyCustomData', 'my custom information');\n $this->assertNull($metadata->getId());\n\n $this->heidelpay->createMetadata($metadata);\n $this->assertNotNull($metadata->getId());\n\n $fetchedMetadata = (new Metadata())->setParentResource($this->heidelpay)->setId($metadata->getId());\n $this->assertNull($fetchedMetadata->getShopType());\n $this->assertNull($fetchedMetadata->getShopVersion());\n $this->assertNull($fetchedMetadata->getMetadata('MyCustomData'));\n\n $this->heidelpay->fetchMetadata($fetchedMetadata);\n $this->assertEquals('my awesome shop', $fetchedMetadata->getShopType());\n $this->assertEquals('v2.0.0', $fetchedMetadata->getShopVersion());\n $this->assertEquals('my custom information', $fetchedMetadata->getMetadata('MyCustomData'));\n }",
"function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ReviewObjectMetadata');\n\t\treturn new ReviewObjectMetadata();\n\t}",
"function getMeta()\n {\n if (!$this->meta)\n $this->meta = new DataEntity;\n\n return $this->meta;\n }",
"public function getMetadata()\n {\n return $this->Metadata;\n }",
"function createMetaData()\n\t{\n\t\tparent::createMetaData();\n\t\t$this->saveAuthorToMetadata();\n\t}",
"public function getMetaData();",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function getMetadata()\n {\n return $this->metadata;\n }",
"public function initialize()\n {\n // attributes\n $this->setName('meta');\n $this->setPhpName('Meta');\n $this->setIdentifierQuoting(true);\n $this->setClassName('\\\\CE\\\\Model\\\\Meta');\n $this->setPackage('src.CE.Model');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null);\n $this->addForeignKey('website_id', 'WebsiteId', 'INTEGER', 'website', 'id', false, null, null);\n $this->addForeignKey('website_routing_id', 'WebsiteRoutingId', 'INTEGER', 'website_routing', 'id', false, null, null);\n $this->addColumn('culture', 'Culture', 'VARCHAR', false, 5, null);\n $this->addColumn('html', 'Html', 'LONGVARCHAR', true, null, null);\n }",
"public function setMetadata($var)\n {\n GPBUtil::checkString($var, True);\n $this->Metadata = $var;\n\n return $this;\n }",
"public function set_metadata ($metadata) {\n $this->metadata = $metadata;\n }",
"public function setMetadata($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\Metadata::class);\n $this->metadata = $var;\n\n return $this;\n }",
"public function getMetaData(): object\n\t{\n\t\treturn $this->metaData;\n\t}",
"public function loadClassMetadata(LoadClassMetadataEventArgs $args)\n {\n $cm = $args->getClassMetadata();\n\n if (isset($this->classes[$cm->name])) {\n $mapping = [\n 'targetEntity' => $this->classes[$cm->name],\n 'fieldName' => 'data',\n 'mappedBy' => 'entity',\n 'cascade' => ['persist', 'remove'],\n 'orphanRemoval' => true,\n ];\n\n $cm->mapOneToMany($mapping);\n } elseif (in_array($cm->name, $this->classes)) {\n $mapping = [\n 'targetEntity' => array_search($cm->name, $this->classes),\n 'fieldName' => 'entity',\n 'inversedBy' => 'data',\n ];\n\n $cm->mapManyToOne($mapping);\n\n $cm->table['uniqueConstraints']['eav_data_idx'] = [\n 'columns' => ['entity_id', 'key'],\n ];\n }\n }",
"protected function load()\n {\n if ($this->contentLoaded) {\n return;\n }\n\n $content = file_get_contents($this->path);\n\n if (!$content) {\n $this->contentLoaded = true;\n return;\n }\n\n preg_match_all('/\\@([a-z]+)\\s([^\\r\\n\\@]+)/i', $content, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $fullMatch = $match[0];\n $variable = $match[1];\n $value = $match[2];\n\n $content = str_replace($fullMatch, '', $content);\n $this->metadata[$variable] = $value;\n }\n\n $this->content = trim($content, \"\\r\\n\");\n $this->contentLoaded = true;\n }",
"function getMetadata() {\n\t\treturn $this->_Metadata;\n\t}",
"public function loadClassMetadata(EventArgs $args)\n {\n $meta = $args->getClassMetadata();\n\n try {\n $configuration = $this->getAnnotationParser()\n ->configureMetadata($meta)\n ->parse();\n } catch (ConfigurationException $e) {\n $configuration = false;\n }\n if ($configuration) {\n $this->configuration = $configuration;\n }\n\n }",
"public static function loadValidatorMetadata(ClassMetadata $metadata)\n {\n $metadata->addPropertyConstraint('content', new Constraints\\NotBlank());\n $metadata->addPropertyConstraint('content', new Constraints\\MinLength(3));\n $metadata->addPropertyConstraint('email', new Constraints\\NotBlank());\n $metadata->addPropertyConstraint('email', new Constraints\\Email(array(\n //'message' => 'Please enter your email address.',\n )));\n $metadata->addPropertyConstraint('name', new Constraints\\NotBlank());\n $metadata->addPropertyConstraint('subject', new Constraints\\NotBlank());\n $metadata->addPropertyConstraint('subject', new Constraints\\MinLength(2));\n }",
"public function getMetadata()\n {\n return $this->_metadata;\n }",
"function metadata()\r\n {\r\n Cache::variable($this->metadata, function() {\r\n return (array)DB::object('userMetadataById', $this->id);\r\n });\r\n }",
"public function load() { }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function getMetadata($objectClass)\n {\n if (! $objectClass instanceof ObjectKey) {\n $objectClass = new ObjectKey($objectClass);\n }\n\n $key = $objectClass->getKey();\n\n return $this->classMetadataFactory->loadMetadata(\n $objectClass,\n LoadingCriteria::createFromConfiguration($this->configuration, $objectClass),\n $this->configuration\n );\n }",
"function &injectMetadataIntoDataObject(&$metadataDescription, &$dataObject) {\n\t\tassert(is_a($dataObject, 'Citation'));\n\n\t\t// Add new meta-data statements to the citation. Add the schema\n\t\t// name space to each property name so that it becomes unique\n\t\t// across schemas.\n\t\t$metadataSchemaNamespace = $this->getMetadataNamespace();\n\n\t\t$nullVar = null;\n\t\tforeach($metadataDescription->getPropertyNames() as $propertyName) {\n\t\t\t$dataObjectKey = $metadataSchemaNamespace.':'.$propertyName;\n\t\t\tif ($metadataDescription->hasStatement($propertyName)) {\n\t\t\t\t// Directly retrieve the internal data so that we don't\n\t\t\t\t// have to care about cardinality and translation.\n\t\t\t\t$value =& $metadataDescription->getData($propertyName);\n\t\t\t\tif (in_array($propertyName, array('person-group[@person-group-type=\"author\"]', 'person-group[@person-group-type=\"editor\"]'))) {\n\t\t\t\t\tassert(is_array($value));\n\n\t\t\t\t\t// Dereference the value to make sure that we don't destroy\n\t\t\t\t\t// the original MetadataDescription.\n\t\t\t\t\t$tmpValue = $value;\n\t\t\t\t\tunset($value);\n\t\t\t\t\t$value =& $tmpValue;\n\n\t\t\t\t\t// Convert MetadataDescription objects to simple key/value arrays.\n\t\t\t\t\tforeach($value as $key => $name) {\n\t\t\t\t\t\tif(is_a($name, 'MetadataDescription')) {\n\t\t\t\t\t\t\t// A name can either be a full name description...\n\t\t\t\t\t\t\t$value[$key] =& $name->getAllData();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// ...or an 'et-al' string.\n\t\t\t\t\t\t\tassert($name == PERSON_STRING_FILTER_ETAL);\n\t\t\t\t\t\t\t// No need to change the value encoding.\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$dataObject->setData($dataObjectKey, $value);\n\t\t\t\tunset($value);\n\t\t\t}\n\t\t}\n\n\t\treturn $dataObject;\n\t}",
"function testLoadMetadata() {\n $v = $this->loadMovie(\"FakeMovie1/FakeMovie1.mp4\");\n $v->loadMetadata(true);\n\n $this->assertEqual($v->title, \"Fake Movie 1\");\n $this->assertEqual($v->plot, \"This is the plot for the fake movie 1.\");\n $this->assertEqual($v->year, \"1992-11-25\");\n $this->assertEqual($v->mpaa, \"PG\");\n $this->assertEqual(count($v->actorList), 3);\n\n $v = $this->loadMovie(\"BarrenMovie/BarrenMovie.mp4\");\n $this->assertEqual($v->title, \"BarrenMovie\");\n $this->assertEqual($v->plot, \"\");\n $this->assertEqual($v->year, \"\");\n $this->assertEqual($v->mpaa, \"N/A\");\n $this->assertEqual(count($v->actorList), 0);\n }",
"public function setMetadata($metadata)\n {\n $this->metadata = $metadata;\n }",
"function getMakeMetadata(){\n\t\t if(!$this->getSavedMetadata()){\n\t\t\t\t$this->tableID = false;\n\t\t\t\t$this->tableName = \"[Not titled]\";\n\t\t\t\t$this->tableDesciption = \"[Not described]\";\n\t\t\t\t$this->tableTags = false;\n\t\t\t\t$this->tableDOI = false;\n\t\t\t\t$this->tableARK = false;\n\t\t\t\t$this->published = false;\n\t\t\t\t$this->pubCreated = false;\n\t\t\t\t$this->pubUpdate = false;\n\t\t\t\t$this->license = $this->DBgetLicense();\n\t\t\t\t$this->getProjects();\n\t\t\t\t$this->getPersons();\n\t\t\t\t$this->getProjectCreators();\n\t\t\t\t$this->getGenerateTableID(); //create a table ID based in the metadata for the table\n\t\t\t\t$this->saveMetadata(); //save the results\n\t\t }\n\t\t else{\n\t\t\t\t$this->metadataParse(); //get saved metadata ready to use\n\t\t }\n\t\t $this->getTableSize(); //get the number of records in a table\n\t\t $this->getTableFields(); //get the fields in a table.\n\t\t $this->getSampleRecords(); //get the fields in a table.\n\t }",
"protected function initModelsMetadata( $options = array() )\n {\n $this->di['modelsMetadata'] = function()\n {\n return new PhMetadataMemory();\n };\n }",
"public static function metadata()\n {\n return Metadata::get(get_called_class());\n }",
"public function getMeta();",
"public function getMeta();",
"public function metadata()\n {\n return $this->hasOne(EntryMeta::class);\n }",
"function __construct () {\n\t\t$this->metaData = Lang::get('metadata');\n\n\t}",
"public function get_metadata() {\n return $this->metadata;\n }",
"public function getGenericMetadata()\n {\n return $this->generic_metadata;\n }",
"public function useMetaData()\n {\n if (!$this->getParam('meta_data')) {\n $this->collectMetaData();\n }\n\n $metaData = $this->getParam('meta_data');\n if ($metaData) {\n if (!empty($metaData['layout.include'])) {\n $this->BLayout->applyLayout($metaData['layout.include']);\n }\n if (!empty($metaData['layout.yml'])) {\n $layoutData = $this->BYAML->parse(trim($metaData['layout.yml']));\n $this->BLayout->addLayout('viewproxy-metadata', $layoutData)->applyLayout('viewproxy-metadata');\n }\n if (($head = $this->view('head'))) {\n foreach ($metaData as $k => $v) {\n $k = strtolower($k);\n switch ($k) {\n case 'title':\n $head->addTitle($v);\n break;\n \n case 'set_title':\n $head->setTitle($v);\n break;\n\n case 'meta_title': \n case 'meta_description': \n case 'meta_keywords':\n $head->meta(str_replace('meta_', '', $k), $v); \n break;\n }\n }\n }\n }\n return $this;\n }",
"public function setMetadata($metadata)\n {\n $this->metadata->set($metadata);\n }",
"public function getClassMetadata(): ClassMetadata;",
"public function loadFromObject($object){\n foreach ($object as $property => $value) {\n //we must ignore this fields\n if(\\in_array($property,['_type','_primary_key','id'])){\n continue;\n }\n $this->{$property}=$value;\n }\n # we set the real short class name\n if(property_exists($model,'_type')){\n $this->setTableName($model->_type);\n }else{\n $modelObj->setTableName(RedBeanEngine::classNameToTableName($model)); \n }\n }",
"function pre_load_metadata($null, $post_id, $name, $hidden)\n {\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 loadClassMetadata(LoadClassMetadataEventArgs $event)\n {\n $metadata = $event->getClassMetadata();\n $className = $metadata->name;\n\n if ($className && $className === $metadata->rootEntityName && array_key_exists($className, $this->map)) {\n $discriminatorMap = $metadata->discriminatorMap;\n $discriminatorMap = $discriminatorMap + $this->map[$className];\n $metadata->setDiscriminatorMap($discriminatorMap);\n }\n }",
"protected function getMetadata()\n {\n // object not working must use array\n $metadata['platform'] = \"Magento 1\";\n $metadata['version'] = Mage::getVersion();\n return $metadata;\n }",
"function autoMetadata(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $this->getProjects();\n\t\t $this->getPersons();\n\t\t $this->getProjectCreators();\n\t\t $this->saveMetadata(); //save the results\n\t }",
"public function metaReLoad()\n {\n return $this->meta = $this->meta()->get();\n }",
"public function useMetaData()\n {\n $this->render();\n $metaData = $this->param('meta_data');\n if ($metaData) {\n if (!empty($metaData['layout.yml'])) {\n $layoutData = BYAML::i()->parse(trim($metaData['layout.yml']));\n BLayout::i()->addLayout('viewproxy-metadata', $layoutData)->applyLayout('viewproxy-metadata');\n }\n if (($head = $this->view('head'))) {\n foreach ($metaData as $k=>$v) {\n $k = strtolower($k);\n switch ($k) {\n case 'title':\n $head->addTitle($v); break;\n case 'meta_title': case 'meta_description': case 'meta_keywords':\n $head->meta(str_replace('meta_','',$k), $v); break;\n }\n }\n }\n }\n return $this;\n }",
"abstract public function load_object(array $args);",
"public function generateMetaData($ObjectName) {\n\t\t$Object = Object::create($ObjectName);\n\t\t$fields = array();\n\t\t$db = $Object->db();\n\t\tarray_push($fields, array(\"name\"=>\"ID\", \"type\"=>\"int\")); //\n\t\tforeach($db as $key=>$value) {\n\t\t\t$value = $this->convertTypeToEXT($value);\n\t\t\t$xtype = $this->getInputType($value);\n\t\t\tarray_push($fields, array(\"name\"=>\"{$key}\", \"type\"=>\"{$value}\", \"xtype\"=>\"{$xtype}\")); //\n\t\t}\n\t\t$has_one = $Object->has_one();\n\t\tforeach($has_one as $key=>$value) {\n\t\t\t//array_push($fields, array(\"name\"=>\"{$key}\", \"type\"=>\"{$value}\"));\n\t\t\tif($value == 'Image') {\n\t\t\t\t$xtype = $this->getInputType($value);\n\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}\", \"mapping\"=>\"{$key}\", \"xtype\"=>\"{$xtype}\"));\n\t\t\t} else {\n\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}ID\", \"type\"=>\"int\", \"mapping\"=>\"{$key}ID\"));\n\t\t\t}\n\t\t\t$sObject = Object::create($value);\n\t\t\tif($sObject == $Object) {\n\t\t\t} else {\n\t\t\t\t$sdb = $sObject->db();\n\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}.ID\", \"type\"=>\"int\", \"mapping\"=>\"{$key}.ID\")); //, \"mapping\"=>\"{$key}.ID\"\n\t\t\t\tforeach($sdb as $sKey=>$sValue) {\n\t\t\t\t\t$sValue = $this->convertTypeToEXT($sValue);\n\t\t\t\t\t$xtype = $this->getInputType($sValue);\n\t\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}.{$sKey}\", \"type\"=>\"{$sValue}\", \"mapping\"=>\"{$key}.{$sKey}\", \"xtype\"=>\"{$xtype}\")); //, \"mapping\"=>\"{$key}.{$sKey}\"\n\t\t\t\t}\n\t\t\t\t$shas_one = $sObject->has_one();\n\t\t\t\tforeach($shas_one as $sKey=>$sValue) {\n\t\t\t\t\t$sValue = $this->convertTypeToEXT($sValue);\n\t\t\t\t\t$xtype = $this->getInputType($sValue);\n\t\t\t\t\tarray_push($fields, array(\"name\"=>\"{$key}.{$sKey}\", \"type\"=>\"{$sValue}\", \"mapping\"=>\"{$key}.{$sKey}\", \"xtype\"=>\"{$xtype}\")); //, \"mapping\"=>\"{$key}.{$sKey}\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$fields = Convert::array2json($fields);\n\t\t$metaData = \"\n\t\t\\\"metaData\\\": {\n\t\t\\\"idProperty\\\": \\\"ID\\\",\n \\\"root\\\": \\\"rows\\\",\n \\\"totalProperty\\\": \\\"results\\\",\n \\\"start\\\": 0,\n \\\"limit\\\": 20,\n \\\"successProperty\\\": \\\"success\\\",\n \\\"fields\\\": {$fields}\n \t},\n \t\";\n\t\treturn $metaData;\n\t}",
"function get_metadata($meta_type, $object_id, $meta_key = '', $single = \\false)\n {\n }",
"public function loadMetadataForClass($className, ClassMetadata $metadata) \n {\n $reflClass = $metadata->getReflectionClass();\n \n // Handle class annotations\n $classAnnotations = $this->reader->getClassAnnotations($reflClass);\n foreach ($classAnnotations as $annotation) {\n\n }\n\n // Handle property annotations\n foreach ($reflClass->getProperties() as $property) {\n $propertyAnnotations = $this->reader->getPropertyAnnotations($property);\n\n $mapping = array('fieldName' => $property->getName());\n\n foreach ($propertyAnnotations as $annotation) {\n if ($annotation instanceof MagicEmbed\\Expose) {\n $mapping = array_replace($mapping, (array) $annotation);\n\n $metadata->setExposedField($mapping);\n }\n }\n }\n\n // Handle method annotations\n \n return $metadata;\n }",
"function injectMetadata(&$metadataDescription) {\n\t\t$dataObject = null;\n\t\t$metadataSchemaName = $metadataDescription->getMetadataSchemaName();\n\t\t$injectionAdapters =& $this->getSupportedInjectionAdapters();\n\t\tif(isset($injectionAdapters[$metadataSchemaName])) {\n\t\t\t// Get the meta-data adapter that supports the\n\t\t\t// given meta-data description's schema.\n\t\t\t$metadataAdapter =& $injectionAdapters[$metadataSchemaName]; /* @var $metadataAdapter MetadataDataObjectAdapter */\n\n\t\t\t// Pass in a reference to the data object which\n\t\t\t// the filter will use to update the current instance\n\t\t\t// of the data object.\n\t\t\t$metadataAdapter->setTargetDataObject($this);\n\n\t\t\t// Use adapter filter to convert from a meta-data\n\t\t\t// description to a data object.\n\t\t\t$dataObject =& $metadataAdapter->execute($metadataDescription);\n\t\t}\n\t\treturn $dataObject;\n\t}",
"private function loadMetadata($packager, $datos)\n {\n \n foreach($datos[\"files\"] as $file) {\n $packager->addFile($file[\"filename\"], $file[\"mimetype\"]);\n }\n\n\t$packager->setTitle($datos[\"title\"]);\n\t$packager->addCreator($datos[\"author\"]);\n\t\n\t\n\tif (array_key_exists(\"subject\",$datos)){\n\t foreach($datos[\"subject\"] as $subject) {\n\t\t$packager->addSubject($subject);\n\t }\n\t}\n\t\n\tif (array_key_exists(\"rights\",$datos)){\n\t $packager->addRights($datos[\"rights\"]);\n\t}\n\t\n\tif (array_key_exists(\"language\",$datos)){\n\t $packager->setLanguage($datos[\"language\"]);\n\t}\n\t\n\tif (array_key_exists(\"publisher\",$datos)){\n\t $packager->setPublisher($datos[\"publisher\"]);\n\t}\n\t\n\t\n\t\n \n }",
"protected function MetaAfterLoad() {\n\t\t}",
"private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }",
"public function loadClassMetadata(LoadClassMetadataEventArgs $args)\n {\n if (\"Goutte\\\\WordpressBundle\\\\Entity\" !== $args->getClassMetadata()->namespace) return;\n\n $classMetadata = $args->getClassMetadata();\n $table_name = $classMetadata->getTableName();\n\n $prefix = $this->getTablePrefix($args);\n\n // Do not apply prefix if already there\n if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()) {\n return;\n }\n\n\n\n $classMetadata->setPrimaryTable(array('name'=>$prefix.$table_name));\n }"
] | [
"0.7296233",
"0.67883456",
"0.67231363",
"0.6220508",
"0.6130248",
"0.6130248",
"0.6130248",
"0.60758543",
"0.60758543",
"0.601151",
"0.59772253",
"0.59480983",
"0.5934559",
"0.5933978",
"0.58546364",
"0.580472",
"0.57982314",
"0.5734579",
"0.57081264",
"0.5699532",
"0.56917536",
"0.559816",
"0.55826867",
"0.5530177",
"0.55295616",
"0.5510462",
"0.54931486",
"0.5476063",
"0.5413362",
"0.5413277",
"0.53980243",
"0.53717923",
"0.5370257",
"0.5359999",
"0.5356443",
"0.5346013",
"0.53452605",
"0.5345041",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.53235674",
"0.5320987",
"0.53055876",
"0.52932316",
"0.5274043",
"0.5270766",
"0.5266896",
"0.52611715",
"0.5259905",
"0.5256508",
"0.52517045",
"0.5243713",
"0.52431995",
"0.52366555",
"0.52346754",
"0.5233758",
"0.52333206",
"0.52333206",
"0.52333206",
"0.5230853",
"0.5230118",
"0.5221993",
"0.5202463",
"0.52006364",
"0.52000254",
"0.5195018",
"0.51942885",
"0.51942885",
"0.5193241",
"0.51858884",
"0.5155719",
"0.51556605",
"0.5154589",
"0.5149791",
"0.5147398",
"0.51424605",
"0.51353043",
"0.51336265",
"0.5132948",
"0.51328206",
"0.5112169",
"0.5103185",
"0.509786",
"0.5094978",
"0.50932807",
"0.50847244",
"0.5068192",
"0.50554323",
"0.50538325",
"0.5029149",
"0.5020435",
"0.500851"
] | 0.0 | -1 |
check element 3, there's no user associated with the notloggedin collections | public function postAction(Request $request, PDO $db)
{
if (isset($request->url_elements[3])) {
switch ($request->url_elements[3]) {
case 'verifications':
$userMapper = new UserMapper($db, $request);
$token = filter_var($request->getParameter("token"), FILTER_SANITIZE_STRING);
if (empty($token)) {
throw new Exception("Verification token must be supplied", Http::BAD_REQUEST);
}
$success = $userMapper->verifyUser($token);
if ($success) {
$view = $request->getView();
$view->setHeader('Content-Length', 0);
$view->setResponseCode(Http::NO_CONTENT);
return;
}
throw new Exception("Verification failed", Http::BAD_REQUEST);
default:
throw new InvalidArgumentException('Unknown Subrequest', Http::NOT_FOUND);
}
} else {
$user = [];
$errors = [];
$userMapper = $this->getUserMapper($db, $request);
// Required Fields
$user['username'] = filter_var(
trim($request->getParameter("username")),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
if (empty($user['username'])) {
$errors[] = "'username' is a required field";
} else {
// does anyone else have this username?
$existingUser = $userMapper->getUserByUsername($user['username']);
if (is_array($existingUser) && array_key_exists('users', $existingUser)) {
if (count($existingUser['users']) > 0) {
$errors[] = "That username is already in use. Choose another";
}
}
}
$user['full_name'] = filter_var(
trim($request->getParameter("full_name")),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
if (empty($user['full_name'])) {
$errors[] = "'full_name' is a required field";
}
$user['email'] = filter_var(
trim($request->getParameter("email")),
FILTER_VALIDATE_EMAIL,
FILTER_FLAG_NO_ENCODE_QUOTES
);
if (empty($user['email'])) {
$errors[] = "A valid entry for 'email' is required";
} else {
// does anyone else have this email?
$existingUser = $userMapper->getUserByEmail($user['email']);
if (is_array($existingUser) && array_key_exists('users', $existingUser)) {
if (count($existingUser['users']) > 0) {
$errors[] = "That email is already associated with another account";
}
}
}
$password = $request->getParameter("password");
if (empty($password)) {
$errors[] = "'password' is a required field";
} else {
// check it's sane
$validity = $userMapper->checkPasswordValidity($password);
if (true === $validity) {
// OK good, go ahead
$user['password'] = $password;
} else {
// the password wasn't acceptable, tell the user why
$errors = array_merge($errors, $validity);
}
}
// Optional Fields
$user['twitter_username'] = filter_var(
trim($request->getParameter("twitter_username")),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
$user['biography'] = filter_var(
trim($request->getParameter("biography")),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
// How does it look? With no errors, we can proceed
if ($errors) {
throw new Exception(implode(". ", $errors), Http::BAD_REQUEST);
}
$userId = $userMapper->createUser($user);
$view = $request->getView();
$view->setHeader('Location', $request->base . $request->path_info . '/' . $userId);
$view->setResponseCode(Http::CREATED);
// autoverify for test platforms
if (
isset($this->config['features']['allow_auto_verify_users'])
&& $this->config['features']['allow_auto_verify_users']
) {
if ($request->getParameter("auto_verify_user") == "true") {
// the test suite sends this extra field, if we got
// this far then this platform supports this
$userMapper->verifyThisTestUser($userId);
}
}
// Generate a verification token and email it to the user
$token = $userMapper->generateEmailVerificationTokenForUserId($userId);
$recipients = [$user['email']];
$emailService = $this->getUserRegistrationEmailService($this->config, $recipients, $token);
$emailService->sendEmail();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}",
"function user_not_loggedin() {\n global $USER;\n return ($USER->id <= 0 || isguestuser());\n}",
"public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}",
"public function notAuthenticated() {\n $objUser = App_Factory_Security::getSecurity()->getObjuser();\n\n if(!($objUser instanceof App_Data_User)) {\n return true;\n }\n \n if($objUser->getUID() !== $this->getlngPlayer1() && $objUser->getUID() !== $this->getlngPlayer2()) {\n return true;\n }\n\n return false;\n }",
"public function loginUserConditionMatchIfUserIsNotLoggedIn() {}",
"private function userNotLoggedin(){\n \n if (session()->get('grandidsession')===null || !session()->has('user_id')\n || (session()->get('role')!==config('constants.roles.USER_ROLE'))){\n return true;\n }\n return false;\n }",
"protected function _canShowForUnregisteredUsers()\n {\n return $this->_objectManager->get(\n \\Magento\\Customer\\Model\\Session::class\n )->isLoggedIn() || $this->getRequest()->getActionName() == 'index' || $this->_objectManager->get(\n \\Magento\\Checkout\\Helper\\Data::class\n )->isAllowedGuestCheckout(\n $this->getOnepage()->getQuote()\n ) || !$this->_objectManager->get(\n \\Magento\\Checkout\\Helper\\Data::class\n )->isCustomerMustBeLogged();\n }",
"function noUser() {\n\t}",
"public function isnotloggedin()\n {\n if (!$this->hasuser())\n {\n return TRUE;\n }\n }",
"function get_nonauthor_user_ids()\n {\n }",
"function wp_get_users_with_no_role($site_id = \\null)\n {\n }",
"function getUsersNotInGroup() {\n\n\tglobal $db;\n\treturn $db->getUsersNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"public function loginUserConditionMatchesAnyLoggedInUser() {}",
"public function loginUserConditionMatchesAnyLoggedInUser() {}",
"function get_all_but_not_this_user($usr)\n{\n $user=$usr->__get('uid');\n $con = connect();\n\t$q1=mysqli_query($con,\"SELECT * FROM user WHERE UId != '$user'\");\n\treturn $q1;\n}",
"abstract function getNonRegisteredUsers();",
"public function loginUserConditionMatchesMultipleLoggedInUsers() {}",
"public function loginUserConditionMatchesMultipleLoggedInUsers() {}",
"function getNotPlantaUsuarios()\r\n\t{\r\n\t\treturn $this->Usuario->find('all',array('conditions' => array('Usuario.planta' => 0)));\r\n\t}",
"public function usergroupConditionDoesNotMatchDefaulUserGroupIds() {}",
"public function hasPartinUsers(){\n return $this->_has(2);\n }",
"function unauthorizedUsersOnly(){\n global $authenticatedUser;\n if(!empty($authenticatedUser)){\n header(\"HTTP/1.1 403 Forbidden\");\n header('Location: https://eso.vse.cz/~frim00/marvelous-movies/');\n exit();\n }\n }",
"public function get_all_user_not_regis()\n\t{\n\t\t$sql = \"SELECT * FROM $this->hr_db.`hr_person` WHERE ps_id not in (SELECT su_ps_id FROM $this->swm_db.`swm_user`)\";\n\t\t$query = $this->swm->query($sql);\n\n\t\treturn $query;\n\t}",
"public function notYou()\n {\n return $this->user_id !== auth()->id();\n }",
"function messageNoUsers()\n {\n $this->get('/usuarios?empty')\n ->assertStatus(200)\n ->assertSee('No hay usuarios registrados');\n }",
"public function isOrphan()\n\t{\n\t\ttry {\n\t\t\t$user = $this->get('user');\n\t\t} catch (SERIA_NotFoundException $e) {\n\t\t\treturn true;\n\t\t} catch (SERIA_Exception $e) {\n\t\t\tif ($e->getCode() == SERIA_Exception::NOT_FOUND)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\tthrow $e;\n\t\t}\n\t\treturn false;\n\t}",
"function notloggedin(){\r\n\tglobal $suid_PageAccess;\r\n\r\n\t// if($_SERVER['HTTP_HOST']==\"localhost:8080\"){\r\n\t// \treturn false;\r\n\t// \techo '<br>1:suid: '.$_SESSION['suid'].'/'.$suid_PageAccess;\r\n\t// \techo '<br>2:cid: '.$_SESSION['cid'].'/'.$suid_PageAccess;\r\n\t// }\r\n\t\r\n\r\n\tif ( ($_SESSION['suid'] && $suid_PageAccess) || (!$_SESSION['suid'] AND !empty($_SESSION['cid']) AND (substr($_SERVER['PHP_SELF'], -16) != 'admin_logout.php')) ) {\r\n\t\treturn false;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n}",
"public function randomQuestionWithNoUser(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionHelper::newQuestion();\n\n $questionsList = User::randomQuestions();\n\n $this->assertFalse($this->user->questions()->get()->contains($questionsList));\n }",
"public function isLoggedInForNoFrontEndReturnsFalse() {\n\t\t$this->assertFalse(\n\t\t\t$this->subject->isLoggedIn()\n\t\t);\n\t}",
"public function check ()\n\t{\n\t\treturn !empty($this->getIdentity());\n\t}",
"public function test_no_group_memberships_group_node_appears_userid_filter() {\n\n // User 1 is in no groups. Ought to show up with groupid of 0. This ought to give us\n // a single node for groupid 0 with a count of 1.\n $params = array(\n 'coursemoduleid' => $this->assign1->cmid,\n 'groupid' => 0,\n 'userid' => 'nextnodefilter',\n );\n\n $nodes = block_ajax_marking_nodes_builder_base::unmarked_nodes($params);\n $this->assertCount(1, $nodes, 'Too many nodes!');\n $node = reset($nodes);\n\n $this->assertObjectHasAttribute('userid', $node);\n $this->assertEquals($this->user1->id, $node->userid, 'Wrong userid returned for groupid 0');\n $this->assertEquals(1, $node->itemcount);\n }",
"public function validateAdminUserAction()\n {\n $id = $this->_request->getParam('user_id');\n if ($id) {\n $limited = $this->_collectionsFactory->create()->getUsersOutsideLimitedScope(\n $this->_role->getIsAll(),\n $this->_role->getWebsiteIds(),\n $this->_role->getStoreGroupIds()\n );\n\n if (in_array($id, $limited)) {\n $this->_forward();\n return false;\n }\n }\n return true;\n }",
"public function no_items() {\n\n\t\tif ( $this->is_filtered() ) {\n\t\t\tesc_html_e( 'No emails found.', 'wp-mail-smtp-pro' );\n\t\t} else {\n\t\t\tesc_html_e( 'No emails have been logged for now.', 'wp-mail-smtp-pro' );\n\t\t}\n\t}",
"function hasEmptyLogin()\n {\n return empty($this->login);\n }",
"public function adminUserConditionDoesNotMatchRegularUser() {}",
"public function is_login(){\n if (empty($this->user['userid'])){\n return false;\n }\n return true;\n }",
"public function testGuestNotAccessUsersPage()\n\t{\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('Users');\n\t}",
"public function has() {\n\t\t$userid = $this->get();\n\t\treturn ! empty( $userid );\n\t}",
"function wp_sub_get_orphaned_users() {\n\tglobal $wpdb;\n\n\t$all_user_site_keys = $wpdb->get_results(\n\t\t$wpdb->prepare(\n\t\t\t\"SELECT u.ID AS user_id, GROUP_CONCAT( m.meta_value SEPARATOR ',' ) AS site_ids, MAX(b.blog_id) AS found_id\n\t\t\t\t FROM $wpdb->usermeta AS m\n\t\t\t\t LEFT JOIN $wpdb->users AS u ON u.ID = m.user_id\n\t\t\t\t LEFT JOIN $wpdb->blogs AS b ON b.blog_id = m.meta_value\n\t\t\t\t WHERE m.meta_key = %s AND u.ID IS NOT NULL\n\t\t\t\t GROUP BY u.ID HAVING found_id IS NULL\n\t\t\t\t\",\n\t\t\t\\WP_SUB\\WP_Separate_User_Base::SITE_META_KEY\n\t\t),\n\t\tARRAY_A\n\t);\n\n\t$orphaned = [];\n\tforeach ( $all_user_site_keys as $user_site ) {\n\t\tforeach ( wp_parse_id_list( $user_site['site_ids'] ) as $site_id ) {\n\t\t\t$orphaned[ $site_id ][] = intval( $user_site['user_id'] );\n\t\t}\n\t}\n\n\treturn $orphaned;\n}",
"public function get_unseen() {\n $this->authenticate();\n $result = $this->discussion->get_unseen_discussions();\n if (!is_null($result)) {\n exit(json_encode([\n 'flg' => TRUE,\n 'msg' => $result\n ]));\n } else {\n exit(json_encode([\n 'flg' => FALSE\n ]));\n }\n }",
"private function fetchUidsToCheck() {\n // We want to query Drupal accounts, which are LDAP associated where a DN\n // is present. The lastUidChecked is used to process only a limited number\n // of batches in the cron run and each user is only checked if the time\n // configured for checking has lapsed.\n $lastUidChecked = $this->state->get('ldap_user_cron_last_uid_checked', 1);\n\n $query = $this->entityTypeManager->getStorage('user')->getQuery()\n ->exists('ldap_user_current_dn')\n ->exists('ldap_user_puid_property')\n ->exists('ldap_user_puid_sid')\n ->exists('ldap_user_puid')\n ->condition('uid', $lastUidChecked, '>')\n ->condition('status', 1)\n ->sort('uid', 'ASC')\n ->range(0, $this->configLdapUser->get('orphanedCheckQty'));\n\n $group = $query->orConditionGroup();\n $group->notExists('ldap_user_last_checked');\n\n switch ($this->configLdapUser->get('orphanedAccountCheckInterval')) {\n case 'always':\n $group->condition('ldap_user_last_checked', time(), '<');\n break;\n\n case 'daily':\n $group->condition('ldap_user_last_checked', strtotime('today'), '<');\n break;\n\n case 'weekly':\n default:\n $group->condition('ldap_user_last_checked', strtotime('today - 7 days'), '<');\n break;\n\n case 'monthly':\n $group->condition('ldap_user_last_checked', strtotime('today - 30 days'), '<');\n break;\n }\n $query->condition($group);\n $uids = $query->execute();\n\n if (count($uids) < $this->configLdapUser->get('orphanedCheckQty')) {\n $this->state->set('ldap_user_cron_last_uid_checked', 1);\n }\n else {\n $this->state->set('ldap_user_cron_last_uid_checked', max($uids));\n }\n\n return $uids;\n }",
"public function testSuccessWithNoUsersToList()\n {\n $response = $this->getJson($this->endpoint(), $this->authenticationHeaders())->assertStatus(200);\n\n // Check the basic api endpoint structure.\n $this->assertEndpointBaseStructure($response);\n }",
"private function notExist() : void\n {\n if(!$this->user)\n {\n (new Session())->set('user','error','Désolé une erreur est survenue');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }\n }",
"public function hasWpUserId(){\n return $this->_has(7);\n }",
"function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM users WHERE id='\". $this->id .\"'\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested user (\". $this->id .\") does not exist - possibly the user has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\n\t\treturn 1;\n\t}",
"public function hasUserId(){\n return $this->_has(2);\n }",
"public function hasUserId(){\n return $this->_has(2);\n }",
"public function hasUserId(){\n return $this->_has(2);\n }",
"public function hasUserId(){\n return $this->_has(2);\n }",
"public function hasUserId(){\n return $this->_has(2);\n }",
"function userExistsNotDeleted($userId) {\n return getSingleValue(\"SELECT COUNT(`id`) FROM `private_users` WHERE `id` =\" . escape(intval($userId)) . \" AND `deleted` =0 LIMIT 0, 1\");\n }",
"public function hasNoRole()\n {\n return $this->hakAksesPengguna()\n ->where('status_request', RequestStatus::APPROVED)\n ->count() === 0;\n }",
"function pms_get_users_non_members( $args = array() ) {\r\n\r\n global $wpdb;\r\n\r\n $defaults = array(\r\n 'orderby' => 'ID',\r\n 'offset' => '',\r\n 'limit' => ''\r\n );\r\n\r\n $args = apply_filters( 'pms_get_users_non_members_args', wp_parse_args( $args, $defaults ), $args, $defaults );\r\n\r\n // Start query string\r\n $query_string = \"SELECT {$wpdb->users}.ID \";\r\n\r\n // Query string sections\r\n $query_from = \"FROM {$wpdb->users} \";\r\n $query_join = \"LEFT JOIN {$wpdb->prefix}pms_member_subscriptions ON {$wpdb->users}.ID = {$wpdb->prefix}pms_member_subscriptions.user_id \";\r\n $query_where = \"WHERE {$wpdb->prefix}pms_member_subscriptions.user_id is null \";\r\n\r\n $query_limit = '';\r\n if( !empty( $args['limit'] ) )\r\n $query_limit = \"LIMIT \" . $args['limit'] . \" \";\r\n\r\n $query_offset = '';\r\n if( !empty( $args['offset'] ) )\r\n $query_offset = \"OFFSET \" . $args['offset'] . \" \";\r\n\r\n\r\n // Concatenate the sections into the full query string\r\n $query_string .= $query_from . $query_join . $query_where . $query_limit . $query_offset;\r\n\r\n $results = $wpdb->get_results( $query_string, ARRAY_A );\r\n\r\n $users = array();\r\n\r\n if( !empty( $results ) ) {\r\n foreach( $results as $result ) {\r\n $users[] = new WP_User( $result['ID'] );\r\n }\r\n }\r\n\r\n return apply_filters( 'pms_get_users_non_members', $users, $args );\r\n\r\n }",
"public function test_show_user_as_unauthorized_user()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user2->id]));\n\n $response->assertStatus(403);\n }",
"function getUserIsLoggedIn() {\r\n\r\n // For now, just return false\r\n return false;\r\n}",
"public static function check()\n {\n return !is_null(static::user());\n }",
"public function check()\t{\n\t\treturn ! is_null($this->user());\n\t}",
"public function userIsExcluded() {\n\t\t// Check whether we should exclude tracking for specific user roles.\n\t\t$excludeUsers = aioseo()->options->deprecated->webmasterTools->googleAnalytics->excludeUsers;\n\t\tif (\n\t\t\taioseo()->options->deprecated->webmasterTools->googleAnalytics->advanced &&\n\t\t\t! empty( $excludeUsers ) &&\n\t\t\tis_user_logged_in()\n\t\t) {\n\t\t\t$currentUser = wp_get_current_user();\n\t\t\tif ( ! empty( $currentUser ) ) {\n\t\t\t\t$intersect = array_intersect( $excludeUsers, $currentUser->roles );\n\t\t\t\tif ( ! empty( $intersect ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"private function userExist(){\n $result = $this->facebookModel->project(array(\"User_id\" => true, \"Current_city\" => true, \"_id\" => false))->get()->count();\n return $result;\n }",
"public static function checkOwnerExisting()\n {\n global $mainframe;\n $db = JFactory::getDbo();\n $db->setQuery(\"Select count(id) from #__osrs_agents where agent_type <> '0' and published = '1'\");\n $count = $db->loadResult();\n if ($count > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function validate_login() {\r\n //find or findOne both methods can be used for query;\r\n /*\r\n * although findOne returns nothing on invalid data which leads to yield warning message for foreach loop but find method returns other \r\n * things even on invalid data which helps to yields no warning on foreach loop.\r\n * \r\n */\r\n /*\r\n * To access name using fineOne method use $result[0] \r\n * To access name using find method use $result[0]['name']\r\n */\r\n $user = $this->collection->user->find( [ 'user_id' => $this->user_id, 'pass' => $this->login_pass, 'user_type' => $this->user_type ] );\r\n $name = '';\r\n $result = array();\r\n $flag = false;\r\n \r\n foreach ($user as $entry) {\r\n $flag = true;\r\n //$entry['name'];\r\n array_push($result,$entry);\r\n }\r\n if($flag){\r\n return $result;\r\n }\r\n else{\r\n return false;\r\n }\r\n \r\n }",
"public function check_insta_user() {\n \n }",
"public function testGuestNotAccessProfilePage()\n\t{\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\t}",
"public function testNoPermission(){\n $noAccessUser = $this->drupalCreateUser([]);\n $this->drupalLogin($noAccessUser);\n $this->drupalGet('connect-four');\n $this->assertSession()->statusCodeEquals(403);\n }",
"public function test_that_unauthroized_user_cannot_view_courses()\n {\n\n }",
"public function empty()\n {\n $forms = $this->belongsToMany(Form::class);\n $users = $this->belongsToMany(User::class);\n\n return ($forms->count() == 0 && $users->count() == 0) ? true : false;\n }",
"public static function counter_unapproved(){\n \n global $db;\n \n $query = \"SELECT COUNT(*) FROM users \";\n $query .= \"WHERE (user_role = 'subscriber') \";\n \n $result = $db->query($query);\n \n $row = $result->fetch_array(MYSQLI_NUM);\n \n return !empty($row) ? $row[0] : false;\n \n }",
"function IsUndefined()\n {\n return $this->user === null;\n }",
"public function checkNotExist($data) {\r\n\t\t$sql = \"Select Count(*) As cnt From `#languages` Where `url_code` = '{$data['url_code']}' And id <> {$data['id']}\"; \r\n\t\t$rs = $this->_get($sql); \r\n\t\tif ($rs) {\r\n\t\t\tif ($rs->cnt == 0) return true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"public function checkUsersSession(){\n\t}",
"private function getUidZerroIsPresent() {\n $count = db_query(\"SELECT uid FROM {users} WHERE uid = 0\")->fetchAll();\n return (boolean) $count;\n }",
"private function isNotAdmin()\n {\n if (Auth::user() == null || Auth::user()->users_status != \"admin\") {\n return true;\n }\n }",
"function isuserloggedin()\r\n{\r\n return false;\r\n}",
"public function isEmpty()\r\n {\r\n return !isset($this->getNamespace()->{$this->getMember()});\r\n }",
"public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }",
"function authorizedUsersOnly(){\n global $authenticatedUser;\n if(empty($authenticatedUser)){\n header(\"HTTP/1.1 401 Unauthorized\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-401\");\n exit();\n }\n }",
"private function checkIfLoggedIn()\n {\n if (!session()->has('user')) {\n abort(403, 'You are not logged in.');\n }\n }",
"function usersWithout(){\n\t\t\t\t\trequire_once(\"database\\database_connection.php\");\n\t\t\t\t\t$conn=database();\n\t\t\t\t\t//Query the database\n\t\t\t\t\t$resultSet = $conn->query(\"SELECT * FROM users_count_view\");\n\t\t\t\t\tif($resultSet->num_rows != 0){\n\t\t\t\t\t\twhile($rows = $resultSet->fetch_assoc()){\n\t\t\t\t\t\t\t$users = $rows['users'];\n\t\t\t\t\t\t\techo \"<h4 class='heading'>\n\t\t\t\t\t\t\tRegistered users: $users\n\t\t\t\t\t\t\t</h4>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\techo\"ERROR\";\n\t\t\t\t\t}\n\t\t \t\t$conn->close();\n}",
"public function hasUsershow(){\n return $this->_has(32);\n }",
"public function testContainsWillReturnFalseIfAnElementIsNotSet()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $element3 = new \\stdClass();\n $element3->Name = 'EL 3';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $Collection->set('index2', $element2);\n $Collection->set('index1', $element1);\n\n $this->assertFalse($Collection->contains($element3));\n }",
"public function testManagerNotAccessProfileUser()\n\t{\n\t\t$this->login($this->users['sample2']['varName'], $this->passwordManager);\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextPresent('You don\\'t have access to this section.');\n\t}",
"public function hasNoLimit() {\n return $this->_has(1);\n }",
"function isNotLoggedIn(){\n\t\tif(!isset($_SESSION['session_id']))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"function isDisabled()\n{\n $obDB = new cstDB();\n $obDB->doQuery('SELECT ownerID from AuctionItems where itemID='.$_GET[\"itemID\"].' LIMIT 1');\n $result=$obDB->fetchAssocResult();\n \n \n if(!isset($_SESSION[\"user\"]) )\n {\n return \"disabled\";\n }\n else if(count($result)!=0)\n {\n if($result[0][\"ownerID\"]==$_SESSION[\"user\"])\n {\n return \"disabled\";\n }\n }\n \n return \"\";\n}",
"public function hasUsername(){\n return $this->_has(4);\n }",
"public function testNewlyCreatedUsersThatHaveNotLoggedInAreNotDeleted(): void\n {\n User::factory()->create();\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, User::all());\n }",
"public function testJsonNotPostsOfUser()\n {\n $response = $this->jsonUser('GET', '/api/users/posts');\n $response->assertJsonStructure($this->jsonStructureNotPostsOfUser());\n $response->assertStatus(Response::HTTP_OK);\n }",
"public function hasUsername(){\n return $this->_has(6);\n }",
"public function hasUsername(){\n return $this->_has(6);\n }",
"public function logged_in() {\n return !empty($this->session->userdata('user_id'));\n }",
"public function hasUid(){\n return $this->_has(2);\n }",
"private static function notAllowed() : array\n\t{\n\t\t$return = [];\n\n\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\n\t\t$return['count'] = 0;\n\t\t$return['status'] = 0;\n\t\t$return['message'] = $aeSettings->getText('not_authenticated');\n\n\t\t/*<!-- build:debug -->*/\n\t\tif ($aeSettings->getDebugMode()) {\n\t\t\t$return['debug'] = 'The show_login settings is set to ' .\n\t\t\t\t'1 and the user isn\\'t yet connected. In that case, ' .\n\t\t\t\t'the list of files should be keept hidden';\n\t\t}\n\t\t/*<!-- endbuild -->*/\n\n\t\treturn $return;\n\t}",
"public function limitToMissingRegistrationsWithNoLoggedInFeUserThrowsException()\n {\n $this->setExpectedException(\n 'BadMethodCallException',\n 'No FE user is currently logged in. Please call this function only when a FE user is logged in.'\n );\n\n $this->fixture->limitToMissingRegistrations();\n }",
"function customerIsLogedIn() {\n\t\treturn isset($_SESSION) && isset($_SESSION[\"webuser\"]) && isset($_SESSION[\"webuser\"][\"ID\"]);\n\t}",
"public function findMissingInCollection($collection_data) {\n $missing_stickers_id = NULL;\n if ($collection_data['success']) {\n // Find the missing stickers of owned stickers\n $missing_stickers = array_filter($collection_data['payload'], function($an_object) { return !$an_object['owned']; });\n $missing_stickers_id = array_map(function($a_value) { return $a_value['id'];}, $missing_stickers);\n }\n return $missing_stickers_id;\n }",
"private function noAction() {\n if(strlen($this->get('username')) <= 0){\n echo 'no-user';\n }\n }",
"public function no_items() {\n\t\t_e( 'No reviews avaliable.', 'woo-better-reviews' );\n\t}",
"public function check()\n {\n $user = $this->user();\n return !empty($user);\n }",
"public function inListForItemNotContainedReturnsFalseDataProvider() {}",
"function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }",
"public function require_no_user()\n {\n //{\n // Session::flash('notice', 'You must be logged out to see that page.');\n // redirect('/');\n //}\n }"
] | [
"0.6741413",
"0.63765734",
"0.6325251",
"0.6318579",
"0.6171644",
"0.6052228",
"0.5989663",
"0.5975919",
"0.59665823",
"0.59503275",
"0.5901578",
"0.5851601",
"0.57212216",
"0.5719714",
"0.570461",
"0.56792927",
"0.5678591",
"0.5677635",
"0.5650076",
"0.56306905",
"0.5629173",
"0.5612914",
"0.55912805",
"0.55835676",
"0.5577884",
"0.5563396",
"0.555141",
"0.5545595",
"0.5530581",
"0.5517195",
"0.54966724",
"0.5495994",
"0.54901314",
"0.54830194",
"0.5474079",
"0.5461367",
"0.5457275",
"0.54535496",
"0.5448201",
"0.54418343",
"0.54411256",
"0.54354984",
"0.54301727",
"0.54276174",
"0.5414767",
"0.5412946",
"0.5412946",
"0.5412946",
"0.5412946",
"0.5412946",
"0.5410267",
"0.5407602",
"0.5405444",
"0.53960574",
"0.5384357",
"0.53796995",
"0.53796077",
"0.53792685",
"0.53717625",
"0.53647184",
"0.53518283",
"0.5346925",
"0.5344613",
"0.534245",
"0.533745",
"0.5336653",
"0.5327383",
"0.5322285",
"0.53213865",
"0.5317901",
"0.53150755",
"0.53128415",
"0.5309271",
"0.53084964",
"0.53071105",
"0.53059906",
"0.5303246",
"0.5296626",
"0.5296547",
"0.52906543",
"0.52842385",
"0.5284213",
"0.5283565",
"0.5279147",
"0.527704",
"0.52663696",
"0.5263191",
"0.52604413",
"0.52604413",
"0.52576166",
"0.52565664",
"0.5255797",
"0.52392447",
"0.52368546",
"0.5236243",
"0.5232971",
"0.5232651",
"0.52255505",
"0.5223127",
"0.5218148",
"0.5214039"
] | 0.0 | -1 |
Allow a user to edit their own record | public function updateUser(Request $request, PDO $db)
{
if (null === ($request->getUserId())) {
throw new Exception("You must be logged in to change a user account", Http::UNAUTHORIZED);
}
$userId = $this->getItemId($request);
$userMapper = $this->getUserMapper($db, $request);
if (!$userMapper->thisUserHasAdminOn($userId)) {
throw new Exception("Could not update user", Http::BAD_REQUEST);
}
$oauthModel = $request->getOauthModel($db);
$accessToken = $request->getAccessToken();
// only trusted clients can change account details
if (!$oauthModel->isAccessTokenPermittedPasswordGrant($accessToken)) {
throw new Exception("This client does not have permission to perform this operation", Http::FORBIDDEN);
}
// start building up a representation of the user
$user = ["user_id" => $userId];
$errors = [];
// start with passwords
$password = $request->getParameter('password');
if (!empty($password)) {
// they must supply their old password to be allowed to set a new one
$oldPassword = $request->getParameter('old_password');
if (empty($oldPassword)) {
throw new Exception(
'The field "old_password" is needed to update a user password',
Http::BAD_REQUEST
);
}
// is the old password correct before we proceed?
if (!$oauthModel->reverifyUserPassword($userId, $oldPassword)) {
throw new Exception("The credentials could not be verified", Http::FORBIDDEN);
}
$validity = $userMapper->checkPasswordValidity($password);
if (true === $validity) {
// OK good, go ahead
$user['password'] = $password;
} else {
// the password wasn't acceptable, tell the user why
$errors = array_merge($errors, $validity);
}
}
$user['full_name'] = filter_var(
trim($request->getParameter("full_name")),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
if (empty($user['full_name'])) {
$errors[] = "'full_name' is a required field";
}
$user['email'] = filter_var(
trim($request->getParameter("email")),
FILTER_VALIDATE_EMAIL,
FILTER_FLAG_NO_ENCODE_QUOTES
);
if (empty($user['email'])) {
$errors[] = "A valid entry for 'email' is required";
} else {
// does anyone else have this email?
$existingUser = $userMapper->getUserByEmail($user['email']);
if (is_array($existingUser) && array_key_exists('users', $existingUser)) {
// yes but is that our existing user being found?
$oldUser = $userMapper->getUserById($userId);
if ($oldUser['users'][0]['uri'] != $existingUser['users'][0]['uri']) {
// the email address exists and not on this user's account
$errors[] = "That email is already associated with another account";
}
}
}
$username = $request->getParameter("username", false);
if (false !== $username) {
$user['username'] = filter_var(
trim($username),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
// does anyone else have this username?
$existingUser = $userMapper->getUserByUsername($user['username']);
if (is_array($existingUser) && array_key_exists('users', $existingUser)) {
// yes but is that our existing user being found?
$oldUser = $userMapper->getUserById($userId);
if ($oldUser['users'][0]['uri'] != $existingUser['users'][0]['uri']) {
// the username exists and not on this user's account
$errors[] = "That username is already associated with another account";
}
}
}
// Optional Fields
$twitterUsername = $request->getParameter("twitter_username", false);
if (false !== $twitterUsername) {
$user['twitter_username'] = filter_var(
trim($twitterUsername),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
}
$biography = $request->getParameter("biography", false);
if (false !== $biography) {
$user['biography'] = filter_var(
trim($biography),
FILTER_SANITIZE_STRING,
FILTER_FLAG_NO_ENCODE_QUOTES
);
}
if ($errors) {
throw new Exception(implode(". ", $errors), Http::BAD_REQUEST);
}
// now update the user
if (!$userMapper->editUser($user, $userId)) {
throw new Exception("User not updated", Http::BAD_REQUEST);
}
// we're good!
$view = $request->getView();
$view->setHeader('Content-Length', 0);
$view->setResponseCode(Http::NO_CONTENT);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}",
"public function editRecord() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-edit') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $id = $this->uri->segment(3);\n $user = $this->UserModel->getRecord($id);\n $permission_group = $this->UserModel->getUserType($user->id);\n $user->user_role = $permission_group->user_type;\n $this->data['result'] = $user;\n $this->set_view('user/edit_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }",
"public function edit() {\n\t\t\t\n\t\t}",
"public function edit(Record $record)\n {\n //\n }",
"public function edit( )\r\n {\r\n //\r\n }",
"protected function canEdit() {}",
"public function edit()\n\t{\n\t\t//\n\t}",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\n {\n \n }",
"public function editAction() {}",
"public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }",
"public function edit()\n {\n \n \n }",
"public function edit() {\n }",
"public function edit()\n\t{\n\t\t\n\t}",
"public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit(BookRecord $bookRecord)\n {\n //\n }",
"public function edit()\n { \n }",
"abstract function allowEditAction();",
"public function edit() {\n\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function can_edit() {\n return true;\n }",
"public function edit()\n {\n\n }",
"public function edit()\n {\n\n }",
"public function edit()\n {\n\n }",
"public function edit()\n {\n\n }",
"public function edit($user_id)\n\t{\n\t\t//\n\t}",
"public function edit(Owner $owner)\n {\n //\n }",
"public function edit(PatientRecord $patientRecord)\n {\n //\n }",
"public function edit(Lawyer $lawyer)\n {\n //\n }",
"public function Edit()\n\t{\n\t\t\n\t}",
"function edit( $id = \"be1\") {\n\n\n\t\t// load user\n\t\t$this->data['backend'] = $this->Backend_config->get_one( $id );\n\n\t\t// call the parent edit logic\n\t\tparent::backendedit( $id );\n\t}",
"public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }",
"public function edit($username)\n {\n //\n }",
"public function edit()\n { }",
"function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}",
"public function actionEdit() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$first_name = $user['first_name'];\n\t\t$last_name = $user['last_name'];\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$first_name = $_POST['first_name'];\n\t\t\t$last_name = $_POST['last_name'];\n\n\t\t\t$errors = array();\n\n\t\t\tif ($error = Validator::checkName($first_name)) $errors['first_name'] = $error;\n\t\t\tif ($error = Validator::checkName($last_name)) $errors['last_name'] = $error;\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::edit($userId, $first_name, $last_name);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Edit Details\";\n\t\trequire_once(ROOT . '/views/account/edit.php');\n\n\t\treturn true;\n\t}",
"public function showEdit()\n {\n\n }",
"function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}",
"function edit() {\n\t\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\r\n\t\n\t\t// Get annonce\r\n\t\t$this->fetchAnnonce();\n\t\t\n\t\t// We should have write access to this annonce\n\t\t$this->checkWriteAccess();\r\n\t\r\n\t\t// Redirect to the annonce\r\n\t\t$this->renderView(\"editAnnonce\");\r\n\t\r\n\t}",
"public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }",
"public function edit($id)\n { \n \n }",
"public function edit($id)\n { \n \n }",
"public function editAction()\r\n {\r\n }",
"function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}",
"function user_edit($user_info)\n {\n }",
"public function edit($id)\n {\n \n }",
"public function edit($id)\n {\n \n }",
"function get_user_to_edit($user_id)\n {\n }",
"function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }",
"public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }",
"public function edit($id) {\n\t\t\n\t}",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function canEdit()\n {\n return true;\n }",
"function account_edit()\n {\n }",
"public function edit($id)\n {\n\n\n\n }",
"public function edit($id) {\n//\n }",
"public function edit($id) {\n//\n }",
"public function edit($obj) {\n\t}",
"public function edit($id)\n {\n\t\t\n \n }",
"public function edit(Member $member)\n {\n //\n }",
"public function edit(Member $member)\n {\n //\n }",
"public function edit($id) {\n \n }",
"public function edit($id) {\n \n }",
"public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit($id)\n { \n //\n }",
"public function edit($id)\n {\n // \n }",
"public function edit($id)\n {\n//\n }",
"public function edit(ResearchMember $researchMember)\n {\n //\n }",
"public function edit ($id) {\n\n }",
"public function edit($id)\n {\n \n\n }",
"public function edit($id)\n {\n //\n \n }",
"public function edit($id)\n {\n //\n }",
"function user_can_edit_user($user_id, $other_user)\n {\n }",
"public function edit($id)\n {\n \n\n }",
"public function edit($id)\n {\n \n\n }",
"public function edit(User $user)\n {\n //\n }"
] | [
"0.8144015",
"0.7668761",
"0.76229084",
"0.7571698",
"0.75554425",
"0.7470559",
"0.7409758",
"0.7357891",
"0.7357891",
"0.7354206",
"0.7353598",
"0.73488295",
"0.7344208",
"0.7335994",
"0.73242337",
"0.73209125",
"0.72854435",
"0.72854435",
"0.72854435",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.72576195",
"0.7244914",
"0.7191533",
"0.7191533",
"0.7191533",
"0.71915144",
"0.71888095",
"0.7188635",
"0.7176389",
"0.71711665",
"0.71594936",
"0.71386987",
"0.71386987",
"0.71386987",
"0.71386987",
"0.7114825",
"0.7095522",
"0.7093705",
"0.7086488",
"0.7075372",
"0.7073789",
"0.7069691",
"0.70551294",
"0.70500416",
"0.7035409",
"0.7032437",
"0.6991348",
"0.6966381",
"0.69557273",
"0.6953887",
"0.69523776",
"0.69523776",
"0.69458264",
"0.6943696",
"0.69430333",
"0.693754",
"0.693754",
"0.6937448",
"0.6934599",
"0.6925184",
"0.6923557",
"0.69222206",
"0.6916108",
"0.69007987",
"0.6899778",
"0.6899613",
"0.6899613",
"0.68995535",
"0.6896202",
"0.6891561",
"0.6891561",
"0.68908846",
"0.68908846",
"0.6879434",
"0.6867642",
"0.6867642",
"0.6867642",
"0.6867642",
"0.6867642",
"0.68662167",
"0.68655133",
"0.68630207",
"0.6858994",
"0.68566394",
"0.68544257",
"0.6849102",
"0.6848433",
"0.6846773",
"0.6845575",
"0.6845575",
"0.68445927"
] | 0.0 | -1 |
Allow users to be set as trusted | public function setTrusted(Request $request, PDO $db)
{
if (null === ($request->getUserId())) {
throw new Exception("You must be logged in to change a user account", Http::UNAUTHORIZED);
}
$userMapper = $this->getUserMapper($db, $request);
if (!$userMapper->isSiteAdmin($request->getUserId())) {
throw new Exception("You must be an admin to change a user's trusted state", Http::FORBIDDEN);
}
$userId = $this->getItemId($request);
if (!is_bool($trustedStatus = $request->getParameter("trusted", null))) {
throw new Exception("You must provide a trusted state", Http::BAD_REQUEST);
}
if (!$userMapper->setTrustedStatus($trustedStatus, $userId)) {
throw new Exception("Unable to update status", Http::INTERNAL_SERVER_ERROR);
}
$view = $request->getView();
$view->setHeader('Content-Length', 0);
$view->setResponseCode(Http::NO_CONTENT);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTrustedUser(){\n if (fromLocal() === true) return true;\n return strpos(clientIp(), ALLOW_IP) === 0;\n}",
"public function content_is_trusted() {\n \treturn true;\n }",
"function trusted() {\n\t//-----------------------------------------------------------\n\t// Check for trusted host\n\tif(getenv('HTTP_REFERRER')) {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERRER'));\n\t\t} else {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERER'));\n\t\t}\n\tif($ref_url_parts['host'] !== $this->accept_host) {\n\t\treturn false;\n\t\t//print \"ERROR - You do not have permission to access this site remotely.\";\n\t\t//exit;\n\t} else {\n\t\treturn true;\n\t}\n}",
"public function is_trusted() {\n\n return $this->confianza > 0;\n }",
"protected function allow() {\n\t\t\n\t\treturn true;\n\t}",
"public function checkSecurity() {\n }",
"public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}",
"static function isUserTainted()\r\n {\r\n return false;\r\n }",
"public function getExplicitlyAllowAndDeny() {}",
"public function setAuthorized() {}",
"function isSecure ()\n {\n return FALSE;\n }",
"function storage_can_set($sv_user) {\n $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));\n if (!$allowed) {\n print \"ERROR : Not allowed\";\n }\n return $allowed;\n}",
"function dokan_is_seller_trusted( $user_id ) {\n $publishing = get_user_meta( $user_id, 'dokan_publishing', true );\n\n if ( $publishing == 'yes' ) {\n return true;\n }\n\n return false;\n}",
"public function isAllowedForUser(){\n\t\treturn true;\n\t}",
"public static function setTrustProxy($isTrusted = true) {\n\t self::$trust = $isTrusted ? true : false;\n\t}",
"function can_be_manually_set() {\n return true;\n }",
"public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }",
"public static function isTrustedRequest()\n\t{\n\t\treturn IpUtils::checkIp(request()->ip(), static::$ips);\n\t}",
"public function authorize()\n { \n //放入購物車時驗證權限 無則發送403\n $v = Auth::user()->verify;\n if(!$v){\n return false;\n }\n return true;\n \n }",
"public function dataProviderForgenerateTrustedPropertiesTokenWithUnallowedValues() {}",
"function allowPasswordChange() {\n global $shib_pretend;\n\n return $shib_pretend;\n\n }",
"public function prevent_direct_user_input() {\n if ($this->action != SURVEYPRO_NOACTION) {\n require_sesskey();\n }\n if ($this->action == SURVEYPRO_DELETEUTEMPLATE) {\n require_capability('mod/surveypro:deleteusertemplates', $this->context);\n }\n if ($this->action == SURVEYPRO_DELETEALLITEMS) {\n require_capability('mod/surveypro:manageusertemplates', $this->context);\n }\n if ($this->action == SURVEYPRO_EXPORTUTEMPLATE) {\n require_capability('mod/surveypro:downloadusertemplates', $this->context);\n }\n }",
"public function sanitize()\n {\n return false;\n }",
"public function sanitize()\n {\n return false;\n }",
"public function sanitize()\n {\n return false;\n }",
"public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}",
"public function authorize()\n {\n return true; //[ *1. default=false ]\n }",
"public function protect() {\n\t}",
"public function allowAllProperties() {}",
"public function isSecure ()\n {\n \treturn false;\n }",
"protected function _isAllowed()\n {\n \treturn true;\n }",
"public function it_can_be_sanitized()\n {\n $this->markTestSkipped('Sanitization is not implemented yet.');\n }",
"public function check_insta_user() {\n \n }",
"public function security_check() {\n\t\t\tif ( current_user_can( 'activate_plugins' ) ) {\n\t\t\t\t//Conditionally adding the function for database context for \n\t\t\t\tadd_filter( 'clean_url', array( $this, 'save_shortcode' ), 99, 3 );\n\t\t\t}\n\t\t}",
"protected function sanitize() {}",
"public function setProtect($value) {\n\t}",
"public function authorize() {\n\t\treturn false;\n }",
"function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }",
"function wp_trusted_keys()\n {\n }",
"function AllowAnonymousUser() {\n\t\tswitch (EW_PAGE_ID) {\n\t\t\tcase \"add\":\n\t\t\tcase \"register\":\n\t\t\tcase \"addopt\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"edit\":\n\t\t\tcase \"update\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"delete\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"view\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"search\":\n\t\t\t\treturn FALSE;\n\t\t\tdefault:\n\t\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function setAllowTrustMeAccount($allow_tma){\r\n\t\t$this->allowTrustMeAccount = $allow_tma;\r\n\t\t$this->overwriteGlobalTMASettings = true;\r\n\t}",
"function instance_allow_config()\r\n\t\t{\r\n\t\t\r\n\t\t}",
"public function testPrivs()\n {\n return true; ///< Every client sees only it's own information\n }",
"public function authorize()\n {\n // User system not implemented\n return true;\n }",
"public function setAllow($value) {\r\n $this->allow = $value;\r\n }",
"function isSecure() {\n\t\treturn false;\n\t}",
"public function isSecure ();",
"public function beforeFilter() {\n \tparent::beforeFilter();\n\t\t$this->Auth->allow('');\n\t}",
"public function authorize()\r\n {\r\n return false;\r\n }",
"public function isSecure();",
"public function adminOnly();",
"public function adminOnly();",
"public function isSecure()\n {\n return false;\n }",
"public static function setTrustedProxies($trustedProxies)\n\t{\n\t\tself::$trustedProxies = (array)$trustedProxies;\n\t}",
"function isSpecial(){\r\n\t\tif($this->user_type == 'Special'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function setExternalAccessUserAuthorization( $flag = true )\r\n\t{\r\n\t $this->external_access_user_authorization = $flag;\r\n\t}",
"public function setAuthenticated();",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"public function authorize()\n {\n return false;\n }",
"function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}",
"function is_verified()\n {\n return false;\n }",
"public function sanitize() {\n }",
"public function authorize()\n {\n //return false; //return False will stop everything\n\t\treturn true;\n }"
] | [
"0.68905914",
"0.6824001",
"0.66266763",
"0.6427507",
"0.6312033",
"0.6076449",
"0.60483164",
"0.6024739",
"0.59828067",
"0.59273094",
"0.5910408",
"0.5908191",
"0.58956313",
"0.58646476",
"0.58488375",
"0.5826323",
"0.58191955",
"0.5803069",
"0.57992107",
"0.5734636",
"0.573288",
"0.57318807",
"0.5711895",
"0.5711895",
"0.5711895",
"0.5710417",
"0.5688069",
"0.5684889",
"0.56835973",
"0.56633",
"0.5656752",
"0.56555796",
"0.565503",
"0.56417805",
"0.56284523",
"0.56258434",
"0.5624693",
"0.5624538",
"0.56142926",
"0.56122136",
"0.5602269",
"0.5594529",
"0.558099",
"0.558097",
"0.55772305",
"0.55676824",
"0.555841",
"0.5556409",
"0.5545769",
"0.5541916",
"0.55361193",
"0.55361193",
"0.55160135",
"0.55144536",
"0.5513453",
"0.55058914",
"0.5500686",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54978275",
"0.54645586",
"0.5462389",
"0.5458741",
"0.54485995"
] | 0.56710774 | 29 |
Determine if the user is authorized to make this request. | public function authorize()
{
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 authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }",
"public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\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 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 isAuth()\n {\n return $this->session->hasAuthorisation();\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 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 isAuthorized() {\n\t\t\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 if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n return $this->auth->check();\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()\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 // User system not implemented\n return true;\n }",
"public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\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.8401071",
"0.8377486",
"0.8377486",
"0.8344406",
"0.8253731",
"0.824795",
"0.8213121",
"0.8146598",
"0.81115526",
"0.8083369",
"0.7991986",
"0.79907674",
"0.79836637",
"0.79604936",
"0.79516214",
"0.79494005",
"0.79265946",
"0.7915068",
"0.79001635",
"0.7894822",
"0.7891453",
"0.7890965",
"0.7862504",
"0.78414804",
"0.78414804",
"0.7837965",
"0.78248763",
"0.7812292",
"0.7809632",
"0.77928597",
"0.7788316",
"0.7781619",
"0.77815884",
"0.7763308",
"0.7754035",
"0.7717961",
"0.7717961",
"0.77171147",
"0.77138597",
"0.7705001",
"0.7693082",
"0.7692783",
"0.76915383",
"0.76909506",
"0.76733255",
"0.7667128",
"0.7665592",
"0.7656238",
"0.7650853",
"0.764326",
"0.76431626",
"0.76431614",
"0.7635147",
"0.76311624",
"0.76294273",
"0.7627076",
"0.76207024",
"0.76207024",
"0.76139116",
"0.76036394",
"0.76035625",
"0.76035625",
"0.76032084",
"0.7602515",
"0.76007926",
"0.75971127",
"0.7588128",
"0.7586303",
"0.7581912",
"0.7563037",
"0.7554785",
"0.75526226",
"0.755171",
"0.75436753",
"0.75432944",
"0.7540682",
"0.7538806",
"0.75280696",
"0.751548",
"0.75149626",
"0.7501161",
"0.74959517",
"0.74956346",
"0.74911124",
"0.7489147",
"0.74858016",
"0.748033",
"0.7478443",
"0.7472642",
"0.7472576",
"0.7465409",
"0.7464371",
"0.74630046",
"0.7462218",
"0.7461453",
"0.7449168",
"0.74399257",
"0.74358094",
"0.7433247",
"0.7432659",
"0.74248093"
] | 0.0 | -1 |
Get the validation rules that apply to the request. | public function rules()
{
return [
//
'name' => 'required|string|min:5|max:45',
'email' => 'required|email|unique:users,email',
'mobile' => 'required|numeric|unique:users,mobile',
'image' => 'image',
'address' => 'required|string|min:3',
'password' => 'required|string|min:5',
'password2'=>'same:password',
'status' => 'string|in:Blocked,Active,Wait',
'idint'=>'required|unique:users,idint|integer'
];
} | {
"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 }",
"protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }",
"public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $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 }",
"protected function get_validation_rules()\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 }",
"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 defineValidationRules()\n {\n return [];\n }",
"public function rules(Request $request)\n {\n return Qc::$rules;\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.8342703",
"0.80143493",
"0.7937251",
"0.79264987",
"0.79233825",
"0.79048395",
"0.78603816",
"0.7790699",
"0.77842164",
"0.77628785",
"0.7737272",
"0.7733618",
"0.7710535",
"0.7691693",
"0.76849866",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7675849",
"0.76724476",
"0.76665044",
"0.7657698",
"0.7641827",
"0.7630892",
"0.76293766",
"0.7617708",
"0.76102096",
"0.7607475",
"0.7602442",
"0.7598732",
"0.7597544",
"0.75924",
"0.75915384",
"0.7588146",
"0.7581354",
"0.7555758",
"0.755526",
"0.7551423",
"0.7546329",
"0.7541439",
"0.75366044",
"0.75363225",
"0.7530296",
"0.7517988",
"0.75155175",
"0.7508439",
"0.75069886",
"0.7505724",
"0.749979",
"0.7495976",
"0.74949056",
"0.7492888",
"0.7491117",
"0.74901396",
"0.7489651",
"0.7486808",
"0.7486108",
"0.7479687",
"0.7478561",
"0.7469412",
"0.74635684",
"0.74619836",
"0.7461325",
"0.74591017",
"0.7455279",
"0.745352",
"0.7453257",
"0.7449877",
"0.74486",
"0.7441391",
"0.7440429",
"0.7435489",
"0.7435326",
"0.74341524",
"0.7430354",
"0.7429103",
"0.7423808",
"0.741936",
"0.74152505",
"0.7414828",
"0.741382",
"0.74126065",
"0.74105227",
"0.740555",
"0.7404385",
"0.74040926",
"0.74015605",
"0.73905706",
"0.73837525",
"0.73732615",
"0.7371123",
"0.7369176",
"0.73619753",
"0.73554605",
"0.73448825",
"0.7344659",
"0.73427117",
"0.73357755"
] | 0.0 | -1 |
include "./include/stat_func_tool.php"; ////////////// get label of province tumbon mooban /////////////////// | function get_label($ccaattmm){
$lst_ampor = getListAA(substr($ccaattmm,0,2));
$lst_tumbon = getListTT(substr($ccaattmm,0,4));
$lst_mooban = getListMM(substr($ccaattmm,0,6));
$arr_aa = explode("|", $lst_ampor);
$arr_tt = explode("|", $lst_tumbon);
$arr_mm = explode("|", $lst_mooban);
/// sel ampor
for($i=0; $i<(count($arr_aa)-3) ;$i+=2){
if(substr($arr_aa[$i+2],2,2)==substr($ccaattmm,2,2)){
echo str_replace('ท้องถิ่น','',$arr_aa[$i+3])." ";
}
}
/// sel tumbon
for($i=0; $i<(count($arr_tt)-3) ;$i+=2){
if(substr($arr_tt[$i+2],4,2)==substr($ccaattmm,4,2)){
echo " ตำบล".$arr_tt[$i+3]." ";
}
}
/// sel mooban
for($i=0; $i<(count($arr_mm)-3) ;$i+=2){
if(substr($arr_mm[$i+2],6,2)==substr($ccaattmm,6,2)){
echo " หมู่".$arr_mm[$i+3];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetLabel();",
"public function get_label();",
"public function get_label();",
"function getLabel(): string;",
"function get_label($ccaattmm){\n\t\t\t$lst_ampor = getListAA(substr($ccaattmm,0,2));\n\t\t\t$lst_tumbon = getListTT(substr($ccaattmm,0,4));\n\t\t\t$lst_mooban = getListMM(substr($ccaattmm,0,6));\n\t\t\t$arr_aa = explode(\"|\", $lst_ampor);\n\t\t\t$arr_tt = explode(\"|\", $lst_tumbon);\n\t\t\t$arr_mm = explode(\"|\", $lst_mooban);\n\t\t\t$label;\n\n\t\t\t/// sel ampor\n\t\t\tfor($i=0; $i<(count($arr_aa)-3) ;$i+=2){\n\t\t\t\tif(substr($arr_aa[$i+2],2,2)==substr($ccaattmm,2,2)){\n\t\t\t\t\t$label = str_replace('ท้องถิ่น','',$arr_aa[$i+3]).\" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/// sel tumbon\n\t\t\tfor($i=0; $i<(count($arr_tt)-3) ;$i+=2){\n\t\t\t\tif(substr($arr_tt[$i+2],4,2)==substr($ccaattmm,4,2)){\n\t\t\t\t\t$label .= \" ตำบล\".$arr_tt[$i+3].\" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/// sel mooban\n\t\t\tfor($i=0; $i<(count($arr_mm)-3) ;$i+=2){\n\t\t\t\tif(substr($arr_mm[$i+2],6,2)==substr($ccaattmm,6,2)){\n\t\t\t\t\t$label .= \" หมู่\".$arr_mm[$i+3];\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $label;\n\t\t}",
"abstract public function getLabel();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function getLabel(): string;",
"public function getLabel(): string;",
"function wpsl_labels() {\n\n $labels = array(\n 'search',\n 'search_btn',\n 'preloader',\n 'radius',\n 'no_results',\n 'results',\n 'more',\n 'directions',\n 'no_directions',\n 'back',\n 'street_view',\n 'zoom_here',\n 'error',\n 'phone',\n 'fax',\n 'email',\n 'url',\n 'hours',\n 'start',\n 'limit',\n 'category',\n 'category_default'\n );\n\n return $labels;\n}",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public abstract function label();",
"public static function label()\n {\n }",
"function get_wpcli_label() {\n\tglobal $argv;\n\n\t$label = '';\n\n\tforeach ($argv as $arg) {\n\t\t$arg = explode('=', $arg, 2);\n\t\tif (count($arg) === 2 && $arg[0] === '--label') {\n\t\t\t$label = $arg[1];\n\t\t}\n\t}\n\n\treturn $label;\n}",
"public function getLabel() {}",
"public function getLabel() {}",
"public function getLabel(): \\Magento\\Framework\\Phrase;",
"abstract protected function label(): string;",
"public function get_label($strict = \\false)\n {\n }",
"public function label() { }",
"public static function label()\n {\n return 'Bukeri';\n }",
"function getLabels()\n{\n $sql=\"SELECT name FROM tablets.manufacturers\";\n $brands=$GLOBALS['db']->getAllValues($sql);\n $brands=json_encode($brands);\n //print_r($brands);\n $lang=$_SESSION['lang'];\n if($lang==\"en_us\"){\n\n $labels = <<<EOF\n[\n {\"type\":\"range\",\"name\":\"total test result\",\"label\":\"Total test result\",\n \"value\":[{\">=\":0,\"<=\":1.5},{\">\":1.5,\"<=\":2.5},{\">\":2.5,\"<=\":3.5},{\">\":3.5,\"<=\":4.5},{\">\":4.5,\"<=\":5.5}],\n \"option\":[\"very good \",\"good \",\"average\",\"sufficient\",\"poor\"]},\n {\"type\":\"date\",\"name\":\"Publication date\",\"label\":\"Tested date\",\n \"value\":[2016,2015,2014],\n \"option\":[2016,2015,2014]},\n {\"type\":\"string\",\"name\":\"Brand\",\"label\":\"Brands\",\n \"value\":$brands,\n \"option\":$brands},\n {\"type\":\"range\",\"name\":\"Screen image diagonal\",\"label\":\"Screen image diagonal\",\n \"value\":[{\"<\":8},{\">=\":8,\"<=\":10},{\">\":10}],\n<<<<<<< HEAD\n \"option\":[\"< 8\\\"\",\"8 - 10\\\"\",\"> 10\\\"\"]},\n=======\n \"option\":[\"> 8\\\"\",\"8 - 10\\\"\",\"> 10\\\"\"]},\n>>>>>>> 7f3fb6250d696d7e9e5bba2a85f6050a0c02fc75\n {\"type\":\"range\",\"name\":\"Native resolution (height)\",\"label\":\"Native resolution (height)\",\n \"value\":[{\"<\":800},{\">=\":800,\"<=\":1200},{\">\":1200,\"<=\":1500},{\">\":1500,\"<=\":2736}],\n \"option\":[\"< 800 Pixel\",\"800 - 1200 Pixel\",\"1200 - 1500 Pixel\",\"1500 -2736 Pixel\"]},\n {\"type\":\"range\",\"name\":\"Native resolution (width)\",\"label\":\"Native resolution (width)\",\n \"value\":[{\"<\":1300},{\">=\":1300,\"<=\":1900},{\">\":1900,\"<=\":2000},{\">\":2000,\"<=\":2736}],\n \"option\":[\"< 1300 Pixel\",\"1300 - 1900 Pixel\",\"1900 - 2000 Pixel\",\"2000 - 2736 Pixel\"]},\n {\"type\":\"string\",\"name\":\"OS installed\",\"label\":\"OS installed\",\n \"value\":[\"Android\",\"iOS\",\"Windows\"],\n \"option\":[\"Android\",\"iOS\",\"Windows\"]},\n {\"type\":\"string\",\"name\":\"Claimed size of internal storage [Gb]\",\"label\":\"Claimed size of internal storage\",\n \"value\":[4,8,16,32,64,128,256],\n \"option\":[\"4GB\",\"8GB\",\"16GB\",\"32GB\",\"64GB\",\"128GB\",\"256GB\"]},\n {\"type\":\"multi\",\"name\":\"\",\"label\":\"Connection\",\n \"value\":[\"3G\",\"LTE\",\"Bluetooth\",\"GPS\",\"NFC\",\"Phone functionality\"],\n \"option\":[\"3G\",\"LTE\",\"Bluetooth\",\"GPS\",\"NFC\",\"Phone functionality\"]},\n {\"type\":\"multi\",\"name\":\"\",\"label\":\"WLAN\",\n \"value\":[\"Wi-Fi G\",\"Wi-Fi N\",\"Wi-Fi 5GHzN\",\"Wi-Fi AC\"],\n \"option\":[\"Wi-Fi G\",\"Wi-Fi N\",\"Wi-Fi 5GHzN\",\"Wi-Fi AC\"]},\n {\"type\":\"multi\",\"name\":\"\",\"label\":\"USB\",\n \"value\":[\"USB 4.0 [y/n]\",\"USB 3.0 [y/n]\",\"USB 2.0 [y/n]\",\"Mini-USB [y/n]\" ,\"Micro-USB [y/n]\", \"HDMI\"],\n \"option\":[\"USB 4.0\",\"USB 3.0\",\"USB 2.0\",\"Mini-USB\" ,\"Micro-USB\", \"HDMI\"]},\n {\"type\":\"multi\",\"name\":\"\",\"label\":\"SD\",\n \"value\":[\"full SD size\",\"mini-SD\",\"micro-SD\"],\n \"option\":[\"full SD size\",\"mini-SD\",\"micro-SD\"]},\n {\"type\":\"multi\",\"name\":\"\",\"label\":\"Accessories\",\n \"value\":[\"Physical keyboard provided\",\"Stylus supplied\"],\n \"option\":[\"Physical keyboard provided\",\"Stylus supplied\"]},\n {\"type\":\"multi\",\"name\":\"\",\"label\":\"Robustness\",\n \"value\":[\"Manufacturer claims waterproof?\",\"Manufacturer claims water resistant?\"],\n \"option\":[\"Waterproof, stated\",\"Water resistant, stated\"]}\n ]\nEOF;\n\n }else if($lang==\"zh_cn\"){\n $sql=\"select CHN from sdictionary where oriword in( SELECT distinct value FROM mobilephones.results where id_evaluation=100001759)\";\n $brandLabels=$GLOBALS['db']->getAllValues($sql);\n $brandLabels=json_encode($brandLabels);\n $labels = <<<EOF\n [\n {\"type\":\"range\",\"name\":\"total test result\",\"label\":\"总评分\",\n \"value\":[{\">=\":0,\"<=\":1.5},{\">\":1.5,\"<=\":2.5},{\">\":2.5,\"<=\":3.5},{\">\":3.5,\"<=\":4.5},{\">\":4.5,\"<=\":5.5}],\n \"option\":[\"优秀\",\"良好\",\"中等\",\"尚可\",\"差劣\"]},\n {\"type\":\"date\",\"name\":\"Publication date\",\"label\":\"测试时间\",\n \"value\":[2016,2015,2014],\n \"option\":[2016,2015,2014]},\n {\"type\":\"string\",\"name\":\"Brand\",\"label\":\"品牌\",\n \"value\":$brands,\n \"option\":$brandLabels}\n ]\nEOF;\n }\n\n $arr = json_decode($labels, true);\n foreach ($arr as $key => $item) {\n if ($item['type'] == 'string') {\n $index=0;\n foreach ($item['value'] as $value) {\n if($item['name']=='Brand'){\n $sql=\"select count(*)from products where id_manufacturer=(select id_manufacturer from manufacturers where `name`='\".$value.\"')\";\n }else\n $sql=\"select count(*) from results where id_evaluation in(select id_evaluation from evaluations where name='\".$item['name'].\"') and value like'%$value%'\";\n //echo $sql;\n $v = $GLOBALS['db']->getOne($sql);\n //echo $value.\" \".$v.\" \".$index.\"+++\\n\";\n if($v==0){\n array_splice($arr[$key]['option'],$index,1);\n array_splice($arr[$key]['value'],$index,1);\n $index--;\n // print_r($arr[$key]['option']);\n\n }else{\n $arr[$key]['number'][] = $v;\n }\n\n\n $index++;\n }\n } else if($item['type'] == 'range') {\n foreach ($item['value'] as $value) {\n $opts = array_keys($value);\n $len = count($opts);\n if($item['name'] == 'total test result'){//评分数据四舍五入\n if ($len == 1 && $opts[0] != -1) {\n $sql = \"select count(*) from results where format(6-value,1)\" . $opts[0] . $value[$opts[0]];\n } else if ($len == 2 && $opts[0] != -1) {\n $sql = \"select count(*) from results where format(6-value,1)\" . $opts[0] . $value[$opts[0]] . \" and format(6-value,1)\" . $opts[1] . $value[$opts[1]];\n }\n }else{//property数值正常读取\n if ($len == 1 && $opts[0] != -1) {\n $sql = \"select count(*) from results where value\" . $opts[0] . $value[$opts[0]];\n } else if ($len == 2 && $opts[0] != -1) {\n $sql = \"select count(*) from results where value\" . $opts[0] . $value[$opts[0]] . \" and value\" . $opts[1] . $value[$opts[1]];\n }\n }\n\n $sql .= \" and id_evaluation=(select id_evaluation from evaluations where \";\n if ($item['name'] == 'total test result')\n $sql .= \"name='\" . $item['name'] . \"')\";\n else\n $sql .= \"id_evaluation>99999999 and name='\" . $item['name'] . \"')\";\n $v = $GLOBALS['db']->getOne($sql);\n $arr[$key]['number'][] = $v;\n }\n }else if($item['type'] == 'date'){\n foreach ($item['value'] as $value) {\n $sql = \"select count(*) from products where FROM_UNIXTIME(timestamp_created, '%Y' )='\" . $value . \"'\" ;\n //echo $sql;\n $v = $GLOBALS['db']->getOne($sql);\n $arr[$key]['number'][] = $v;\n }\n }else if($item['type'] == 'multi'){\n foreach ($item['value'] as $value) {\n $sql = \"select count(*) from results where value=1\" . \" and id_evaluation=(select id_evaluation from evaluations where id_evaluation>99999999 and name='\" .$value . \"')\";\n //echo $sql;\n $v = $GLOBALS['db']->getOne($sql);\n $arr[$key]['number'][] = $v;\n }\n }\n }\n sortByNumber($arr[2]);\n //print_r($arr);\n return json_encode($arr);\n}",
"function f_app_lov_return_label($lov)\n {\n//############################################ HELP #############################################################################\n/*\n $lov[\"name\"] = \"procesi\"; \t\t\t//DS -> sherben vetem per funksionin lov_name_default_values();\n $lov[\"obj_or_label\"] = \"label\"; \t\t\t//DS -> sherben vetem per funksionin lov_name_default_values(); pranon vetem vlerat object, label; default = object;\n $lov[\"type\"] = \"dinamik\"; \t\t//*DS -> pranon vlerat dinamik, statik;\n $lov[\"tab_name\"] = \"proces\"; \t\t//*D -> per tipin=\"dinamik\" emri tabeles ku do behet select | per tipin=\"statik\" sduhet;\n $lov[\"id\"] = \"id_proces\"; \t\t//*DS -> per tipin=\"dinamik\" emri i fushes qe ruan kodin | per tipin=\"statik\" lista e kodeve te ndara me ndaresin perkates, default ,;\n $lov[\"field_name\"] = \"name_proces\"; \t\t//*DS -> per tipin=\"dinamik\" emri i fushes qe ruan emertimin, mund te perdoret p.sh: Concat(id_proces, ' ', name_proces) | per tipin=\"statik\" lista e emertimeve te ndara me ndaresin perkates, default ,;\n\n $lov[\"layout_forma\"] = \"\"; \t\t//DS -> ka kuptim vetem kur kthehet me shume se nje etikete; ne rast se vendoset vlera 'table' elementet strukturohen ne nje tabele; vlera te ndryshme jane: <br> = elementet thyhen njeri poshte tjetrit;   = elementet ndahen me nje ose me shume spacio; default = <br>; ;\n\n $lov[\"distinct\"] = \"F\"; \t\t//D -> per tipin=\"dinamik\", pranon vlerat T,F (pra true ose false), default = 'F', pra ti beje distinct vlerat apo jo;\n\n $lov[\"filter\"] = \"WHERE id_proces < 30\";//D -> per tipin=\"dinamik\" kushti i filtrimit te te dhenave, default = '', p.sh: WHERE status = 1 AND id > 0 (mos haroni 'WHERE'); kur kjo ka vlere $lov[\"id_select\"] i shtohet si fitrim shtese;\n $lov[\"filter_plus\"] = \"\"; //D -> per tipin=\"dinamik\" kusht filtrimi shtese, default = '', p.sh: AND status = 1 AND id > 0 (mos haroni qe 'WHERE' ne kete rast nuk duhet sepse duhet ta kete variabli $filter); meret parasysh vetem kur $filter != ''; filtrimi i vlerave kryhet: $filter.\" \".$filter_plus\n\n $lov[\"id_select\"] = \"1\"; \t\t//DS -> vlerat e kodit per te cilat duhet te meren emertimet te ndara me ndaresin perkates default ,(presje); bosh kur i duam te gjitha vlerat; kur eshte vetem nje vlere vendoset vetem vlera e kodit pa presje; selektimi behet me id IN ($lov[\"id_select\"]), per id te tipit stringe mos haroni ti mbyllni ne thonjeza teke;\n $lov[\"order_by\"] = \"name_proces\"; \t\t//D -> emri i kolones qe do perdoret per order, default = $lov[\"name\"] | per tipin=\"statik\" sduhet;\n\n $lov[\"ndares_vlerash\"] = \",\"; \t\t//S -> stringa qe ndan vlerat e listes statike (kod dhe emertim), default = ,(presje);\n $lov[\"class_etiketa\"] = \"\"; \t\t//DS -> emri i klases ne style per etiketat, vetem ne rastet kur strukturohen ne tabele; po spati vlere nuk meret parasysh;\n $lov[\"isdate\"] = \"\"; \t\t//D -> pranon vlerat T,F (pra true ose false), default = 'F'; perdoret kur etiketa eshte e tipit date;\n $lov[\"asc_desc\"] = \"\"; \t\t//D -> per orderin, pranon vlerat ASC,DESC; default = 'ASC';;\n*/\n//###############################################################################################################################\n\n $lov_array_id = \"\";\n $lov_array_name = \"\";\n\n IF (!isset($lov[\"ndares_vlerash\"]) OR ($lov[\"ndares_vlerash\"]==\"\"))\n {$lov[\"ndares_vlerash\"] = \",\";}\n\n //PER LISTEN DINAMIKE ---------------------------------------------------------------------------------------------------------\n IF ($lov[\"type\"] == \"dinamik\")\n {\n IF (!isset($lov[\"order_by\"]) OR ($lov[\"order_by\"]==\"\"))\n {$lov[\"order_by\"] = $lov[\"field_name\"];}\n\n IF (!isset($lov[\"asc_desc\"]) OR ($lov[\"asc_desc\"]==\"\"))\n {$lov[\"asc_desc\"] = \" ASC\";}\n\n $filter = \"\";\n IF (ISSET($lov[\"filter\"]) AND ($lov[\"filter\"] != \"\"))\n {\n $filter = $lov[\"filter\"];\n \n IF (ISSET($lov[\"filter_plus\"]) AND ($lov[\"filter_plus\"] != \"\"))\n {$filter .= \" \".$lov[\"filter_plus\"];}\n }\n\n IF ((isset($lov[\"id_select\"])) AND ($lov[\"id_select\"] != \"\"))\n {\n IF ($filter == \"\")\n {$filter = \" WHERE \".$lov[\"id\"].\" IN (\".$lov[\"id_select\"].\") \";}\n ELSE\n {$filter .= \" AND \".$lov[\"id\"].\" IN (\".$lov[\"id_select\"].\") \";}\n }\n\n $lov_distinct = \"\";\n IF (ISSET($lov[\"distinct\"]) AND ($lov[\"distinct\"] == \"T\"))\n {$lov_distinct = \"DISTINCT\";}\n\n IF ($lov[\"isdate\"] == \"T\")\n {$sql = \"SELECT \".$lov_distinct.\" \".$lov[\"id\"].\" as id_as, IF(\".$lov[\"field_name\"].\" IS NULL, '',DATE_FORMAT(\".$lov[\"field_name\"].\",'%d.%m.%Y')) AS fusha_as_as, \".$lov[\"field_name\"].\" as field_name_order FROM \".$lov[\"tab_name\"].\" \".$filter.\" ORDER BY field_name_order \".$lov[\"asc_desc\"];}\n ELSE\n {$sql = \"SELECT \".$lov_distinct.\" \".$lov[\"id\"].\" as id_as, IF(\".$lov[\"field_name\"].\" IS NULL, '',\".$lov[\"field_name\"].\") AS fusha_as_as FROM \".$lov[\"tab_name\"].\" \".$filter.\" ORDER BY \".$lov[\"order_by\"].\" \".$lov[\"asc_desc\"];}\n\n $i = -1;\n $rs = WebApp::execQuery($sql);\n $rs->MoveFirst();\n while (!$rs->EOF())\n {\n $id = $rs->Field(\"id_as\");\n $name = $rs->Field(\"fusha_as_as\");\n\n $i = $i + 1;\n $lov_array_id[$i] = $id;\n $lov_array_name[$i] = $name;\n \n $lov_array_id_id[$id] = $id;\n $lov_array_id_name[$id] = $name;\n\n $rs->MoveNext();\n }\n }\n //PER LISTEN DINAMIKE =========================================================================================================\n\n //PER LISTEN STATIKE ----------------------------------------------------------------------------------------------------------\n IF ($lov[\"type\"] == \"statik\")\n {\n $lov_array_id_temp = EXPLODE($lov[\"ndares_vlerash\"], $lov[\"id\"]);\n $lov_array_name_temp = EXPLODE($lov[\"ndares_vlerash\"], $lov[\"field_name\"]);\n\n IF ((ISSET($lov[\"id_select\"])) AND ($lov[\"id_select\"] != \"\"))\n {\n $kaloje_kushtin_stristr = \"N\";\n }\n ELSE\n {\n $kaloje_kushtin_stristr = \"Y\";\n }\n\n $k = -1;\n $id_select_txt = $lov[\"ndares_vlerash\"].$lov[\"id_select\"].$lov[\"ndares_vlerash\"];\n FOR ($i=0; $i < count($lov_array_id_temp); $i++)\n {\n $lov_array_id_txt = $lov[\"ndares_vlerash\"].$lov_array_id_temp[$i].$lov[\"ndares_vlerash\"];\n\n IF (STRISTR($id_select_txt, $lov_array_id_txt) OR ($kaloje_kushtin_stristr == \"Y\"))\n {\n $k = $k + 1;\n $lov_array_id[$k] = $lov_array_id_temp[$i];\n $lov_array_name[$k] = $lov_array_name_temp[$i];\n\n $lov_array_id_id[$lov_array_id_temp[$i]] = $lov_array_id_temp[$i];\n $lov_array_id_name[$lov_array_id_temp[$i]] = $lov_array_name_temp[$i];\n }\n }\n }\n //PER LISTEN STATIKE ==========================================================================================================\n\n //FORMOHET HTML E LOV ---------------------------------------------------------------------------------------------------------\n IF (($lov[\"all_data_array\"] == \"Y\") OR ($lov[\"only_ids\"] == \"Y\"))\n {\n IF ($lov[\"all_data_array\"] == \"Y\")\n {\n $lov_html = $lov_array_id_name;\n }\n \n IF ($lov[\"only_ids\"] == \"Y\")\n {\n $lov_html = $lov_array_id_id;\n }\n }\n ELSE\n {\n $lov_html = \"\";\n\n IF (!isset($lov[\"class_etiketa\"]) OR ($lov[\"class_etiketa\"]==\"\"))\n {$lov[\"class_etiketa\"] = \"\";}\n ELSE\n {$lov[\"class_etiketa\"] = \"class='\".$lov[\"class_etiketa\"].\"'\";}\n\n IF (!isset($lov[\"layout_forma\"]) OR ($lov[\"layout_forma\"]==\"\"))\n {$lov[\"layout_forma\"] = \"<br>\";}\n\n IF ($lov[\"layout_forma\"] == \"table\")\n {$lov_html .= \"<Table border=0 cellspacing=0 cellpadding=0>\";}\n\n FOR ($i=0; $i < count($lov_array_id); $i++)\n {\n IF ($lov[\"layout_forma\"] == \"table\")\n {\n $lov_html .= \"<TR><TD \".$lov[\"class_etiketa\"].\">\".$lov_array_name[$i].\"</TD></TR>\";\n }\n ELSE\n {\n IF ($lov[\"layout_forma\"] == \"<br>\")\n {\n IF ($i == 0)\n {$lov_html .= $lov_array_name[$i];}\n ELSE\n {$lov_html .= $lov[\"layout_forma\"].$lov_array_name[$i];}\n }\n ELSE\n {\n $lov_html .= $lov[\"layout_forma\"].$lov_array_name[$i];\n }\n }\n }\n \n IF ($lov[\"layout_forma\"] == \"table\")\n {\n $lov_html .= \"</Table>\";\n }\n \n }\n //FORMOHET HTML E LOV =========================================================================================================\n\n RETURN $lov_html;\n }",
"public function getLabel() {\n\t}",
"function displayAvailableLabels() {\n $db = dbConnect();\n $travelLabels = dbGetTravelsTitle($db); // Récupération des titres de voyages\n\n // Création d'une ligne par titre avec comme value le code ISO et comme texte le nom du pays\n foreach($travelLabels as $travel) {\n echo \"<option value='\" . $travel->getTitle() . \"'>\" . $travel->getTitle() . \"</option>\";\n }\n }",
"public function getLabel()\n {\n }",
"public function getLabel()\n {\n }",
"function getProvince($num = 0, $format = 1) {\n\n\t$province = \"\";\n\n\tif ( $format == 1 ) {\n\t\tswitch ($num) {\n\t\t\tcase 1108:\n\t\t\t\t$province = \"ON\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$province = \"XX\";\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn($province);\n\n//getProvince\n}",
"public function get_label() {\n\t\t\treturn __( 'Costumapi', 'text-domain' );\n\t\t}",
"abstract function labels();",
"function getLabelField() \r\n {\r\n return 'country_shortDesc';\r\n }",
"function getLabel()\n\t{\n\t\treturn '';\n\t}",
"function getLabel(){\n\t\t\n\t\ttry{\n\t\tglobal $system;\n\t\t$language=$system[\"config\"][\"mluse\"][\"language\"];\n\t\tinclude_once 'tablero/SecurityActionLabelPeer.php';\n\t\t$language='eng';\n\t\t$actionLabelInfo=SecurityActionLabelPeer::getByActionAndLanguage($this->GetAction(),$language);\n\t\treturn $actionLabelInfo->getLabel();\n\t\t}catch (PropelException $e) {}\n\t}",
"function get_label($data) {\n error('Abstract method get_label() called - must be implemented');\n }",
"function getLocationInfoByIp($ip){\r\n\r\n $ip_data = @json_decode(file_get_contents(\"http://www.geoplugin.net/json.gp?ip=\".$ip));\r\n if($ip_data && $ip_data->geoplugin_countryName != null){\r\n $result['country'] = $ip_data->geoplugin_countryCode;\r\n $result['city'] = $ip_data->geoplugin_city;\r\n }\r\n $country_short=$result['country'];\r\n $country_name=Locale::getDisplayRegion('sl-Latn-'.$country_short.'-nedis', 'en');\r\n return $country_name;\r\n}",
"function get_abbr($args){\n\n\t$abbr = array(\n 'k' => 'knit',\n 'p' => 'purl',\n 'CO' => 'cast on',\n 'cm' => 'centimetre(s)',\n 'mm' => 'millimetre(s)',\n\t'in.' => 'inch(es)',\n\t'alt' => 'alternate',\n\t'tog' => 'together',\n\t'sl1' => 'slip one stitch',\n\t'sl1p' => 'slip one stitch purlwise',\n\t'yo' => 'yarn over - bring yarn forward under needle then back over needle (increase 1 stitch)',\n\t'ws' => 'wrong side',\n\t'k2tog' => 'knit next two stitches together (decrease 1 stitch)',\n\t'rs' => 'right side',\n\t'kfb' => 'knit through front and back loop of next stitch (increase 1 stitch)',\n\t'tbl' => 'through back loop',\n\t'psso' => 'pass slipped stitch over',\n\t'p2tog' => 'purl 2 together (decrease 1 stitch)',\n\t'dec' => 'decrease',\n\t'st' => 'stitch',); \n\n\t\n\t$terms = explode(\",\", $args);\n\t// new system\n\t$terms = $args;\n\t\n\t// clean up and sort\n\tfor( $i=0; $i < sizeof($terms); $i++){\n\t\t$terms[$i] = trim($terms[$i]);\n\t} // end for each token\n\tsort($terms);\n\t\n\tfor( $i=0; $i < sizeof($terms); $i++){\n\t\tif(array_key_exists($terms[$i], $abbr)){\n\t\t\t?><dt><? echo $terms[$i]; ?></dt>\n \t\t<dd><? echo $abbr[$terms[$i]]; ?></dd>\n\t\t\t<?\n\t\t}// if is an abbreviation\n\t} // end for each tokensort\n\n}",
"public function label()\n {\n\n }",
"function my_custom_any_label_bedrooms() {\n\t$label = 'All';\n\treturn $label;\n}",
"public function get_label(){ return $this->label; }",
"public abstract function get_amd_name();",
"function getLead($country) { /*Get Details from Ini file stored in asset folder*/\n $leads = parse_ini_file('assets/leads.ini.php',true);\n return $leads[$country];\n}",
"public static function label()\n {\n return 'Ārsti';\n }",
"function mb_locations()\n {\n }",
"function papan_catur($angka) {\r\n}",
"function get_wilayah_code_by_branch_induk($branch_induk)\n {\n \t$sql = \"select wilayah from mfi_branch where branch_code = ?\";\n \t$query = $this->db->query($sql,array($branch_induk));\n \t$row = $query->row_array();\n \treturn (isset($row['wilayah'])==true)?$row['wilayah']:'00000';\n }",
"public function getLabel($label, $default_only=false) {\n\t\t\tglobal $db, $site;\n\t\t\tif ($_SESSION['treeline_language']) $lang = $_SESSION['treeline_language'];\n\t\t\telse if ($_SESSION['treeline_user_language']) $lang = $_SESSION['treeline_user_language'];\n\t\t\t\n\t\t\tif ($lang && $label) {\n\t\t\t\tif ($row = $db->get_row(\"SELECT id, longname FROM labels WHERE shortname='$label'\")) {\n\t\t\t\t\t$label_id = $row->id;\n\t\t\t\t\t$english = $row->longname;\n\t\t\t\t\t$query = \"SELECT longname FROM labels_default WHERE label_id = $label_id AND lang = '$lang'\";\n\t\t\t\t\t//print \"$query<br>\\n\";\n\t\t\t\t\t$default = $db->get_var($query);\n\t\t\t\t\tif (!$default_only) {\n\t\t\t\t\t\t$query = \"SELECT longname FROM labels_translations WHERE label_id = $label_id AND msv=\".$site->id;\n\t\t\t\t\t\t//print \"$query<br>\\n\";\n\t\t\t\t\t\t$sitelabel = $db->get_var($query);\n\t\t\t\t\t}\n\t\t\t\t\t$r = $sitelabel?$sitelabel:($default?$default:($english?$english:$label));\n\t\t\t\t\t//print \"return $r<br>\\n\";\n\t\t\t\t\treturn $r;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}",
"function name_prin(){\n\n\n\techo \"_Last wxample of Sensitivity using function_\";\n}",
"abstract function add_label();",
"function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = \"\\n\") {\n\t$address_query = tep_db_query(\"select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id = '\" . (int)$customers_id . \"' and address_book_id = '\" . (int)$address_id . \"'\");\n\t$address = tep_db_fetch_array($address_query);\n\t\n\t$format_id = tep_get_address_format_id($address['country_id']);\n\t\n\treturn tep_address_format($format_id, $address, $html, $boln, $eoln);\n}",
"public function getLabels();",
"public function getLabels();",
"public function getLabels();",
"public function run()\n {\n $defregions = array(\n array('lg_code' => 1000, 'md_code' => 0, 'sm_code' => 1, 'area_name' => '札幌市' ),\n array('lg_code' => 1000, 'md_code' => 0, 'sm_code' => 2, 'area_name' => 'その他北海道' ),\n array('lg_code' => 2000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '青森県' ),\n array('lg_code' => 2000, 'md_code' => 200, 'sm_code' => 2, 'area_name' => '秋田県' ),\n array('lg_code' => 2000, 'md_code' => 300, 'sm_code' => 3, 'area_name' => '岩手県' ),\n array('lg_code' => 2000, 'md_code' => 400, 'sm_code' => 4, 'area_name' => '山形県' ),\n array('lg_code' => 2000, 'md_code' => 500, 'sm_code' => 5, 'area_name' => '仙台市' ),\n array('lg_code' => 2000, 'md_code' => 500, 'sm_code' => 6, 'area_name' => 'その他宮城県' ),\n array('lg_code' => 2000, 'md_code' => 600, 'sm_code' => 7, 'area_name' => '福島県' ),\n array('lg_code' => 3000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '富山県' ),\n array('lg_code' => 3000, 'md_code' => 100, 'sm_code' => 2, 'area_name' => '石川県' ),\n array('lg_code' => 3000, 'md_code' => 100, 'sm_code' => 3, 'area_name' => '福井県' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '池袋・目白' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 2, 'area_name' => '赤羽・王子・板橋・成増' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 3, 'area_name' => '新宿・代々木・高田馬場・飯田橋' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 4, 'area_name' => '練馬・大泉学園・荻窪・中野' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 5, 'area_name' => '渋谷・青山・恵比寿' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 6, 'area_name' => '明大前・三軒茶屋・自由が丘・駒沢' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 7, 'area_name' => '赤坂・六本木・新橋' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 8, 'area_name' => '品川・大森・蒲田・五反田' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 9, 'area_name' => '上野・浅草・錦糸町・神田' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 10, 'area_name' => '亀有・小岩・葛西' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 11, 'area_name' => '北千住・竹ノ塚' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 12, 'area_name' => '立川・八王子・福生・国分寺' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 13, 'area_name' => '町田・多摩' ),\n array('lg_code' => 4000, 'md_code' => 100, 'sm_code' => 14, 'area_name' => '調布・吉祥寺・西東京' ),\n array('lg_code' => 4000, 'md_code' => 200, 'sm_code' => 1, 'area_name' => '横浜・上大岡・金沢・鶴見' ),\n array('lg_code' => 4000, 'md_code' => 200, 'sm_code' => 2, 'area_name' => '戸塚・瀬谷・青葉台・たまプラーザ' ),\n array('lg_code' => 4000, 'md_code' => 200, 'sm_code' => 3, 'area_name' => '川崎市'),\n array('lg_code' => 4000, 'md_code' => 200, 'sm_code' => 4, 'area_name' => '横須賀・藤沢' ),\n array('lg_code' => 4000, 'md_code' => 200, 'sm_code' => 5, 'area_name' => '茅ヶ崎・平塚・小田原' ),\n array('lg_code' => 4000, 'md_code' => 200, 'sm_code' => 6, 'area_name' => '厚木・相模原・大和' ),\n array('lg_code' => 4000, 'md_code' => 300, 'sm_code' => 1, 'area_name' => 'さいたま・川口・蕨' ),\n array('lg_code' => 4000, 'md_code' => 300, 'sm_code' => 2, 'area_name' => '越谷・久喜・春日部・草加' ),\n array('lg_code' => 4000, 'md_code' => 300, 'sm_code' => 3, 'area_name' => '所沢・川越・新座・和光' ),\n array('lg_code' => 4000, 'md_code' => 300, 'sm_code' => 4, 'area_name' => '熊谷・鴻巣・上尾' ),\n array('lg_code' => 4000, 'md_code' => 400, 'sm_code' => 1, 'area_name' => '千葉・木更津' ),\n array('lg_code' => 4000, 'md_code' => 400, 'sm_code' => 2, 'area_name' => '柏・松戸' ),\n array('lg_code' => 4000, 'md_code' => 400, 'sm_code' => 3, 'area_name' => '船橋' ),\n array('lg_code' => 4000, 'md_code' => 500, 'sm_code' => 1, 'area_name' => '群馬県' ),\n array('lg_code' => 4000, 'md_code' => 600, 'sm_code' => 1, 'area_name' => '栃木県' ),\n array('lg_code' => 4000, 'md_code' => 700, 'sm_code' => 1, 'area_name' => '茨城県' ),\n array('lg_code' => 5000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '新潟県' ),\n array('lg_code' => 5000, 'md_code' => 200, 'sm_code' => 1, 'area_name' => '長野県' ),\n array('lg_code' => 5000, 'md_code' => 300, 'sm_code' => 1, 'area_name' => '山梨県' ),\n array('lg_code' => 6000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '浜松' ),\n array('lg_code' => 6000, 'md_code' => 100, 'sm_code' => 2, 'area_name' => 'その他静岡県' ),\n array('lg_code' => 6000, 'md_code' => 200, 'sm_code' => 1, 'area_name' => '名駅・栄・金山' ),\n array('lg_code' => 6000, 'md_code' => 200, 'sm_code' => 2, 'area_name' => '藤が丘・今池・八事・野並' ),\n array('lg_code' => 6000, 'md_code' => 200, 'sm_code' => 3, 'area_name' => '小牧・北名古屋・一宮・春日井' ),\n array('lg_code' => 6000, 'md_code' => 200, 'sm_code' => 4, 'area_name' => '豊田・刈谷・岡崎・豊橋' ),\n array('lg_code' => 6000, 'md_code' => 300, 'sm_code' => 1, 'area_name' => '岐阜県' ),\n array('lg_code' => 6000, 'md_code' => 400, 'sm_code' => 1, 'area_name' => '三重県' ),\n array('lg_code' => 7000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '梅田・京橋・十三・新大阪' ),\n array('lg_code' => 7000, 'md_code' => 100, 'sm_code' => 2, 'area_name' => '心斎橋・難波・天王寺' ),\n array('lg_code' => 7000, 'md_code' => 100, 'sm_code' => 3, 'area_name' => '堺・岸和田・泉佐野・八尾' ),\n array('lg_code' => 7000, 'md_code' => 100, 'sm_code' => 4, 'area_name' => '枚方・寝屋川・東大阪' ),\n array('lg_code' => 7000, 'md_code' => 100, 'sm_code' => 5, 'area_name' => '豊中・池田・吹田・茨木' ),\n array('lg_code' => 7000, 'md_code' => 200, 'sm_code' => 1, 'area_name' => '京都府' ),\n array('lg_code' => 7000, 'md_code' => 300, 'sm_code' => 1, 'area_name' => '神戸市内' ),\n array('lg_code' => 7000, 'md_code' => 300, 'sm_code' => 2, 'area_name' => 'その他兵庫県' ),\n array('lg_code' => 7000, 'md_code' => 400, 'sm_code' => 1, 'area_name' => '奈良県' ),\n array('lg_code' => 7000, 'md_code' => 500, 'sm_code' => 2, 'area_name' => '滋賀県' ),\n array('lg_code' => 7000, 'md_code' => 600, 'sm_code' => 3, 'area_name' => '和歌山県' ),\n array('lg_code' => 8000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '岡山県' ),\n array('lg_code' => 8000, 'md_code' => 200, 'sm_code' => 2, 'area_name' => '広島県' ),\n array('lg_code' => 8000, 'md_code' => 300, 'sm_code' => 3, 'area_name' => '鳥取県' ),\n array('lg_code' => 8000, 'md_code' => 400, 'sm_code' => 4, 'area_name' => '島根県' ),\n array('lg_code' => 8000, 'md_code' => 500, 'sm_code' => 5, 'area_name' => '山口県' ),\n array('lg_code' => 9000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '愛媛県' ),\n array('lg_code' => 9000, 'md_code' => 200, 'sm_code' => 1, 'area_name' => '徳島県' ),\n array('lg_code' => 9000, 'md_code' => 300, 'sm_code' => 1, 'area_name' => '香川県' ),\n array('lg_code' => 9000, 'md_code' => 400, 'sm_code' => 1, 'area_name' => '高知県' ),\n array('lg_code' => 10000, 'md_code' => 100, 'sm_code' => 1, 'area_name' => '福岡市内' ),\n array('lg_code' => 10000, 'md_code' => 100, 'sm_code' => 2, 'area_name' => 'その他福岡県' ),\n array('lg_code' => 10000, 'md_code' => 200, 'sm_code' => 1, 'area_name' => '熊本県' ),\n array('lg_code' => 10000, 'md_code' => 300, 'sm_code' => 1, 'area_name' => '佐賀県' ),\n array('lg_code' => 10000, 'md_code' => 400, 'sm_code' => 1, 'area_name' => '長崎県' ),\n array('lg_code' => 10000, 'md_code' => 500, 'sm_code' => 1, 'area_name' => '大分県' ),\n array('lg_code' => 10000, 'md_code' => 600, 'sm_code' => 1, 'area_name' => '宮崎県' ),\n array('lg_code' => 10000, 'md_code' => 700, 'sm_code' => 1, 'area_name' => '鹿児島県' ),\n array('lg_code' => 10000, 'md_code' => 800, 'sm_code' => 1, 'area_name' => '沖縄県' ),\n );\n DB::table('regions')->insert($defregions);\n }",
"public function getLabel(): ?string;",
"function getLabel(){\r\n\t\treturn $this->label;\r\n\t}",
"function lc_cfg_use_get_zone_class_title($id) {\r\r\n global $lC_Database, $lC_Language;\r\r\n\r\r\n if ($id == '0') {\r\r\n return $lC_Language->get('parameter_none');\r\r\n }\r\r\n\r\r\n $Qclass = $lC_Database->query('select geo_zone_name from :table_geo_zones where geo_zone_id = :geo_zone_id');\r\r\n $Qclass->bindTable(':table_geo_zones', TABLE_GEO_ZONES);\r\r\n $Qclass->bindInt(':geo_zone_id', $id);\r\r\n $Qclass->execute();\r\r\n\r\r\n return $Qclass->value('geo_zone_name');\r\r\n }",
"function getLabelField() \n {\n return 'statevar_name';\n }",
"public function getLabel() {\n\t\treturn \\Extension\\Templavoila\\Utility\\GeneralUtility::getLanguageService()->sL($this->label);\n\t}",
"public function run()\n {\n \n $provinces = array(\n array('01','01', 'Chachapoyas'),\n array('01','02', 'Bagua'),\n array('01','03', 'Bongará'),\n array('01','04', 'Condorcanqui'),\n array('01','05', 'Luya'),\n array('01','06', 'Rodríguez de Mendoza'),\n array('01','07', 'Utcubamba'),\n array('02','01', 'Huaraz'),\n array('02','02', 'Aija'),\n array('02','03', 'Antonio Raymondi'),\n array('02','04', 'Asunción'),\n array('02','05', 'Bolognesi'),\n array('02','06', 'Carhuaz'),\n array('02','07', 'Carlos Fermín Fitzcarrald'),\n array('02','08', 'Casma'),\n array('02','09', 'Corongo'),\n array('02','10', 'Huari'),\n array('02','11', 'Huarmey'),\n array('02','12', 'Huaylas'),\n array('02','13', 'Mariscal Luzuriaga'),\n array('02','14', 'Ocros'),\n array('02','15', 'Pallasca'),\n array('02','16', 'Pomabamba'),\n array('02','17', 'Recuay'),\n array('02','18', 'Santa'),\n array('02','19', 'Sihuas'),\n array('02','20', 'Yungay'),\n array('03','01', 'Abancay'),\n array('03','02', 'Andahuaylas'),\n array('03','03', 'Antabamba'),\n array('03','04', 'Aymaraes'),\n array('03','05', 'Cotabambas'),\n array('03','06', 'Chincheros'),\n array('03','07', 'Grau'),\n array('04','01', 'Arequipa'),\n array('04','02', 'Camaná'),\n array('04','03', 'Caravelí'),\n array('04','04', 'Castilla'),\n array('04','05', 'Caylloma'),\n array('04','06', 'Condesuyos'),\n array('04','07', 'Islay'),\n array('04','08', 'La Uniòn'),\n array('05','01', 'Huamanga'),\n array('05','02', 'Cangallo'),\n array('05','03', 'Huanca Sancos'),\n array('05','04', 'Huanta'),\n array('05','05', 'La Mar'),\n array('05','06', 'Lucanas'),\n array('05','07', 'Parinacochas'),\n array('05','08', 'Pàucar del Sara Sara'),\n array('05','09', 'Sucre'),\n array('05','10', 'Víctor Fajardo'),\n array('05','11', 'Vilcas Huamán'),\n array('06','01', 'Cajamarca'),\n array('06','02', 'Cajabamba'),\n array('06','03', 'Celendín'),\n array('06','04', 'Chota'),\n array('06','05', 'Contumazá'),\n array('06','06', 'Cutervo'),\n array('06','07', 'Hualgayoc'),\n array('06','08', 'Jaén'),\n array('06','09', 'San Ignacio'),\n array('06','10', 'San Marcos'),\n array('06','11', 'San Miguel'),\n array('06','12', 'San Pablo'),\n array('06','13', 'Santa Cruz'),\n array('07','01', 'Prov. Const. del Callao'),\n array('08','01', 'Cusco'),\n array('08','02', 'Acomayo'),\n array('08','03', 'Anta'),\n array('08','04', 'Calca'),\n array('08','05', 'Canas'),\n array('08','06', 'Canchis'),\n array('08','07', 'Chumbivilcas'),\n array('08','08', 'Espinar'),\n array('08','09', 'La Convención'),\n array('08','10', 'Paruro'),\n array('08','11', 'Paucartambo'),\n array('08','12', 'Quispicanchi'),\n array('08','13', 'Urubamba'),\n array('09','01', 'Huancavelica'),\n array('09','02', 'Acobamba'),\n array('09','03', 'Angaraes'),\n array('09','04', 'Castrovirreyna'),\n array('09','05', 'Churcampa'),\n array('09','06', 'Huaytará'),\n array('09','07', 'Tayacaja'),\n array('10','01', 'Huánuco'),\n array('10','02', 'Ambo'),\n array('10','03', 'Dos de Mayo'),\n array('10','04', 'Huacaybamba'),\n array('10','05', 'Huamalíes'),\n array('10','06', 'Leoncio Prado'),\n array('10','07', 'Marañón'),\n array('10','08', 'Pachitea'),\n array('10','09', 'Puerto Inca'),\n array('10','10', 'Lauricocha '),\n array('10','11', 'Yarowilca '),\n array('11','01', 'Ica '),\n array('11','02', 'Chincha '),\n array('11','03', 'Nasca '),\n array('11','04', 'Palpa '),\n array('11','05', 'Pisco '),\n array('12','01', 'Huancayo '),\n array('12','02', 'Concepción '),\n array('12','03', 'Chanchamayo '),\n array('12','04', 'Jauja '),\n array('12','05', 'Junín '),\n array('12','06', 'Satipo '),\n array('12','07', 'Tarma '),\n array('12','08', 'Yauli '),\n array('12','09', 'Chupaca '),\n array('13','01', 'Trujillo '),\n array('13','02', 'Ascope '),\n array('13','03', 'Bolívar '),\n array('13','04', 'Chepén '),\n array('13','05', 'Julcán '),\n array('13','06', 'Otuzco '),\n array('13','07', 'Pacasmayo '),\n array('13','08', 'Pataz '),\n array('13','09', 'Sánchez Carrión '),\n array('13','10', 'Santiago de Chuco '),\n array('13','11', 'Gran Chimú '),\n array('13','12', 'Virú '),\n array('14','01', 'Chiclayo '),\n array('14','02', 'Ferreñafe '),\n array('14','03', 'Lambayeque '),\n array('15','01', 'Lima '),\n array('15','02', 'Barranca '),\n array('15','03', 'Cajatambo '),\n array('15','04', 'Canta '),\n array('15','05', 'Cañete '),\n array('15','06', 'Huaral '),\n array('15','07', 'Huarochirí '),\n array('15','08', 'Huaura '),\n array('15','09', 'Oyón '),\n array('15','10', 'Yauyos '),\n array('16','01', 'Maynas '),\n array('16','02', 'Alto Amazonas '),\n array('16','03', 'Loreto '),\n array('16','04', 'Mariscal Ramón Castilla '),\n array('16','05', 'Requena '),\n array('16','06', 'Ucayali '),\n array('16','07', 'Datem del Marañón '),\n array('16','08', 'Putumayo'),\n array('17','01', 'Tambopata '),\n array('17','02', 'Manu '),\n array('17','03', 'Tahuamanu '),\n array('18','01', 'Mariscal Nieto '),\n array('18','02', 'General Sánchez Cerro '),\n array('18','03', 'Ilo '),\n array('19','01', 'Pasco '),\n array('19','02', 'Daniel Alcides Carrión '),\n array('19','03', 'Oxapampa '),\n array('20','01', 'Piura '),\n array('20','02', 'Ayabaca '),\n array('20','03', 'Huancabamba '),\n array('20','04', 'Morropón '),\n array('20','05', 'Paita '),\n array('20','06', 'Sullana '),\n array('20','07', 'Talara '),\n array('20','08', 'Sechura '),\n array('21','01', 'Puno '),\n array('21','02', 'Azángaro '),\n array('21','03', 'Carabaya '),\n array('21','04', 'Chucuito '),\n array('21','05', 'El Collao '),\n array('21','06', 'Huancané '),\n array('21','07', 'Lampa '),\n array('21','08', 'Melgar '),\n array('21','09', 'Moho '),\n array('21','10', 'San Antonio de Putina '),\n array('21','11', 'San Román '),\n array('21','12', 'Sandia '),\n array('21','13', 'Yunguyo '),\n array('22','01', 'Moyobamba '),\n array('22','02', 'Bellavista '),\n array('22','03', 'El Dorado '),\n array('22','04', 'Huallaga '),\n array('22','05', 'Lamas '),\n array('22','06', 'Mariscal Cáceres '),\n array('22','07', 'Picota '),\n array('22','08', 'Rioja '),\n array('22','09', 'San Martín '),\n array('22','10', 'Tocache '),\n array('23','01', 'Tacna '),\n array('23','02', 'Candarave '),\n array('23','03', 'Jorge Basadre '),\n array('23','04', 'Tarata '),\n array('24','01', 'Tumbes '),\n array('24','02', 'Contralmirante Villar '),\n array('24','03', 'Zarumilla '),\n array('25','01', 'Coronel Portillo '),\n array('25','02', 'Atalaya '),\n array('25','03', 'Padre Abad '),\n array('25','04', 'Purús'), \n );\n \n \n for ($i=0; $i < count($provinces) ; $i++) { \n DB::table('provinces')->insert([\n 'region' =>$provinces[$i][0],\n 'code' => $provinces[$i][1],\n 'name' => $provinces[$i][2]\n ]); \n }\n\n\n }",
"function cake_country_GetProvinces($params = array(), $locale = \"en_US\") {\n return require(LIB_CAKE . \"Country/GetProvinces.php\");\n}",
"function getLabelField() \n {\n return \"label_label\";\n }",
"function tep_get_country_name($country_id) {\n\t$country_array = tep_get_countries($country_id);\n\treturn $country_array['countries_name'];\n}",
"function GetBranch($usn){\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$properusn = strtolower($formattedusn);\r\n\t$branch = ($properusn[5].$properusn[6]);\r\n\tif($branch==cs) {\r\n $branch=\"C.S.E.\";\r\n }elseif ($branch==ec){\r\n $branch=\"E.C.E.\";\r\n\t}elseif ($branch==me) {\r\n $branch=\"Mech Eng.\";\r\n }elseif ($branch==cv){\r\n $branch=\"Civil Eng.\";\r\n }else{\r\n\t\t$branch=\"No Branch set.\";\r\n\t}\r\n\treturn $branch;\r\n}",
"public final function getLabel(){\n $config = $this->getLocalConfiguration();\n\n if(array_key_exists('label',$config)){\n return $config['label'];\n }\n\n return $this->getConfiguration()['__title'];\n }",
"public static function getLabels(): array;",
"function get_country_short_name($id)\n{\n $CI =& get_instance();\n $CI->db->where('country_id', $id);\n $country = $CI->db->get('tblcountries')->row();\n if ($country) {\n return $country->iso2;\n }\n\n return '';\n}",
"function get_lang_label($key){\n\t\t$list = array(\n\t\t\t//bg 'Bulgarian'\n\t\t\t'cat' => 'Català',\n\t\t\t//cs 'Čeština'\n\t\t\t//da 'Dansk'\n\t\t\t'deu' => 'Deutsch',\n\t\t\t'eng' => 'English',\n\t\t\t'esp' => 'Español',\n\t\t\t//fi 'Finnish (Suomi)'\n\t\t\t'fra' => 'Français',\n\t\t\t//he 'Hebrew (עברית)'\n\t\t\t//hu 'Magyar'\n\t\t\t//it 'Italiano'\n\t\t\t'jpn' => 'Japanese (日本語)',\n\t\t\t'kor' => 'Korean (한국어)',\n\t\t\t//lt 'Lithuanian (lietuvių)'\n\t\t\t//nl 'Nederlands'\n\t\t\t//no 'Norwegian (Norsk bokmål)'\n\t\t\t//pl 'Polski'\n\t\t\t'bra' => 'Português(Brasil)',\n\t\t\t//pt 'Português'\n\t\t\t'ron' => 'Română',\n\t\t\t'rus' => 'Russian (Русский)',\n\t\t\t//sk 'Slovensky'\n\t\t\t//sr 'Srpski'\n\t\t\t//sv 'Svenska'\n\t\t\t'tha' => 'Thai (ไทย)',\n\t\t\t//tr 'Türkçe'\n\t\t\t//uk 'Ukrainian (Українська)'\n\t\t\t//vn 'Tiếng Việt'\n\t\t\t//zh-tw 'Traditional Chinese (繁體中文)'\n\t\t\t'chi' => 'Simplified Chinese (简体中文)'\n\t );\n\t return isset($list[$key]) ? $list[$key] : $key;\n\t}",
"public function getLabel()\n\t{\t\t\t\n\t\treturn $this->label;\n\t}",
"function getCountry($ip_address){\n $url = \"http://ip-to-country.webhosting.info/node/view/36\";\n $inici = \"src=/flag/?type=2&cc2=\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST,\"POST\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"ip_address=$ip_address\"); \n \n ob_start();\n \n curl_exec($ch);\n curl_close($ch);\n $cache = ob_get_contents();\n ob_end_clean();\n \n $resto = strstr($cache,$inici);\n $pais = substr($resto,strlen($inici),2);\n \n return $pais;\n }",
"protected function shortLabel($lbl){\n if(isset($_COOKIE['screen_width'])){\n if((int)$_COOKIE['screen_width']>1400){\n return $lbl;\n }\n }\n\n if(strlen($lbl)>28){\n\n $lbl = iconv('utf-8', 'windows-1251', $lbl);\n $lbl = substr($lbl, 0, 14).'...';\n $lbl = iconv('windows-1251', 'utf-8', $lbl);\n\n\n }\n return $lbl;\n }",
"public function getLabel($name);",
"public function status_label(){\n\t\t$label='';\n\t\t\tswitch($this->status){\n\t\t\t\tCASE '1' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '2' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '3' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '4' : $label = 'label-success';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '5' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '6' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '7' : $label = 'label-warning';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '8' : $label = 'label-danger';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '9' : $label = 'label-danger';\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\tCASE '11' : $label = 'label-success';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '15' : $label = 'label-danger';\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\treturn $label;\n\t}",
"function get_province_name($provinceid)\r\r\n\t{\r\r\n\t\t$this->db->where('ID',$provinceid);\r\r\n\r\r\n\t\t$query = $this->db->get('election_reigons');\r\r\n\t\t\r\r\n\t\t// Check if Result is Greater Than Zero\r\r\n\t\tif($query->num_rows() > 0)\r\r\n\t\t{\r\r\n\t\t\treturn $query->row()->REIGONNAME;\r\r\n\t\t}\r\r\n\t}",
"function ut_main()\n{\n\n $locales = array(\n 'uk-ua_CALIFORNIA@currency=;currency=GRN',\n 'root',\n 'uk@currency=EURO',\n 'Hindi',\n//Simple language subtag\n 'de',\n 'fr',\n 'ja',\n 'i-enochian', //(example of a grandfathered tag)\n//Language subtag plus Script subtag:\n 'zh-Hant',\n 'zh-Hans',\n 'sr-Cyrl',\n 'sr-Latn',\n//Language-Script-Region\n 'zh-Hans-CN',\n 'sr-Latn-CS',\n//Language-Variant\n 'sl-rozaj',\n 'sl-nedis',\n//Language-Region-Variant\n 'de-CH-1901',\n 'sl-IT-nedis',\n//Language-Script-Region-Variant\n 'sl-Latn-IT-nedis',\n//Language-Region:\n 'de-DE',\n 'en-US',\n 'es-419',\n//Private use subtags:\n 'de-CH-x-phonebk',\n 'az-Arab-x-AZE-derbend',\n//Extended language subtags\n 'zh-min',\n 'zh-min-nan-Hant-CN',\n//Private use registry values\n 'x-whatever',\n 'qaa-Qaaa-QM-x-southern',\n 'sr-Latn-QM',\n 'sr-Qaaa-CS',\n/*Tags that use extensions (examples ONLY: extensions MUST be defined\n by revision or update to this document or by RFC): */\n 'en-US-u-islamCal',\n 'zh-CN-a-myExt-x-private',\n 'en-a-myExt-b-another',\n//Some Invalid Tags:\n 'de-419-DE',\n 'a-DE',\n 'ar-a-aaa-b-bbb-a-ccc'\n );\n\n $res_str = '';\n\n foreach( $locales as $locale )\n {\n $scr = ut_loc_get_script( $locale);\n $res_str .= \"$locale: script='$scr'\";\n $res_str .= \"\\n\";\n }\n\n return $res_str;\n\n}",
"public function getDisplayLabel();",
"public function autoLabelNeeded();",
"abstract public function country();",
"public function getModeLabel();",
"public function addressLabeling()\n\t\t{\n\t\t\t$this->Checklogin();\n\t\t\tsetAActivityLogs('Transaction_activity','AAaddresslabelling_view');\n\n\t\t\t$visitor_id=implode(\",\",$_POST['all_visitors_id']);\n\t\t\n\t\t\t$data['result']=$visitor_id;\n\n\t\t\t//$data ['result']=$this->setting_model->addressLabeling();\n\t\t\t$data ['include']='admin/setting/labeling';\n\t\t\t$data ['admin_section']='labeling';\n\t\t\t$this->load->view('backend/container',$data);\t\n\t\t}"
] | [
"0.65225047",
"0.6519477",
"0.6519477",
"0.64948946",
"0.6446904",
"0.6252001",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.61410403",
"0.61410403",
"0.6139777",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6022079",
"0.5982291",
"0.5950799",
"0.59299874",
"0.59299874",
"0.58807147",
"0.58732796",
"0.5857024",
"0.5801496",
"0.5732569",
"0.57252353",
"0.5724865",
"0.5724052",
"0.5681792",
"0.56317365",
"0.56317365",
"0.5631441",
"0.5627435",
"0.5605314",
"0.5583536",
"0.5574928",
"0.5569795",
"0.55359924",
"0.5535853",
"0.55296975",
"0.55147576",
"0.5506705",
"0.5500586",
"0.549027",
"0.5467572",
"0.5462277",
"0.54471433",
"0.5431638",
"0.5423325",
"0.54035354",
"0.5402552",
"0.5382431",
"0.53620154",
"0.53617066",
"0.53617066",
"0.53617066",
"0.53526664",
"0.53481245",
"0.53463507",
"0.5336958",
"0.53297615",
"0.5317224",
"0.53155535",
"0.5276616",
"0.5270485",
"0.526854",
"0.52624893",
"0.525831",
"0.525734",
"0.5252115",
"0.5249249",
"0.52487785",
"0.5243123",
"0.524029",
"0.52129406",
"0.5211327",
"0.5206583",
"0.52064055",
"0.5203269",
"0.5203083",
"0.5200802",
"0.5197901",
"0.518928"
] | 0.6562518 | 0 |
Setup the test properties. | protected function setUp()
{
$this->_blockMockBuilder = $this->getBlockMockBuilder('infinitescroll/init')
->disableOriginalConstructor();
$this->_blockFullMock = $this->_blockMockBuilder->setMethods(null)
->getMock();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setUp()\n {\n $this->object = new Properties();\n }",
"protected function setUp()\n {\n $this->object = new TestAutoGetSetProps;\n }",
"protected function setUp(): void {\n $this->parser = new PropertyParser();\n }",
"protected function setUp() {\n\n\t\t$class_name = __NAMESPACE__.\"\\\\\".$this->property_class_name;\n\t\t$this->property_options[\"default_value\"] = $this->default_value;\n\n\t\t$this->config = new ConfigTestMock(\"test\");\n\t\t$this->object = new $class_name( $this->config, $this->property_name, $this->property_options );\n\t}",
"public function setUp()\n {\n $this->faker = Factory::create();\n\n $reader = new PhpDocReader();\n\n foreach (array_keys(get_object_vars($this)) as $propertyName) {\n if (self::MOCK_SUFFIX !== substr($propertyName, -strlen(self::MOCK_SUFFIX))) {\n continue;\n }\n\n $property = new \\ReflectionProperty(static::class, $propertyName);\n $propertyClass = $reader->getPropertyClass($property);\n\n $this->$propertyName = $this->prophesize($propertyClass);\n }\n }",
"protected function setUp()\n {\n $this->instance = new TestProPropertyDTO();\n $this->masterClass = AbstractCSR3PropertyDTO::class;\n $this->reflexClass = TestProPropertyDTO::class;\n }",
"protected function setUp(): void\n {\n parent::setup();\n\n $configurationManager = $this->objectManager->get(ConfigurationManager::class);\n $this->zoomAccountIdentifier = (string)$configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'PunktDe.Zoom.Api.zoomAccountIdentifier');\n\n if ($this->zoomAccountIdentifier === '') {\n $this->markTestSkipped('No zoom-api configuration present');\n }\n\n try {\n $this->meetingResource = $this->objectManager->get(MeetingResource::class);\n $this->meetingRegistrantResource = $this->objectManager->get(MeetingRegistrantResource::class);\n } catch (ZoomApiConfigurationException $e) {\n $this->markTestSkipped('No zoom-api configuration present');\n }\n }",
"protected function setUp() {\n\t\tparent::setUp();\n\t\tConfig::getInstance()->set(array(\n\t\t\t'resource.session.test.namespace' => 'test',\n\t\t\t'resource.session.test.cookieName' => 'testSession',\n\t\t\t'resource.session.test.cookieDomain' => 'testdomain',\n\t\t\t'resource.session.test.cookiePath' => '/test',\n\n\t\t\t'resource.missingNamespace.cookieName' => 'testSession',\n\t\t));\n\t}",
"public function setUp() {\n\t\t$this->setDefaultUserInfo($this->userInfo);\n\t\tparent::setUp();\n\n\t\t$path = __DIR__ . DS;\n\t\t$this->applyTestConfig($path);\n\t\t//Configure::write('Config.language', 'eng');\n\t}",
"protected function setUp() {\n $this->object = new Qwin_Config;\n }",
"protected function setUp()\n\t{\n\t\t$view = new \\Aimeos\\MW\\View\\Standard();\n\n\t\t$config = array(\n\t\t\t'page' => 'test',\n\t\t\t'sub' => array(\n\t\t\t\t'subpage' => 'test2',\n\t\t\t),\n\t\t);\n\n\t\t$conf = new \\Aimeos\\MW\\Config\\PHPArray( $config );\n\t\t$this->object = new \\Aimeos\\MW\\View\\Helper\\Config\\Standard( $view, $conf );\n\t}",
"public function setup()\n {\n parent::setup();\n \n // Build some fuxture values\n $this->userName = 'fixture';\n $this->firstName = 'Test';\n $this->lastName = 'User';\n $this->email = '[email protected]';\n $this->password = '123123';\n $this->roleName = 'Fixture';\n // Generate the fixture\n $this->createAdminUserFixture(); \n }",
"static function setup() {\n\n $zfRoot = realpath(dirname(basename(__FILE__)) . '/../lib/');\n \n $compassRoot = realpath(dirname(basename(__FILE__)) . '/..');\n\n TestConfiguration::$compassRoot = $compassRoot;\n TestConfiguration::$zfRoot = $zfRoot;\n \n require_once 'PHPUnit/Framework.php';\n require_once 'PHPUnit/Framework/TestSuite.php';\n require_once 'PHPUnit/TextUI/TestRunner.php';\n \n error_reporting( E_ALL | E_STRICT );\n \n set_include_path($compassRoot . '/application/models/'\n . PATH_SEPARATOR . $zfRoot\n . PATH_SEPARATOR . get_include_path()\n );\n \n include 'Zend/Loader.php';\n Zend_Loader::registerAutoload();\n \n // load configuration\n $section = 'test';\n $config = new Zend_Config_Ini($compassRoot .'/application/config.ini', $section);\n Zend_Registry::set('config', $config);\n \n date_default_timezone_set($config->date_default_timezone);\n \n // set up database\n $db = Zend_Db::factory($config->database);\n Zend_Db_Table::setDefaultAdapter($db);\n Zend_Registry::set('db', $db); \n }",
"protected function setUp()\n {\n $this->setUpFilesystem();\n $this->object = Config::table('users');\n }",
"public function setUp()\r\n {\r\n $this->config += [\r\n 'http_errors' => false,\r\n 'timeout' => 10.0,\r\n 'base_uri' => $this->description->getBaseUri(),\r\n 'apiKey' => 'XXX',\r\n 'projectId' => 000,\r\n ];\r\n }",
"public function setup()\n\t{\n\t\tparent::setup();\n\t\t$this->testUser = self::createTestUser();\n\t}",
"protected function setUp() {\n\t\t$GLOBALS['appLog'] = new \\Lib\\appLogger(SITEPATH . 'tests/logs', \\Lib\\appLogger::DEBUG);\n\t\t$this->object = new userdoa;\n\t\t$this->u['username'] = 'phpunit';\n\t\t$this->u['email'] = '[email protected]';\n\t\t$this->u['created'] = date(\"Y-m-d H:i:s\");\n\t\t$this->u['active'] = false;\n\t\t$this->u['password'] = md5('phpunit');\n\t\t$this->u['activateKey'] = 0;\n\t}",
"protected function setUp(): void\n {\n $this->object = new Options('testuser', 'testpass', 'testauthzid', 'testservice', 'testhost');\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->setUpToolsAliases(true);\n $this->setUpToolsRoutes();\n $this->setUpToolsModels();\n }",
"public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }",
"protected function setUp(): void\n {\n $this->firstNumber = 10;\n $this->secondNumber = 5;\n $this->businessLogic = new BusinessLogic();\n $this->mockTest = new MockTest();\n }",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"protected function setUp()\n {\n $this->manager = Manager::getInstance()\n ->setEndpoint($this->endpoint)\n ->setProxy($this->proxy);\n }",
"protected function setUp()\n\t{\n\t\t$this->object = PPCredentialManager::getInstance();\n\t}",
"protected function setUp()\n {\n $this->update = new Update;\n }",
"protected function setUp()\n\t{\n\t\t$this->object = new CXLHash;\n\t}",
"protected function setUp()\n {\n $this->clock = new Clock();\n }",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}"
] | [
"0.78110677",
"0.75613904",
"0.74574476",
"0.74184036",
"0.7302611",
"0.728605",
"0.7021227",
"0.7020154",
"0.7016898",
"0.6964622",
"0.6910357",
"0.6899997",
"0.68768203",
"0.68570465",
"0.6849253",
"0.6807189",
"0.679796",
"0.6795303",
"0.6775165",
"0.67726594",
"0.6752555",
"0.6749376",
"0.6749376",
"0.6749376",
"0.6749376",
"0.6749376",
"0.6740953",
"0.67401767",
"0.6722296",
"0.67203134",
"0.6708615",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.66992867",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.6699025",
"0.66986525",
"0.66986525",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613",
"0.66985613"
] | 0.0 | -1 |
Get an addressed delay message | public function getAddressedDelayMessage(UserInterface $user, DestinationInterface $destination, string $operation): string {
$bacon = $this->getRandom([
"Hang in there {mention}, I'm still working on that {event}.",
'This is taking a while {mention}, but everything is fine and nothing is ruined. Especially not this {event}.',
"Go get a coffee {mention}, that {event} is taking its sweet time.",
'Give it a second {mention}, your {event} is going to space for crying out loud!',
'Good things come to those who wait {mention}. You like good things, right? Your {event} is still running.',
'Did I leave a {event} in the oven {mention}?',
"Rome wasn't built in a day {mention}, and neither is this {event}.",
'Cool your jamjets {mention}, your {event} will be done... eventually.',
"This {event} is still red in the middle {mention}, needs a bit more time.",
]);
$mention = $this->getUserReference($user);
return str_replace(['{mention}', '{event}'], [$mention, $operation], $bacon);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDelay(): int;",
"public function getDelayTime() {}",
"public function getDelay()\n {\n return $this->delay;\n }",
"public function getDelay(): int\n {\n return $this->delay;\n }",
"public function getDelay(): int\n {\n return $this->delay;\n }",
"function get_timing_delay() {\n\n\t\t$timing_type = $this->get_timing_type();\n\n\t\tif ( ! in_array( $timing_type, [ 'delayed', 'scheduled' ] ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$number = $this->get_timing_delay_number();\n\t\t$unit = $this->get_timing_delay_unit();\n\n\t\t$units = [\n\t\t\t'm' => MINUTE_IN_SECONDS,\n\t\t\t'h' => HOUR_IN_SECONDS,\n\t\t\t'd' => DAY_IN_SECONDS,\n\t\t\t'w' => WEEK_IN_SECONDS\n\t\t];\n\n\t\tif ( ! $number || ! isset( $units[$unit] ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn $number * $units[$unit];\n\t}",
"public static function getThrottleDelay() {}",
"public function getDelayType()\n {\n return $this->delayType;\n }",
"abstract public function getFullMessage($msgNo);",
"function msg_get($umd=NULL){\n $keys = is_null($umd)?$this->domain_seq:(array)$umd;\n $res = array();\n foreach($keys as $ck) $res[$ck] = $this->domains[$ck]->msg_get();\n return is_array($umd)?$res:array_shift($res);\n }",
"function formatDelay($delay) {\n\tif ($delay) {\n\t\tlist($dh,$dm) = explode('.',$delay);\n\t\treturn '+' . ( 60*$dh + $dm ) . '\\'';\n\t} else return \"\";\n}",
"public function getDelayedTime()\n {\n $packet = $this->getPacket();\n\n if ($packet['delayed'] > 0) {\n return $packet['delayed'];\n }\n\n return -1;\n }",
"public function showDelay()\n {\n global $conf, $langs;\n\n if (empty($this->date_delivery) && ! empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility\n\n if (empty($this->date_delivery)) $text=$langs->trans(\"OrderDate\").' '.dol_print_date($this->date_commande, 'day');\n else $text=$text=$langs->trans(\"DeliveryDate\").' '.dol_print_date($this->date_delivery, 'day');\n $text.=' '.($conf->commande->fournisseur->warning_delay>0?'+':'-').' '.round(abs($conf->commande->fournisseur->warning_delay)/3600/24, 1).' '.$langs->trans(\"days\").' < '.$langs->trans(\"Today\");\n\n return $text;\n }",
"abstract public function get_message();",
"function com_message_pump($timeoutms = 0) {}",
"public function at($delay);",
"public function delay(Command $command, $delay);",
"public function handleDeliveryDelayEvent(object $message): void;",
"public function getDelayInterval()\n {\n $delay = $this->getData();\n $modifier = ( $delay['delay_type'] == 'before' ) ? '-' : '+';\n $base = $delay['delay_value'];\n $unit = $delay['delay_unit'];\n return \"{$modifier}{$base} {$unit}\";\n }",
"public function get_delay_export() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_delay_export() function\n\t\t\treturn $this->delay_export;\n\t\t}",
"public function getWarnDisconnectDelay()\n {\n $result = $this->client->GetWarnDisconnectDelay();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }",
"protected function getAvailableAt($delay)\n {\n $availableAt = $delay instanceof \\DateTime ? $delay : (new \\DateTime())->modify((int) $delay.' second');\n\n return $availableAt->getTimestamp();\n }",
"public function receive(int $timeout = 0): ?Message;",
"public static function deferredPublish($topic, $delay, $body)\n {\n return \"DPUB $topic $delay\\n\" . pack('N', strlen($body)) . $body;\n }",
"public function getNextMessage(){\r\n }",
"public function getAfterDelay()\n {\n return $this->afterDelay;\n }",
"private function getMsg()\n {\n return $this->msg;\n }",
"function send_cntdwn_msg()\n{\n $current = new DateTime();\n $current->Sub(new Dateinterval(\"PT1H\"));\n\t$sqldate = $current->format(\"Y-m-d H:i:s\");\n $ipAddress = false;\n $stopparam = new TempPredictionStopParam($this->connector);\n $stopparam->build_id = $this->stopBuild->build_id;\n $send_count = 0;\n\n\n // Get IP to send message to - either last GPRS address in last hour or hard coded UDP receiver\n if ( $this->display_type == \"B\" )\n {\n $gprsStatus = new UnitStatus($this->connector);\n $gprsStatus->build_id = $this->stopBuild->build_id;\n $status = $gprsStatus->load(false, \" and message_time > '$sqldate'\");\n $status = $gprsStatus->load();\n if ( $status )\n {\n $ipAddress = $gprsStatus->ip_address;\n $connectTime = $gprsStatus->message_time;\n }\n }\n else\n {\n $stopparam->param_desc = \"ipAddress\";\n $status = $stopparam->load();\n if ( $status )\n {\n $ipAddress = $stopparam->ipAddress;\n $connectTime = $current->format(\"Y-m-d H:i:s\");\n }\n }\n\n if ( !$ipAddress )\n {\n $this->text .= \" - no current ip address for \".$this->stopBuild->build_code.\"\\n\";\n\t return false;\n }\n\n // Dont send if ip address has been assigned to unit more recently\n\tif ( $this->display_type == \"B\" ) \n {\n $gprsStatusDup = new UnitStatus($this->connector);\n $gprsStatusDup->ip_address = $ipAddress;\n $status = $gprsStatusDup->count(array(\"ip_address\"), \" and build_id != \".$this->stopBuild->build_id.\" AND message_time > '\".$connectTime.\"'\");\n //echo \" build_id != \".$this->stopBuild->build_id.\" AND message_time > '\".$connectTime.\"'\\n\";\n if ( $gprsStatusDup->selectCount > 0 )\n {\n $this->text .= \" sedncntdown: \".$this->stopBuild->build_code.\" ip $ipAddress / $connectTime is in use by another unit\";\n return false;\n }\n }\n\n\t$delivery = new PredictionDelivery($this->connector);\n\t$delivery->messageType = 0;\n\t$delivery->addressId = $this->stopBuild->build_code;\n\t$delivery->serviceCode = $this->service_code;\n\t$delivery->bay_no = $this->bay_no;\n\n\t$l_vehicle_code = $this->vehicle->vehicle_code;\n\t$l_build_code = $this->vehicleBuild->build_code;\n\t$l_build_id = $this->vehicleBuild->build_id;\n\n \n\n // Send unitId of 0 if ( $this is an autoroute\n\t// || $if ( $this is a CONT && $the vehicle is already expected at the stop for a REAL route.\n if ( $l_vehicle_code == \"AUT\" || $this->sch_rtpi_last_sent == \"P\" ) \n\t\t\t$delivery->unitId = 0;\n\telse\n {\n if ( !$this->vehicleBuild->build_code )\n {\n\t\t $this->text .= \"\tsend_cntdwn_msg: Failed to get build_code for vehicle_id \". $this->vehicle->vehice_code;\n\t\t\treturn false;\n }\n\t\telse \n {\n $delivery->unitId = $this->vehicleBuild->build_code;\n\t\t}\n\t}\n\n\t$delivery->journeyId = $this->pub_ttb_id;\n\n if ( $this->predictionParameters->countdown_dep_arr == \"A\" ) \n $time_string = $this->eta_last_sent;\n else\n $time_string = $this->etd_last_sent;\n\n $countdown_time_dt = DateTime::createFromFormat(\"Y-m-d H:i:s\", $time_string);\n\t$delivery->countdownTime = $countdown_time_dt->getTimestamp();\n\n\n $stopparam->param_desc = \"countdownMsgType\";\n\t$countdownType = 470;\n if ( $stopparam->load() && $stopparam->param_value )\n $countdownType = $stopparam->param_value;\n\n $stopparam->param_desc = \"destinationType\";\n\t$destinationColumn = \"dest_short1\";\n if ( $stopparam->load() && $stopparam->param_value )\n {\n if ( $stopparam->param_value == \"DEST50\" )\n $destinationColumn = \"dest_long\";\n }\n\n $destination = new Destination($this->connector);\n $destination->dest_id = $this->dest_id;\n if ( !$destination->load() )\n {\n $this->text .= \" Unable to fetch destination for id $this->dest_id\";\n }\n if ( !$destination->dest_short1 && $destination->dest_long ) $destination->dest_short1 = $destination->dest_long;\n if ( !$destination->dest_short1 && $destination->terminal_text ) $destination->dest_short1 = $destination->terminal_text;\n if ( !$destination->dest_long && $destination->dest_short1 ) $destination->dest_long = $destination->dest_short1;\n \n $destinationText = $destination->$destinationColumn;\n if ( $countdownType == 450 )\n $destinationText = substr($destinationText, 0, 15);\n\n $delivery->cntdwn_msg_ver = $countdownType;\n\n // Get vehicle and operator details\n $delivery->wheelchairAccess = 0;\n $delivery->operatorId = 0;\n if ( $this->vehicle->vehicle_id != 0 && $this->vehicle->vehicle_code != \"AUT\" )\n {\n // We have a rela vehicle tracking the prediction trip, get missing vehicle and operator details\n // so we can get operator loc_prefix - not sure why?\n if ( !$this->vehicle->load() )\n {\n $this->text .= \" Cant load vehicle for prediction\";\n return false;\n }\n\n $operator = new Operator($this->connector);\n $operator->operator_id = $this->vehicle->operator_id;\n if ( !$operator->load() )\n {\n $this->text .= \" Cant load operator for prediction\";\n return false;\n }\n $delivery->wheelchairAccess = $this->vehicle->wheelchair_access;\n $delivery->operatorId = $operator->loc_prefix;\n }\n\n\t// Get whether || $not an acknowledgment is currently required for\n\t// countdown messages.\n //echo \"TODO ackreqd\\n\";\n\t//$l_ack_reqd = $get_ack_reqd(450);\n\n $now = new DateTime();\n $delivery->id = 0;\n $delivery->messageType = $countdownType;\n $delivery->journey_fact_id = $this->journey_fact_id;\n $delivery->sequence = $this->sequencsequence;\n $delivery->send_time = $now->format(\"Y-m-d H:i:s\"); \n $delivery->pred_type = \"C\";\n $delivery->display_mode = $this->predictionParameters->countdown_dep_arr;\n $delivery->rtpi_eta_sent = $this->rtpi_eta_sent;\n $delivery->rtpi_etd_sent = $this->rtpi_etd_sent;\n $delivery->pub_eta_sent = $this->pub_eta_sent;\n $delivery->pub_eta_sent = $this->pub_etd_sent;\n $delivery->prediction = $time_string;\n\n \t$this->setOutboundQueue();\n\n\t$this->text = $this->text. \": >>> \".\n\t\t\t$ipAddress. \" \". \n\t\t\t\t$this->sch_rtpi_last_sent. \" \". \n\t\t\t\t$delivery->serviceCode. \" \". \n\t\t\t\tsubstr($destinationText, 0, 15). \" \".\n\t\t\t\tsubstr($time_string,11,8);\n\n\t//$m_status = $set_c_countdown_message();\n\tif ( true )\n {\n\t\t\tswitch($this->display_type)\n {\n\t\t\t\tcase \"U\" :\n\t\t\t\t\t//$m_status = $message_to_queue(m_external_sys_id,w_ip_address,LENGTH(w_ip_address),0,w_stop_build,l_ack_reqd)\n break;\n \t \tcase \"B\" :\n $junk1 = 0;\n $terminatingZero = 0;\n $send_count++;\n $destlen=strlen($destinationText);\n // I RL T\n if ( $delivery->messageType == 518 )\n {\n $msg = pack(\"A3Sa18SSSSSIA6SIIiCa10A${destlen}I\",\n \"PHP \",\n 3, // message type\n\n $ipAddress, // destination\n 1, // repeats\n $destlen + 48, // message length\n 0, // portNumber\n\n $delivery->messageType,\n $junk1,\n $delivery->addressId,\n substr($delivery->serviceCode, 0, 6),\n $delivery->operatorId,\n $delivery->unitId,\n $delivery->journeyId,\n $delivery->countdownTime,\n $delivery->wheelchairAccess,\n $delivery->bay_no,\n $destinationText,\n $terminatingZero\n );\n }\n else\n $msg = pack(\"A3Sa18SSSSSIA6SIIiCA${destlen}I\",\n \"PHP \",\n 3, // message type\n\n $ipAddress, // destination\n 1, // repeats\n $destlen + 38, // message length\n 0, // portNumber\n\n $delivery->messageType,\n $junk1,\n $delivery->addressId,\n substr($delivery->serviceCode, 0, 6),\n $delivery->operatorId,\n $delivery->unitId,\n $delivery->journeyId,\n $delivery->countdownTime,\n $delivery->wheelchairAccess,\n $destinationText,\n $terminatingZero\n );\necho \" Tid $delivery->bay_no, $delivery->messageType, $delivery->addressId, $delivery->serviceCode, $delivery->operatorId, $delivery->unitId, $delivery->journeyId, $delivery->countdownTime, $delivery->wheelchairAccess, $destinationText\\n\";\n if ( $this->outboundQueue )\n {\n if (!msg_send ($this->outboundQueue, 1, $msg ) )\n {\n $this->text .= \"Failed to send event to route tracker message queue\";\n echo $this->text.\"\\n\";\n }\n }\n\t\t\t}\n\t}\n\n if ( $send_count == 0 ) \n {\n $this->text = $this->text. \" UNSENT OUT OF DATE\";\n }\n\n //echo \"sent $send_count <BR>\";\n\treturn $send_count;\n\n}",
"public function delay($value) {\n return $this->setProperty('delay', $value);\n }",
"public function get_message(): string\n {\n // $res is a string;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::MESSAGE_INVALID;\n }\n }\n $res = $this->_message;\n return $res;\n }",
"protected function getMessage($duration)\n {\n if($duration >= 2) {\n return 'Thank you for the conversation we had on the phone just now.';\n } else {\n return 'Thank you for your call.';\n }\n }",
"function tf_latency($message)\r\n {\r\n static $lastTime = 0;\r\n\r\n $currentTime = microtime(true);\r\n\r\n echo 'latency(';\r\n echo $lastTime == 0 ? '~' : $currentTime - $lastTime;\r\n echo ')(';\r\n echo htmlspecialchars($message, null, 'UTF-8');\r\n echo ')<br/>';\r\n\r\n $lastTime = $currentTime;\r\n }",
"public function _messageIdForIP(){\n return (date('H:i:s').'T'.date('Y-m-d').'.'.substr(time(),0,3).'@'.$_SERVER['REMOTE_ADDR']);\n }",
"public function receiveNoWait(): ?Message;",
"public function getNotifyMsg()\n {\n return $this->get(self::_NOTIFY_MSG);\n }",
"public static function getOfflineMessage() {\n $configModel = new \\App\\Configurations();\n echo $configModel->get(\\Config::get('configurations.open_time_msg_key'));\n }",
"function msgsrv_request ($target, $cmd, $content, $link, $timeout = 30000) {}",
"public function later($delay, $recepient, $message, $queue = null)\n {\n $callback = [\n 'recepient' => $recepient,\n 'message' => $message,\n 'sender' => isset($sender) ? $sender : null,\n 'message_type' => isset($message_type) ? $message_type : 0\n ];\n \n return $this->queue->later($delay, 'sms@handleQueuedMessage', $callback, $queue);\n }",
"public function getLastsend();",
"public function lastMessage()\n {\n return $this->messages()\n ->take(1);\n }",
"public function sentAt();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getDelay( $value, $defaultValue = 10 )\n {\n $items = array();\n $items[0] = array( 'value' => 0, 'text' => \"no delay\" );\n foreach (range(15, 1440, 15) as $i) {\n $items[$i] = array( 'value' => $i, 'text' => $this->_convertToHoursMins($i) );\n }\n\n $inputSettings = array(\n 'value' => $value,\n 'defaultValue' => $defaultValue,\n 'name' => 'delay',\n 'items' => $items,\n );\n\n $labelSettings = array(\n 'text' => 'Delay',\n );\n\n $options = array(\n 'attributes' => array(\n 'class' => 'form-item'\n )\n );\n\n return $this->getSelect( $inputSettings, $labelSettings, $options );\n }",
"public function getMsg()\n {\n return $this->Msg;\n }",
"public function get_rate_limit_delay( $rate_limit_id ) {\n\n\t\treturn (int) get_transient( \"wc_facebook_rate_limit_${rate_limit_id}\" );\n\t}",
"public function getTMsg()\n {\n return $this->t_msg;\n }",
"function getRemainingDelay($ip)\n\t{\n\t\t$sql \t= \" select time_to_sec(timediff(now(), delayFrameStart))/60 as delayFrameMin from ( \"\n\t\t\t\t. \" select max(lastAttempt) as delayFrameStart from `blockedIPs` where ip = ? \"\n\t\t\t\t. \" and lastAttempt > Date_sub(Now(), Interval \".LOGIN_FAILS_TIMEOUT_MIN.\" Minute) \"\n\t\t\t\t. \" ) as maxLastAttempt \";\n\t\t$result = $this->sqlQueryArray($sql, array($ip));\n\t\t\n\t\tif(count($result) == 0)\n\t\t\t$remaining_delay = '0';\n\t\telse\n\t\t{\n\t\t\t$roundedDiff = round(LOGIN_FAILS_TIMEOUT_MIN - $result[0]->delayFrameMin);\n\t\t\tif($roundedDiff == 0)\n\t\t\t\t$remaining_delay = 'less than 1 minute';\n\t\t\telse\n\t\t\t\t$remaining_delay = 'approximately '.$roundedDiff.' minute(s)';\n\t\t}\n\t\t\n\n\t\treturn $remaining_delay;\n\t}",
"public function wait($name, $delay = 30);",
"public function getLongMessage()\n {\n return $this->longMessage;\n }",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMsg()\n {\n return $this->msg;\n }",
"public function getMsg()\n {\n return $this->msg;\n }",
"public function message() {\n $message = $this->rawMessage();\n\n return t($message['message'], $message['options'], array('context' => 'bibdk_holdingstatus'));;\n }",
"function send_message($serial, $instruction, $addrh, $addrl, $data1, $data2, $text)\r\n{\r\n\tusleep(COMM_WAIT_BETWEEN_MESSAGES);\r\n\r\n\t$sum = ($instruction + $addrh + $addrl + $data1 + $data2) & 255;\r\n\t$message = pack(\"CCCCCCC\", $instruction, $addrh, $addrl, $data1, $data2, $sum, 13);\r\n\t$try = 0;\r\n\t$result = -1;\r\n\tdo\r\n\t{\r\n\t//\tprint($text);\r\n\t\t\r\n\t\t$serial->sendMessage($message);\r\n\t\t\r\n\t\tusleep(COMM_WAIT_RESPONSE_DELAY);\r\n\t\t\r\n\t\t$read = $serial->readPort(7);\r\n\t\t\r\n\t\tif (strlen($read) == 7)\r\n\t\t{\r\n\t\t\t$data = unpack(\"C*\", $read);\t// first item has index 1 !!!\r\n\t\t\t\r\n\t\t\tif ($data[3] == 0x99 and $data[4] == 0x99 and $data[5] == 0x99)\r\n\t\t\t{\r\n//\t\t\t\tprint(\"No data available\");\r\n\t\t\t\t$result = -2;\r\n\t\t\t}\r\n\t\t\telse if ($data[1] == 0x00 and $data[2] == 0x00 and $data[3] == 0x00 and $data[4] == 0x00 and $data[5] == 0x00)\r\n\t\t\t{\r\n//\t\t\t\tprint(\"Unit busy\");\r\n\t\t\t\t$result = -3;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$result = ($data[3] << 16) + ($data[4] << 8) + $data[5];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($result < 0 and ++$try < COMM_NR_OF_RETRIES)\r\n\t\t{\t// retry\r\n\t\t\tusleep(COMM_RETRY_DELAY);\r\n\t\t}\r\n\t} while ($result < 0 and $try < COMM_NR_OF_RETRIES);\r\n\t\r\n\treturn $result;\r\n}",
"function sendMsg(string $msg, $id = null)\n{\n echo \"id: \" . ($id ?? time()) . PHP_EOL;\n echo \"retry: 500\" . PHP_EOL;\n echo \"data: $msg\" . PHP_EOL;\n echo PHP_EOL;\n ob_flush();\n flush();\n}",
"public function fetchMessageFromQueue()\n {\n $whereParams = [\n 'status' => 'PENDING',\n ];\n $orderBy = 'attempts';\n return $this->db->first($this->table, $whereParams, $orderBy);\n\n }",
"public function delay($value)\n {\n $this->pushDelay = $value;\n return $this;\n }",
"protected function _getWhen(int $delay = null) : int\n {\n return $this->_objectManager->create('Pulchritudinous\\Queue\\Helper\\Data')->getWhen($delay);\n }",
"public function status($delay = FALSE);",
"function generateMessageId() {\n\t\treturn md5(md5(microtime(true).\"\"));\n\t}",
"public function toTalk(): string;",
"private function requestId()\n\t{\n\t\t$string = $this->randHex();\n\t\t$string.= $this->randHex();\n\t\t$string.= \"-\";\n\t\t$string.= $this->randHex();\n\t\t$string.= \"-\";\n\t\t$string.=\"dmcp-\";\n\t\t$string.= $this->randHex();\n\t\t$string.= \"-\";\n\t\t$string.= $this->randHex();\n\t\t$string.= $this->randHex();\n\t\t$string.= $this->randHex();\n\t\treturn $string;\n\t}",
"private function buildMessage(string $message, int $timerRef = null, bool $newLineAfter = false): string\n {\n return $message . $this->formatTime($timerRef) . ($newLineAfter ? PHP_EOL : '');\n }",
"public function getMessage() {}",
"public function getMessage() {}",
"public function getMessage() {}",
"function reply_time() {\n\tglobal $reply;\n\treturn $reply['time'];\n}",
"public function getMessageId() {\n\treturn ($this->messageId);\n}",
"function dgettext($domain, $messageid)\n\t{\n\t\treturn $messageid;\n\t}",
"public function message ();",
"function reply($id, $mobile, $message, $cost = 0);",
"public function delay(int $delay): self\n {\n $this->delay = $delay;\n return $this;\n }",
"function getEmailDelayTime($email) {\n // Get the general delay time\n $delayTime = $this->getProperty('FREEMAIL_DELAY', 0);\n // If it's 0, we can safely return this value regardless of the email address\n if ($delayTime == 0) {\n return 0;\n }\n // Now check whether the email address matches a blacklist rule in delay mode\n $match = FALSE;\n $emailBlacklist = $this->getBlacklistRules('email', FALSE, TRUE);\n foreach ($emailBlacklist as $id => $blacklistRule) {\n if ($blacklistRule['blacklist_delay'] == 0) {\n continue;\n }\n $rule = $this->convertFromSqlLikeValue($blacklistRule['blacklist_match']);\n // Strip whitespace\n $rule = trim($rule);\n // Convert current rule into valid regexp\n if ($rule[0] == '*') {\n $rule = ltrim($rule, '*');\n } else {\n $rule = '^'.$rule;\n }\n if ($rule[strlen($rule) - 1] == '*') {\n $rule = rtrim($rule, '*');\n } else {\n $rule = $rule.'$';\n }\n // Now do the check\n if (preg_match('~'.$rule.'~i', $email)) {\n $match = TRUE;\n break;\n }\n }\n if ($match) {\n return $delayTime * 60;\n }\n return 0;\n }",
"function getMessage($i){\n $options = array('My Skillset', 'Projects I have done', 'Past Work Places');\n switch($i){\n case 0:\n $msg = $options[0];\n break;\n case 1;\n $msg = $options[1];\n break;\n case 2:\n $msg = $options[2];\n break;\n default:\n \n break; \n }\n return $msg;\n }",
"public function message()\n {\n return $this->msg;\n }",
"public function message()\n {\n return $this->msg;\n }",
"public function message()\n {\n return $this->msg;\n }",
"public function getMsgref() : string\n {\n return $this->msgref;\n }",
"protected function delay()\n {\n if (!isset($this->headers['x-rate-limit-reset'])) {\n exit('Rate limited, but no rate limit header found');\n }\n\n $delay = $this->headers['x-rate-limit-reset'] - time();\n\n if ($delay < 10) {\n $delay = 60 * 15; // 15 minute delay if the given delay seems unreasonably small (can be due to server time differences)\n }\n \n print \"\\n\";\n\n do {\n print \"\\r\\e[K\";\n printf('Sleeping for %d seconds', $delay--);\n sleep(1);\n } while ($delay);\n }",
"public static function GetUserDelay($wU_id){\n\t\t$wUser = Database::safeQuery(\"SELECT rating FROM users WHERE u_id=$wU_id;\")->fetch_assoc();\n\t\t$oRatingDelay = (750 * pow(M_E,(-0.1609438*$wUser['rating'])) )-150;\n\t\treturn floor($oRatingDelay);\n\t}",
"protected abstract function _message();",
"private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyName . self::$timeStamp, true);\n break;\n case 'payNote':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$PspTxnId . self::$MsTxnId . self::$timeStamp . self::$Result, true);\n break;\n }\n }",
"public function getDefaultMessageTimeToLive()\n {\n return $this->_defaultMessageTimeToLive;\n }"
] | [
"0.67242295",
"0.6342543",
"0.6128936",
"0.6110978",
"0.6110978",
"0.604764",
"0.5802513",
"0.5618736",
"0.55427665",
"0.5501457",
"0.5499948",
"0.5469847",
"0.5458123",
"0.5452401",
"0.54503417",
"0.54331344",
"0.5381336",
"0.5326907",
"0.5259076",
"0.52521944",
"0.52490926",
"0.5243538",
"0.5233497",
"0.5223159",
"0.5191318",
"0.5180167",
"0.51722896",
"0.516764",
"0.5166814",
"0.51584756",
"0.51193744",
"0.5091313",
"0.5074368",
"0.50685465",
"0.49825817",
"0.49816322",
"0.49489462",
"0.49401107",
"0.49381942",
"0.49236003",
"0.49161088",
"0.4914942",
"0.4914942",
"0.4914942",
"0.4914942",
"0.4914942",
"0.4914942",
"0.4905868",
"0.48903537",
"0.48846072",
"0.48838997",
"0.48835623",
"0.48712656",
"0.48682064",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48641714",
"0.48597628",
"0.48597628",
"0.48558584",
"0.48521048",
"0.48446718",
"0.48407632",
"0.4840275",
"0.48193243",
"0.48187032",
"0.4812204",
"0.4812108",
"0.48095047",
"0.48013887",
"0.47940803",
"0.47940803",
"0.47940803",
"0.47894096",
"0.4784291",
"0.47805294",
"0.47682142",
"0.47681564",
"0.47604328",
"0.47404584",
"0.47403374",
"0.47370315",
"0.47370315",
"0.47370315",
"0.47252914",
"0.4723308",
"0.47232747",
"0.47150975",
"0.47136858",
"0.4710224"
] | 0.475289 | 89 |
Get an adddressed normal message | public function getAddressedMessage(UserInterface $user, DestinationInterface $destination, string $message): string {
$bacon = $this->getRandom([
"{mention}: {message}.",
]);
$mention = $this->getUserReference($user);
return str_replace(['{mention}', '{message}'], [$mention, $message], $bacon);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRawMessage()\n {\n return $this->phrase->getText();\n }",
"abstract public function get_message();",
"public function rawMessage(){\n $return = array(\n 'message' => '',\n 'options' => array(),\n );\n if ($this->getWillLend() && $this->isItHome()) {\n $return['message'] = 'bibdk_holding_material_is_home';\n }\n else if (!$this->isItHome() && $this->getExpectedDelivery()) {\n $return['message'] = 'bibdk_holding_material_will_be_home @date';\n $return['options'] = array('@date' => format_date($this->getExpectedDelivery(), 'custom', 'd.m.Y'));\n }\n else if ($note = $this->hasNote()){\n $return['message'] = $note;\n }\n else if ($error = $this->getErrorMessage()) {\n $return['message'] = $error;\n }\n else {\n $return['message'] = 'bibdk_holding_someting_went_wrong';\n }\n\n return $return;\n }",
"protected static function getPlainMessage()\n {\n return PHP_EOL . static::getMessage() . PHP_EOL;\n }",
"public function get_msg() {\r\n return $this->msg;\r\n }",
"public function get_raw_message() { return $this->raw_message; }",
"public function getMessage()\n\t{\n\t\tprepareDisplayContext();\n\t}",
"public function getPlainMessage()\n {\n return $this->plainMessage;\n }",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function get_message() {\n\n\t\t$entity = $this->get_current_entity();\n\n\t\tswitch ($entity) {\n\t\t\tcase self::$ARTICLE:\n\t\t\t\treturn $this->maybe_get_restricted_excerpt() .\n\t\t\t\t $this->maybe_get_restricted_message() .\n\t\t\t\t $this->maybe_get_before_html() .\n\t\t\t\t $this->maybe_get_login_form() .\n\t\t\t\t $this->maybe_get_after_html();\n\n\t\t\tcase self::$ARCHIVE:\n\t\t\t\treturn MKB_Options::option('restrict_topic_message');\n\n\t\t\tcase self::$HOME:\n\t\t\t\treturn MKB_Options::option('restrict_page_message');\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn '';\n\t}",
"public function get_message() { return $this->getMessage(); }",
"private function getMsg()\n {\n return $this->msg;\n }",
"public function getMessageText() {\n\treturn ($this->messageText);\n}",
"public function getFormattedMessage();",
"function raw($message);",
"public function message ();",
"public function getMessage() {\n $ret = \"\";\n if ($this->message !== \"\") {\n $ret = <<<EOF\n <p class=\"dice-message\">{$this->message}</p>\nEOF;\n }\n return $ret;\n }",
"function generate_alt_message($message = '')\n\t{\n\t\tif (!$message)\n\t\t\treturn NULL;\n\t\t\t\n\t\t//fix linebreaks\n\t\t//replace <br/> with \\n\n\t\t$message = preg_replace('%<br\\s?/>([^\\n\\s])%im', \"\\n$1\", $message);\n\t\t//replace <p> and </p>\n\t\t$message = preg_replace('%([^\\n\\s])<p[^>]+?>%im', \"$1\\n\\n\", $message);\n\t\t$message = preg_replace('%</p[^>\\s]+?>([^\\n])%im', \"\\n\\n$1\", $message);\n\t\t\n\t\t//strip all HTML tags\n\t\t$message = preg_replace('%<[^>]+?>%is', '', $message);\n\t\t\n\t\treturn $message;\n\t}",
"public function getMessage() {}",
"public function getMessage() {}",
"public function getMessage() {}",
"protected abstract function _message();",
"abstract public function getFullMessage($msgNo);",
"public function raw()\n {\n return $this->message;\n }",
"function utilmessage($message){\n return $message;\n }",
"public function message() {\n $message = $this->rawMessage();\n\n return t($message['message'], $message['options'], array('context' => 'bibdk_holdingstatus'));;\n }",
"public function getMsg()\n {\n return $this->msg;\n }",
"public function getMsg()\n {\n return $this->msg;\n }",
"public function getMessage()\n {\n return '';\n }",
"public function getMessage(){\n\t\treturn $this->message;\n\t}",
"public static function getDefaultMessage(): string;",
"function getMessage(){\n\t\t\treturn $this->message;\n\t\t}",
"function getMessage()\n {\n return (string) $this->_sMessage;\n }",
"function getMessage()\n {\n return (string) $this->_sMessage;\n }",
"public function getMessDefault ()\n {\n return $this->mess_default;\n }",
"function getMessage() {\n return $this->message;\n }",
"public function getStdOut() {\n\t\treturn parent::getMessage();\n\t}",
"private function getMessage(){ \n\t\t\t//return $this->message;\n\t\t //return \"Sample Message\";\n\t\t\t//$msgArray = array(\"s_id\" => \"s_id\",\"u_id\" => \"u_id\",\"status\"=>\"status\");\n\t\t\t//return json_encode($msgArray); \n\t\t\treturn $this->message;\n\t\t\t\n\t\t}",
"public function getMessage()\n {\n return $this->msg;\n }",
"public function getMessage(): string;",
"public function getMessage(): string;",
"public function getMessage(): string;",
"public function getMessage(): string;",
"public function getMessage(): string;",
"public function getMessage() {\n return $this->message;\n }",
"public function getMessage() {\n return $this->message;\n }",
"public function getMessage() {\n return $this->message;\n }",
"public function getMessage() {\n return $this->message;\n }",
"public function get_message_text()\n {\n return $this->message_text;\n }",
"public function getMessage() {\n\t\treturn preg_replace('%(\\r\\n|\\r|\\n)%', self::$crlf, $this->message . (MAIL_SIGNATURE ? self::$crlf . self::$crlf . MAIL_SIGNATURE : ''));\n\t}",
"public function message()\n {\n return $this->msg;\n }",
"public function message()\n {\n return $this->msg;\n }",
"public function message()\n {\n return $this->msg;\n }",
"public function getMessage()\n {\n return $this->message;\n }",
"public function getMessage () {\n\t\treturn $this->message;\n\t}",
"public function msg() {\n return '';\n }",
"public function msg() {\n return '';\n }",
"public function getMessage() \n\t{\n\t\treturn $this->message;\n\t}",
"public function getMessage()\r\n {\r\n return $this->message;\r\n }",
"public function getMessage()\r\n {\r\n return $this->message;\r\n }",
"public function getMessage()\r\n {\r\n return $this->message;\r\n }",
"public function getMessage() {\n return $this->message;\n }",
"public function FormattedMessage() {\n\t\treturn $this->FormattedText($this->Message);\n\t}",
"public function getMessage() {\n return self::$message;\n }",
"public function getMessageText(): string\n {\n return $this->message_text;\n }",
"public function getMsg()\n {\n return $this->Msg;\n }",
"protected function renderMessage() {}",
"public function get_message()\n {\n return $this->_message;\n }",
"public function getMessage()\n {\n return $this->_message;\n }",
"public function getMessage()\n {\n return $this->_message;\n }",
"function &getMessage() {\r\n\t\t\treturn $this->msg;\r\n\t\t}",
"public function message()\n {\n return 'La moneda que intenta usar no es válida.';\n }",
"public function getMessage()\n\t{\n\t\treturn $this->message;\n\t}",
"public function getMessage()\n\t{\n\t\treturn $this->message;\n\t}",
"public function getMessage()\n\t{\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getMessage()\n {\n return $this -> message;\n }",
"public function getMessage()\n {\n }",
"public function getMessage()\n {\n }",
"public function getRawMessage(): int|float|string\n {\n return $this->rule->getRawMessage();\n }",
"public function getMessage() : mixed\n {\n return $this->message;\n \n }",
"protected function getOnepageNormalizeMessage()\n {\n return $this->config->getOnepageNormalizeMessage($this->store);\n }",
"public function getMessage()\n {\n return $this->message;\n }",
"public function getMessage()\n {\n return $this->message;\n }",
"public function getMessage()\n {\n return $this->message;\n }",
"public function getMessage()\n {\n return $this->message;\n }"
] | [
"0.6821266",
"0.66930115",
"0.6653818",
"0.6559868",
"0.65384877",
"0.6516365",
"0.6496804",
"0.647781",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.64641416",
"0.6442834",
"0.64190716",
"0.63994044",
"0.6372392",
"0.6349044",
"0.6335795",
"0.6330835",
"0.6328351",
"0.63218325",
"0.6309795",
"0.6309795",
"0.6309795",
"0.6305196",
"0.63043004",
"0.6252725",
"0.6249121",
"0.6233566",
"0.62266773",
"0.62266773",
"0.622141",
"0.6219393",
"0.62079644",
"0.62017065",
"0.61944324",
"0.61944324",
"0.6191189",
"0.61843455",
"0.61569715",
"0.61536384",
"0.61515296",
"0.61466324",
"0.61466324",
"0.61466324",
"0.61466324",
"0.61466324",
"0.61389285",
"0.61389285",
"0.61389285",
"0.61389285",
"0.61296636",
"0.61208254",
"0.6109292",
"0.6109292",
"0.6109292",
"0.61077446",
"0.6091082",
"0.6089334",
"0.6089334",
"0.6087673",
"0.6082372",
"0.6082372",
"0.6082372",
"0.606866",
"0.6059984",
"0.60583144",
"0.6055088",
"0.6049087",
"0.6029266",
"0.60239065",
"0.60222393",
"0.60222393",
"0.60199755",
"0.6019278",
"0.6013388",
"0.6013388",
"0.6013388",
"0.6006571",
"0.6006571",
"0.6006571",
"0.6006571",
"0.5994642",
"0.59875655",
"0.59875655",
"0.5969073",
"0.5956707",
"0.5954004",
"0.5951547",
"0.5951547",
"0.5951547",
"0.5951547"
] | 0.0 | -1 |
Get an addressed error message | public function getAddressedError(UserInterface $user, DestinationInterface $destination, string $error): string {
$bacon = $this->getRandom([
"{mention}: {error}. Sorry.",
"Uh {mention}, {error}. Sorry homie.",
"Sorry {mention}, {error}.",
"{mention}... {error}. Woops!",
"Bad news {mention}, {error}",
"Yikes {mention}, {error}. C'est la vie.",
"{mention} you donut, {error}.",
"Damn it {mention}, {error}!",
"Wow, nice work {mention}. {error}...",
"Way to go {mention}, {error}.",
"See what you made me do {mention}!? {error}.",
"{error} {mention}. Get it together, ok?",
]);
$mention = $this->getUserReference($user);
return str_replace(['{mention}', '{error}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($error))], $bacon);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }",
"public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }",
"public function getMessage()\n {\n return $this->_error;\n }",
"public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}",
"function get_error_message() {\n return $this->error_msg;\n }",
"abstract public function getMsgError();",
"final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }",
"public function getError();",
"public function getError();",
"public function getError();",
"public function get_error();",
"public function get_error();",
"abstract protected function _getErrorString();",
"public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }",
"public function getErrMsg() {\n $errMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()\n . '<br><b>Message: ' . $this->getMessage()\n . '</b><br>Exception Type: NoFormsFoundException';\n return $errMsg;\n }",
"public function getErrorMessage()\n\t\t{\n\t\t\t$error = $this->statement->errorInfo();\n\t\t\t$errorText \t= '<h6>Something happened ... :(</h6>';\n\t\t\t$errorText .= 'Error code : '.$error[0].'<br>';\n\t\t\t$errorText .= 'Driver error code : '.$error[1].'<br>';\n\t\t\t$errorText .= 'Error Message : '.$error[2].'<br>';\n\t\t\treturn $errorText;\n\t\t}",
"public function getErrorMessage();",
"public function getErrorMessage();",
"public function message()\n {\n return $this->getError();\n }",
"public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }",
"public function getError() {}",
"public function message()\n {\n return $this->errorText;\n }",
"public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }",
"public function getErrorMessage()\n {\n return $this->error_message;\n }",
"public function getErrorMessage(): ?string {\n\t\t// 1. a string with an error message (e.g. `{\"error\":{\"code\":404,\"errors\":\"invalid token\"},\"success\":false}`)\n\t\t// 2. an object (e.g. `{\"error\":{\"code\":120,\"errors\":{\"name\":\"payload\",\"reason\":\"required\"}},\"success\":false}`)\n\t\t//\n\t\t// Below is an attempt to make sense of such craziness.\n\t\t$error = $this->getValue('[error][errors]');\n\t\tif ($error === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!is_array($error)) {\n\t\t\t$error = [\n\t\t\t\t'name' => 'generic',\n\t\t\t\t'reason' => $error,\n\t\t\t];\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t'name=%s, reason=%s',\n\t\t\t(array_key_exists('name', $error) ? $error['name'] : 'missing'),\n\t\t\t(array_key_exists('reason', $error) ? $error['reason'] : 'missing')\n\t\t);\n\t}",
"public function getError() {\n return $this->get(self::ERROR);\n }",
"public function getError() {\n return $this->get(self::ERROR);\n }",
"public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}",
"public function getError(): string\n {\n return $this->error;\n }",
"public function message()\n {\n return $this->doorman->error;\n }",
"function getMessage()\n {\n return ($this->error_message_prefix . $this->message);\n }",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"public function getErr()\n {\n return $this->get(self::ERR);\n }",
"public function getErr()\n {\n return $this->get(self::ERR);\n }",
"public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }",
"public function message()\n {\n return $this->error_message;\n }",
"public function message(): string\n {\n return $this->errorMessage;\n }",
"public function getError(): string\n {\n return $this->Error;\n }",
"public function getMessage()\n {\n return self::getMessageForError($this->value);\n }",
"function getError();",
"function getError();",
"public function getError() : string\r\n {\r\n return $this->strError;\r\n }",
"public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}",
"public function getErrorMsg()\n\t{\n\t\treturn $this->error;\n\t}",
"public function getErr() {}",
"function error() {\n return $this->error_message;\n }",
"public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}",
"public function get_error() {\n \t$error = oci_error($this->resource);\n \treturn $error[ 'code' ] . ': ' . $error[ 'message' ];\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}",
"public function getErrorMessage() : string\n {\n return $this->errorMessage;\n }",
"protected function getErrorMessage(): string\n\t{\n\t\tif($this->input !== null)\n\t\t{\n\t\t\t$errorMessage = $this->input->getErrorMessage();\n\t\t}\n\n\t\treturn $errorMessage ?? $this->defaultErrorMessage;\n\t}",
"public function getError()\r\n {\r\n return count($this->strError) == 0 ? null :\r\n (count($this->strError) == 1 ? $this->strError[0] :\r\n $this->strError);\r\n }",
"public function getError(): string\n {\n foreach ($this->getBulkResponses() as $bulkResponse) {\n if ($bulkResponse->hasError()) {\n return $bulkResponse->getError();\n }\n }\n\n return '';\n }",
"public function getLastError()\r\n\t{\r\n\t\t// TODO: we should move this to returning an Error\r\n\t\t$numErrors = count($this->errors);\r\n\t\tif ($numErrors > 0)\r\n\t\t{\r\n\t\t\treturn $this->errors[$numErrors-1]['message'];\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}",
"public function getMessage()\n {\n return isset($this->data->failure_msg) ? $this->data->failure_msg : '';\n }",
"public function getErrorText(){\n return $this->error;\n }",
"public function getMsgError() {\r\n return $this->msg_error;\r\n }",
"function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}",
"public function message()\n {\n return $this->errorMsg;\n }",
"public function getError() {\n\t\treturn $this->current_error;\n\t}",
"function getErrorString() {\n\t\tswitch ($this->getErrorType()) {\n\t\t\tcase INSTALLER_ERROR_DB:\n\t\t\t\treturn 'DB: ' . $this->getErrorMsg();\n\t\t\tdefault:\n\t\t\t\treturn __($this->getErrorMsg());\n\t\t}\n\t}",
"public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}",
"public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}",
"public function getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"function ts3client_getErrorMessage($errorCode, &$error) {}",
"public function getErrorMessage()\n {\n return $this->applyTemplate();\n }",
"function errorMsg() {\r\n return \r\n $this->resultError;\r\n }",
"abstract public function getErrorType(): string;",
"public final function last_error_message()\n {\n return isset($this->error) ? $this->error['message'] : '';\n }",
"public function getErrorMessage($input) {\n\t\treturn $input . ' is invalid.';\n\t}",
"public function getErrorMessage(): string\n {\n if ($this->getSuccess()) {\n return '';\n }\n\n return (string) $this->errorMessage;\n }",
"public function getError(): ?string\n {\n return $this->debugMessage;\n }",
"function get_error()\n\t{\n\t\tif ($this->error != \"\") {\n\t\t\treturn \"Error:\".$this->error;\n\t\t}\n\t\treturn \"\";\n\t}",
"public function getErrorName(){\n return $this->error_name;\n }",
"public function getErrorMessage() {\n return $this->errorMessage;\n }",
"public static function getErrorMessage(int $code): string\n {\n return sprintf(\n '%s - Error Code = [%d]'\n , self::$errors[$code]\n , $code\n );\n }",
"function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}",
"protected function getErrorMsgTemplate()\n {\n return 'The %s cast is ';\n }",
"public function error(): string\n {\n return $this->error;\n }",
"public function getError()\n\t{\n\t\treturn $this->err;\n\t}",
"public function getLastError();",
"public function getErrorMsg()\r\n {\r\n return $this->lastErrorMsg;\r\n }",
"public function publicErrorMessage()\n\t{\n\t\t$errorMsg = $this->getMessage().' is not a valid E-Mail address.';\n\t\treturn $errorMsg;\n\t}",
"public function getLastError()\n {\n return $this->_errorMsg;\n }",
"public function getRuleError()\n {\n if(!isset($this->rules_objects_list[$this->table_name]))\n return '';\n\n //current table rules object\n $l_target = $this->rules_objects_list[$this->table_name];\n\n if($l_target->rules_error_flag)\n return $l_target->rules_error_message;\n\n return '';\n }",
"public function getErrorMessage() {\n return curl_error($this->curl_handle);\n }",
"public function errorMessage()\n {\n return $this->provider->errorMessage;\n }",
"public function getErrorDesc()\n {\n return $this->errorDesc;\n }",
"function my_error($e = '') {\t\t\n\t\t$msg = $this->error->get_error_message($e);\t\t\n\t\tif ($msg == null) {\n\t\t\treturn __(\"Unknown error occured, please contact the administrator.\", $this->plugin_domain);\n\t\t}\n\t\treturn $msg;\n\t}",
"public function getLastError(): string\r\n {\r\n return $this->lastError;\r\n }",
"function get_error_msg()\n\t{\n\t\t//$this->error_no=curl_errno($this->ch);\n\t\techo \"Error: \" .curl_errno($this->ch) .\"\\n\";\n\t\techo \"Message3: \" .curl_error($this->ch).\"\\n\";\n\n\t\treturn $err;\n\t}"
] | [
"0.7943212",
"0.78881043",
"0.7876968",
"0.78735584",
"0.78591",
"0.7858627",
"0.769098",
"0.7674132",
"0.7671183",
"0.7671183",
"0.7671183",
"0.7652574",
"0.7652574",
"0.76233625",
"0.76000476",
"0.7548441",
"0.754332",
"0.75359213",
"0.75359213",
"0.75286734",
"0.7525346",
"0.7518235",
"0.7512427",
"0.750998",
"0.7508498",
"0.75020003",
"0.7477043",
"0.7477043",
"0.7469284",
"0.746804",
"0.7441018",
"0.7439708",
"0.74191767",
"0.74127716",
"0.74127716",
"0.7409612",
"0.73893905",
"0.7379524",
"0.73749655",
"0.73659927",
"0.734643",
"0.734643",
"0.7329299",
"0.7297476",
"0.72900826",
"0.7289738",
"0.72868353",
"0.7285902",
"0.7285003",
"0.72802836",
"0.72802836",
"0.72514385",
"0.72477144",
"0.72389287",
"0.7235582",
"0.72341925",
"0.7230466",
"0.7206149",
"0.7173268",
"0.71567255",
"0.7154923",
"0.7142669",
"0.71382195",
"0.71239066",
"0.7123487",
"0.71183413",
"0.7115875",
"0.7111241",
"0.7111241",
"0.7111241",
"0.7111241",
"0.7111241",
"0.7111241",
"0.7111241",
"0.7108022",
"0.70999163",
"0.7091977",
"0.7090291",
"0.7089183",
"0.7086112",
"0.7058057",
"0.7050167",
"0.7046107",
"0.70439607",
"0.704218",
"0.70349354",
"0.70219827",
"0.7008482",
"0.70038205",
"0.6998918",
"0.6996399",
"0.69961506",
"0.69928676",
"0.6987703",
"0.69798815",
"0.69761145",
"0.69667166",
"0.6964407",
"0.69633824",
"0.69602394",
"0.6946143"
] | 0.0 | -1 |
Get an addressed confirmation message | public function getAddressedConfirm(UserInterface $user, DestinationInterface $destination, string $command): string {
$bacon = $this->getRandom([
"{mention} you asked me to {command}. Ready?",
]);
$mention = $this->getUserReference($user);
return str_replace(['{mention}', '{command}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($command))], $bacon);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLocalizedConfirmMessage() {\n\t\treturn $this->_confirmMessageLocalized;\n\t}",
"public function getConfirmation() { return $this->confirmation; }",
"public function getConfirmationToken(): string\n {\n return $this->confirmationToken;\n }",
"public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}",
"function __confirm()\n {\n $postdata = 'Comando=validar&Token=' . $this->token;\n foreach($_POST as $key => $value) {\n $val = $this->__clearstr($value);\n $postdata.= \"&$key=$val\";\n }\n return $this->__getConfirmation($postdata);\n }",
"public function sendConfirm()\n {\n $newPackage = \"\";\n $client = $this->clientEntity;\n $client->writeByte($newPackage, ClientEntity::HEAD_MAIL_SENT);\n $client->writeByte($newPackage, 1);\n $client->writeLong($newPackage, $this->messageEntity->time);\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n }",
"protected function createConfirmString()\n {\n return md5(\\uniqid($this->getSubscriber()->getUid()));\n }",
"public function getConfirmationToken()\r\n {\r\n return $this->confirmation_token;\r\n }",
"public function sendConfirmEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->toEmail;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n //for testing\n $email->fromEmail = $emailSettings['emailAddress'];\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->confirmEmailSubject;\n\t\t$email->body = $this->template->confirmEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n\n }",
"public function getConfirmationToken()\n {\n return $this->confirmationToken;\n }",
"private function sendConfirmationMail() {\n\t\t\t\t$subject = 'Confirmation Mail';\n\t\t\t\t$from = '[email protected]';\n\t\t\t\t$replyTo = '[email protected]';\n\t\t\t\t\n\t\t\t\t//include some fancy stuff here, token is md5 of email\n\t\t\t\t$message = \"<a href='http://www.momeen.com/eCommerce/register/confirmUser.php?token=$this->token'> Confirm</a>\";\n\n\t\t\t\t$headers = \"From: \".\"$from\".\"\\r\\n\";\n\t\t\t\t$headers .= \"Reply-To: \".\"$replyTo\".\"\\r\\n\";\n\t\t\t\t$headers .= \"MIME-Version:1.0\\r\\n\";\n\t\t\t\t$headers .= \"Content-Type:text/html; charset=ISO-8859-1\\r\\n\";\n\t\t\t\tif(!mail($this->email, $subject, $message, $headers)) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Confirmation mail did not sent. Contact admin';\n\t\t\t\t}\n\t\t\t}",
"public function sendConfirmation()\n {\n $subject = _t(\n 'SilverShop\\ShopEmail.ConfirmationSubject',\n 'Order #{OrderNo} confirmation',\n '',\n ['OrderNo' => $this->order->Reference]\n );\n return $this->sendEmail(\n 'SilverShop/Model/Order_ConfirmationEmail',\n $subject,\n self::config()->bcc_confirmation_to_admin\n );\n }",
"public function confirmation($value) {\n return $this->setProperty('confirmation', $value);\n }",
"public function getConfirmUrl() {\n\t\treturn $this->getEmailActionLink('email/emailConfirm');\n\t}",
"function confirmation() {\r\n global $order;\r\n $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_NAME,\r\n 'field' => $_POST['authorizenet_echeck_bank_name']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ROUTING_CODE,\r\n 'field' => $_POST['authorizenet_echeck_bank_aba_code']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_TYPE,\r\n 'field' => $_POST['authorizenet_echeck_bank_acct_type']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_NUM,\r\n 'field' => $_POST['authorizenet_echeck_bank_acct_num']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHORIZATION_TITLE,\r\n 'field' => sprintf(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHORIZATION_NOTICE, strtolower(zen_db_prepare_input($_POST['authorizenet_echeck_bank_acct_type'])), zen_date_short(date(\"Y-m-d\")), $order->info['total']))\r\n ));\r\n return $confirmation;\r\n }",
"public function getJoinConfirm()\n {\n return $this->get(self::_JOIN_CONFIRM);\n }",
"abstract protected function getConfirmationSecret();",
"public function displayConfirmation($message)\n {\n $this->initializeTemplateMessages();\n $this->templateConfirms[] = $message;\n\n return ' ';\n }",
"private function getConfirmCode()\n {\n return md5(bin2hex(time()) . time());\n }",
"public function confirmMail($emailadd, $confirmationCode)\n {\n $message = \\Swift_Message::newInstance()\n ->setSubject('Welcome to CloudPod - A Virtual Learning Environment')\n ->setFrom('[email protected]')\n ->setTo($emailadd)\n ->setBody('Click on this link to activate your account <strong>http://localhost/CloudPod/web/app_dev.php/confirmation/'.$confirmationCode.'</strong>', 'text/html');;\n //->addPart('Click on this link to activate your account http://localhost/CloudPod/web/app_dev.php/confirmation/'.$confirmationCode,'text/plain');;\n $this->get('mailer')->send($message);\n\n return new Response('Congratulations! Pls. confirm your email. And start using CLOUDPOD!');\n }",
"public function getActivationMessage()\n {\n return $this->activation_message;\n }",
"function confirm()\n {\n return $this->__confirm();\n }",
"public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }",
"function jetpackcom_contact_confirmation() {\n if ( is_page( '16' ) ) {\n $conf = __( 'A special confirmation message for the form you added to page 16', 'plugin-textdomain' );\n } else {\n $conf = __( 'A generic confirmation message to display for all the other forms', 'plugin-textdomain' );\n }\n return $conf;\n}",
"public function getConfirmation()\n {\n return $this->readOneof(1);\n }",
"public static function get_confirmation_message( $confirmation, $form, $entry, $aux_data = array() ) {\n\t\t$ajax = isset( $_POST['gform_ajax'] );\n\t\t$anchor = self::get_anchor( $form, $ajax );\n\t\t$anchor = $anchor['tag'];\n\n\t\t$nl2br = rgar( $confirmation, 'disableAutoformat' ) ? false : true;\n\t\t$css_class = esc_attr( rgar( $form, 'cssClass' ) );\n\n\t\t$message = GFCommon::replace_variables( $confirmation['message'], $form, $entry, false, true, $nl2br, 'html', $aux_data );\n\t\t$message = self::maybe_sanitize_confirmation_message( $message );\n\t\t$message = empty( $confirmation['message'] ) ? \"{$anchor} \" : \"{$anchor}<div id='gform_confirmation_wrapper_{$form['id']}' class='gform_confirmation_wrapper {$css_class}'><div id='gform_confirmation_message_{$form['id']}' class='gform_confirmation_message_{$form['id']} gform_confirmation_message'>\" . $message . '</div></div>';\n\n\t\treturn $message;\n\t}",
"public function action_confirm()\n {\n $hash = $this->request->param('hash');\n\n $model_auth = new Model_Auth();\n\n $id = $model_auth->getUserIdByHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n if (!$id) {\n $error_text = 'Ваш аккаунт уже подтвержден';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $model_auth->deleteHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n $user = new Model_User($id);\n\n if (!$user->id) {\n $error_text = 'Переданы некорректные данные';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $user->updateUser($user->id, ['isConfirmed' => 1]);\n\n $this->redirect('/user/' . $id . '?confirmed=1');\n }",
"function _wp_privacy_account_request_confirmed_message($request_id)\n {\n }",
"public function displayOrderConfirmation()\n\t{\n\t\tif (Validate::isUnsignedId($this->id_order))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$order = new Order($this->id_order);\n\t\t\t$currency = new Currency($order->id_currency);\n\n\t\t\tif (Validate::isLoadedObject($order))\n\t\t\t{\n\t\t\t\t$params['total_to_pay'] = $order->getOrdersTotalPaid();\n\t\t\t\t$params['currency'] = $currency->sign;\n\t\t\t\t$params['objOrder'] = $order;\n\t\t\t\t$params['currencyObj'] = $currency;\n\n\t\t\t\treturn Hook::exec('displayOrderConfirmation', $params);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function qconfirm(&$irc, &$data)\n {\n\t\t\tglobal $pickupchannel;\n if($data->message == \"Remember: NO-ONE from QuakeNet will ever ask for your password. NEVER send your password to ANYONE except [email protected].\")\n {\n echo \"\\n\\n\\n\\nSHIIIT\\n\\n\\n\\n\";\n $irc->join($pickupchannel);\n }\n }",
"public function getConfirm($token)\n\t{\n\t\tUser::whereToken($token)->firstOrFail()->confirmEmail();\n\n\t\t\\Session::flash('success.message', \"Thank You. Your email is confirmed.\");\n\n\t\treturn redirect('user/settings');\n\t}",
"function ywraq_get_message_after_request_quote_sending( $new_order ) {\n\n\t\tif ( get_option( 'ywraq_activate_thank_you_page' ) == 'yes' ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$ywraq_message_after_sent_the_request = get_option( 'ywraq_message_after_sent_the_request' );\n\t\t$ywraq_message_to_view_details = get_option( 'ywraq_message_to_view_details' );\n\n\t\t$quote_number = apply_filters( 'ywraq_quote_number', $new_order );\n\t\tif ( is_user_logged_in() && ( get_option( 'ywraq_enable_link_details' ) == \"yes\" && get_option( 'ywraq_enable_order_creation', 'yes' ) == 'yes' ) ) {\n\t\t\t$message = sprintf( __( '%s %s <a href=\"%s\">#%s</a>', 'yith-woocommerce-request-a-quote' ), $ywraq_message_after_sent_the_request, $ywraq_message_to_view_details, YITH_YWRAQ_Order_Request()->get_view_order_url( $new_order ), $quote_number );\n\t\t} else {\n\t\t\t$message = $ywraq_message_after_sent_the_request;\n\t\t}\n\n\t\treturn $message;\n\t}",
"public function getNotifyMsg()\n {\n return $this->get(self::_NOTIFY_MSG);\n }",
"public function get_confirm($user_id=0, $confirmation_code=0) {\n \n // If not information was provider, show the confirmation form\n if($user_id==0) {\n return View::make('login.confirm'); \n } else {\n // Confirm the account\n $user = User::where('id', '=', $user_id)\n ->where('confirmation_code', '=', $confirmation_code)\n ->first();\n\n if(is_null($user)) {\n return View::make('login.confirm')->with('confirm_error', true);\n } else {\n // Confirmed\n $user->confirmed='Y';\n $user->confirmation_code=null;\n $user->save();\n\n $this->successes[] = \"Your account has been confirmed successfully.\";\n //Session::put('successes', serialize($this->successes));\n\n // if the user is not logged in it will be redirected to the login page.\n if (Auth::guest()) return Redirect::to('login')->with('successes', serialize($this->successes));\n\n return Redirect::to('dashboard'); \n }\n }\n \n }",
"private function cancelConfirmation()\n {\n Chat::$bot->editMessageText([\n 'text' => 'channel removing confirmation canceled',\n 'inline_message_id' => Chat::getCallBackQuery()->getInlineMessageId()\n ]);\n }",
"public static function get_message()\n\t{\n\t\treturn Session::instance()->get('alert');\n\t}",
"public function two_factor_confirm_email_method_strings() {\n\t\t/* translators: Do not translate the curly brackets or their contents, those are placeholders. */\n\t\t$message = esc_html__( 'Hi {{ $display_name }},\n\nClick the button to continue or manually enter the authentication code below to finish setting up Two-Factor.', 'it-l10n-ithemes-security-pro' );\n\n\t\t$desc = sprintf(\n\t\t\tesc_html__( 'The %1$sTwo-Factor Authentication%2$s module sends an email containing the Authentication Code for users when they are setting up Two-Factor. Try to keep the email similar to the Two Factor Email.', 'it-l10n-ithemes-security-pro' ),\n\t\t\t'<a href=\"#\" data-module-link=\"two-factor\">', '</a>'\n\t\t);\n\t\t$desc .= ' ' . esc_html__( 'Disabling this email will disable the Two-Factor Email Confirmation flow.', 'it-l10n-ithemes-security-pro' );\n\n\t\treturn array(\n\t\t\t'label' => esc_html__( 'Two-Factor Email Confirmation', 'it-l10n-ithemes-security-pro' ),\n\t\t\t'description' => $desc,\n\t\t\t'subject' => esc_html__( 'Login Authentication Code', 'it-l10n-ithemes-security-pro' ),\n\t\t\t'message' => $message,\n\t\t\t'tags' => array(\n\t\t\t\t'username' => esc_html__( \"The recipient's WordPress username.\", 'it-l10n-ithemes-security-pro' ),\n\t\t\t\t'display_name' => esc_html__( \"The recipient's WordPress display name.\", 'it-l10n-ithemes-security-pro' ),\n\t\t\t\t'site_title' => esc_html__( 'The WordPress Site Title. Can be changed under Settings -> General -> Site Title', 'it-l10n-ithemes-security-pro' ),\n\t\t\t)\n\t\t);\n\t}",
"function confirm($message = 'Are you sure?')\n{\n\t$CI\t=& get_instance();\n $CI->output->set_header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n $CI->output->set_header(\"Cache-Control: post-check=0, pre-check=0\", FALSE);\n $CI->output->set_header(\"Pragma: no-cache\");\n\t$segments = $CI->uri->segment_array();\n\t\n\tif( end($segments) != 'yes')\n\t{\n\t\t$referrer = $CI->input->server('HTTP_REFERER');\n\t\tif (empty($referrer))\n\t\t{\n\t\t\t// No user agent referrer, use the controller index\n\t\t\t$RTR =& load_class('Router');\n\t\t\t$referrer = $RTR->fetch_directory().$RTR->fetch_class();\n\t\t}\n\n\t\t$data['no_href']\t= $referrer;\n\t\t$data['yes_href']\t= implode('/', $segments).'/yes';\n\t\t$data['message']\t= $message;\n\t\t\t\t\n\t\techo $CI->template->display('content/confirmation', $data, 'general', TRUE);\n\t\texit;\n\t}\n}",
"public function getConfirmCancelTopic()\n {\n return view('teacher.confirmcancel', ['topics' => $this->topic->getTopicCancel()]);\n }",
"public function confirm($response_code, $message = null)\n {\n $message = $message ?: $this->getMessage($response_code);\n $this->setCode($response_code);\n\n return $this->sendResponse([\n 'message' => $message,\n 'code' => $response_code\n ]);\n }",
"function confirmation() {\n\t\n\n\n}",
"public function getConfirmHtml() {\n\t\treturn '<input type=\"hidden\" name=\"g-recaptcha-response\" id=\"g-recaptcha-response\" value=\"' . HtmlEncode($this->Response) . '\">';\n\t}",
"public function emailConfirmation() {\n try {\n return $this->getEmailVerificationUtils()->verifyConfirmationRequest();\n } catch (\\Illuminate\\Database\\QueryException $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n } catch (\\Exception $ex) {\n return $this->getExceptionUtils()->storeException($ex);\n }\n }",
"public function getConfirmExtendTopic()\n {\n return view('teacher.confirmextend', ['topics' => $this->topic->getExtendTopic()]);\n }",
"public function getConfirm( $code )\n {\n if ( Confide::confirm( $code ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.confirmation');\n return Redirect::to('user/login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_confirmation');\n return Redirect::to('user/login')\n ->with( 'error', $error_msg );\n }\n }",
"public function message()\n {\n return 'La cuenta debe contar con al menos ' . $this->monto_permitido . ' Bs';\n }",
"public function getConfirmationStatus()\n {\n return $this->confirmation_status;\n }",
"public function message()\n {\n return 'Endereço de email já cadastrado para essa lista.';\n }",
"public function getConfirmPassword()\n {\n return $this->confirmPassword;\n }",
"public function getPasswordConfirmation()\n {\n return $this->passwordConfirmation;\n }",
"public function isConfirmed()\n {\n return $this->confirmation;\n }",
"public function message()\n {\n return 'Ya existe una susbcripción con el identificador de la venta';\n }",
"protected function confirmEmailToken( $code ) {\n\t\tglobal $wgConfirmAccountContact, $wgPasswordSender;\n\n\t\t$reqUser = $this->getUser();\n\t\t$out = $this->getOutput();\n\t\t# Confirm if this token is in the pending requests\n\t\t$name = ConfirmAccount::requestNameFromEmailToken( $code );\n\t\tif ( $name !== false ) {\n\t\t\t# Send confirmation email to prospective user\n\t\t\tConfirmAccount::confirmEmail( $name );\n\n\t\t\t$adminsNotify = ConfirmAccount::getAdminsToNotify();\n\t\t\t# Send an email to admin after email has been confirmed\n\t\t\tif ( $adminsNotify->count() || $wgConfirmAccountContact != '' ) {\n\t\t\t\t$title = SpecialPage::getTitleFor( 'ConfirmAccounts' );\n\t\t\t\t$subject = $this->msg(\n\t\t\t\t\t'requestaccount-email-subj-admin' )->inContentLanguage()->escaped();\n\t\t\t\t$body = $this->msg(\n\t\t\t\t\t'requestaccount-email-body-admin', $name )->params(\n\t\t\t\t\t\t$title->getCanonicalURL() )->inContentLanguage()->text();\n\t\t\t\t# Actually send the email...\n\t\t\t\tif ( $wgConfirmAccountContact != '' ) {\n\t\t\t\t\t$source = new MailAddress( $wgPasswordSender, wfMessage( 'emailsender' )->text() );\n\t\t\t\t\t$target = new MailAddress( $wgConfirmAccountContact );\n\t\t\t\t\t$result = UserMailer::send( $target, $source, $subject, $body );\n\t\t\t\t\tif ( !$result->isOK() ) {\n\t\t\t\t\t\twfDebug( \"Could not sent email to admin at $target\\n\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t# Send an email to all users with \"confirmaccount-notify\" rights\n\t\t\t\tforeach ( $adminsNotify as $adminNotify ) {\n\t\t\t\t\tif ( $adminNotify->canReceiveEmail() ) {\n\t\t\t\t\t\t$adminNotify->sendMail( $subject, $body );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$out->addWikiMsg( 'requestaccount-econf' );\n\t\t\t$out->returnToMain();\n\t\t} else {\n\t\t\t# Maybe the user confirmed after account was created...\n\t\t\t$user = User::newFromConfirmationCode( $code, User::READ_LATEST );\n\t\t\tif ( is_object( $user ) ) {\n\t\t\t\t$user->confirmEmail();\n\t\t\t\t$user->saveSettings();\n\t\t\t\t$message = $reqUser->isLoggedIn()\n\t\t\t\t\t? 'confirmemail_loggedin'\n\t\t\t\t\t: 'confirmemail_success';\n\t\t\t\t$out->addWikiMsg( $message );\n\t\t\t\tif ( !$reqUser->isLoggedIn() ) {\n\t\t\t\t\t$title = SpecialPage::getTitleFor( 'Userlogin' );\n\t\t\t\t\t$out->returnToMain( true, $title );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$out->addWikiMsg( 'confirmemail_invalid' );\n\t\t\t}\n\t\t}\n\t}",
"public static function getAcceptanceMessagePart1() { self::checkInit(); return self::$acceptanceMessagePart1; }",
"function confirm()\n\t\t{\n\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\treturn $this->Gateway->confirm($this);\n\t\t\t}\n\t\t}",
"public function getQuestion(): TranslatableMarkup {\n return $this->t(\"Are you sure\");\n }",
"public function getCancelledMessage(){\n \treturn $this->canc_message;\n }",
"public function getQuestion() {\n return $this->t('Are you sure you want to reset tfa?');\n }",
"function format_button_confirm($p_text, $p_action, $p_args, $p_msg, $p_msg_class = '', $p_icon = ''){\n\t$t_r = '';\n\n\t$t_args['confirm_btn'] = $p_text;\n\t$t_args['confirm_redirect'] = $p_action;\n\t$t_args['confirm_arg_keys'] = implode('|', array_keys($p_args));\n\t$t_args['confirm_arg_values'] = implode('|', array_values($p_args));\n\t$t_args['confirm_msg'] = $p_msg;\n\t$t_args['confirm_msg_class'] = $p_msg_class;\n\n\tif($p_icon != '')\n\t\t$t_r .= format_link($p_icon, helper_mantis_url('confirm.php'), $t_args, 'inline-page-link');\n\telse\n\t\t$t_r .= format_button_link($p_text, helper_mantis_url('confirm.php'), $t_args, 'inline-page-link');\n\n\treturn $t_r;\n}",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getConfirmationStatus() {\n return $this->confirmationStatus;\n }",
"public function generateConfirmationCode()\n {\n return h(str_random(30));\n }",
"static function confirm_account_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n $code = confirm_account_email($user->email);\n\n if ($code === -1) {\n flash('Sua conta já está confirmada, basta acessá-la.', 'warning');\n } else if ($code == true)\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você confirmar sua conta.\");\n else\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }",
"private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyName . self::$timeStamp, true);\n break;\n case 'payNote':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$PspTxnId . self::$MsTxnId . self::$timeStamp . self::$Result, true);\n break;\n }\n }",
"public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }",
"public function resendConfirmationMailAction()\n {\n // @todo find a better way to fetch the data\n $result = GeneralUtility::_GP('tx_femanager_pi1');\n if (is_array($result)) {\n if (GeneralUtility::validEmail($result['user']['email'])) {\n $user = $this->userRepository->findFirstByEmail($result['user']['email']);\n if (is_a($user, User::class)) {\n $this->sendCreateUserConfirmationMail($user);\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailSend'),\n '',\n AbstractMessage::INFO\n );\n $this->redirect('resendConfirmationDialogue');\n }\n }\n }\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailFail'),\n LocalizationUtility::translate('validationError'),\n AbstractMessage::ERROR\n );\n $this->redirect('resendConfirmationDialogue');\n }",
"public function messages()\n {\n return [\n 'confirmation_code.exists' => 'Your confirmation code has expired or is incorrect. Please request a new one to be sent.'\n ];\n }",
"public function actionAccept($confirmation) {\n\n\t\tUser::confirmEmail($confirmation);\n\t}",
"abstract public function get_message();",
"public static function label()\n {\n return __('Confirmations');\n }",
"public function confirmOrder()\n {\n $order = Order::query()->findOrFail(request()->input('order'));\n\n if ($order->orderStatus->slug !== OrderStatus::PROCESSED) {\n return redirect()->back();\n }\n\n $order->delivery_tracking = request()->input('delivery_tracking');\n\n $order->setStatusSent();\n\n $order->save();\n\n $order->user->notify(new OrderSent($order));\n\n return redirect(backpack_url('order?status=2')) //http://lucilevilaine.local/admin/order?status=2\n ->with('success', 'La commande a bien été confirmé');\n }",
"public function confirmation($confirmationCode){\n\n $authUser = User::where('confirmation_code', $confirmationCode)->firstOrFail();\n\n return view('account_confirmation', compact(['authUser']));\n\n }",
"public function getConfirmRegisterTopic()\n {\n return view('teacher.confirmregister', ['topics' => $this->topic->getTopicStudent()]);\n }",
"function getConfirmPassword() {\n\t$COMMON = new Common($debug);\n\n\t$sql = \"SELECT * FROM `Proj2Advisors` WHERE `New` = 'true'\";\n \t$rs = $COMMON->executeQuery($sql, \"Advising Appointments\");\n \t$row = mysql_fetch_row($rs);\n\n\treturn $row[5];\n}",
"public function confirm($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\confirm)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('confirm', $this->make_soap_params($mixed));\n\t}",
"protected function confirm_add()\n\t{\n\t\t$msg = 'Successfully added Booth ' . $this->fields['BoothNum'];\n\t\treturn '<font color = green>' . $msg . '</font><br>';\n\n\t}",
"public function getMessage() {\n\t\treturn preg_replace('%(\\r\\n|\\r|\\n)%', self::$crlf, $this->message . (MAIL_SIGNATURE ? self::$crlf . self::$crlf . MAIL_SIGNATURE : ''));\n\t}",
"public function getActiveConfirmMode()\n {\n return $this->customerSession->getQuoteConfirmation();\n }",
"public function accountConfirm(User $user)\n {\n $content = $this->renderContent(__FUNCTION__, ['model' => $user]);\n $contentPlain = $this->renderContent(__FUNCTION__, ['model' => $user], true);\n\n $from = $this->getFrom();\n $to = $this->getTo($user);\n\n return $this->sendMessage($from, $to, $content, $contentPlain, 'Confirm your account');\n }",
"public function sendConfirmation( ){\n\t\t$data = Request::only(['email']);\n\t\t$email = $data['email'];\n\t\t$token = str_random(30);\n\t\t$domain = substr(strrchr($email, \"@\"), 1);\n\n\t\tif( in_array( $domain, explode( ',', env('ACCEPTABLE_EMAIL_DOMAINS') ) ) ){\n\t\t\ttry {\n\t\t\t\t// Check if student exists already\n\t\t\t\tUser::where('email', $email)->firstOrFail();\n\n\t\t\t} catch (ModelNotFoundException $e) {\n\t\t\t\t// Send email verification if they are\n\t\t\t\tMail::send('emails.verification_code', ['email' => $email, 'confirmation_code' => $token], function ($m) use($email) {\n\t\t $m->from('admin@'.env('USER_DOMAIN'), env('SITE_TITLE') );\n\n\t\t $m->to($email)->subject('Verify Your Email For '.env('SITE_TITLE'));\n\t\t });\n\n\t\t VerificationCode::create([\n\t\t \t'email' => $email,\n\t\t \t'confirmation_code' => $token\n\t\t ]);\n\n\t\t return View::make('emails.thank_you');\n\t\t\t}\n\t\t} else{\n\t\t\treturn Redirect::back()->withErrors(['That email is not on our approved list of student emails']);\n\t\t}\n\t}",
"public function actionConfirm(){\n if($this->confirm('Yakin loe..??'))\n echo \"Ok deh kaka..\";\n else\n echo \"Ga yakin diee..:p\";\n }",
"public function message()\n { \n //Se falso retornar mensagem para o usuário\n return 'O cliente deve ser maior de 18 anos.';\n }",
"protected function getConfirmEmailUrl()\n {\n $hash = base64_encode($this->user->password_hash);\n $email = $this->person->email;\n $baseUrl = NotificationUtil::getApplicationBaseUrl();\n $confirmEmailUrl = $baseUrl . $this->getValidateUrl() . '?hash=' . $hash . '&email=' . $email;\n return $confirmEmailUrl;\n }",
"public function generateEmailConfirmToken()\n {\n $this->email_confirm_token = Yii::$app->security->generateRandomString();\n }",
"public function confirmationPayment()\n {\n $response = $this->client->request($this->methods['post'], \"payment_gateway_api/confirm_payment\", [\n 'json' => [\n 'AGR_TRANS_ID' => $this->agr_trans_id,\n 'VERIFICATION_CODE' => $this->verification_code,\n 'SIGN_TIME' => $this->generateSignTime(),\n 'SIGN_STRING' => md5($this->SECRET_KEY. $this->agr_trans_id.$this->verification_code. $this->sign_time)\n ]\n ]);\n\n return json_decode($response->getBody());\n }",
"public function confirmOrder()\n {\n $requestData = array();\n\t\tif (!is_null($this->eshopDataProvider)) {\n $requestData = $this->eshopDataProvider->collectConfirmData();\n }\n\n\t\t$orderTransactionName = 'pm_order_transaction_id' . $requestData['paymentMethod_name'];\n\n $this->pmClient->setEndPoint($this->endPointUrl . 'confirmOrder');\n $responseData = $this->pmClient->sendRequest($requestData);\n\n\t\tif ($this->isResponseDeclined($responseData)) {\n\t\t\tif (isset($_SESSION[$orderTransactionName])) {\n\t\t\t\tunset($_SESSION[$orderTransactionName]);\n\t\t\t}\n\t\t}\n\t\t\n if (!is_null($this->responseHandler)) {\n if ($this->isResponseOK($responseData)) {\n $this->responseHandler->handleConfirmOrderResponseOK($responseData);\n } else {\n $this->responseHandler->handleConfirmOrderResponseError($responseData);\n }\n }\n\n return $responseData;\n }",
"protected function promptMessage($index) {\n return $this->_prompts[$index];\n }",
"public function confirmAction()\n {\n try {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n $hash = $this->getRequest()->getParam('hash');\n $this->loadValidOrder($orderId, $hash);\n\n //Load and render basic layout\n $this->loadLayout();\n\n // set page title\n $title = $this->getLayout()->getBlock('dhlonlineretoure_customer_address_edit')->getTitle();\n $this->getLayout()->getBlock('head')->setTitle($this->__($title));\n\n // set current navigation entry\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('sales/order/history');\n }\n\n $this->renderLayout();\n } catch (Exception $e) {\n //Show error message to user\n Mage::getSingleton('core/session')->addError($e->getMessage());\n Mage::helper(\"dhlonlineretoure/data\")->log($e->getMessage());\n\n $this->_redirect('*/*/error');\n }\n }"
] | [
"0.6675702",
"0.6650465",
"0.65302044",
"0.6478664",
"0.64228815",
"0.6389416",
"0.63164335",
"0.62710524",
"0.62657464",
"0.62526095",
"0.6247272",
"0.6245209",
"0.6219021",
"0.61852574",
"0.61729825",
"0.6163508",
"0.6163126",
"0.61368823",
"0.6094315",
"0.60893285",
"0.6071356",
"0.6055603",
"0.6053899",
"0.6033872",
"0.601677",
"0.6006352",
"0.59833",
"0.59508026",
"0.5926525",
"0.5922297",
"0.59165466",
"0.59143656",
"0.5889506",
"0.5887834",
"0.58659166",
"0.5851879",
"0.58297145",
"0.5803743",
"0.5798658",
"0.57902646",
"0.5786077",
"0.5769305",
"0.5766838",
"0.57506394",
"0.5721543",
"0.571335",
"0.5713189",
"0.57048947",
"0.56927437",
"0.56603587",
"0.5658481",
"0.564193",
"0.5631408",
"0.5627759",
"0.56257534",
"0.56174046",
"0.56160754",
"0.5609102",
"0.5607203",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.5607174",
"0.56016827",
"0.5599694",
"0.5599615",
"0.55849636",
"0.5579878",
"0.55789655",
"0.5561439",
"0.5555427",
"0.55305034",
"0.55292964",
"0.5525719",
"0.55241215",
"0.55207866",
"0.55131036",
"0.55053514",
"0.5504157",
"0.55015904",
"0.549964",
"0.5499048",
"0.54988456",
"0.54872316",
"0.5483201",
"0.54806405",
"0.5479425",
"0.5473649",
"0.5469028",
"0.5467533",
"0.5464534"
] | 0.56446844 | 51 |
Get an addressed acknowledge message | public function getAddressedAcknowledge(UserInterface $user, DestinationInterface $destination, string $message): string {
$bacon = $this->getRandom([
"Ok {mention}, {message}.",
"No problem {mention}, {message}.",
"You got it {mention}, {message}.",
"Sure thing {mention}, {message}.",
]);
$mention = $this->getUserReference($user);
return str_replace(['{mention}', '{message}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($message))], $bacon);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAck()\n\t{\n\t\treturn $this->ack;\n\t}",
"public function buildAck(): ?string\n\t{\n\t\tif(!is_numeric($this->iPktType)){\n\t\t\treturn null;\n\t\t}\n\t\t$sPtk = NULL;\n\t\tif($this->aTypeMap[$this->iPktType]=='Unicast'){\n\t\t\t//Set the type as Ack\n\t\t\t$sPtk = pack('C',3);\n\t\t\t//Port 0\n\t\t\t$sPtk = $sPtk.pack('C',0);\n\t\t\t//Flag 0\n\t\t\t$sPtk = $sPtk.pack('C',0);\n\t\t\t//Retrans 0\n\t\t\t$sPtk = $sPtk.pack('C',0);\n\t\t\t//Sequence\n\t\t\t$sPtk = $sPtk.pack('V',$this->iSeq);\n\t\t}\n\t\tif($this->aTypeMap[$this->iPktType]=='Immediate' AND $this->iCb==8){\n\t\t\t//Echo request equiv\n\n\t\t\t//Set the type as Immediate reply\n\t\t\t$sPtk = pack('C',6);\n\t\t\t//Port 0\n\t\t\t$sPtk = $sPtk.pack('C',0);\n\t\t\t//Flag 0\n\t\t\t$sPtk = $sPtk.pack('C',0);\n\t\t\t//Retrans 0\n\t\t\t$sPtk = $sPtk.pack('C',0);\n\t\t\t//Sequence\n\t\t\t$sPtk = $sPtk.pack('V',0);\n\t\t\t//Peek Lo\n\t\t\t$sPtk = $sPtk.pack('C',0x40);\n\t\t\t//Peek Hi\n\t\t\t$sPtk = $sPtk.pack('C',0x66);\n\t\t\t$sPtk = $sPtk.pack('C',config::getValue('version_minor'));\n\t\t\t$sPtk = $sPtk.pack('C',config::getValue('version_majour'));\n\t\t}\n\t\treturn $sPtk;\n\n\t}",
"static function acknowledgeMessage(AMQPMessage $message)\n\t{\n\t\t$message->delivery_info['channel']->basic_ack($message->delivery_info['delivery_tag']);\n\t}",
"public function print_ack() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n //modified on 27/11/2014\n $data['meta_data'] = $this->meta_data;\n return generate_acknowledgment($data);\n }",
"public function acknowledge()\n {\n if ($this->acknowledged)\n return;\n if ($this->wantsRetry) {\n $this->log->info(\"Ignoring message acknowledge for retry {$this->message->id()}\");\n return;\n }\n $this->subscription->acknowledge($this->message);\n $this->acknowledged = true;\n $this->log->info(\"Acknowledged message {$this->message->id()}\");\n }",
"function SendNotificationAcknowledgment() {\n $acknowledgment = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" .\n \"<notification-acknowledgment xmlns=\\\"\" .\n $GLOBALS[\"schema_url\"] . \"\\\"/>\";\n\n echo $acknowledgment;\n\n // Log <notification-acknowledgment>\n LogMessage($GLOBALS[\"logfile\"], $acknowledgment);\n}",
"public function getAckLevel()\n {\n return $this->ack_level;\n }",
"public function ack(Message $message);",
"public function sendAcknowledged();",
"public function acknowledge(Message $message): void;",
"public function doEarlyAckResponse() {\n if ( $_SERVER['REQUEST_METHOD'] == 'GET' ) {\n die('This endpoint is for Midtrans notification URL (HTTP POST). This message will be shown if opened using browser (HTTP GET). You can copy this current URL on your browser address bar and paste it to: \"Midtrans Dashboard > Settings > Configuration > Notification Url\". This will allow your WooCommerce to receive Midtrans payment status, which will auto sync the payment status.');\n exit();\n }\n\n ob_start();\n $input_source = \"php://input\";\n $raw_notification = json_decode(file_get_contents($input_source), true);\n echo esc_html(\"Notification Received: \\n\");\n print_r($raw_notification);\n WC_Midtrans_Logger::log( print_r($raw_notification, true), 'midtrans-notif' );\n header('Connection: close');\n header('Content-Length: '.ob_get_length());\n ob_end_flush();\n ob_flush();\n flush();\n return $raw_notification;\n }",
"abstract public function getFullMessage($msgNo);",
"public function getExcavateReply()\n {\n return $this->get(self::_EXCAVATE_REPLY);\n }",
"public function getNotifyMsg()\n {\n return $this->get(self::_NOTIFY_MSG);\n }",
"public function acknowledge(array $messages);",
"public function acknowledge(): bool\n\t{\n\t\t$this->acknowledged_at = Carbon::now();\n\n\t\treturn $this->save();\n\t}",
"public function acknowledgeOrder($orderId)\n {\n return $this->_getOrderManagementApi()->acknowledgeOrder($orderId);\n }",
"private function get_message()\n {\n switch (self::$requestType) {\n case 'payRequest':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$MsTxnId . self::$firstName . self::$familyName . self::$timeStamp, true);\n break;\n case 'payNote':\n self::$msg = sha1(self::$mid . self::$amount . self::$cac . self::$PspTxnId . self::$MsTxnId . self::$timeStamp . self::$Result, true);\n break;\n }\n }",
"public function getMsgref() : string\n {\n return $this->msgref;\n }",
"public function acknowledge(string $id): void;",
"public function getChargeReply()\n {\n return $this->get(self::_CHARGE_REPLY);\n }",
"public function getResponseMessage();",
"private function postCacheAcknowledge($auth, $ack, $message) {\n\t\t$this->uplink->open($auth);\n\t\t$resp = $this->uplink->postAcknowledge($ack, $message);\n\t\t$this->uplink->close();\n\t\treturn $resp;\n\t}",
"public function fakeAck(Message $msg): void\n {\n $this->handlePublisherConfirm($msg, Signal::ACK());\n }",
"private function fetchMessage(): ?Envelope\n {\n $deliveryId = $this->codec->encodeBinary(Uuid::uuid4());\n $result = $this->select\n ->setParameter('delayedUntil', new DateTimeImmutable(), Types::DATETIMETZ_IMMUTABLE)\n ->executeQuery()\n ->fetchAssociative();\n\n if (! $result) {\n return null;\n }\n\n $id = $result['id'];\n if (is_resource($id)) {\n $id = stream_get_contents($id);\n }\n\n $this->update\n ->setParameter('deliveryId', $deliveryId, ParameterType::BINARY)\n ->setParameter('redeliverAfter', new DateTimeImmutable('+5 minutes'), Types::DATETIMETZ_IMMUTABLE)\n ->setParameter('messageId', $id, ParameterType::BINARY);\n\n if ($this->update->executeStatement()) {\n /** @phpstan-var array{body: string, headers: string, id: string|resource, time_to_live: string}|false $deliveredMessage */\n $deliveredMessage = $this->connection->createQueryBuilder()\n ->select('body', 'headers', 'id', 'time_to_live')\n ->from($this->tableName)\n ->andWhere('delivery_id = :deliveryId')\n ->setParameter('deliveryId', $deliveryId, ParameterType::BINARY)\n ->setMaxResults(1)\n ->executeQuery()\n ->fetchAssociative();\n\n // the message has been removed by a 3rd party, such as truncate operation.\n if ($deliveredMessage === false) {\n return null;\n }\n\n if (\n empty($deliveredMessage['time_to_live']) ||\n new DateTimeImmutable($deliveredMessage['time_to_live']) > new DateTimeImmutable()\n ) {\n return $this->hydrate($deliveredMessage);\n }\n }\n\n return null;\n }",
"abstract public function get_message();",
"public function getInboundMessage();",
"public function getShopConsumeReply()\n {\n return $this->get(self::_SHOP_CONSUME_REPLY);\n }",
"public function fetchMessage()\n {\n if ($this->socket === null) {\n $this->socket = stream_socket_server(static::buildFullAddress($this->address));\n }\n return @stream_socket_accept($this->socket);\n }",
"public function getClearExcavateBattleReply()\n {\n return $this->get(self::_CLEAR_EXCAVATE_BATTLE_REPLY);\n }",
"public function acknowledgeAlert(int $alertID): bool;",
"public function nack(Message $message, $requeue = true);",
"public function sendAcknowledgment($request_type) {\n if (isset($request_type)) {\n $content = NULL;\n switch ($request_type) {\n case 1: ///accept/acknowledge bill payments/data from gepg\n $content = \"<gepgPmtSpInfoAck><TrxStsCode>7201</TrxStsCode> </gepgPmtSpInfoAck>\";\n\n break;\n case 2://accept/acknowledge bill controll number details/data from gepg\n $content = \"<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>\";\n\n break;\n\n case 3://accept/acknowledge reconciliation request/data from gepg\n $content = \"<gepgSpReconcRespAck><ReconcStsCode>7101</ReconcStsCode></gepgSpReconcRespAck>\";\n\n break;\n }\n if ($content) {\n $signature = $this->generateSignature($content);\n\n $response = \"<Gepg>\" . $content . \"<gepgSignature>\" . $signature . \"</gepgSignature></Gepg>\";\n echo $response;\n }\n }\n }",
"public function getQueryExcavateDefReply()\n {\n return $this->get(self::_QUERY_EXCAVATE_DEF_REPLY);\n }",
"function getStatusMessage() \r\n\t{\r\n\t\treturn $this->replyString;\r\n\t}",
"public function getConsumerMessage()\n {\n return $this->singleValue('//i:consumerMessage');\n }",
"function ack ($message, $transactionId = null)\n {\n if ( $message instanceOf StompFrame )\n {\n $this->writeFrame(new StompFrame('ACK', $message->headers));\n } else\n {\n $headers = array();\n if ( isset($transactionId) )\n {\n $headers['transaction'] = $transactionId;\n }\n $headers['message-id'] = $message;\n $this->writeFrame(new StompFrame('ACK', $headers));\n }\n }",
"public function receiveNoWait()\n {\n if ($this->currentEnvelope) {\n throw new \\RuntimeException(\n 'AmqpQueueDriver: This driver has a message that was not acknowledged yet. A message must be processed and acknowledged before receiving new messages.'\n );\n }\n\n $this->dequeueingTimeMs = 0;\n\n $this->currentEnvelope = $this->queue->get();\n\n $msg = null;\n\n if (!$this->currentEnvelope) {\n return null;\n }\n\n $start = microtime(true);\n $deserializationContext = new DeserializationContext();\n\n try{\n /** @var QueueMessageInterface $msg */\n $msg = $this->getSerializer()->deserialize($this->currentEnvelope->getBody(), SerializableInterface::class, $this->format, $deserializationContext);\n } catch (\\Exception $exception) {\n $this->getExceptionHandler()($exception, ['headers' => $this->currentEnvelope->getHeaders(), 'body' => $this->currentEnvelope->getBody()]);\n $this->ack();\n return null;\n }\n foreach ($this->currentEnvelope->getHeaders() as $header => $value) {\n $msg->setHeader($header, $value);\n }\n\n // Calculate how long it took to deserilize the message\n $this->dequeueingTimeMs = (int) ((microtime(true) - $start) * 1000);\n\n return $msg;\n }",
"public function getReadMailReply()\n {\n return $this->get(self::_READ_MAIL_REPLY);\n }",
"function extract_acknowledge(&$output, $testmode = false) {\n\n $changed = false;\n if ($this->lastextract) {\n if (!empty($this->parms->ackquery)) {\n $extractname = 'lastextract_'.$this->parms->ackquery;\n $this->$extractname = $this->lastextract;\n } else {\n etl_error(\"Not a valid boardzmoodle query to acknowledge\");\n die;\n }\n $this->lastextract = 0;\n $changed = true;\n }\n $this->save_config();\n\n if ($testmode == 'test') {\n } else {\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\";\n echo \"<acknowledge>\\n\";\n if ($changed){\n echo \"\\t<lastextract>{$this->lastextract}</lastextract>\\n\";\n } else { \n echo \"\\t<nochange>{$this->lastextract}</nochange>\\n\";\n }\n echo \"</acknowledge>\\n\";\n }\n // TODO : organize purge of yet unnecessary logs\n }",
"public function getConsumeItemReply()\n {\n return $this->get(self::_CONSUME_ITEM_REPLY);\n }",
"public function serverAck()\n {\n $this->revision += 1;\n $this->state = $this->state->serverAck($this);\n }",
"public function findAcknowledgements(int $hostId, int $serviceId): array;",
"public function setModeAck( ){\n\t\t\n\t\t$info = array(\n\t\t\t'username' => 'unkown',\n\t\t\t'realName' => 'unkown',\n\t\t\t'email' => 'unkown'\n\t\t);\n\t\t\n\t\tif ( TYPO3_MODE==\"BE\" ){\n\t\t\t$info['username'] = $GLOBALS['BE_USER']->user['username'];\n\t\t\t$info['realName'] = $GLOBALS['BE_USER']->user['realName'];\n\t\t\t$info['email'] = $GLOBALS['BE_USER']->user['email'];\n\t\t}\n\n\t\t$resultRepository = tx_caretaker_TestResultRepository::getInstance();\n\t\t$latestTestResult = $resultRepository->getLatestByNode( $this );\n\t\t\n\t\t$message = new tx_caretaker_ResultMessage( 'LLL:EXT:caretaker/locallang_fe.xml:message_ack', $info );\n\t\t$result = tx_caretaker_TestResult::create( tx_caretaker_Constants::state_ack, 0 , $message );\n\t\t$resultRepository->saveTestResultForNode( $this, $result );\n\t\t\n\t\t$this->notify( 'updatedTestResult', $result, $latestTestResult );\n\t\t\n\t\treturn $result;\n\t}",
"public function get_resend_cc()\n\t{\n\t\treturn $this->resend_cc_array;\n\t}",
"public function getAutoReplyMessage()\n {\n return $this->autoReplyMessage;\n }",
"public function getMessageId();",
"public function getMessageId();",
"public function getMessageId();",
"public function getMessageId();",
"function msg_get($umd=NULL){\n $keys = is_null($umd)?$this->domain_seq:(array)$umd;\n $res = array();\n foreach($keys as $ck) $res[$ck] = $this->domains[$ck]->msg_get();\n return is_array($umd)?$res:array_shift($res);\n }",
"function getDateAcknowledged() {\n\t\treturn $this->getData('dateAcknowledged');\n\t}",
"function send_message($serial, $instruction, $addrh, $addrl, $data1, $data2, $text)\r\n{\r\n\tusleep(COMM_WAIT_BETWEEN_MESSAGES);\r\n\r\n\t$sum = ($instruction + $addrh + $addrl + $data1 + $data2) & 255;\r\n\t$message = pack(\"CCCCCCC\", $instruction, $addrh, $addrl, $data1, $data2, $sum, 13);\r\n\t$try = 0;\r\n\t$result = -1;\r\n\tdo\r\n\t{\r\n\t//\tprint($text);\r\n\t\t\r\n\t\t$serial->sendMessage($message);\r\n\t\t\r\n\t\tusleep(COMM_WAIT_RESPONSE_DELAY);\r\n\t\t\r\n\t\t$read = $serial->readPort(7);\r\n\t\t\r\n\t\tif (strlen($read) == 7)\r\n\t\t{\r\n\t\t\t$data = unpack(\"C*\", $read);\t// first item has index 1 !!!\r\n\t\t\t\r\n\t\t\tif ($data[3] == 0x99 and $data[4] == 0x99 and $data[5] == 0x99)\r\n\t\t\t{\r\n//\t\t\t\tprint(\"No data available\");\r\n\t\t\t\t$result = -2;\r\n\t\t\t}\r\n\t\t\telse if ($data[1] == 0x00 and $data[2] == 0x00 and $data[3] == 0x00 and $data[4] == 0x00 and $data[5] == 0x00)\r\n\t\t\t{\r\n//\t\t\t\tprint(\"Unit busy\");\r\n\t\t\t\t$result = -3;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$result = ($data[3] << 16) + ($data[4] << 8) + $data[5];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($result < 0 and ++$try < COMM_NR_OF_RETRIES)\r\n\t\t{\t// retry\r\n\t\t\tusleep(COMM_RETRY_DELAY);\r\n\t\t}\r\n\t} while ($result < 0 and $try < COMM_NR_OF_RETRIES);\r\n\t\r\n\treturn $result;\r\n}",
"public function getMessage()\n {\n return $this->_transport->getMessage();\n }",
"public function getInReplyTo() {}",
"public function receiveNoWait(): ?Message;",
"public function receive()\n {\n $messages = array();\n\n if (apcu_exists($this->key)) {\n $messages = apcu_fetch($this->key);\n apcu_delete($this->key);\n }\n\n return $messages;\n }",
"function respond($tf)\n{\n\n print '<?xml version = \"1.0\" encoding = \"utf-8\"?>\n <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <notifications xmlns=\"http://soap.sforce.com/2005/09/outbound\">\n <Ack>' . $tf . '</Ack>\n </notifications>\n </soapenv:Body>\n </soapenv:Envelope>';\n}",
"public function getActivationMessage()\n {\n return $this->activation_message;\n }",
"public function fetchMessageFromQueue()\n {\n $whereParams = [\n 'status' => 'PENDING',\n ];\n $orderBy = 'attempts';\n return $this->db->first($this->table, $whereParams, $orderBy);\n\n }",
"public function getMessageId() {\n\treturn ($this->messageId);\n}",
"public function getWithdrawExcavateHeroReply()\n {\n return $this->get(self::_WITHDRAW_EXCAVATE_HERO_REPLY);\n }",
"public function getMessageId()\n {\n }",
"public function get_reference()\n\t{\n\t\treturn $this->user->lang(\n\t\t\t'NOTIFICATION_REFERENCE',\n\t\t\t$this->get_data('message_subject')\n\t\t);\n\t}",
"public function getConsultReply()\n {\n return $this->consult_reply;\n }",
"private function getMsg()\n {\n return $this->msg;\n }",
"public function hasMessageId(){\n return $this->_has(3);\n }",
"public function acknowledgement()\n {\n add_settings_field(\n 'acknowledgement',\n apply_filters($this->plugin_name . 'label-acknowledgement',\n esc_html__('Acknowledgement', $this->plugin_name)),\n [$this->builder, 'text'],\n $this->plugin_name,\n $this->plugin_name . '-directives',\n [\n 'description' => 'Your acknowledgements URL. (Optional)',\n 'id' => 'acknowledgement',\n 'class' => 'text widefat hide-when-disabled',\n 'value' => isset($this->options['acknowledgement']) ? $this->options['acknowledgement'] : false,\n 'placeholder' => get_site_url() . '/security-hall-of-fame/',\n ]\n );\n }",
"public function queryMessage( $msgid )\n {\n $this->getHttpClient()->setParameterGet( 'apimsgid', $msgid );\n $this->call( OSS_Service_Clickatell_Http::API_METHOD_QUERY );\n\n $data = explode( ' ', $this->_response->getBody() );\n\n if( $data[0] == 'ID:' )\n return $data[3];\n\n throw new OSS_Service_Clickatell_Exception( 'Unknown response for Clickatell message query: ' \n . $this->_response->getBody() );\n }",
"public function getIncidentMessage(): ?string;",
"public function getQueryExcavateBattleReply()\n {\n return $this->get(self::_QUERY_EXCAVATE_BATTLE_REPLY);\n }",
"public function getMidasReply()\n {\n return $this->get(self::_MIDAS_REPLY);\n }",
"protected function getMessage()\n {\n //return new \\Swift_Message('Test subject', 'Test body.');\n }",
"public function getNextMessage(){\r\n }",
"public function getCasMsg()\n {\n return $this->casErrorCode;\n }",
"public function getTbcReply()\n {\n return $this->get(self::_TBC_REPLY);\n }",
"abstract public function getMessage(): ReceivedMessage;",
"abstract public function getMessage(): ReceivedMessage;",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function makeBusMessage(Envelope $envelope): BusMessageInterface;",
"public function aim_recv()\r\n\t{\r\n\t\t$header = fread($this->resource, 6);\r\n if ($this->user['debug']) $this->aim_debug($header, AIM_RAW);\r\n\r\n\t\t// Need error checking here to prevent bad data\r\n\t\ttry {\r\n\t\t\tif (!$data = @unpack(\"aone/Ctwo/nthree/nfour\", $header)) {\r\n\t\t\t\t// This normally happens if you sign on elsewhere with the same name,\r\n // or, if the TOC server resets (AOL likes to do this alot).\r\n\t\t\t\tthrow new TACException('Connection to TOC server interrupted.');\r\n\t\t\t} \r\n\t\t} catch(TACException $ex) {\r\n\t\t\t$ex->display();\r\n\t\t}\r\n\r\n if ($this->user['debug']) print_r($data);\r\n\t\t$msg = fread($this->resource, $data['four']);\r\n\t\t$msg = implode('', unpack(\"a*done\", $msg));\r\n if ($this->user['debug']) var_dump($msg);\r\n\r\n // match incoming commands\r\n preg_match(\"/^([A-Z0-9_]{4,19})\\:(.*)/s\", $msg, $matches);\r\n @list($orig, $cmd, $args) = $matches;\r\n // send the command and arguments to our parser\r\n $this->parser->aim_parse_command($cmd, $args);\r\n // regain some memory\r\n unset($header, $orig, $data, $matches);\r\n\t}",
"public function get_message()\n {\n return $this->_message;\n }",
"public static function getConfirmedReceivedByAddress($address)\n\t{\n\t\t$amount = file_get_contents(\"https://blockchain.info/q/getreceivedbyaddress/$address?confirmations=\" . getenv(\"REQUIRED_CONFIRMATIONS\"));\n\n\t\treturn $amount;\n\t}",
"public function getMsg()\n {\n return $this->msg;\n }",
"public function getMsg()\n {\n return $this->msg;\n }",
"public function ack($message, $transactionId = null)\n {\n $this->connect();\n return $this->stomp->ack($message, $transactionId);\n }",
"function &getMessage() {\r\n\t\t\treturn $this->msg;\r\n\t\t}",
"public function get_msg() {\r\n return $this->msg;\r\n }"
] | [
"0.65506154",
"0.60935456",
"0.5933206",
"0.5568381",
"0.5542685",
"0.55309165",
"0.55300635",
"0.55167186",
"0.55120337",
"0.5450928",
"0.5372342",
"0.5352986",
"0.52318484",
"0.5196054",
"0.5117026",
"0.5062878",
"0.5058786",
"0.5020445",
"0.5014797",
"0.50035256",
"0.49852228",
"0.49745584",
"0.4962327",
"0.49375495",
"0.4903673",
"0.4860277",
"0.48582894",
"0.48520848",
"0.4837517",
"0.4836637",
"0.48126385",
"0.48097104",
"0.4786908",
"0.47816566",
"0.47583744",
"0.47477967",
"0.47385487",
"0.47275293",
"0.47214946",
"0.47207457",
"0.47137973",
"0.47089288",
"0.4704572",
"0.4695525",
"0.4686014",
"0.4642338",
"0.46420243",
"0.46420243",
"0.46420243",
"0.46420243",
"0.4605659",
"0.46038386",
"0.45903778",
"0.45866635",
"0.45807233",
"0.45546964",
"0.45440665",
"0.45237657",
"0.45226708",
"0.45169473",
"0.45119682",
"0.45053107",
"0.45031545",
"0.44988385",
"0.4491329",
"0.44892305",
"0.44835895",
"0.44723034",
"0.44682282",
"0.44519508",
"0.44440225",
"0.44439372",
"0.44355428",
"0.4427801",
"0.4420129",
"0.4412548",
"0.4394586",
"0.4394586",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43899626",
"0.43884006",
"0.43857124",
"0.4370272",
"0.43693283",
"0.43681487",
"0.43681487",
"0.4366352",
"0.43591756",
"0.43556413"
] | 0.53177834 | 12 |
Get an addressed completion message | public function getAddressedComplete(UserInterface $user, DestinationInterface $destination, string $message): string {
$bacon = $this->getRandom([
"Great news {mention}, {message}.",
"Good news {mention}, {message}.",
"You can breathe again {mention}, {message}.",
"FYI {mention}, {message}.",
"P.S. {mention}, {message}.",
"Hey {mention}, just letting you know {message}.",
]);
$mention = $this->getUserReference($user);
return str_replace(['{mention}', '{message}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($message))], $bacon);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFragmentComposeReply()\n {\n return $this->get(self::_FRAGMENT_COMPOSE_REPLY);\n }",
"public function getTriggerJobReply()\n {\n return $this->get(self::_TRIGGER_JOB_REPLY);\n }",
"public function getTriggerTaskReply()\n {\n return $this->get(self::_TRIGGER_TASK_REPLY);\n }",
"abstract public function get_message();",
"private function complete($messageType, Message $message) {\n # Generic method\n echo $message->getKey() . \"\\n\";\n }",
"public function getAutoReplyMessage()\n {\n return $this->autoReplyMessage;\n }",
"public function getAskMagicsoulReply()\n {\n return $this->get(self::_ASK_MAGICSOUL_REPLY);\n }",
"public function getOnCompletion()\r\n {\r\n return $this->on_completion;\r\n }",
"public function getChargeReply()\n {\n return $this->get(self::_CHARGE_REPLY);\n }",
"public function getResultMessage() {}",
"public function getLPCompleted();",
"public function getConsumeItemReply()\n {\n return $this->get(self::_CONSUME_ITEM_REPLY);\n }",
"public function get_message() { return $this->getMessage(); }",
"private function onCompletion()\n {\n }",
"public function getAskActivityInfoReply()\n {\n return $this->get(self::_ASK_ACTIVITY_INFO_REPLY);\n }",
"private function getCompleteResult()\n\t{\n\t\tif($this->complete_result)\n\t\t{\n\t\t\treturn $this->complete_result;\n\t\t}\n\n\t\t$message = $this->amqp->GetMessageBody($this->connection, $this->task_id,$this->connection_details['result_expire'], true);\n\t\t\n\t\tif($message !== false)\n\t\t{\n\t\t\t$this->complete_result = $message['complete_result'];\n\t\t\t$this->body = json_decode(\n\t\t\t\t$message['body']\n\t\t\t);\n\t\t}\n\n\t\treturn false;\n\t}",
"function getStatusMessage() \r\n\t{\r\n\t\treturn $this->replyString;\r\n\t}",
"function getMessage($i){\n $options = array('My Skillset', 'Projects I have done', 'Past Work Places');\n switch($i){\n case 0:\n $msg = $options[0];\n break;\n case 1;\n $msg = $options[1];\n break;\n case 2:\n $msg = $options[2];\n break;\n default:\n \n break; \n }\n return $msg;\n }",
"public function getReply()\n {\n return $this->reply;\n }",
"public function getChatReply()\n {\n return $this->get(self::_CHAT_REPLY);\n }",
"function getResponseMsg()\n {\n $msg = array('START' => 'Enter a product name:',\n 'NO_ITEMS' => 'There are no such items available.',\n 'INVALID_Q' => 'The query must contain only letters and digits (3 through 30).',\n 'DONE' => '{NUM} items from \"{NAME}\" fetched.');\n\n if (self::$current_state == 'DONE'){\n $msg[self::$current_state] = str_replace('{NAME}', self::$items_name, $msg[self::$current_state]);\n $msg[self::$current_state] = str_replace('{NUM}', self::$items_number, $msg[self::$current_state]);\n }\n return $msg[self::$current_state];\n }",
"public function getCompleteTpl(){\n return $this->templates['complete'];\n }",
"abstract public function getFullMessage($msgNo);",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getMessage();",
"public function getReadMailReply()\n {\n return $this->get(self::_READ_MAIL_REPLY);\n }",
"public function getTbcReply()\n {\n return $this->get(self::_TBC_REPLY);\n }",
"public static function getCampaignCompleteErrorText()\n\t{\n\t\t$text = 'I don\\'t understand what are you want for me! 😿';\n\t\t$text .= PHP_EOL . PHP_EOL;\n\t\t$text .= 'Please, choose any command from menu';\n\t\t\n\t\treturn $text;\n\t}",
"public function getResponseMessage();",
"public function getShopConsumeReply()\n {\n return $this->get(self::_SHOP_CONSUME_REPLY);\n }",
"public function getCdkeyGiftReply()\n {\n return $this->get(self::_CDKEY_GIFT_REPLY);\n }",
"public function fuManCompleteAsText()\n {\n return ($this->fu_man_complete == 0) ? \"No\" : \"Yes\";\n }",
"public function current()\n\t{\n\t\treturn $this->_messages[$this->_position];\n\t}",
"public function getCancelledMessage(){\n \treturn $this->canc_message;\n }",
"public function getDeliverySuggestionName()\n {\n return $this->_deliverySuggestionName;\n }",
"public static function getAcceptanceMessagePart1() { self::checkInit(); return self::$acceptanceMessagePart1; }",
"public function message()\n {\n return 'A megadott termékkóddal már létezik cikk!';\n }",
"public function getTranslatedMessage(): string\n\t{\n\t\tif(self::$resolver === null)\n\t\t{\n\t\t\tself::$resolver = new DefaultMessageResolver();\n\t\t}\n\t\t\n\t\treturn self::$resolver->resolveMessage($this->name, $this->key, $this->args);\n\t}",
"public function getQueryExcavateDefReply()\n {\n return $this->get(self::_QUERY_EXCAVATE_DEF_REPLY);\n }",
"public function get_message()\n {\n return $this->_message;\n }",
"private function getMsg()\n {\n return $this->msg;\n }",
"public function getExcavateReply()\n {\n return $this->get(self::_EXCAVATE_REPLY);\n }",
"#[Pure]\n public function getRequestMessage() {}",
"public function getResGot()\n {\n return $this->get(self::_RES_GOT);\n }",
"function getMessage() {\n return $this->message;\n }",
"public function setCompletion($value)\n {\n return $this->set('Completion', $value);\n }",
"public function getMessage(): string\n {\n return $this->requireString('message');\n }",
"public function getMessage() {}",
"public function getMessage() {}",
"public function getMessage() {}",
"public function getCompletionResults()\n {\n return $this->completion_results;\n }",
"public function getLongMessage()\n {\n return $this->longMessage;\n }",
"public function getConsultReply()\n {\n return $this->consult_reply;\n }",
"public function getReplyToken()\n {\n return $this->baseEvent->getReplyToken();\n }",
"public function getSplitHeroReply()\n {\n return $this->get(self::_SPLIT_HERO_REPLY);\n }",
"public function get_message() {\n\t\t// translators: Placeholders refer to a file name, and a theme / plugin name (e.g. \"index.php\", \"Stream\")\n\t\treturn _x(\n\t\t\t'\"%1$s\" in \"%2$s\" updated',\n\t\t\t'1: File name, 2: Theme/plugin name',\n\t\t\t'stream'\n\t\t);\n\t}",
"public function getCommandText();",
"private function replyBot(): string\n { \n $asc_cmd = preg_replace('/\\({.+/s', '', $this->lang['respond']['bio']['wait_approve'] );\n $asc_cmd = trim($asc_cmd);\n\n switch ( true ) {\n case preg_match( '/\\b(' . $asc_cmd . ')\\b/iu', $this->info['reply_text'] ):\n if ( !$this->is_admin )\n return $this->lang['respond']['not_admin'];\n\n if ( !in_array($this->info['msg_text'], $this->lang['command']['confirm']) ) {\n return $this->lang['respond']['bio']['not_approved']; // Bio not approved\n } else {\n preg_match( \"/\\((.*?)\\)/\", $this->info['reply_text'], $user_id ); // Return id inside brackets\n $bio = preg_replace( \"/^.+\\:\\n/\", '', $this->info['reply_text'] ); // Removes all text before colon\n $this->db_post->updateBio( $bio, $user_id[1] );\n return $this->lang['respond']['bio']['approved']; // Bio approved\n }\n case preg_match( '/\\b('. $this->lang['respond']['tanos']['list'] . ')\\b/u', $this->info['reply_text'] ):\n if ( !$this->is_admin )\n return $this->lang['respond']['not_admin'];\n\n $status = $this->tg->getStatus( $this->info['chat_id'], $this->bot['id'] );\n if ( $this->info['reply_date'] + 120 < time() ){\n return $this->lang['respond']['tanos']['overtime'];\n } elseif ( !in_array($this->info['msg_text'], $this->lang['command']['confirm']) ) {\n return $this->lang['respond']['bio']['not_approved'];\n } elseif ( $status !== 'administrator' ) {\n return $this->lang['respond']['tanos']['bot_not_adm'];\n } else {\n preg_match_all( \"/\\((.*?)\\)/\", $this->info['reply_text'], $user_array );\n $results = $this->tg->kickMembers( $user_array[1], $this->info['chat_id'] );\n $this->db_post->kickUsers( $user_array[1] );\n return $this->lang['respond']['tanos']['goodbye'];\n }\n default:\n exit('ok');\n }\n }",
"public function getSay()\n {\n return $this->get(self::_SAY);\n }",
"public function getPrompt();",
"function _auto_trans_complete($label = 'complete')\r\n\t{\r\n\t\t// Complete auto transaction\r\n\t\tif ($this->auto_transaction)\r\n\t\t{\r\n\t\t\t// Check if successful\r\n\t\t\tif (!$this->trans_complete())\r\n\t\t\t{\r\n\t\t\t\t$rule = 'transaction';\r\n\r\n\t\t\t\t// Get corresponding error from language file\r\n\t\t\t\tif (FALSE === ($line = $this->lang->line($rule)))\r\n\t\t\t\t{\r\n\t\t\t\t\t$line = 'Unable to access the ' . $rule .' error message.';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Add transaction error message\r\n\t\t\t\t$this->error_message($rule, sprintf($line, $label));\r\n\r\n\t\t\t\t// Set validation as failed\r\n\t\t\t\t$this->valid = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function getMessage () {\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n return $this->message;\n }",
"public function getMessage() {\n return $this->message;\n }",
"public function getMessage() {\n return $this->message;\n }",
"public function getMessage() {\n return $this->message;\n }",
"public function getMessage()\n {\n return $this->message;\n }",
"public function getMessage() {\n return self::$message;\n }",
"public function getMessage(): string;",
"public function getMessage(): string;",
"public function getMessage(): string;",
"public function getMessage(): string;",
"public function getMessage(): string;",
"function getMessage(){\n\t\t\treturn $this->message;\n\t\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getMessage() {\n\t\treturn $this->message;\n\t}",
"public function getTutorialReply()\n {\n return $this->get(self::_TUTORIAL_REPLY);\n }",
"public function getMessage(){\n\t\treturn $this->message;\n\t}",
"#[Pure]\n public function getParentMessage() {}",
"public function getMessage()\n\t{\n\t\tprepareDisplayContext();\n\t}",
"public function resolve($message);",
"protected function getMessage()\n {\n //return new \\Swift_Message('Test subject', 'Test body.');\n }",
"public function getmessage()\n {\n return array_shift($this->storage);\n }",
"protected abstract function _message();",
"public function getMessage() \n\t{\n\t\treturn $this->message;\n\t}",
"public function getMessage()\r\n {\r\n return $this->message;\r\n }",
"public function getMessage()\r\n {\r\n return $this->message;\r\n }",
"public function getMessage()\r\n {\r\n return $this->message;\r\n }"
] | [
"0.5593971",
"0.55617803",
"0.5529762",
"0.54996955",
"0.53648376",
"0.5275457",
"0.5207765",
"0.5196588",
"0.51485234",
"0.51258785",
"0.50984406",
"0.50970644",
"0.5094707",
"0.50938815",
"0.5092328",
"0.5079508",
"0.50707316",
"0.50377566",
"0.4999959",
"0.49890396",
"0.49465498",
"0.49454525",
"0.49305537",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49191198",
"0.49085304",
"0.4903158",
"0.48969594",
"0.48967567",
"0.4896654",
"0.48821476",
"0.48739955",
"0.4867116",
"0.48470584",
"0.48465782",
"0.48433626",
"0.4841898",
"0.4835988",
"0.4835425",
"0.48335698",
"0.48334932",
"0.48252335",
"0.48206007",
"0.481955",
"0.4819132",
"0.4815889",
"0.48155972",
"0.4815396",
"0.4815396",
"0.4815396",
"0.48114905",
"0.4798212",
"0.47808442",
"0.47805113",
"0.4772531",
"0.4771119",
"0.47694397",
"0.47645888",
"0.4763005",
"0.47547367",
"0.47466165",
"0.47451356",
"0.47449684",
"0.47449684",
"0.47449684",
"0.47449684",
"0.47417513",
"0.47358367",
"0.47345132",
"0.47345132",
"0.47345132",
"0.47345132",
"0.47345132",
"0.47336426",
"0.47328034",
"0.47328034",
"0.47328034",
"0.47328034",
"0.4732046",
"0.4729281",
"0.47283262",
"0.47268197",
"0.47159645",
"0.4715232",
"0.47060874",
"0.47052228",
"0.47041285",
"0.46989962",
"0.46989962",
"0.46989962"
] | 0.0 | -1 |
Get a random response | protected function getRandom(array $responses): string {
$countResponses = count($responses);
$responseID = mt_rand(0, $countResponses - 1);
return $responses[$responseID];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_random_response_id($connect){\n $q='RES'.rand(2000,2999);\n $id=check_response_in_DB($q,$connect); \n return $id;\n}",
"public function random();",
"public function getRandom() {\n\t\t$quote = $this->get('random', array('limit'=>1));\n\t\treturn $quote[0];\n\t}",
"public function findRandom();",
"public function index_get()\n {\n $ranstring = $this->common->randomString();\n $this->response([\n 'status' => FALSE,\n 'message' => $ranstring\n ], REST_Controller::HTTP_UNAUTHORIZED);\n }",
"public function getRnd($gen) {\n if(empty($gen) || $gen == \"any\") {\n $condition = \"\";\n } else {\n $condition = \" WHERE genres like '%\" . $gen . \"%'\";\n }\n $query = \"SELECT * FROM movies \".$condition.\" ORDER BY RAND() LIMIT 24\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_CLASS);\n if($result) {\n return json_response(200, \"Et Voilà !\", $result);\n } else {\n return json_response(404, \"Ups, couldn't find anything\");\n }\n }",
"public function getHeaderRandom()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__RANDOM];\r\n\t}",
"public function handleRandomResponse(&$template)\n {\n /** @var \\DOMElement $random */\n if ($random = $template->getElementsByTagName(\"random\")->item(0)) {\n $lis = $random->getElementsByTagName(\"li\");\n\n // Get maximum response index\n $maxIdx = $lis->length - 1;\n\n // Randomize response content from min to max index\n $idx = mt_rand(0, $maxIdx);\n\n $template = $lis->item($idx);\n }\n return $this;\n }",
"function random_catchphrase() {\n // but it's wrapped in a try/catch so whatever :P\n $initial = getResults(1);\n $initial = $initial->queries->request;\n $initial = $initial[0];\n $initial = $initial->totalResults;\n $numResults = (int)$initial;\n $page = rand(0, min(10, floor($numResults/10)));\n $randStart = $page*10+1;\n $results = getResults($randStart);\n var_dump($results);\n $results = $results->items;\n if (!count($results)) {\n return null;\n }\n else {\n return $results[rand(0, count($results)-1)]->snippet;\n }\n}",
"public function fetchRandomQuote()\n {\n try {\n $offset = rand(0, 5000);\n $endpoint = self::BASE_RANDOM_QUOTE_ENDPOINT . $offset;\n $apikey = strtr(\"Token apikey\", [\n 'apikey' => config('paper_quotes_api_key'),\n ]);\n\n $response = $this->client->get($endpoint, [\n 'headers' => [\n 'Authorization' => $apikey,\n ]\n ])->getBody();\n\n $data = json_decode($response);\n $message = strtr('_quote (by _author with _like like(s)).', [\n '_quote' => $data->results[0]->quote,\n '_author' => $data->results[0]->author === \"\" ? \"Anonymous\" : $data->results[0]->author,\n '_like' => $data->results[0]->likes,\n ]);\n\n return $message;\n } catch (Exception $exception) {\n return \"Error! Please try again\";\n }\n }",
"public function & GetResponse ();",
"function getRandomLink() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY RAND() LIMIT 1;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}",
"public function getRandom()\n {\n return $this->offsetGet($this->getRandomKey());\n }",
"abstract public function response();",
"public function randomItem();",
"function getResponse();",
"function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function test_it_show_random_item_in_array()\n {\n $payload = [\n 'items' => [\n 'apple',\n 'strawberry',\n 'kiwi',\n 'pineapple',\n 'banana',\n 'olive',\n ],\n ];\n\n // When submitting to the pick endpoint\n $response = $this->getJson(route('tools.random.pick', $payload));\n\n // Then it should return a random value\n $response->assertStatus(200);\n //TODO : Find a way to test this behaviour :grimacing:\n }",
"public function index()\n {\n return Random::generate();\n }",
"public function response ();",
"public function getResponse() {}",
"public function getResponse() {}",
"function randomTest(){\n $treatment = $this->getTreatment();\n $username = $this->generateUsername();\n $hashed = $this->generateMD5Pass();\n $extra = array('username' =>$username,\n\t\t 'treatment' => $treatment,\n\t\t 'hash' => $hashed);\n $output = $this->outputBoilerplate('test.html', $extra);\n return $output; \n }",
"public function response();",
"public function getRandomKey(){\n\n //get keys\n return $this->client->randomkey();\n }",
"public function orderRandom();",
"public function random()\r\n\t{\r\n\t\treturn $this->_items[array_rand($this->_items)];\r\n\t}",
"function generatechallenge(){\n\tsrand();\n\t//create the challenge variable\n\t$challenge=\"\";\n\t//fill the challenge variable\n\tfor($i=0; $i<80; $i++)\n\t{\n\t\t$challenge.=dechex(rand(0,15));\n\t}\n\t$_SESSION['challenge']=$challenge;\n\treturn $challenge;\n}",
"private function getRandomSayText()\n {\n $texts = [\n 'They see me rollin\\'',\n '*whistle*',\n 'I\\'m walking on sunshine',\n ];\n $rand = mt_rand(0, count($texts) - 1);\n\n return $texts[$rand];\n }",
"public function random()\n {\n return $this->items[array_rand($this->items)];\n }",
"protected static function generate_challenge()\r\n {\r\n // Complexity setting is used as character count\r\n static::$response = static::random(\\max(1, static::$config['complexity']));\r\n \\Session::instance()->set(static::$sessionname, array('code' => static::$response, 'time' => \\TIME));\r\n }",
"function get_question_random_simple() {\n global $default_terms_array;\n $session = new Session();\n $questions = get_questions($default_terms_array);\n\n for ($i = 0; $i < sizeof($questions); $i++) {\n\n $question = $questions[array_rand($questions) ];\n\n // if the question hasn't already been asked recently OR we're not remembering things in the session, return it\n if ((!$session->get('random_questions_asked') || ($session->get('random_questions_asked') && !in_array($question->get_ID(), $session->get('random_questions_asked'))))) {\n return $question;\n }\n }\n\n return $questions[array_rand($questions) ];\n}",
"public function getRandom()\n {\n $this->update();\n $count = sizeof($this->data);\n if ($count > 0) {\n $index = rand(0, $count - 1);\n if (isset($this->data[$index])) {\n return $this->updateValueIfNeeded($this->data, $index);\n }\n }\n return null;\n }",
"function get_response() {\n return $this->response;\n }",
"public static function random() { return Secrets::random(); }",
"public function generateResponse(){\n\n switch ($this->requestMethod) {\n\n case 'GET':\n if(isset($this->topicId)){\n\n $response = $this->getTopicById($this->topicId);\n\n }else{\n\n $response = $this->getAllTopic();\n \n } \n \n break;\n\n case 'POST':\n\n $response = $this->createTopic();\n \n break;\n \n case 'PUT':\n\n if($this->userAction === \"update_topic\"){\n $response = $this->updateTopic($this->topicId);\n }else{\n\n $response = $this->notFoundResponse();\n }\n \n break;\n\n case 'DELETE':\n if($this->userAction == \"delete_topic_info\"){\n $response = self::deleteUser($this->topicId);\n } \n \n break;\n \n default:\n $response = $this->invalidRoute();\n break;\n }\n \n echo $response['body'];\n\n }",
"public function howAre() {\n return $this->randomItem(\n \"Super, thanks for asking.\",\n 'Pretty good.',\n 'Just fine.',\n 'Never better.',\n 'Great!'\n );\n }",
"public function hello()\n {\n return $this->TextResponseFactory->make(static::HELLO_TEXT);\n }",
"function challangeRandom() {\r\n // random number between 10 and 99\r\n $random = rand(10,99);\r\n $say = \"<Say voice='gcloud.en-GB-Standard-F' loop='2'>Please type the following number, $random, then press pound.</Say>\";\r\n return [$random, $say];\r\n}",
"public function Random()\n {\n return parent::Random();\n }",
"public function test_response() \n\t{\n\t\treturn CCResponse::create( 'Callbacks are pretty cool' );\n\t}",
"public function hrregistration(){\n\n \t $rands = str_random(10);\n \t $rand = json_encode($rands);\n return response()->json($rand,200);\n }",
"public function showRandom()\n {\n $question = Question::inRandomOrder()->first();\n if ($question) {\n return $this->show($question->id);\n } else {\n return redirect(route('questions.index'));\n }\n }",
"protected function fetchRandomPathway() {\n\t\twfDebugLog( __METHOD__, \"Fetching random pathway...\\n\" );\n\t\t$dbr = wfGetDB( DB_SLAVE );\n\t\t// Pick a random pathway from all articles in namespace NS_PATHWAY\n\t\t// FIXME: RAND() only works in MySQL?\n\t\t$res = $dbr->query(\n\t\t\t\"SELECT page_title FROM page WHERE page_namespace = \" . NS_PATHWAY .\n\t\t\t\t\" AND page_is_redirect = 0 ORDER BY RAND() LIMIT 1\", DB_SLAVE );\n\t\t$row = $dbr->fetchRow( $res );\n\t\twfDebugLog( __METHOD__, \"Resulting pathway: \" . $row[0] . \"\\n\" );\n\t\treturn $row[0];\n\t}",
"public function getRandomUser()\n {\n $oObject = $this->makeRequestToUiFaces();\n return $this->transformResponseToTransformer($oObject);\n }",
"public static function getRandomStatus()\n\t{\n\t\treturn Arr::random([Status::Pending, Status::Accept, Status::Block]);\n\t}",
"public function getResponse($response) {\r\n\r\n\r\n }",
"public function generateQuestion()\n\t{\n\t\t//get random question type\n\t\t$type = $this->questionTypes[array_rand($this->questionTypes)];\n\n\t\t//get random section\n\t\t$section = $this->getRandomSection();\n\n\t\t//get random function (within the above section)\n\t\t$function = $this->getRandomFunction($section);\n\n\t\t$question = [];\n\t\t$question['type'] = $type;\n\t\t$question['section'] = $section;\n\t\t$question['function'] = $function;\n\t\t$question['text'] = \"{$section} now, {$this->questionTextPerType[$type]}\";\n\t\t$question['choices'] = [];\n\t\t$question['answer_text'] = '';\n\t\t$question['answer_index'] = '';\t//in ['choices'] array\n\n\n\t\treturn $this->fillQuestion($question);\n\t}",
"public function get ($params) {\n // Get a saying repository.\n $sayingRepo = $this->repository('domain\\Saying');\n // Get the total number of sayings.\n $says = $sayingRepo->select('COUNT(*) as total')->to(null)->findOne();\n // Get a random saying.\n $randomId = mt_rand(1, $says['total']);\n $saying = $sayingRepo->findOne(array(\n 'id' => eq($randomId)\n ));\n // Return the random saying.\n return new Response(array(\n 'saying' => $saying\n ));\n }",
"public function saySomething()\n\t{\n\t\t$response = json_decode(file_get_contents(self::API_URL));\n\t\t$result = isset($response[0])?$response[0]:'';\n\t\treturn $result;\n\t}",
"public function getRandomComponent() {\n $component = Component::getRandomComponent();\n return \\Response::json($component);\n }",
"function searchURI()\t{\n return $this->getRandomString(mt_rand(0,100));\n\t}",
"function retrieveRandom() {\n\t\t\n\t\t$dbh=$this->getdbh();\t\t\n\t\t$stmt = $dbh->query('SELECT max(oid) FROM '.$this->enquote($this->tablename));\n\t\t$oid=$stmt->fetchColumn();\n\t $oid=rand(1,$oid);\n\t return $this->retrieve($oid,-1);\n\t}",
"public function getResponse()\n {\n }",
"function getRandomGames() {\n return DBcommand(\"SELECT * FROM games WHERE suggestion = 0 ORDER BY RAND() LIMIT 5\", [])['output'];\n}",
"public function random(): GifData;",
"public function randomQuestion() {\n return\n $this->createQueryBuilder('qb')\n ->orderBy('RAND()')\n ->setMaxResults($this->maxResult)\n ->getQuery()\n ->getResult()\n ;\n }",
"protected function _response() {}",
"function random($onoff) {\n\n if (is_null($this->_httpq->random($onoff))) { return false; }\n return true;\n\n }",
"public function generateChallenge()\n {\n // Easy\n if (Captcha::$config['complexity'] < 4) {\n $numbers[] = mt_rand(1, 5);\n $numbers[] = mt_rand(1, 4);\n }\n // Normal\n elseif (Captcha::$config['complexity'] < 7) {\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n // Difficult, well, not really ;)\n else {\n $numbers[] = mt_rand(100, 200);\n $numbers[] = mt_rand(10, 20);\n $numbers[] = mt_rand(1, 10);\n }\n\n // Store the question for output\n $this->mathExercise = implode(' + ', $numbers) . ' = ';\n\n // Return the answer\n $this->response = array_sum($numbers);\n\n return $this->response;\n }",
"function w18ol_ajax_get_oneliner() {\n\tglobal $oneliners;\n\t$oneliner_index = array_rand($oneliners);\n\t$oneliner = $oneliners[$oneliner_index];\n\techo $oneliner;\n\t// echo $oneliners[array_rand($oneliners)];\n\twp_die();\n}",
"public function testRandomInt(){\n $txt = (string) rand(10, 1000);\n $ws = new Client(\"ws://{$GLOBALS[\"ip\"]}:{$GLOBALS[\"port\"]}/?service=hello\");\n $ws->send($txt);\n \n $this->assertEquals($txt, $ws->receive());\n $ws->close();\n }",
"public function random() {\r\n \t$objReturn = null;\r\n\r\n \t$intIndex = rand(0, (count($this->collection) - 1));\r\n \tif (isset($this->collection[$intIndex])) {\r\n\t\t\t$objReturn = $this->collection[$intIndex];\r\n \t}\r\n\r\n \treturn $objReturn;\r\n }",
"public function getResponse() {\n }",
"private function select_random() {\n $ad = $this->db_wrapper->select_data($this->table_name, '*', null, 1, 'RAND()');\n if($ad) {\n $ad = array_flat($ad);\n \n $this->ad_code = $ad['adcode'];\n $this->ad_id = $ad['ad_id'];\n $this->ad_title = $ad['ad_title'];\n }\n }",
"public function getRandomOne()\n {\n $allType = $this->horoscopeDictionnary->getAllType();\n $randomKeyType = rand(0, 11);\n $frenchType = $this->horoscopeDictionnary->getTypeEnglishToFrench($allType[$randomKeyType]);\n\n return $this->getByKey($frenchType);\n }",
"protected function getResponse($trigger)\n {\n $trigger = synapse()->brain->topic()->triggers()->get($trigger);\n\n if (isset($trigger['redirect'])) {\n return $this->getResponse($trigger['redirect']);\n }\n\n $key = array_rand($trigger['responses']);\n $this->output = $this->parseResponse($trigger['responses'][$key]);\n }",
"public function getResponse() {\n\t}",
"function _get_random_header_data()\n {\n }",
"public function get_response()\n {\n return $this->response; \n }",
"public function actionRandomSongView()\n {\n $song = Song::getRandomSong();\n\n if ($song) {\n $song->hit = $song->hit + 1;\n\n if (Yii::$app->session->get('last_page') != Yii::$app->request->getReferrer()) {\n Song::plusHit($song->id);\n Singer::plusHit($song->singer->id);\n }\n\n return $this->render('song-view', [\n 'song' => $song\n ]);\n } else {\n Yii::$app->response->statusCode = 404;\n\n return $this->render('error', ['name' => 'Not Found']);\n }\n }",
"public static function get_random_status() {\n\n\t\t$status = array( 'OPEN', 'PROCESSING', 'ACCEPTED', 'DECLINED' );\n\t\tshuffle( $status );\n\n\t\treturn $status[0];\n\t}",
"public function okay() {\n return $this->randomItem(\n \"Okay, I'm on it!\",\n \"I'll get right on that!\",\n 'You got it, boss.',\n 'No problem!',\n 'Sure thing.'\n );\n }",
"public function getRandomInt()\n {\n return random_int(0, 1);\n }",
"public function seed()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n if($this->request->server['REMOTE_ADDR'] != '127.0.0.1' && $this->request->server['REMOTE_ADDR'] != '::1')\n return 403;\n\n $matcher = new SurveyMatcher();\n $matcher->seed((isset($this->request->get['limit']) ? $this->request->get['limit'] : 150));\n\n $this->response->write('OK');\n }",
"function get_challenge(){\n\t$challenge = md5(uniqid(rand(), true));\n\t$_SESSION['challenge'] = $challenge;\n\treturn $challenge;\n}",
"public function randomFunc() {\n return \"RANDOM\";\n }",
"public function getRandomID() \n\t{\n\t\treturn $this->random_id;\n\t}",
"public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}",
"public static function curlGet() {\n $meal = self::curlCall('https://www.themealdb.com/api/json/v1/1/random.php');\n return json_decode($meal, true);\n }",
"public function randomRequests(int $num = 10)\n {\n return Request::with('word')->inRandomOrder()->limit($num)->get();\n }",
"public function genius(){\n $aNames = array('name-1', 'name-2', 'name-3');\n\n // Pick random index number from array aNames\n $iKey = array_rand($aNames);\n\n // Return the name using the random index\n return $aNames[$iKey];\n\n }",
"public static function getRandom()\n\t{\n\t\t$randNumPhp = Lottery::getSecureRand( self::getCount() );\n\t\t//$randNumSql = '( SELECT FLOOR( MAX(`id`) * RAND() ) FROM `category_prize` LIMIT 1 )';\n\n\t\treturn self::find()\n ->select(['id', 'name'])\n\t\t ->andWhere(['>=', 'id', $randNumPhp])\n\t\t ->orderBy('id')\n\t\t ->asArray()\n ->one();\n\t}",
"function bb2_get_response($key)\n{\n\t$bb2_responses = [\n\t\t'00000000' => ['response' => 200, 'explanation' => '', 'log' => 'Permitted'],\n\t\t'136673cd' => ['response' => 403, 'explanation' => 'Your Internet Protocol address is listed on a blacklist of addresses involved in malicious or illegal activity. See the listing below for more details on specific blacklists and removal procedures.', 'log' => 'IP address found on external blacklist'],\n\t\t'17566707' => ['response' => 403, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Required header \\'Accept\\' missing'],\n\t\t'17f4e8c8' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'User-Agent was found on blacklist'],\n\t\t'21f11d3f' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a mobile Web device, but you do not actually appear to be a mobile Web device.', 'log' => 'User-Agent claimed to be AvantGo, claim appears false'],\n\t\t'2b021b1f' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'IP address found on http:BL blacklist'],\n\t\t'2b90f772' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. If you are using the Opera browser, then Opera must appear in your user agent.', 'log' => 'Connection: TE present, not supported by MSIE'],\n\t\t'35ea7ffa' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Check your browser\\'s language and locale settings.', 'log' => 'Invalid language specified'],\n\t\t'408d7e72' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'POST comes too quickly after GET'],\n\t\t'41feed15' => ['response' => 400, 'explanation' => 'An invalid request was received. This may be caused by a malfunctioning proxy server. Bypass the proxy server and connect directly, or contact your proxy server administrator.', 'log' => 'Header \\'Pragma\\' without \\'Cache-Control\\' prohibited for HTTP/1.1 requests'],\n\t\t'45b35e30' => ['response' => 400, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Header \\'Referer\\' is corrupt'],\n\t\t'57796684' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'Prohibited header \\'X-Aaaaaaaaaa\\' or \\'X-Aaaaaaaaaaaa\\' present'],\n\t\t'582ec5e4' => ['response' => 400, 'explanation' => 'An invalid request was received. If you are using a proxy server, bypass the proxy server or contact your proxy server administrator. This may also be caused by a bug in the Opera web browser.', 'log' => '\"Header \\'TE\\' present but TE not specified in \\'Connection\\' header'],\n\t\t'69920ee5' => ['response' => 400, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Header \\'Referer\\' present but blank'],\n\t\t'6c502ff1' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Bot not fully compliant with RFC 2965'],\n\t\t'70e45496' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'User agent claimed to be CloudFlare, claim appears false'],\n\t\t'71436a15' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a major search engine, but you do not appear to actually be a major search engine.', 'log' => 'User-Agent claimed to be Yahoo, claim appears to be false'],\n\t\t'799165c2' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Rotating user-agents detected'],\n\t\t'7a06532b' => ['response' => 400, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Required header \\'Accept-Encoding\\' missing'],\n\t\t'7ad04a8a' => ['response' => 400, 'explanation' => 'The automated program you are using is not permitted to access this server. Please use a different program or a standard Web browser.', 'log' => 'Prohibited header \\'Range\\' present'],\n\t\t'7d12528e' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Prohibited header \\'Range\\' or \\'Content-Range\\' in POST request'],\n\t\t'939a6fbb' => ['response' => 403, 'explanation' => 'The proxy server you are using is not permitted to access this server. Please bypass the proxy server, or contact your proxy server administrator.', 'log' => 'Banned proxy server in use'],\n\t\t'96c0bd29' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'URL pattern found on blacklist'],\n\t\t'9c9e4979' => ['response' => 403, 'explanation' => 'The proxy server you are using is not permitted to access this server. Please bypass the proxy server, or contact your proxy server administrator.', 'log' => 'Prohibited header \\'via\\' present'],\n\t\t'a0105122' => ['response' => 417, 'explanation' => 'Expectation failed. Please retry your request.', 'log' => 'Header \\'Expect\\' prohibited; resend without Expect'],\n\t\t'a1084bad' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'User-Agent claimed to be MSIE, with invalid Windows version'],\n\t\t'a52f0448' => ['response' => 400, 'explanation' => 'An invalid request was received. This may be caused by a malfunctioning proxy server or browser privacy software. If you are using a proxy server, bypass the proxy server or contact your proxy server administrator.', 'log' => 'Header \\'Connection\\' contains invalid values'],\n\t\t'b0924802' => ['response' => 400, 'explanation' => 'An invalid request was received. This may be caused by malicious software on your computer.', 'log' => 'Incorrect form of HTTP/1.0 Keep-Alive'],\n\t\t'b40c8ddc' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, close your browser, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'POST more than two days after GET'],\n\t\t'b7830251' => ['response' => 400, 'explanation' => 'Your proxy server sent an invalid request. Please contact the proxy server administrator to have this problem fixed.', 'log' => 'Prohibited header \\'Proxy-Connection\\' present'],\n\t\t'b9cc1d86' => ['response' => 403, 'explanation' => 'The proxy server you are using is not permitted to access this server. Please bypass the proxy server, or contact your proxy server administrator.', 'log' => 'Prohibited header \\'X-Aaaaaaaaaa\\' or \\'X-Aaaaaaaaaaaa\\' present'],\n\t\t'c1fa729b' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'Use of rotating proxy servers detected'],\n\t\t'cd361abb' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Data may not be posted from offsite forms.', 'log' => 'Referer did not point to a form on this site'],\n\t\t'd60b87c7' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, please remove any viruses or spyware from your computer.', 'log' => 'Trackback received via proxy server'],\n\t\t'dfd9b1ad' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Request contained a malicious JavaScript or SQL injection attack'],\n\t\t'e3990b47' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, please remove any viruses or spyware from your computer.', 'log' => 'Obviously fake trackback received'],\n\t\t'e4de0453' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a major search engine, but you do not appear to actually be a major search engine.', 'log' => 'User-Agent claimed to be msnbot, claim appears to be false'],\n\t\t'e87553e1' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'I know you and I don\\'t like you, dirty spammer.'],\n\t\t'f0dcb3fd' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'Web browser attempted to send a trackback'],\n\t\t'f1182195' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a major search engine, but you do not appear to actually be a major search engine.', 'log' => 'User-Agent claimed to be Googlebot, claim appears to be false.'],\n\t\t'f9f2b8b9' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'A User-Agent is required but none was provided.'],\n\t];\n\n\tif (array_key_exists($key, $bb2_responses)) return $bb2_responses[$key];\n\n\treturn ['00000000'];\n}",
"public function sentence()\n {\n $sentence = $this->randomizer->getSentences(1);\n\n return $this->apiResponse($sentence[0]);\n }",
"protected function randomIndex() {\n return mt_rand(1, 10);\n }",
"public function getRandom(array $options = [])\n {\n $path = $this->buildPath(static::STRING_ENDPOINT);\n\n $request = $this->performRequest('POST', $path, ['body' => $options]);\n return $request->data->random;\n }",
"function fetch_credit() {\n return rand(60, 100);\n}",
"function getRandomNumber() {\n return rand(0, 0x7fffffff);\n }"
] | [
"0.6625422",
"0.6340368",
"0.6286194",
"0.6191449",
"0.6178401",
"0.61579233",
"0.6094504",
"0.6067878",
"0.6049713",
"0.60324997",
"0.60200506",
"0.600707",
"0.59981906",
"0.59847075",
"0.59388465",
"0.5925821",
"0.5925821",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5859056",
"0.5854456",
"0.5810615",
"0.58031005",
"0.57821155",
"0.57821155",
"0.57786965",
"0.57264113",
"0.570812",
"0.57034785",
"0.5656662",
"0.5642094",
"0.56333584",
"0.5612591",
"0.55712134",
"0.5567109",
"0.55490446",
"0.55474824",
"0.55467135",
"0.5541528",
"0.5527483",
"0.5524693",
"0.5520694",
"0.551705",
"0.55169505",
"0.5516882",
"0.55027694",
"0.54965544",
"0.5496219",
"0.5494164",
"0.54811525",
"0.5453294",
"0.5453229",
"0.54513776",
"0.54486144",
"0.54408234",
"0.5436373",
"0.54302436",
"0.54246634",
"0.54227304",
"0.5422594",
"0.54107237",
"0.5409035",
"0.540778",
"0.53974766",
"0.53937536",
"0.5384318",
"0.53837895",
"0.5382263",
"0.5380043",
"0.5373848",
"0.5370077",
"0.53670007",
"0.53651273",
"0.5360883",
"0.5342795",
"0.5342325",
"0.53399116",
"0.5329219",
"0.5320034",
"0.53182286",
"0.5318099",
"0.5317758",
"0.5303243",
"0.529499",
"0.5294768",
"0.5292734",
"0.529067",
"0.5287407",
"0.52860934",
"0.5283136",
"0.52713424",
"0.52700853"
] | 0.6278672 | 3 |
Get a user mention' | protected function getUserReference(UserInterface $user): string {
return "@{$user->getName()}";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mentionDetect($match)\n{\n\tstatic $nameCache, $myCache;\n\n\tif (!empty($match['quoted'])) {\n\t\t$username = $match['quoted'];\n\t} elseif (!empty($match['unquoted'])) {\n\t\t$username = $match['unquoted'];\n\t} else {\n\t\treturn $match[0];\n\t}\n\n\t$username = html_entity_decode(mb_strtolower($username));\n\n\t// cache names to reduce queries\n\tif ($myCache instanceof MentionMeCache == false) {\n\t\t$myCache = MentionMeCache::getInstance();\n\t}\n\n\tif (!isset($nameCache)) {\n\t\t$nameCache = $myCache->read('namecache');\n\t}\n\n\tif (isset($nameCache[$username])) {\n\t\treturn mentionBuild($nameCache[$username]);\n\t}\n\n\t// lookup the user name\n\t$user = mentionTryName($username);\n\tif ($user['uid'] == 0) {\n\t\treturn $match[0];\n\t}\n\n\t// store the mention\n\t$nameCache[$username] = $user;\n\t$myCache->update('namecache', $nameCache);\n\n\t// and return the mention\n\treturn mentionBuild($user);\n}",
"public function get_mention(){retrun($id_local_mention); }",
"public function mention()\n {\n $project_id = $this->request->getStringParam('project_id');\n $query = $this->request->getStringParam('search');\n $users = $this->projectPermissionModel->findUsernames($project_id, $query);\n\n $this->response->json($this->userMentionFormatter->withUsers($users)->format());\n }",
"function iu_mentionusername($string, $from, $posturl){\n\tinclude 'dbparams.php';\n\tpreg_match_all('/@[a-zA-Z0-9_]+/', $string, $matches);\n\t// print_r($matches[1]);\n\tforeach ($matches as $match) {\n\t\tif(in_array($match, $matches)){\n\t\t\tforeach ($match as $name) {\n\t\t\t\t$matchedname = str_replace(\"@\", \"\", $name);//remove '@' from username match\n\t\t\t\t$mentionQuery = @mysqli_query($dblink, \"SELECT user_id FROM users WHERE username = '$matchedname'\");\n\t\t\t\t$mentionRow = mysqli_fetch_assoc($mentionQuery);\n\t\t\t\t$mentionuserid = $mentionRow['user_id'];\n\n\t\t\t\tiu_send_notification($from, $mentionuserid, 'mentionpost', $posturl);\n\t\t\t}\n\t\t}\n\t}\n}",
"public function mentions(){\n\t\t$title = \"mentioning user: @\";\n\t\t$where = \"select m.post_id from mentions m, users u2 where m.user_id = u2.user_id and u2.user_name\";\n\n\t\t#call generic routine for showing a specific list of posts:\n\t\t$this->view_specific($where, $title);\n\t}",
"function mentionBuild($user)\n{\n\tif (!is_array($user) ||\n\t\tempty($user) ||\n\t\tstrlen($user['username']) == 0) {\n\t\treturn false;\n\t}\n\n\tglobal $mybb, $lang;\n\n\tif (!$lang->mention) {\n\t\t$lang->load('mention');\n\t}\n\n\t$username = htmlspecialchars_uni($user['username']);\n\t$title = $lang->sprintf($lang->mention_link_title, $username);\n\tif ($mybb->settings['mention_format_names']) {\n\t\t// set up the user name link so that it displays correctly for the display group of the user\n\t\t$username = format_name($username, $user['usergroup'], $user['displaygroup']);\n\t}\n\t$url = get_profile_link($user['uid']);\n\n\t$target = '';\n\tif ($mybb->settings['mention_open_link_in_new_window']) {\n\t\t$target = ' target=\"_blank\"';\n\t}\n\n\t// the HTML id property is used to store the uid of the mentioned user for MyAlerts (if installed)\n\treturn <<<EOF\n{$mybb->settings['mention_display_symbol']}<a id=\"mention_{$user['uid']}\" href=\"{$url}\" class=\"mentionme_mention\" title=\"{$title}\"{$target}>{$username}</a>\nEOF;\n}",
"function show_mentions()\n\t{\n\t\tglobal $id;\t\t\n\t\tif ($id) {\n\t\t\t$rs = safe_rows(\"*\", \"txp_log_mention\", \"article_id='$id'\");\n\t\t\tif ($rs) {\n\t\t\t\tforeach($rs as $a) {\n\t\t\t\t\textract($a);\n\t\t\t\t\t$out[] = '<a href=\"http://'.$refpage.'\" title=\"'.$excerpt\n\t\t\t\t\t\t.'\">'.$reftitle.'</a>';\n\t\t\t\t}\t\n\t\t\t\treturn hed(gTxt('mentions'),3) . graf(join(br, $out));\n\t\t\t}\n\t\t}\n\t}",
"public function mention() {\n\n return view('admin.mention');\n }",
"public function completeUserMention(){\n $mentions=array();\n if (!empty($this->mention_id)){\n foreach ($this->mention_id as $mid){\n array_push($mentions,User::find($mid)->infoSmall());\n }\n }\n return $mentions;\n }",
"public function mentionedUsers()\n {\n\n preg_match_all('/\\@([\\w\\-]+)/', $this->body, $matches);\n\n // return the mentioned users\n\n return $matches[1];\n\n }",
"public function tryMention($escape_markdown = false)\n {\n //TryMention only makes sense for the User and Chat entity.\n// if (!($this instanceof User || $this instanceof Chat)) {\n// return null;\n// }\n\n\n //Try with the username first...\n $name = $this->getProperty('username');\n $is_username = $name !== null;\n\n if ($name === null) {\n //...otherwise try with the names.\n $name = $this->getProperty('first_name');\n $last_name = $this->getProperty('last_name');\n if ($last_name !== null) {\n $name .= ' ' . $last_name;\n }\n }\n\n\n if ($escape_markdown) {\n $name = $this->escapeMarkdown($name);\n }\n\n return ($is_username ? '@' : '') . $name;\n }",
"function content_twitter_mention($content) {\n\treturn preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', \"$1<a href=\\\"http://twitter.com/$2\\\" target=\\\"_blank\\\" rel=\\\"nofollow\\\">@$2</a>\", $content);\n}",
"function get_the_author_nickname()\n {\n }",
"public function getMe()\r\n {\r\n return $this->telegram(\"getMe\");\r\n }",
"function reply_author() {\n\tglobal $reply;\n\treturn $reply['author'];\n}",
"private function ncc_v2_twitter_tweets_mention_finder($tweet_text)\n {\n $parsed_text = preg_replace('/(^|\\s)@([a-z0-9_]+)/i',\n '$1<a class=\"twitter-user\" data-hovercard=\"$2\" href=\"http://www.twitter.com/$2\" target=\"_blank\">@$2</a>',\n $tweet_text);\n\n return $parsed_text;\n }",
"function mentionTryName($username = '')\n{\n\t/**\n\t * create another name cache here to save queries if names\n\t * with spaces are used more than once in the same post\n\t */\n\tstatic $nameList;\n\n\tif (!is_array($nameList)) {\n\t\t$nameList = array();\n\t}\n\n\t// no user name supplied\n\tif (!$username) {\n\t\treturn false;\n\t}\n\n\t$username = mb_strtolower($username);\n\n\t// if the name is in this cache (has been searched for before)\n\tif ($nameList[$username]) {\n\t\t// . . . just return the data and save the query\n\t\treturn $nameList[$username];\n\t}\n\n\tglobal $db, $mybb;\n\n\t$searchname = $db->escape_string($username);\n\n\t$fieldList = 'uid, username, usergroup, displaygroup, additionalgroups, ignorelist';\n\tif ($mybb->settings['mention_show_avatars']) {\n\t\t$fieldList .= ', avatar';\n\t}\n\n\t// query the db\n\t$query = $db->simple_select('users', $fieldList, \"LOWER(username)='{$searchname}'\", array('limit' => 1));\n\n\t// result?\n\tif ($db->num_rows($query) !== 1) {\n\t\t// no matches\n\t\treturn false;\n\t}\n\n\t// cache the name\n\t$nameList[$username] = $db->fetch_array($query);\n\n\t// and return it\n\treturn $nameList[$username];\n}",
"function get_twitter_screen_name($user_id){\n\tglobal $gianism;\n\treturn get_user_meta($user_id, $gianism->twitter->umeta_screen_name, true);\n}",
"function getMention(): string\n\t{\n\t\treturn \"<@\".$this->id.\">\";\n\t}",
"private function getMentionUrl(string $name): string {\n $encodedName = rawurlencode($name);\n $mentionPath = \"/profile/$encodedName\";\n return url($mentionPath, true);\n }",
"function mentionMeXMLHTTP()\n{\n\tglobal $mybb;\n\n\t$ajaxFunction = \"mentionMeXMLHTTP{$mybb->input['mode']}\";\n\tif ($mybb->input['action'] != 'mentionme' ||\n\t\t!function_exists($ajaxFunction)) {\n\t\treturn;\n\t}\n\n\t$ajaxFunction();\n\treturn;\n}",
"public function get_user_mentions( $limit, $page ) {\n $feed_params = array('count' => $limit, 'page' => $page);\n $user_feed = $this->_api_call('https://api.twitter.com/1.1/statuses/mentions_timeline.json', $feed_params);\n return $user_feed;\n }",
"function get_the_author_msn()\n {\n }",
"function mentionMeXMLHTTPnameSearch()\n{\n\tglobal $mybb, $db, $cache;\n\n\tif (!$mybb->input['search']) {\n\t\texit;\n\t}\n\n\t$originalName = trim($mybb->input['search']);\n\t$name = $db->escape_string($originalName);\n\t$name = strtr($name,\n\t\tarray(\n\t\t\t'%' => '=%',\n\t\t\t'=' => '==',\n\t\t\t'_' => '=_')\n\t\t);\n\n\t$fieldList = 'username';\n\tif ($mybb->settings['mention_show_avatars']) {\n\t\t$fieldList .= ', avatar';\n\t}\n\n\t$fullText = '';\n\tif ($mybb->settings['mention_full_text_search']) {\n\t\t$fullText = '%';\n\t}\n\n\t$query = $db->simple_select('users', $fieldList, \"username LIKE '{$fullText}{$name}%' ESCAPE '='\");\n\n\tif ($db->num_rows($query) == 0) {\n\t\texit;\n\t}\n\n\t$names = array();\n\twhile ($user = $db->fetch_array($query)) {\n\t\t$username = mb_strtolower($user['username']);\n\t\tif (($fullText === '' &&\n\t\t\tsubstr($username, 0, strlen($originalName)) === $originalName) ||\n\t\t\t($fullText &&\n\t\t\tstrpos($username, $originalName) !== -1)) {\n\t\t\t$names[$username] = $user;\n\t\t}\n\t}\n\n\tif (empty($names)) {\n\t\texit;\n\t}\n\t$json = json_encode($names);\n\n\t// send our headers.\n\theader('Content-type: application/json');\n\techo($json);\n\texit;\n}",
"public function getMention (string $link_text = '', string $parse_mode = '') {\n if (empty($link_text)) {\n $link_text = $this->fullName();\n }\n\n if ($parse_mode === parseMode::HTML) {\n return \"<a href=\\\"tg://user?id=$this->id\\\">$link_text</a>\";\n }\n\n if ($parse_mode === parseMode::MARKDOWN || $parse_mode === parseMode::MARKDOWNV2) {\n return \"[$link_text](tg://user?id=$this->id)\";\n }\n\n return \"tg://user?id=$this->id\";\n }",
"function mentionMePostbit(&$post)\n{\n\tglobal $mybb, $theme, $lang, $templates, $forumpermissions,\n\t$fid, $post_type, $thread, $forum;\n\n\tif ($mybb->settings['quickreply'] == 0 ||\n\t\t$mybb->user['suspendposting'] == 1 ||\n\t\t$forumpermissions['canpostreplys'] == 0 ||\n\t\t($thread['closed'] == 1 && !is_moderator($fid)) ||\n\t\t$forum['open'] == 0 ||\n\t\t$post_type ||\n\t\t$mybb->user['uid'] == $post['uid']) {\n\t\treturn;\n\t}\n\n\t// tailor JS to postbit setting\n\t$js = \"javascript:MentionMe.insert('{$post['username']}');\";\n\tif ($mybb->settings['mention_multiple']) {\n\t\t$js = \"javascript:MentionMe.multi.mention({$post['pid']});\";\n\t}\n\n\teval(\"\\$post['button_mention'] = \\\"\" . $templates->get('mentionme_postbit_button') . \"\\\";\");\n}",
"function mentionMeXMLHTTPgetMultiMentioned()\n{\n\tglobal $mybb, $db, $charset;\n\n\t// if the cookie does not exist, exit\n\tif (!array_key_exists('multi_mention', $mybb->cookies)) {\n\t\texit;\n\t}\n\t// divide up the cookie using our delimiter\n\t$mentioned = explode('|', $mybb->cookies['multi_mention']);\n\n\t// no values - exit\n\tif (!is_array($mentioned)) {\n\t\texit;\n\t}\n\n\t// loop through each post ID and sanitize it before querying\n\tforeach ($mentioned as $post) {\n\t\t$mentionedPosts[$post] = (int) $post;\n\t}\n\n\t// join the post IDs back together\n\t$mentionedPosts = implode(',', $mentionedPosts);\n\n\t// fetch unviewable forums\n\t$unviewableForums = get_unviewable_forums();\n\tif ($unviewableForums) {\n\t\t$unviewableForums = \" AND fid NOT IN ({$unviewableForums})\";\n\t}\n\t$message = '';\n\n\t// are we loading all mentioned posts or only those not in the current thread?\n\t$fromTID = '';\n\tif (!$mybb->input['load_all']) {\n\t\t$tid = (int) $mybb->input['tid'];\n\t\t$fromTID = \"tid != '{$tid}' AND \";\n\t}\n\n\t// query for any posts in the list which are not within the specified thread\n\t$mentioned = array();\n\t$query = $db->simple_select('posts', 'username, fid, visible', \"{$fromTID}pid IN ({$mentionedPosts}){$unviewableForums}\", array(\"order_by\" => 'dateline'));\n\twhile ($mentionedPost = $db->fetch_array($query)) {\n\t\tif (!is_moderator($mentionedPost['fid']) &&\n\t\t\t$mentionedPost['visible'] == 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ($mentioned[$mentionedPost['username']] != true) {\n\t\t\t$mentionedPost['username'] = html_entity_decode($mentionedPost['username']);\n\n\t\t\t// find an appropriate quote character based on whether or not the\n\t\t\t// mentioned name includes that character\n\t\t\t$quote = '';\n\t\t\tif (strpos($mentionedPost['username'], '\"') === false) {\n\t\t\t\t$quote = '\"';\n\t\t\t} elseif (strpos($mentionedPost['username'], \"'\") === false) {\n\t\t\t\t$quote = \"'\";\n\t\t\t} elseif (strpos($mentionedPost['username'], \"`\") === false) {\n\t\t\t\t$quote = \"`\";\n\t\t\t}\n\n\t\t\t$message .= \"@{$quote}{$mentionedPost['username']}{$quote} \";\n\t\t\t$mentioned[$mentionedPost['username']] = true;\n\t\t}\n\t}\n\n\t// send our headers.\n\theader(\"Content-type: text/plain; charset={$charset}\");\n\techo $message;\n\texit;\n}",
"function the_author_nickname()\n {\n }",
"function the_author() {\n\tglobal $discussion;\n\treturn $discussion['author'];\n}",
"function get_the_author_aim()\n {\n }",
"public function liked()\n {\n\t\t$user = $this->uri->segment(2, 0);;\n }",
"public function getWhoToFollow()\n {\n /** @phpstan-ignore-next-line */\n if ($user = JWTAuth::parseToken()->user()) {\n return $this->getWhoToFollowData($user);\n }\n\n return $this->unauthorizedResponse();\n }",
"public function mentions(){\n return $this->render('home/mentions.html.twig');\n }",
"function get_the_author_firstname()\n {\n }",
"private function getAuthor()\n {\n $tokenStorage = $this->getOption('token_storage');\n\n return $tokenStorage->getToken()->getUser();\n }",
"public function getUsernameMedico() {\n return parent::getUsernameUser();\n }",
"private function retrieve_userid() {\n\t\t$replacement = ! empty( $this->args->post_author ) ? $this->args->post_author : get_query_var( 'author' );\n\n\t\treturn $replacement;\n\t}",
"function mentionMeXMLHTTPgetNameCache()\n{\n\tglobal $mybb, $db;\n\n\t$nameCache = MentionMeCache::getInstance()->read('namecache');\n\n\t$names = array(\n\t\t\"cached\" => array(),\n\t\t\"inThread\" => array(),\n\t);\n\tforeach ((array) $nameCache as $key => $data) {\n\t\t$names['cached'][$key] = $data;\n\t}\n\n\t$tid = (int) $mybb->input['tid'];\n\t$limit = (int) $mybb->settings['mention_max_thread_participants'];\n\tif ($tid &&\n\t\t$mybb->settings['mention_get_thread_participants'] &&\n\t\t$limit > 0) {\n\t\tif ($mybb->settings['mention_show_avatars']) {\n\t\t\t$query = $db->write_query(\"\n\t\t\t\tSELECT p.username, u.avatar\n\t\t\t\tFROM {$db->table_prefix}posts p\n\t\t\t\tLEFT JOIN {$db->table_prefix}users u ON (p.uid=u.uid)\n\t\t\t\tWHERE p.tid='{$tid}'\n\t\t\t\tORDER BY p.pid DESC\n\t\t\t\");\n\t\t} else {\n\t\t\t$query = $db->simple_select('posts', 'username', \"tid='{$tid}'\", array(\"order_by\" => 'pid', \"order_dir\" => 'DESC'));\n\t\t}\n\n\t\tif ($db->num_rows($query) > 0) {\n\t\t\t$count = 0;\n\t\t\twhile ($count < $limit && $user = $db->fetch_array($query)) {\n\t\t\t\t$key = mb_strtolower($user['username']);\n\n\t\t\t\tif (isset($names['inThread'][$key])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$names['inThread'][$key] = $user;\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t}\n\n\t// send our headers.\n\theader('Content-type: application/json');\n\techo(json_encode($names));\n\texit;\n}",
"public function getMe()\n {\n return $this->_execute('/user/', self::METHOD_GET);\n }",
"private function replyUserAndCallBot(): string\n {\n $user_id = $this->info['reply_from_id'];\n $username = $this->info['reply_from_username'];\n $first_name = $this->info['reply_from_first_name'];\n $cmd = '';\n switch ( true ) { \n case preg_match( '/\\b(' . $this->lang['command']['save_bio'] . ')\\b/iu', $this->info['msg_text'] ):\n if ( $this->info['reply_from_is_bot'] )\n exit('ok');\n\n $bio_cmd = $this->lang['command']['save_bio'];\n $bio = substr( strstr($this->info['msg_text'], $bio_cmd), strlen($bio_cmd) );\n $bio = preg_replace( '/\\s+/', ' ', trim($bio) );\n if ( mb_strlen($bio) < 4 )\n return $this->lang['respond']['bio']['too_short'];\n\n if ( $this->is_admin ) {\n $this->db_post->updateBio( $bio, $user_id );\n return $this->lang['respond']['bio']['approved']; // Add more info to bio\n } else {\n $find = [ '{{ user_id }}', '{{ bio }}' ];\n $replace = compact( 'user_id', 'bio' );\n return str_replace( $find, $replace, $this->lang['respond']['bio']['wait_approve'] ) ;\n }\n case preg_match( '/\\b(' . $this->lang['command']['karma'] . ')\\b/iu', $this->info['msg_text'] ):\n if ( $this->info['reply_from_is_bot'] )\n exit('ok');\n\n return $this->userKarma( $user_id, $username ); // Karma stats \n case preg_match( '/\\b(' . $this->lang['command']['ask_bio'] . ')\\b/iu', $this->info['msg_text'] ):\n if ( $this->info['reply_from_is_bot'] )\n return $this->lang['respond']['its_bot']; // Bio from bot\n\n return $this->userBio( $user_id, $username ); // User's bio\n case preg_match( '/\\b(' . $this->lang['command']['add_sticker'] . ')\\b/iu', $this->info['msg_text'] ):\n $cmd = $this->lang['command']['add_sticker'];\n case preg_match( '/\\b(' . $this->lang['command']['add_sticker2'] . ')\\b/iu', $this->info['msg_text'] ):\n $cmd = $cmd ?: $this->lang['command']['add_sticker2'];\n //if ( $this->info['reply_from_is_bot'] )\n //exit('ok');\n\n return $this->makeQuote( '/data/quotes/', $cmd ); // Make new sticker\n default:\n exit('ok');\n }\n }",
"public function getMe(): \\Sumrak\\TelegramBot\\Entity\\User\n {\n $response = $this->apiAdapter->call('getMe');\n\n return $this->serializer->deserialize(\n \\Sumrak\\TelegramBot\\Entity\\User::class,\n $response\n );\n }",
"protected static function getFacadeAccessor()\n {\n return 'mentions';\n }",
"public function getUserName()\n {\n $accessToken = Session::get('spotify_access_token');\n if(!$accessToken) {\n return false;\n }\n\n if ($accessToken->hasExpired()) {\n return false;\n }\n\n $request = $this->client()->request('GET', 'me', [\n 'headers' => [\n 'Authorization' => sprintf('Bearer %s', $accessToken),\n ]\n ]);\n\n $response = $this->prase_reponse($request);\n\n return isset($response['id']) ? $response['id'] : false;\n }",
"function get_the_author_yim()\n {\n }",
"function show_user_comment() {\n $comment = get_user_comment();\n if ($comments = mysqli_fetch_array($comment)) {\n $com = $comments['comment'];\n return $com;\n }\n }",
"public function getUsernameByForgotKey(){\n $key = $this->key;\n\n //get email\n $user_forgot = new \\Filebase\\Database([\n 'dir' => $this->getDataSourceForgot()\n ]);\n\n $item = $user_forgot->get($key);\n $email = $item->email;\n\n //get username\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource(),\n 'cache' => $this->cache,\n 'cache_expires' => $this->cache_expires\n ]);\n\n $list = $user->query()->where('email','=',$email)->limit(1)->results();\n if(!empty($list)){\n if(!empty($list[0]['username'])){\n return $list[0]['username'];\n }\n }\n return '';\n }",
"public function get_user_username($em){\r\n $this->db->select('username');\r\n $this->db->where('email', $em);\r\n $query = $this->db->get('users');\r\n foreach ($query->result() as $row)\r\n {\r\n return $row->username;\r\n }\r\n }",
"function name()\n\t{\n\t\t$name = $this->CI->session->userdata(AUTH_USER_FRIENDLY_NAME);\n\t\tif ($name)\n\t\t{\n\t\t\treturn $name;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn AUTH_DEFAULT_FRIENDLY_NAME;\t\n\t\t}\n\t}",
"public function get_staff_mentions(){\n \t$user_data = array();\n\t\t$users = $this->staff_model->get();\n\t\tforeach($users as $key => $val)\n\t\t{\n\t\t\t$user_data[$key]['id'] = intval($val['staffid']);\n\t\t\t$user_data[$key]['name'] = trim($val['firstname'] . ' ' . $val['lastname']);\n\t\t\tif ($val['profile_image']) {\n\n $url = site_url().'/uploads/staff_profile_images/'. $val['staffid'].'/thumb_'.$val['profile_image'];\n \n // Use get_headers() function \n $headers = get_headers($url); \n \n // Use condition to check the existence of URL \n if($headers && strpos( $headers[0], '200')) { \n $user_data[$key]['avatar'] = site_url().'/uploads/staff_profile_images/'. $val['staffid'].'/thumb_'.$val['profile_image'];\n } \n else { \n $user_data[$key]['avatar'] = site_url().'/assets/images/user-placeholder.jpg';\n } \n \n }else{\n $user_data[$key]['avatar'] = site_url().'/assets/images/user-placeholder.jpg';\n }\n\t\t\t$user_data[$key]['type'] = 'staff';\n\t\t}\n\t\techo json_encode($user_data);\n die();\n }",
"private function retrieve_name() {\n\t\t$replacement = null;\n\n\t\t$user_id = $this->retrieve_userid();\n\t\t$name = get_the_author_meta( 'display_name', $user_id );\n\t\tif ( $name !== '' ) {\n\t\t\t$replacement = $name;\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getMentionLegale()\n\t{\n\t\t$this->db->where('titre = \"mention-legale\"');\n\t\t$Query = $this->db->get(\"mention\");\n\t\tif($Query->num_rows() > 0 ){\n\t\t\tforeach ($Query->result() as $mentionsLegales)\n\t\t\t{\n\t\t\t\t$data[] = $mentionsLegales;\n\t\t\t}\n\t\t\t\t\n\t\t\treturn $data;\n\t\t}\n\t}",
"function get_FEUserName($uid = 0) {\n\n\t\tif ($uid > 0) {\n\t\t\t$SELECT = '*';\n\t\t\t$FROM = 'fe_users';\n\t\t\t$WHERE = 'uid = ' . intval($uid);\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($SELECT, $FROM, $WHERE);\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\tif ($row['name'] == '') {\n\t\t\t\t\t$content = $row['username'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$content = $row['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $content;\n\t}",
"function getnick_uid($uid)\n{\n $unick = mysql_fetch_array(mysql_query(\"SELECT name FROM ibwf_users WHERE id='\".$uid.\"'\"));\n return $unick[0];\n}",
"function bd_get_author($comment) {\n\t\t$author ='';\n\n\t\tif ( empty($comment->comment_author) )\n\t\t\t$author = __('Anonymous', 'wolf');\n\t\telse\n\t\t\t$author = $comment->comment_author;\n\n\t\treturn $author;\n\t}",
"public function getAuthor() {\n\t\treturn UserManager::getFromBlid($this->blid);\n\t}",
"function api_chat_me_info() {\n\tif (session_check()) {\n\t\t$db = new db;\n\t\t$info = $db->getRow(\"SELECT CONCAT(fname, ' ', lname) as fio, avatar,id FROM users WHERE id = ?i\", $_SESSION[\"user_id\"]);\n\t\taok($info);\n\t} else {\n\t\taerr(array(\"Пожалуйста войдите.\"));\n\t}\n\t\n}",
"function mentionMeShowThreadStart()\n{\n\tglobal $mybb, $mentionScript, $mentionQuickReply,\n\t$mentionedIDs, $lang, $tid, $templates;\n\n\t// we only need the extra JS and Quick Reply additions if we are allowing multiple mentions\n\tif ($mybb->settings['mention_multiple']) {\n\t\t$multi = '_multi';\n\t\teval(\"\\$mentionQuickReply = \\\"\" . $templates->get('mentionme_quickreply_notice') . \"\\\";\");\n\n\t\t$mentionedIDs = <<<EOF\n\n\t<input type=\"hidden\" name=\"mentioned_ids\" value=\"\" id=\"mentioned_ids\" />\nEOF;\n\t}\n\n\tif ($mybb->settings['mention_minify_js']) {\n\t\t$min = '.min';\n\t}\n\n\t$mentionScript = <<<EOF\n<script type=\"text/javascript\" src=\"jscripts/MentionMe/thread{$multi}{$min}.js\"></script>\n\nEOF;\n}",
"public function getUsername()\n {\n return $this->getNickname();\n }",
"function get_the_author_login()\n {\n }",
"public function getLoggedInMember()\n {\n return $_SESSION['__COMMENTIA__']['member_username'];\n }",
"public function mentionsAction()\n {\n return $this->render('sil16VitrineBundle:Default:mentions.html.twig');\n }",
"public static function mentions ( $count = 50 ) {\n\n\t\tstatic::api()->request('GET', static::api()->url('1.1/statuses/mentions_timeline'), array(\n\t\t\t'count' => $count,\n\t\t\t'include_entities' => true\n\t\t));\n\n\t\t$response = static::api()->response['response'];\n\t\t$code = static::api()->response['code'];\n\n\t\tif ($code === 200) {\n\t\t\treturn json_decode($response, false, 512, JSON_BIGINT_AS_STRING);\n\t\t}\n\n\t\treturn false;\n\n\t}",
"static public function getAuthorByUid($uid) {\n\t\tlist($row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('realName', 'be_users',\n\t\t\t'uid= ' . intval($uid), '', '', '1'\n\t\t);\n\t\treturn (is_array($row) ? $row['realName'] : '');\n\t}",
"public function getUserDisplayName();",
"public function getUsername(): string\n {\n return (string) $this->pseudo;\n }",
"public function author()\n {\n if ($this->user_id) {\n $field = config(\"binshopsblog.comments.user_field_for_author_name\",\"name\");\n return optional($this->user)->$field;\n }\n\n return $this->author_name;\n }",
"public function get_author($userid, $relateduserid, $cmid, $itemid) {\n return (!empty($relateduserid)) ? $relateduserid : $userid;\n }",
"public function getUsername(): string\n {\n return (string) $this->nickname;\n }",
"public function getAvatar(): string;",
"function get_twitter_message_info(&$nickname,$num_messages){\n\t$ret=get_twitter_user_messages($nickname,$num_messages);\n \t$json = new Services_JSON();\n\t$obj=$json->decode($ret); \n\n\tforeach ($obj as $val){\n\t\t$msg=$val->{'text'};\n\t\t// the regex below was used from http://snipplr.com/view/2371/regex-regular-expression-to-match-a-url/\n\t\t$url_regex=\"/https?:\\/\\/([-\\w\\.]+)+(:\\d+)?(\\/([\\w\\/_\\.]*(\\?\\S+)?)?)?/\";\n\t if(preg_match($url_regex,$msg)){\n\t\t\t$non_url_part=preg_replace($url_regex,\"\",$msg);\n\t\t\tpreg_match($url_regex,$msg,$url);\n\t print \"Url: \" . $url[0].\"\\n\" ;\n\t\t}\n\t\tprint \"Message: \" . $msg .\"\\n\"; \n \t\tprint \"Time: \" . $val->{'created_at'} .\"\\n\" ;\n\t print \"---------------------\\n\\n\";\n\t}\n}",
"public function actionLikedFindOne(){\n\t\t$id_user = F3::get('PARAMS.id');\n\n\t\t$user = $this->model_users->getUser($id_user);\n\n\t\tif (!empty($user)):\n\t\t\t$data = $this->model_likes->getUserAction($id_user, $action = 'like');\n\n\t\t\tif (!empty($data)):\n\t\t\t\tApi::response(200, $data);\n\t\t\telse:\n\t\t\t\tApi::response(204, 'No movies liked by this user');\n\t\t\tendif;\n\n\t\telse:\n\t\t\tApi::response(400, 'Bad ID : this user doesn\\'t exist');\n\t\tendif;\n\t}",
"public function get_screen_name()\n\t{\n\t\tif (empty($this->user))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->user[static::_column('id')];\n\t}",
"function getPostAuthorById($user_id)\n{\n\tglobal $conn;\n\t$sql = \"SELECT username FROM users WHERE id=$user_id\";\n\t$result = mysqli_query($conn, $sql);\n\tif ($result) {\n\t\t// return username\n\t\treturn mysqli_fetch_assoc($result)['username'];\n\t} else {\n\t\treturn null;\n\t}\n}",
"public function me()\n {\n $user = auth()->user();\n if ($user->member && empty($user->share_code)) {\n $user->share_code = app('commonRepo')->randomCode();\n $user->save();\n }\n //推荐人\n if ($user->leader1) {\n $user['invitor'] = User::where('id', $user->leader1)->first();\n }\n return response()->json(['status_code' => 0, 'data' => $user]);\n }",
"function get_comment_author($comment_id = 0)\n {\n }",
"function get_author_name($auth_id = \\false)\n {\n }",
"private function replyUser(): string\n {\n if ( $this->info['reply_from_is_bot'] )\n exit('ok');\n\n $karma_plus = $not_liar = false;\n $username = $this->info['reply_from_username'];\n $user_id = $this->info['reply_from_id'];\n $replied_user_db = $this->db->getUserData( $this->info['reply_from_id'] );\n $user_db = $this->db->getUserData( $this->info['user_id'] );\n $last_time = $user_db['last_karma_send'];\n\n switch ( true ) {\n case in_array( $this->info['msg_text'], $this->lang['command']['karma_plus'] ):\n $karma_plus = true; // Add karma\n case in_array( $this->info['msg_text'], $this->lang['command']['karma_minus'] ):\n if ( $this->info['reply_from_id'] == $this->info['user_id'] || $last_time + 20 >= time() ) \n exit('ok'); // Change own karma is not allowed\n $karma = $karma_plus ? $replied_user_db['karma'] + 1 : $replied_user_db['karma'] - 1;\n $msg_tmpl = $karma_plus ? $this->lang['respond']['karma']['add'] : $this->lang['respond']['karma']['lose'];\n $find = [ '{{ user_id }}', '{{ username }}', '{{ karma }}' ];\n $replace = compact( 'user_id', 'username' , 'karma' );\n $this->db_post->karmaUpdate( $this->info['reply_from_id'], $this->info['user_id'], $karma_plus );\n exit('ok');\n // return str_replace( $find, $replace, $msg_tmpl ); // Karma changed\n case preg_match( '/\\b(' . $this->lang['command']['not_liar'] . ')\\b/iu', $this->info['msg_text'] ):\n if ( !$this->is_admin )\n return $this->lang['respond']['not_admin'];\n\n $not_liar = true; \n case in_array( $this->info['msg_text'], $this->lang['command']['lies'] ):\n if ( $not_liar ) { // Admin says - this user is not a liar\n $lies = $replied_user_db['lie_times'] == 0 ? 0 : $replied_user_db['lie_times'] - 1;\n $passed = $this->daysPassed( $replied_user_db['before_lie'] );\n $honest_days = $passed[0] . ' ' . $passed[1];\n $tmpl = $this->lang['respond']['liar']['lose'];\n } else {\n if ( $this->info['reply_from_id'] == $this->info['user_id'] || $last_time + 20 >= time() )\n exit('ok'); // Can't change own\n\n $lies = $replied_user_db['lie_times'] + 1;\n $passed = $this->daysPassed( $replied_user_db['last_lie'] );\n $honest_days = $passed[0] . ' ' . $passed[1];\n $tmpl = $this->lang['respond']['liar']['add'];\n }\n $tmpl .= $this->liesCounter( (int)$lies ); // Add to template\n $this->db_post->lieUpdate( $this->info['reply_from_id'], $not_liar ); \n $find = [ '{{ user_id }}', '{{ username }}', '{{ honest_days }}', '{{ lies }}' ];\n $replace = compact( 'user_id', 'username', 'honest_days', 'lies' );\n return str_replace( $find, $replace, $tmpl );\n default:\n exit('ok');\n }\n }",
"function hc_get_the_author($gravatarSize = '', $field = ''){\n\t\tglobal $post;\n\t\t$username = get_user_by('id',$post->post_author);\n\t\t$username = $username->user_login;\n\t\t$args = array('single' => true, 'username' => $username, 'gravatarsize' => $gravatarSize);\n\t\tif($field != '')\n\t\t\t$args['fields'] = $field;\n\t\t$users = hc_get_users($args);\n\t\tif ( is_wp_error($users) ){\n\t\t\t\techo $users->get_error_message();\n\t\t\t\treturn false;\n\t\t}\n\t\treturn $users;\n\t}",
"function twitter_auto_follow(int $uid, object $data)\n{\n\t$addrpattern = '([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6})';\n\n\t// Search for [email protected] in the name\n\tif (preg_match('#' . $addrpattern . '#', $data->name, $match)) {\n\t\tif (twitter_add_contact($match[1], true, $uid)) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Search for @[email protected] in the description\n\tif (preg_match('#@' . $addrpattern . '#', $data->description, $match)) {\n\t\tif (twitter_add_contact($match[1], true, $uid)) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Search for [email protected] in the description\n\t// We don't probe here, since this could be a mail address\n\tif (preg_match('#' . $addrpattern . '#', $data->description, $match)) {\n\t\tif (twitter_add_contact($match[1], false, $uid)) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Search for profile links in the description\n\tforeach ($data->entities->description->urls as $url) {\n\t\tif (!empty($url->expanded_url)) {\n\t\t\t// We only probe on Mastodon style URL to reduce the number of unsuccessful probes\n\t\t\ttwitter_add_contact($url->expanded_url, strpos($url->expanded_url, '@'), $uid);\n\t\t}\n\t}\n}",
"function um_followers_ajax_get_user_suggestions( $data, $term ) {\n\tif ( ! UM()->options()->get( 'activity_followers_mention' ) ) {\n\t\treturn $data;\n\t}\n\n\t$term = str_replace( '@', '', $term );\n\tif ( empty( $term ) ) {\n\t\treturn $data;\n\t}\n\n\t$users_data = array();\n\n\t$user_id = get_current_user_id();\n\n\t$following = UM()->Followers_API()->api()->following( $user_id );\n\tif ( $following ) {\n\t\tforeach ( $following as $k => $arr ) {\n\t\t\t/**\n\t\t\t * @var int $user_id1\n\t\t\t */\n\t\t\textract( $arr );\n\t\t\tum_fetch_user( $user_id1 );\n\n\t\t\tif ( ! stristr( um_user( 'display_name' ), $term ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$users_data[ $user_id1 ]['user_id'] = $user_id1;\n\t\t\t$users_data[ $user_id1 ]['photo'] = get_avatar( $user_id1, 80 );\n\t\t\t$users_data[ $user_id1 ]['name'] = str_replace( $term, '<strong>' . $term . '</strong>', um_user( 'display_name' ) );\n\t\t\t$users_data[ $user_id1 ]['username'] = um_user( 'display_name' );\n\t\t}\n\t}\n\n\t$followers = UM()->Followers_API()->api()->followers( $user_id );\n\tif ( $followers ) {\n\t\tforeach ( $followers as $k => $arr ) {\n\t\t\t/**\n\t\t\t * @var int $user_id2\n\t\t\t */\n\t\t\textract( $arr );\n\t\t\tum_fetch_user( $user_id2 );\n\t\t\tif ( ! stristr( um_user( 'display_name' ), $term ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$users_data[ $user_id2 ]['user_id'] = $user_id2;\n\t\t\t$users_data[ $user_id2 ]['photo'] = get_avatar( $user_id2, 80 );\n\t\t\t$users_data[ $user_id2 ]['name'] = str_replace( $term, '<strong>' . $term . '</strong>', um_user( 'display_name' ) );\n\t\t\t$users_data[ $user_id2 ]['username'] = um_user( 'display_name' );\n\t\t}\n\t}\n\n\tif ( ! empty( $users_data ) ) {\n\t\t$data = array_merge( $data, $users_data );\n\t}\n\n\treturn $data;\n}",
"public function getNickname() //geter leo la informacion\n\n {\n return $this->nickname;\n }",
"function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }",
"public function get_forum_user()\n\t{\n\t\t$user = get_session(\"user\");\n\t\t$this->db->where(array(\"member_id\"=>$user->id));\n\t\t$hasil = $this->db->get($this->forum_table);\n\t\treturn $hasil->result();\n\t}",
"function userDisplayName($userID) {\n if ($user = $this->CI->model('SocialUser')->get($userID)->result) {\n return $user->DisplayName;\n }\n }",
"function getMentions( SocialUser $oUser, $params = null ){\n\t\t\n\t\t$twAPI = new TwitterAPI(CDT_SOCIAL_API_TWITTER_CONSUMER_KEY, CDT_SOCIAL_API_TWITTER_CONSUMER_SECRET, $oUser->getOauth_token() , $oUser->getOauth_token_secret());\n\t\t\n\t\t$mentions = $twAPI->get('/statuses/mentions.json', array('include_entities' => true));\n\n\t\t//TODO ver si salió todo ok, leer el status de la llamada.\n\t\t\n\t\t$mentions = json_decode( $mentions->responseText );\n\t\t\n\t\tif(!empty($mentions))\n\t\t\t$items = ResultFactory::arrayToCollection($mentions, new SocialTWTPostFactory());\t\t\n\t\telse\n\t\t\t$items = new ItemCollection();\n\t\treturn $items;\n\t\t\n\t}",
"public function getUsername();",
"public function getUsername();",
"public function getUsername();",
"public function getUsername();",
"public function getUsername();",
"function newsdot_posted_by() {\n\t\tif ( get_theme_mod( 'newsdot_show_post_author', true ) ) :\n\t\t\t?>\n\t\t\t<span class=\"byline\">\n\t\t\t\t<i class=\"far fa-user-circle\"></i>\n\t\t\t\t<span class=\"author vcard\"><a class=\"url fn n\" href=\"<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>\"><?php echo esc_html( get_the_author() ); ?></a></span>\n\t\t\t</span>\n\t\t\t<?php\n\t\tendif;\n\t}",
"public function getAuthor() {\n return $this->randomQuote->author_name;\n }",
"private function retrieve_user_description() {\n\t\t$replacement = null;\n\n\t\t$user_id = $this->retrieve_userid();\n\t\t$description = get_the_author_meta( 'description', $user_id );\n\t\tif ( $description !== '' ) {\n\t\t\t$replacement = $description;\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"function jid_to_user( $jid ) {\n\t\treturn substr( $jid, 0, strpos( $jid, \"@\" ) );\n\t}",
"public function getUserArticleName()\n {\n return $this->user_article_name;\n }",
"function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}",
"function getuid_nick($nick)\n{\n $uid = mysql_fetch_array(mysql_query(\"SELECT id FROM ibwf_users WHERE name='\".$nick.\"'\"));\n return $uid[0];\n}",
"function wv_get_username_by_userid($uid) {\n\n $user = get_user_by('id', $uid);\n $username = $user->user_login;\n return $username;\n }",
"function get_author_ID() {\n\t\treturn $this->get_data( 'user_id' );\n\t}",
"public function me()\n {\n return $this->send($this->endpointUrl('me', false), true, null, 'GET');\n }",
"function getUsername($user_id){\n $this->load( array( \"id=?\", $user_id ));\n return $this->query[0];\n }"
] | [
"0.73527265",
"0.7237184",
"0.70045775",
"0.6949537",
"0.6816772",
"0.65863216",
"0.65647507",
"0.6497825",
"0.6458947",
"0.6417737",
"0.63917005",
"0.6326686",
"0.6299716",
"0.6243281",
"0.62321895",
"0.6203905",
"0.6099018",
"0.59687454",
"0.58519363",
"0.58465546",
"0.58450943",
"0.5798796",
"0.5711491",
"0.57053894",
"0.56859946",
"0.568597",
"0.566483",
"0.5662243",
"0.5617471",
"0.5615255",
"0.5614999",
"0.5601705",
"0.5529733",
"0.55295867",
"0.5486602",
"0.54592305",
"0.5444679",
"0.5434106",
"0.5431564",
"0.5429158",
"0.54269874",
"0.54025",
"0.5388124",
"0.5374934",
"0.5369958",
"0.5364972",
"0.5361518",
"0.53427225",
"0.53423595",
"0.5337128",
"0.5336989",
"0.5320155",
"0.53175527",
"0.53126115",
"0.53087485",
"0.5305365",
"0.53045696",
"0.5301992",
"0.53002065",
"0.5298025",
"0.528949",
"0.52882314",
"0.52741206",
"0.52567697",
"0.52545965",
"0.52512735",
"0.5247226",
"0.5235968",
"0.52341783",
"0.52248114",
"0.5221343",
"0.52122104",
"0.52104783",
"0.5210424",
"0.5205333",
"0.5203023",
"0.5194873",
"0.5190202",
"0.5181905",
"0.5172793",
"0.51718104",
"0.5166711",
"0.51625454",
"0.5155165",
"0.5152299",
"0.51521784",
"0.51521784",
"0.51521784",
"0.51521784",
"0.51521784",
"0.5148683",
"0.514536",
"0.5130894",
"0.5125111",
"0.5122918",
"0.51166815",
"0.51149327",
"0.5105821",
"0.5104783",
"0.51025605",
"0.5098776"
] | 0.0 | -1 |
Test that true does in fact equal true | public function testCurlGoodUrl()
{
$curl = new CurlClass();
$res = $curl->submit('http://feeds.nationalgeographic.com/ng/News/News_Main');
$this->assertTrue($res, 'test url ktory zwraca kod 200');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testTrue()\n {\n $testtrue = true;\n $this->assertTrue($testtrue);\n\n\treturn false;\n }",
"public function isTrue();",
"public function testTrueIsTrue(){\n $foo = true;\n $this->assertTrue($foo);\n }",
"public function testTrueIsTrue()\n {\n $this->assertTrue(true);\n }",
"public function testTrueIsTrue()\n {\n $this->assertTrue(true);\n }",
"function testValueForTrue(){\n $this->assertTrue(true);\n }",
"public function testAssertion() \r\n {\r\n $this->assertEquals(true, true);\r\n }",
"public function testConvertToBoolean() {\r\n $data = array(\r\n true => true,\r\n false => false,\r\n 'true' => true,\r\n 'false' => false,\r\n 'test' => true,\r\n 0 => false,\r\n '0' => false,\r\n 1 => true\r\n );\r\n\r\n foreach ($data as $value => $expected) {\r\n $this->assertSame($expected, $this->_utils->convertToBoolean($value));\r\n }\r\n }",
"public function isValidComparisonExpectations() {}",
"public function testSomethingIsTrue()\n\t{\n\t\t$this->assertTrue(true);\t\n\t}",
"public function isTrue() {\n return $this->is(new Identical(true));\n }",
"public function isTrue()\n {\n return $this->value === true;\n }",
"static function isTrue()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::isTrue', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function testValidateTrue(): void\n {\n $this->assertFalse($this->validate(true));\n }",
"public function isTrue()\n {\n \n return !!$this->value;\n \n }",
"public function testSomethingIsTrue()\n\t{\n\t\t$this->assertTrue(true);\n\t}",
"public function testIsBoolean() {\n\t\t$result = _::isBoolean(true);\n\t\t$this->assertTrue($result);\n\n\t\t// test that false is a boolean\n\t\t$result = _::isBoolean(false);\n\t\t$this->assertTrue($result);\n\n\t\t// test that null is not a boolean\n\t\t$result = _::isBoolean(null);\n\t\t$this->assertFalse($result);\n\t}",
"function test_equals($a, $b) {\n\treturn $a == $b;\n}",
"public function testEmptyObjectCastedToBoolGivesTrue() {\n\t\t$this->asserttrue((bool)new stdClass());\n\t}",
"public function origTestFinal()\n {\n $this->assertTrue('true');\n }",
"protected function pass()\n {\n $this->assertTrue(true);\n }",
"public function testSuccessIsTrue(): void\n {\n $this->get_accessible_reflection_property('success');\n $this->assertTrue($this->get_reflection_property_value('success'));\n }",
"public function testSuccessIsTrue(): void\n {\n $this->assertTrue($this->get_reflection_property_value('success'));\n }",
"public function testSetAndRetrieveBoolean(): void\n {\n $key = \"A test key\";\n $this->testNotStrict->set($key, true);\n $actual = $this->testNotStrict->get($key);\n $this->assertTrue($actual);\n $this->testNotStrict->set($key, false);\n $actual = $this->testNotStrict->get($key);\n $this->assertFalse($actual);\n }",
"public static function true(): bool\n {\n return true;\n }",
"public function testGetBoolTrue(): void\n {\n // 1\n $_SERVER['MY_KEY'] = 1;\n $this->assertTrue(Env::getBool('MY_KEY'));\n\n // true\n $_SERVER['MY_KEY'] = true;\n $this->assertTrue(Env::getBool('MY_KEY'));\n\n // '1'\n $_SERVER['MY_KEY'] = '1';\n $this->assertTrue(Env::getBool('MY_KEY'));\n\n // 'true'\n $_SERVER['MY_KEY'] = 'true';\n $this->assertTrue(Env::getBool('MY_KEY'));\n\n // 'yes'\n $_SERVER['MY_KEY'] = 'yes';\n $this->assertTrue(Env::getBool('MY_KEY'));\n\n // 'on'\n $_SERVER['MY_KEY'] = 'on';\n $this->assertTrue(Env::getBool('MY_KEY'));\n }",
"static function unittest_nonEmptyBoolGuarantee () {\n PhlintTest::assertIssues('\n $foo = false;\n if (rand(0, 1))\n $foo = new ArrayObject();\n if (!empty($foo))\n foreach ($foo as $bar) {}\n ', [\n ]);\n }",
"public function assertAllTrue()\n {\n $bools = func_get_args();\n\n if (is_array(func_get_arg(0))) {\n $bools = func_get_arg(0);\n }\n\n return ! collect($bools)->contains(false);\n }",
"public function shouldBeEqualTo($expected) {}",
"public function testToStringWithBooleanValueTrue()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(true);\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}",
"public function testBoolean()\r\n {\r\n $s = new XML_Serializer();\r\n $s->serialize(true);\r\n $this->assertEquals('<boolean>1</boolean>', $s->getSerializedData());\r\n $s->serialize(false);\r\n $this->assertEquals('<boolean />', $s->getSerializedData());\r\n }",
"public function testRegon6()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function isTrue($failMessage = null) {}",
"public function testEquals(){\n $result = 5 + 5;\n $this->assertEquals($result, 10); // verificar con ==\n }",
"function test()\n {\n return true;\n }",
"public static function isTrue()\n {\n return new Matcher\\IsTrue();\n }",
"function is_true(mixed $var): bool\n{\n return ($var === true);\n}",
"public function testRegon7()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testRegon2()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function assertQueryTrue($prop, ...$props)\n {\n global $wp_query;\n $all = array(\n 'is_404',\n 'is_admin',\n 'is_archive',\n 'is_attachment',\n 'is_author',\n 'is_category',\n 'is_comment_feed',\n 'is_date',\n 'is_day',\n 'is_embed',\n 'is_feed',\n 'is_front_page',\n 'is_home',\n 'is_month',\n 'is_page',\n 'is_paged',\n 'is_post_type_archive',\n 'is_posts_page',\n 'is_preview',\n 'is_robots',\n 'is_search',\n 'is_single',\n 'is_singular',\n 'is_tag',\n 'is_tax',\n 'is_time',\n 'is_trackback',\n 'is_year',\n );\n\n $props = array_merge((array)$prop, ...$props);\n\n foreach ($props as $true_thing) {\n $this->assertContains($true_thing, $all, \"{$true_thing}() is not handled by assertQueryTrue().\");\n }\n\n $passed = true;\n $not_false = $not_true = array(); // properties that were not set to expected values\n\n foreach ($all as $query_thing) {\n $result = is_callable($query_thing) ? $query_thing() : $wp_query->$query_thing;\n\n if (in_array($query_thing, $props, true)) {\n if (!$result) {\n $not_true[] = $query_thing;\n $passed = false;\n }\n } elseif ($result) {\n $not_false[] = $query_thing;\n $passed = false;\n }\n }\n\n $message = '';\n if (count($not_true)) {\n $message .= implode(', ', $not_true) . ' is expected to be true. ';\n }\n if (count($not_false)) {\n $message .= implode(', ', $not_false) . ' is expected to be false.';\n }\n $this->assertTrue($passed, $message);\n }",
"public function testRegon3()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"function always_true() {\n return mt_rand(1, 2) < 10;\n}",
"public function testRegon4()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public static function test() {\n\t\treturn true;\n\t}",
"public function testRegonLocal6()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public static function boolean() {}",
"public function testRegonLocal2()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testRegonLocal4()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testIfStockManagementIsBool()\n {\n $this->assertIsBool($this->stock->isStock());\n }",
"public function testRegonLocal7()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function shouldEqual($expected) {}",
"public function testRegon0()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"function __return_true()\n {\n }",
"public function passes()\n\t{\n\t\tif (empty($this->results)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->results as $value) {\n\t\t\tif ($value === false) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function testRegon5()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"function isCorrect()\r\n {\r\n if ( $this->IsCorrect == 1 )\r\n return true;\r\n elseif ( $this->IsCorrect == 0 )\r\n return false;\r\n }",
"public function testRegonLocal3()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function selfTest(): bool;",
"public function assert_true($value, $strict = true)\n\t{\n\t\tTests::$results['assertions']++;\n\n\t\tif ($value === true or ( ! $strict and $value))\n\t\t{\n\t\t\t$this->pass();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->fail('assert_true - Value is does not validate as true.');\n\t\t}\n\t}",
"public static function __return_true() {\n\t\treturn true;\n\t}",
"public static function true(): self\n {\n return self::fromValue(Value::true());\n }",
"public function testRegon1()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"function assertTrue($bool){\r\n $this->log($bool);\r\n if($bool){\r\n $status = \"passed\";\r\n }\r\n else{\r\n $status = \"failed\";\r\n }\r\n \r\n $this->updateStatus($status);\r\n $this->updateAction(__FUNCTION__);\r\n \r\n }",
"public function testRegonLocal5()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testCastToBooleanTrue($data) {\n\t\t$this->assertTrue(Convertor::cast($data), \"[{$data}] is not Boolean TRUE\");\n\t}",
"#[@test]\n public function boolCast() {\n $this->assertSourcecodeEquals(\n '$s= (bool)$num;',\n $this->emit('$s= (bool)$num;')\n );\n }",
"public function testRegonLocal0()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function isSet() : bool;",
"public function pass(): bool;",
"public function isTruthy():bool {\n // You can't actually define functions starting with digits, so that's impossible.\n return true;\n }",
"public function valid(): bool;",
"public function valid(): bool;",
"public function valid(): bool;",
"public function valid(): bool;",
"public function testVerifiedFlag()\n {\n $user = new User();\n\n $this->assertFalse($user->isVerified());\n\n $user->setVerified(true);\n $this->assertTrue($user->isVerified());\n\n $user->setVerified(false);\n $this->assertFalse($user->isVerified());\n }",
"abstract public function getIsOk(): bool;",
"public function test_dummy() {\n\t\t$this->assertEquals(\n\t\t\ttrue,\n\t\t\ttrue\n\t\t);\n\t}",
"public function testRegonLocal1()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"function assertTrue($value,$title){\n\tif($value){\n\t\techo $title.\" - Succeded\";\n\t}else{\n\t\techo $title.\" - Failed\";\n\t}\n}",
"function testBasicAssertions()\n\t{\n\t\t$this->assertTrue( true );\n\t\t$this->assertFalse( false );\n\t}",
"public function testExample()\n {\n\n \n $this->assertTrue(true);\n \n return true;\n }",
"public function assertTrue($value, $message = null) {\n $this->assertions++;\n $message = $message ?? 'Assert if <' . gettype($value) . '> ' . $value . ' is true ';\n $passed = $value === (boolean)true;\n $this->_passed += $passed;\n $this->_log($message. ': '.$this->_colors->getColoredString($this->_textOutputs[$passed], $this->_colorsPalete[$passed]));\n $this->_progress($passed);\n $trueFalse = ['False','True'];\n !$passed && $this->_log('Expectig `true` but found <' . gettype($value) . '> ' . (is_bool($value) ? $trueFalse[$value] : $value)) && $this->_triggerError('Asserts True');\n }",
"public static function isValid(): bool\n {\n return self::$ok;\n }",
"public function isDummy(): bool;",
"public function isFalse();",
"public function testToStringWithStringValueTrue()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('true');\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}",
"public function boolberry(): bool\n\t{\n\t\treturn false;\n\t}",
"public function testExample()\n {\n $this->assertTrue(false);\n }",
"public function test()\n\t{\t\t\n\t\treturn (!PHPFOX_SAFE_MODE ? true : false);\n\t}",
"public function isOk(): bool\n {\n static $valueProperty;\n $valueProperty ??= new \\ReflectionProperty(self::class, \"value\");\n $valueProperty->setAccessible(true);\n\n self::$toBeUsed[$this] = false;\n\n return $valueProperty->isInitialized($this);\n }",
"public function produced(): bool;",
"protected final function AssertTrue( $value, $strict = true )\n {\n $this->observer->OnAssert();\n\n if( $strict )\n {\n $result = ( $value === true );\n }\n else\n {\n $result = ( $value == true );\n }\n\n Core::Assert( $result, var_export( $value, true ) . ' is not true' );\n }",
"public function test_checked_with_equal_values() {\n\t\t$this->assertSame( \" checked='checked'\", checked( 'foo', 'foo', false ) );\n\t}",
"public function hasPassed() {\n \treturn $this < new \\DateTime();\n }",
"public function check()\n {\n foreach ($this->_tests as $test) {\n $res = $test->check();\n if ($res !== true) {\n return $res;\n }\n }\n\n return true;\n }",
"public function calculateEquityValue(): bool\n {\n return true;\n }",
"public function shouldBe($expected) {}",
"public function testShouldReturnTrue()\n\t{\n\t\t$this->assertTrue(SRPH\\Luhn\\luhn('7992739877'));\n\t\t$this->assertTrue(SRPH\\Luhn\\luhn('79927398712'));\n\t}",
"public function isRisky(): bool;",
"public function hasTrueMutations(){\n return $this->_has(4);\n }",
"public function simulateEnabledMatchAllConditionsSucceeds() {}"
] | [
"0.7951144",
"0.7752722",
"0.7670101",
"0.74442613",
"0.74442613",
"0.7052292",
"0.6819346",
"0.67771477",
"0.6762823",
"0.6759817",
"0.6748157",
"0.6692686",
"0.66890013",
"0.66663045",
"0.66407454",
"0.6626448",
"0.6622745",
"0.66221976",
"0.66015077",
"0.6575891",
"0.65381217",
"0.65253663",
"0.65019757",
"0.6500924",
"0.6485903",
"0.6483021",
"0.64764756",
"0.64690024",
"0.6420013",
"0.6411991",
"0.63811004",
"0.6357241",
"0.6356282",
"0.63462573",
"0.63398015",
"0.6335983",
"0.6334866",
"0.6331151",
"0.6317799",
"0.63070196",
"0.6305747",
"0.63044035",
"0.6304357",
"0.6290882",
"0.62875664",
"0.62792456",
"0.6252262",
"0.6251588",
"0.6246213",
"0.6245136",
"0.6238401",
"0.6235497",
"0.6229447",
"0.6229263",
"0.6222654",
"0.62197435",
"0.6212522",
"0.62091076",
"0.6204585",
"0.6196618",
"0.6183832",
"0.61830926",
"0.61780983",
"0.61750096",
"0.6173623",
"0.61661935",
"0.6155814",
"0.6153825",
"0.6135741",
"0.61273044",
"0.6110609",
"0.6110609",
"0.6110609",
"0.6110609",
"0.610876",
"0.6100159",
"0.60984117",
"0.6095931",
"0.60958487",
"0.6095419",
"0.60842437",
"0.6075648",
"0.60552317",
"0.6054412",
"0.60530674",
"0.605124",
"0.60403895",
"0.60397696",
"0.6025265",
"0.60199034",
"0.6017889",
"0.6015649",
"0.60117507",
"0.60044396",
"0.5997396",
"0.5988123",
"0.598392",
"0.59788996",
"0.59787625",
"0.597698",
"0.5961172"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.